Skip to content

Commit a4897e2

Browse files
committed
AME2
1 parent 6a7e4d3 commit a4897e2

File tree

18 files changed

+204
-158
lines changed

18 files changed

+204
-158
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: windows-latest
1212
strategy:
1313
matrix:
14-
dotnet-version: ['7.0.x' ]
14+
dotnet-version: ['10.0.x' ]
1515

1616
steps:
1717
- uses: actions/checkout@v3
@@ -20,7 +20,7 @@ jobs:
2020

2121
- uses: actions/setup-dotnet@v3
2222
with:
23-
dotnet-version: '7.0.x'
23+
dotnet-version: '10.0.x'
2424

2525
- name: Add MSYS64 bin to PATH
2626
run: echo "C:\msys64\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
@@ -48,7 +48,7 @@ jobs:
4848
uses: "marvinpinto/action-automatic-releases@latest"
4949
with:
5050
repo_token: "${{ secrets.GITHUB_TOKEN }}"
51-
automatic_release_tag: "latest"
51+
automatic_release_tag: "ame-latest"
5252
prerelease: true
5353
title: "plugin_Kinect360 Build Artifact"
5454
files: |

KinectHandler/KinectHandler.h

Lines changed: 46 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,39 @@ using namespace Collections::Generic;
1010
using namespace ComponentModel::Composition;
1111
using namespace Runtime::InteropServices;
1212

13-
using namespace Amethyst::Plugins::Contract;
14-
1513
namespace KinectHandler
1614
{
15+
private enum TrackedJointTypeInternal
16+
{
17+
JointHead,
18+
JointNeck,
19+
JointSpineShoulder,
20+
JointShoulderLeft,
21+
JointElbowLeft,
22+
JointWristLeft,
23+
JointHandLeft,
24+
JointHandTipLeft,
25+
JointThumbLeft,
26+
JointShoulderRight,
27+
JointElbowRight,
28+
JointWristRight,
29+
JointHandRight,
30+
JointHandTipRight,
31+
JointThumbRight,
32+
JointSpineMiddle,
33+
JointSpineWaist,
34+
JointHipLeft,
35+
JointKneeLeft,
36+
JointFootLeft,
37+
JointFootTipLeft,
38+
JointHipRight,
39+
JointKneeRight,
40+
JointFootRight,
41+
JointFootTipRight,
42+
JointManual,
43+
JointCount
44+
};
45+
1746
public ref class KinectJoint sealed
1847
{
1948
public:
@@ -72,31 +101,29 @@ namespace KinectHandler
72101
const auto& states = kinect_->tracking_states();
73102

74103
auto trackedKinectJoints = gcnew List<KinectJoint^>;
75-
for each (auto v in Enum::GetValues<TrackedJointType>())
104+
for (auto v = 0; v < JointCount; v++)
76105
{
77-
if (v == TrackedJointType::JointHandTipLeft ||
78-
v == TrackedJointType::JointHandTipRight ||
79-
v == TrackedJointType::JointThumbLeft ||
80-
v == TrackedJointType::JointThumbRight ||
81-
v == TrackedJointType::JointNeck ||
82-
v == TrackedJointType::JointManual)
106+
if (v == JointHandTipLeft ||
107+
v == JointHandTipRight ||
108+
v == JointThumbLeft ||
109+
v == JointThumbRight ||
110+
v == JointNeck ||
111+
v == JointManual)
83112
continue; // Skip unsupported joints
84113

85114
auto joint = gcnew KinectJoint(static_cast<int>(v));
86-
87-
joint->TrackingState =
88-
states[kinect_->KinectJointType(static_cast<int>(v))];
115+
joint->TrackingState = states[kinect_->KinectJointType(v)];
89116

90117
joint->Position = Vector3(
91-
positions[kinect_->KinectJointType(static_cast<int>(v))].x,
92-
positions[kinect_->KinectJointType(static_cast<int>(v))].y,
93-
positions[kinect_->KinectJointType(static_cast<int>(v))].z);
118+
positions[kinect_->KinectJointType(v)].x,
119+
positions[kinect_->KinectJointType(v)].y,
120+
positions[kinect_->KinectJointType(v)].z);
94121

95122
joint->Orientation = Quaternion(
96-
orientations[kinect_->KinectJointType(static_cast<int>(v))].absoluteRotation.rotationQuaternion.x,
97-
orientations[kinect_->KinectJointType(static_cast<int>(v))].absoluteRotation.rotationQuaternion.y,
98-
orientations[kinect_->KinectJointType(static_cast<int>(v))].absoluteRotation.rotationQuaternion.z,
99-
orientations[kinect_->KinectJointType(static_cast<int>(v))].absoluteRotation.rotationQuaternion.w);
123+
orientations[kinect_->KinectJointType(v)].absoluteRotation.rotationQuaternion.x,
124+
orientations[kinect_->KinectJointType(v)].absoluteRotation.rotationQuaternion.y,
125+
orientations[kinect_->KinectJointType(v)].absoluteRotation.rotationQuaternion.z,
126+
orientations[kinect_->KinectJointType(v)].absoluteRotation.rotationQuaternion.w);
100127

101128
trackedKinectJoints->Add(joint);
102129
}

