This repository has been archived by the owner on May 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
54b3cb3
commit bcdc88c
Showing
301 changed files
with
62,465 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,12 @@ | ||
# Prerequisites | ||
*.d | ||
|
||
# Compiled Object files | ||
*.slo | ||
*.lo | ||
*.o | ||
*.obj | ||
|
||
# Precompiled Headers | ||
*.gch | ||
*.pch | ||
|
||
# Compiled Dynamic libraries | ||
*.so | ||
*.dylib | ||
*.dll | ||
|
||
# Fortran module files | ||
*.mod | ||
*.smod | ||
|
||
# Compiled Static libraries | ||
*.lai | ||
*.la | ||
*.a | ||
*.lib | ||
|
||
# Executables | ||
*.exe | ||
*.out | ||
*.app | ||
Debug/* | ||
Release/* | ||
ipch/* | ||
.vs/* | ||
FreepieWriter/bin/* | ||
FreepieWriter/obj/* | ||
FreepieWriterBridge/Debug/* | ||
FreepieWriterBridge/Release/* | ||
PSMoveFreepieBridge/Debug/* | ||
PSMoveFreepieBridge/Release/* | ||
x64/* | ||
*.sdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
using System; | ||
using System.Runtime.InteropServices; | ||
using Microsoft.Win32; | ||
|
||
namespace FreepieWriter | ||
{ | ||
public class FreepieWriter | ||
{ | ||
[StructLayout(LayoutKind.Sequential)] | ||
public struct FreepieData | ||
{ | ||
public float yaw; | ||
public float pitch; | ||
public float roll; | ||
|
||
public float x; | ||
public float y; | ||
public float z; | ||
} | ||
|
||
[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)] | ||
[return: MarshalAs(UnmanagedType.Bool)] | ||
private static extern bool SetDllDirectory(string lpPathName); | ||
|
||
[DllImport("freepie_io.dll")] | ||
private static extern int freepie_io_6dof_slots(); | ||
|
||
[DllImport("freepie_io.dll", CallingConvention = CallingConvention.Cdecl)] | ||
private static extern int freepie_io_6dof_write(int index, int length, FreepieData[] data); | ||
|
||
private static bool bInit = false; | ||
|
||
private static void init() | ||
{ | ||
//Set freepie DLL path so we don't have to include it | ||
var path = Registry.GetValue(string.Format("{0}\\Software\\{1}", Registry.CurrentUser, "FreePIE"), "path", null) as string; | ||
SetDllDirectory(path); | ||
bInit = true; | ||
} | ||
|
||
public static void WriteData(FreepieData data, Int32 freepieIndex = 0) | ||
{ | ||
if (!bInit) | ||
{ | ||
init(); | ||
} | ||
|
||
FreepieData[] toArray = new FreepieData[1]; | ||
toArray[0] = data; | ||
int result = freepie_io_6dof_write(freepieIndex, 1, toArray); | ||
|
||
if (result != 0) | ||
{ | ||
throw new Exception("FreepieWriter - Could not write pose to freepie index " + freepieIndex + ", Freepie result " + result); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{8408DE33-57B4-4953-B8DE-F68FC6B4E12D}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>FreepieWriter</RootNamespace> | ||
<AssemblyName>FreepieWriter</AssemblyName> | ||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="Microsoft.CSharp" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Net.Http" /> | ||
<Reference Include="System.Xml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="FreepieWriter.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. | ||
Other similar extension points exist, see Microsoft.Common.targets. | ||
<Target Name="BeforeBuild"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
[assembly: AssemblyTitle("FreepieWriter")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("FreepieWriter")] | ||
[assembly: AssemblyCopyright("Copyright © 2016")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// Setting ComVisible to false makes the types in this assembly not visible | ||
// to COM components. If you need to access a type in this assembly from | ||
// COM, set the ComVisible attribute to true on that type. | ||
[assembly: ComVisible(false)] | ||
|
||
// The following GUID is for the ID of the typelib if this project is exposed to COM | ||
[assembly: Guid("8408de33-57b4-4953-b8de-f68fc6b4e12d")] | ||
|
||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Build Number | ||
// Revision | ||
// | ||
// You can specify all the values or you can default the Build and Revision Numbers | ||
// by using the '*' as shown below: | ||
// [assembly: AssemblyVersion("1.0.*")] | ||
[assembly: AssemblyVersion("1.0.0.0")] | ||
[assembly: AssemblyFileVersion("1.0.0.0")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#include "stdafx.h" | ||
|
||
using namespace System; | ||
using namespace System::Reflection; | ||
using namespace System::Runtime::CompilerServices; | ||
using namespace System::Runtime::InteropServices; | ||
using namespace System::Security::Permissions; | ||
|
||
// | ||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
// | ||
[assembly:AssemblyTitleAttribute(L"FreepieWriterBridge")]; | ||
[assembly:AssemblyDescriptionAttribute(L"")]; | ||
[assembly:AssemblyConfigurationAttribute(L"")]; | ||
[assembly:AssemblyCompanyAttribute(L"")]; | ||
[assembly:AssemblyProductAttribute(L"FreepieWriterBridge")]; | ||
[assembly:AssemblyCopyrightAttribute(L"Copyright (c) 2016")]; | ||
[assembly:AssemblyTrademarkAttribute(L"")]; | ||
[assembly:AssemblyCultureAttribute(L"")]; | ||
|
||
// | ||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Build Number | ||
// Revision | ||
// | ||
// You can specify all the value or you can default the Revision and Build Numbers | ||
// by using the '*' as shown below: | ||
|
||
[assembly:AssemblyVersionAttribute("1.0.*")]; | ||
|
||
[assembly:ComVisible(false)]; | ||
|
||
[assembly:CLSCompliantAttribute(true)]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// This is the main DLL file. | ||
|
||
#include "stdafx.h" | ||
|
||
#include "FreepieWriterBridge.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#pragma once | ||
#include "../thirdparty/headers/FreePIE/freepie_io.h" | ||
using namespace System; | ||
|
||
namespace FreepieWriterBridge { | ||
|
||
public ref class FreepieWriterBridge | ||
{ | ||
public:static void WriteToFreepie(freepie_io_6dof_data data, int32_t freepieIndex) | ||
{ | ||
//Can't send freepie_io_6dof_data directly, need to copy into CS compatible struct | ||
FreepieWriter::FreepieWriter::FreepieData csData; | ||
csData.x = data.x; | ||
csData.y = data.y; | ||
csData.z = data.z; | ||
csData.pitch = data.pitch; | ||
csData.yaw = data.yaw; | ||
csData.roll = data.roll; | ||
FreepieWriter::FreepieWriter::WriteData(csData, freepieIndex); | ||
} | ||
}; | ||
} | ||
|
||
__declspec(dllexport) void WriteToFreepie(freepie_io_6dof_data data, int32_t freepieIndex = 0) | ||
{ | ||
FreepieWriterBridge::FreepieWriterBridge bridge; | ||
bridge.WriteToFreepie(data, freepieIndex); | ||
} |
Oops, something went wrong.