Skip to content

Commit

Permalink
update onairvr plugin to 1.9.0
Browse files Browse the repository at this point in the history
- adjust video encoding settings
- apply the new media protocol
  • Loading branch information
kteem committed Jan 10, 2020
2 parents 4150642 + 7a18a72 commit e1c2a23
Show file tree
Hide file tree
Showing 83 changed files with 366 additions and 566 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017-2018 Clicked, Inc.
Copyright (c) 2017-present Clicked, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Binary file not shown.
Binary file modified Plugins/onAirVRServer/Binaries/Win64/onAirVRUnrealServerPlugin.lib
Binary file not shown.
Binary file modified Plugins/onAirVRServer/Resources/onairvr.license
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***********************************************************
Copyright (c) 2017-2018 Clicked, Inc.
Copyright (c) 2017-present Clicked, Inc.
Licensed under the MIT license found in the LICENSE file
in the Docs folder of the distributed package.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***********************************************************
Copyright (c) 2017-2018 Clicked, Inc.
Copyright (c) 2017-present Clicked, Inc.
Licensed under the MIT license found in the LICENSE file
in the Docs folder of the distributed package.
Expand All @@ -16,11 +16,9 @@ UENUM(BlueprintType)
enum class FAirVRInputDeviceType : uint8
{
HeadTracker,
Touchpad,
Gamepad,
TrackedController,
LeftController,
RightController
LeftHandTracker,
RightHandTracker,
Controller
};

UENUM(BlueprintType)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***********************************************************
Copyright (c) 2017-2018 Clicked, Inc.
Copyright (c) 2017-present Clicked, Inc.
Licensed under the MIT license found in the LICENSE file
in the Docs folder of the distributed package.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***********************************************************
Copyright (c) 2017-2018 Clicked, Inc.
Copyright (c) 2017-present Clicked, Inc.
Licensed under the MIT license found in the LICENSE file
in the Docs folder of the distributed package.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***********************************************************
Copyright (c) 2017-2018 Clicked, Inc.
Copyright (c) 2017-present Clicked, Inc.
Licensed under the MIT license found in the LICENSE file
in the Docs folder of the distributed package.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***********************************************************
Copyright (c) 2017-2018 Clicked, Inc.
Copyright (c) 2017-present Clicked, Inc.
Licensed under the MIT license found in the LICENSE file
in the Docs folder of the distributed package.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***********************************************************
Copyright (c) 2017-2018 Clicked, Inc.
Copyright (c) 2017-present Clicked, Inc.
Licensed under the MIT license found in the LICENSE file
in the Docs folder of the distributed package.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/***********************************************************
Copyright (c) 2017-present Clicked, Inc.
Licensed under the MIT license found in the LICENSE file
in the Docs folder of the distributed package.
***********************************************************/

#include "AirVRControllerInputDevice.h"
#include "AirVRServerPrivate.h"