KinectHandler/KinectHandler.vcxproj

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@
2424
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
2525
<ConfigurationType>DynamicLibrary</ConfigurationType>
2626
<UseDebugLibraries>true</UseDebugLibraries>
27-
<PlatformToolset>v143</PlatformToolset>
27+
<PlatformToolset>v145</PlatformToolset>
2828
<CLRSupport>NetCore</CLRSupport>
2929
<CharacterSet>Unicode</CharacterSet>
3030
</PropertyGroup>
3131
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
3232
<ConfigurationType>DynamicLibrary</ConfigurationType>
3333
<UseDebugLibraries>false</UseDebugLibraries>
34-
<PlatformToolset>v143</PlatformToolset>
34+
<PlatformToolset>v145</PlatformToolset>
3535
<CLRSupport>NetCore</CLRSupport>
3636
<CharacterSet>Unicode</CharacterSet>
3737
</PropertyGroup>
@@ -94,9 +94,6 @@
9494
<ClCompile Include="AssemblyInfo.cpp" />
9595
</ItemGroup>
9696
<ItemGroup>
97-
<PackageReference Include="Amethyst.Plugins.Contract">
98-
<Version>1.3.0</Version>
99-
</PackageReference>
10097
<PackageReference Include="System.ComponentModel">
10198
<Version>4.3.0</Version>
10299
</PackageReference>

external/manifest.json

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
{
2-
"version": "1.0.0.0",
3-
"display_name": "Xbox 360 Kinect",
4-
"download_": "plugin_Kinect360.zip",
5-
"changelog": "Added AppSounds on Settings UI actions.",
6-
"guid": "K2VRTEAM-AME2-APII-DVCE-DVCEKINECTV1"
7-
}
2+
"name": "Xbox 360 Kinect",
3+
"description": "Ame2 plugin for the Xbox 360 Kinect.",
4+
"guid": "K2VRTEAM-AME2-APII-DVCE-DVCEKINECTV1",
5+
"type": "device",
6+
"author": "K2VR Team",
7+
"artifacts": [
8+
{
9+
"version": "2.0.0.0",
10+
"contract": "2.0.0.0",
11+
"platform": "windows",
12+
"name": "Kinect V2",
13+
"download": "plugin_Kinect360.zip",
14+
"changelog": "Initial release of the Kinect V1 plugin."
15+
}
16+
]
17+
}

plugin_Kinect360/Fixes/NotPoweredFix.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Amethyst.Plugins.Contract;
1+
using Amethyst.Contract;
22
using Microsoft.VisualBasic;
33
using plugin_Kinect360.PInvoke;
44
using System;

plugin_Kinect360/Fixes/NotReadyFix.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using System.Threading.Tasks;
77
using Windows.Storage;
88
using Windows.System;
9-
using Amethyst.Plugins.Contract;
9+
using Amethyst.Contract;
1010
using NAudio.CoreAudioApi;
1111
using plugin_Kinect360.PInvoke;
1212

@@ -278,4 +278,4 @@ public static void AssignGenericAudioDriver(IDependencyInstaller.ILocalizationHo
278278
.Select(device => device.GetInstanceId()).LastOrDefault(x => !string.IsNullOrEmpty(x), string.Empty),
279279
"wdma_usb.inf", "(Generic USB Audio)", "USB Audio Device", host);
280280
}
281-
}
281+
}

0 commit comments

Comments
 (0)