FAirVRControllerInputDevice::FAirVRControllerInputDevice() {
AddControlTouch((uint8)AirVRControllerKey::Touchpad);

AddControlButton((uint8)AirVRControllerKey::ButtonTouchpad);
AddControlButton((uint8)AirVRControllerKey::ButtonUp);
AddControlButton((uint8)AirVRControllerKey::ButtonDown);
AddControlButton((uint8)AirVRControllerKey::ButtonLeft);
AddControlButton((uint8)AirVRControllerKey::ButtonRight);

AddControlAxis2D((uint8)AirVRControllerKey::Axis2DLThumbstick);
AddControlAxis2D((uint8)AirVRControllerKey::Axis2DRThumbstick);
AddControlAxis((uint8)AirVRControllerKey::AxisLIndexTrigger);
AddControlAxis((uint8)AirVRControllerKey::AxisRIndexTrigger);
AddControlAxis((uint8)AirVRControllerKey::AxisLHandTrigger);
AddControlAxis((uint8)AirVRControllerKey::AxisRHandTrigger);
AddControlButton((uint8)AirVRControllerKey::ButtonA);
AddControlButton((uint8)AirVRControllerKey::ButtonB);
AddControlButton((uint8)AirVRControllerKey::ButtonX);
AddControlButton((uint8)AirVRControllerKey::ButtonY);
AddControlButton((uint8)AirVRControllerKey::ButtonStart);
AddControlButton((uint8)AirVRControllerKey::ButtonBack);
AddControlButton((uint8)AirVRControllerKey::ButtonLThumbstick);
AddControlButton((uint8)AirVRControllerKey::ButtonRThumbstick);
AddControlButton((uint8)AirVRControllerKey::ButtonLShoulder);
AddControlButton((uint8)AirVRControllerKey::ButtonRShoulder);

AddExtControlAxis2D((uint8)AirVRControllerKey::Axis2DTouchpad);
AddExtControlButton((uint8)AirVRControllerKey::TouchTouchpad);
AddExtControlButton((uint8)AirVRControllerKey::ButtonLIndexTrigger);
AddExtControlButton((uint8)AirVRControllerKey::ButtonRIndexTrigger);
AddExtControlButton((uint8)AirVRControllerKey::ButtonLHandTrigger);
AddExtControlButton((uint8)AirVRControllerKey::ButtonRHandTrigger);
AddExtControlButton((uint8)AirVRControllerKey::ButtonLThumbstickUp);
AddExtControlButton((uint8)AirVRControllerKey::ButtonLThumbstickDown);
AddExtControlButton((uint8)AirVRControllerKey::ButtonLThumbstickLeft);
AddExtControlButton((uint8)AirVRControllerKey::ButtonLThumbstickRight);
AddExtControlButton((uint8)AirVRControllerKey::ButtonRThumbstickUp);
AddExtControlButton((uint8)AirVRControllerKey::ButtonRThumbstickDown);
AddExtControlButton((uint8)AirVRControllerKey::ButtonRThumbstickLeft);
AddExtControlButton((uint8)AirVRControllerKey::ButtonRThumbstickRight);
}

void FAirVRControllerInputDevice::UpdateExtendedControls() {
const float AxisAsButtonThreshold = 0.5f;

ONAIRVR_VECTOR2D axis2d;
bool down = false;

GetTouch((uint8)AirVRControllerKey::Touchpad, &axis2d, &down);
SetExtControlAxis2D((uint8)AirVRControllerKey::Axis2DTouchpad, axis2d);
SetExtControlButton((uint8)AirVRControllerKey::TouchTouchpad, down ? 1.0f : 0.0f);

SetExtControlButton((uint8)AirVRControllerKey::ButtonLIndexTrigger, GetAxis((uint8)AirVRControllerKey::AxisLIndexTrigger) >= AxisAsButtonThreshold ? 1.0f : 0.0f);
SetExtControlButton((uint8)AirVRControllerKey::ButtonRIndexTrigger, GetAxis((uint8)AirVRControllerKey::AxisRIndexTrigger) >= AxisAsButtonThreshold ? 1.0f : 0.0f);
SetExtControlButton((uint8)AirVRControllerKey::ButtonLHandTrigger, GetAxis((uint8)AirVRControllerKey::AxisLHandTrigger) >= AxisAsButtonThreshold ? 1.0f : 0.0f);
SetExtControlButton((uint8)AirVRControllerKey::ButtonRHandTrigger, GetAxis((uint8)AirVRControllerKey::AxisRHandTrigger) >= AxisAsButtonThreshold ? 1.0f : 0.0f);

axis2d = GetAxis2D((uint8)AirVRControllerKey::Axis2DLThumbstick);
SetExtControlButton((uint8)AirVRControllerKey::ButtonLThumbstickUp, axis2d.y >= AxisAsButtonThreshold ? 1.0f : 0.0f);
SetExtControlButton((uint8)AirVRControllerKey::ButtonLThumbstickDown, axis2d.y <= -AxisAsButtonThreshold ? 1.0f : 0.0f);
SetExtControlButton((uint8)AirVRControllerKey::ButtonLThumbstickLeft, axis2d.x <= -AxisAsButtonThreshold ? 1.0f : 0.0f);
SetExtControlButton((uint8)AirVRControllerKey::ButtonLThumbstickRight, axis2d.x >= AxisAsButtonThreshold ? 1.0f : 0.0f);

axis2d = GetAxis2D((uint8)AirVRControllerKey::Axis2DRThumbstick);
SetExtControlButton((uint8)AirVRControllerKey::ButtonRThumbstickUp, axis2d.y >= AxisAsButtonThreshold ? 1.0f : 0.0f);
SetExtControlButton((uint8)AirVRControllerKey::ButtonRThumbstickDown, axis2d.y <= -AxisAsButtonThreshold ? 1.0f : 0.0f);
SetExtControlButton((uint8)AirVRControllerKey::ButtonRThumbstickLeft, axis2d.x <= -AxisAsButtonThreshold ? 1.0f : 0.0f);
SetExtControlButton((uint8)AirVRControllerKey::ButtonRThumbstickRight, axis2d.x >= AxisAsButtonThreshold ? 1.0f : 0.0f);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@

#include "AirVRInputDevice.h"

class FAirVRLeftControllerInputDevice : public FAirVRInputDevice {
class FAirVRControllerInputDevice : public FAirVRInputDevice {
public:
FAirVRLeftControllerInputDevice();
FAirVRControllerInputDevice();

public:
// implements FAirVRInputDevice
virtual FString Name() const override { return ONAIRVR_INPUT_DEVICE_LEFT_CONTROLLER; }
virtual FString Name() const { return ONAIRVR_INPUT_DEVICE_CONTROLLER; }

virtual void UpdateExtendedControls() override;
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***********************************************************
Copyright (c) 2017-2018 Clicked, Inc.
Copyright (c) 2017-present Clicked, Inc.
Licensed under the MIT license found in the LICENSE file
in the Docs folder of the distributed package.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***********************************************************
Copyright (c) 2017-2018 Clicked, Inc.
Copyright (c) 2017-present Clicked, Inc.
Licensed under the MIT license found in the LICENSE file
in the Docs folder of the distributed package.
Expand Down Expand Up @@ -61,8 +61,8 @@ class FAirVRTrackedControllerDeviceFeedback : public FAirVRTrackedDeviceFeedback

protected:
// implements FAirVRPointerInputDeviceFeedback
virtual uint8 RaycastHitResultControlID() const override { return (uint8)AirVRTrackedControllerKey::RaycastHitResult; }
virtual uint8 RaycastHitResultControlID() const override { return (uint8)AirVRRightHandTrackerKey::RaycastHitResult; }

public:
virtual FString Name() const override { return ONAIRVR_INPUT_DEVICE_TRACKED_CONTROLLER; }
virtual FString Name() const override { return ONAIRVR_INPUT_DEVICE_RIGHT_HAND_TRACKER; }
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***********************************************************
Copyright (c) 2017-2018 Clicked, Inc.
Copyright (c) 2017-present Clicked, Inc.
Licensed under the MIT license found in the LICENSE file
in the Docs folder of the distributed package.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***********************************************************
Copyright (c) 2017-2018 Clicked, Inc.
Copyright (c) 2017-present Clicked, Inc.
Licensed under the MIT license found in the LICENSE file
in the Docs folder of the distributed package.
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***********************************************************
Copyright (c) 2017-2018 Clicked, Inc.
Copyright (c) 2017-present Clicked, Inc.
Licensed under the MIT license found in the LICENSE file
in the Docs folder of the distributed package.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***********************************************************
Copyright (c) 2017-2018 Clicked, Inc.
Copyright (c) 2017-present Clicked, Inc.
Licensed under the MIT license found in the LICENSE file
in the Docs folder of the distributed package.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***********************************************************
Copyright (c) 2017-2018 Clicked, Inc.
Copyright (c) 2017-present Clicked, Inc.
Licensed under the MIT license found in the LICENSE file
in the Docs folder of the distributed package.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***********************************************************
Copyright (c) 2017-2018 Clicked, Inc.
Copyright (c) 2017-present Clicked, Inc.
Licensed under the MIT license found in the LICENSE file
in the Docs folder of the distributed package.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***********************************************************
Copyright (c) 2017-2018 Clicked, Inc.
Copyright (c) 2017-present Clicked, Inc.
Licensed under the MIT license found in the LICENSE file
in the Docs folder of the distributed package.
Expand All @@ -12,22 +12,18 @@

#include "AirVRCameraRig.h"
#include "AirVRHeadTrackerInputDevice.h"
#include "AirVRTouchpadInputDevice.h"
#include "AirVRGamepadInputDevice.h"
#include "AirVRTrackedControllerInputDevice.h"
#include "AirVRLeftControllerInputDevice.h"
#include "AirVRRightControllerInputDevice.h"
#include "AirVRLeftHandTrackerInputDevice.h"
#include "AirVRRightHandTrackerInputDevice.h"
#include "AirVRControllerInputDevice.h"
#include "AirVRDeviceFeedback.h"

FAirVRInputStream::FAirVRInputStream(FAirVRCameraRig* InOwner)
: Owner(InOwner)
{
AddInputDevice(new FAirVRHeadTrackerInputDevice());
AddInputDevice(new FAirVRTouchpadInputDevice());
AddInputDevice(new FAirVRGamepadInputDevice());
AddInputDevice(new FAirVRTrackedControllerInputDevice());
AddInputDevice(new FAirVRLeftControllerInputDevice());
AddInputDevice(new FAirVRRightControllerInputDevice());
AddInputDevice(new FAirVRLeftHandTrackerInputDevice());
AddInputDevice(new FAirVRRightHandTrackerInputDevice());
AddInputDevice(new FAirVRControllerInputDevice());
}

FAirVRInputStream::~FAirVRInputStream()
Expand Down Expand Up @@ -94,12 +90,15 @@ void FAirVRInputStream::Update()

InputSendTimer.UpdatePerFrame();
if (InputSendTimer.Expired()) {
int64_t timestamp = 0;
onairvr_BeginPendInput(Owner->GetPlayerID(), timestamp);

for (auto& Feedback : DeviceFeedbacks) {
if (Feedback.Value->IsRegistered()) {
Feedback.Value->PendInputsPerFrame(this);
}
}
onairvr_SendPendingInputs(Owner->GetPlayerID());
onairvr_SendPendingInputs(Owner->GetPlayerID(), timestamp);
}
}

Expand Down Expand Up @@ -284,7 +283,7 @@ FAirVRTrackedDeviceFeedback* FAirVRInputStream::CreateTrackedDeviceFeedback(cons
if (DeviceName.Equals(ONAIRVR_INPUT_DEVICE_HEADTRACKER)) {
return new FAirVRHeadTrackerDeviceFeedback(CookieTexture, CookieTextureSize, CookieDepthScaleMultiplier);
}
else if (DeviceName.Equals(ONAIRVR_INPUT_DEVICE_TRACKED_CONTROLLER)) {
else if (DeviceName.Equals(ONAIRVR_INPUT_DEVICE_RIGHT_HAND_TRACKER)) {
return new FAirVRTrackedControllerDeviceFeedback(CookieTexture, CookieTextureSize, CookieDepthScaleMultiplier);
}
return nullptr;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***********************************************************
Copyright (c) 2017-2018 Clicked, Inc.
Copyright (c) 2017-present Clicked, Inc.
Licensed under the MIT license found in the LICENSE file
in the Docs folder of the distributed package.
Expand Down
Loading

0 comments on commit e1c2a23

Please sign in to comment.