Skip to content

Commit

Permalink
⬆️
Browse files Browse the repository at this point in the history
- Steam VR 10.0.12
- Kotlin 1.2.20 eap 71
- gradle 4.4.1
- shadow 2.0.2
- glm
  • Loading branch information
elect86 committed Jan 16, 2018
1 parent a9e7ae1 commit 457f93a
Show file tree
Hide file tree
Showing 19 changed files with 316 additions and 155 deletions.
24 changes: 13 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ group = 'com.github.kotlin-graphics'

buildscript {

ext.kotlinVersion = '1.2.0'
ext.kotlinVersion = '1.2.20-eap-71'

repositories {
jcenter() // shadow
Expand All @@ -18,7 +18,7 @@ buildscript {

dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.1'
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.2'
}
}

Expand All @@ -30,7 +30,7 @@ dependencies {

testCompile 'io.kotlintest:kotlintest:2.0.7'

compile "com.github.kotlin-graphics:glm:70b4eb23b05153de66137bb3dba0446eb77654f0"
compile "com.github.kotlin-graphics:glm:513efb138ce49ef1a6b0a87810c47c7548e7d1f6"

compile "net.java.dev.jna:jna:4.5.0"
}
Expand All @@ -42,15 +42,17 @@ repositories {
maven { url 'https://jitpack.io' }
}

task packageSources(type: Jar, dependsOn: 'classes') {
from sourceSets.main.allSource
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}

//jar {
// /** This line of code recursively collects and copies all of a project's files and adds them to the JAR itself.
// One can extend this task, to skip certain files or particular types at will */
// from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
//}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

artifacts { archives packageSources }
artifacts {
archives sourcesJar
archives javadocJar
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-all.zip
4 changes: 2 additions & 2 deletions src/main/kotlin/openvr/lib/ivrCompositor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -257,15 +257,15 @@ open class IVRCompositor : Structure {
/** Interface for accessing last set of poses returned by WaitGetPoses one at a time.
* Returns VRCompositorError_IndexOutOfRange if unDeviceIndex not less than openvr.lib.getK_unMaxTrackedDeviceCount otherwise VRCompositorError_None.
* It is okay to pass NULL for either pose if you only want one of the values. */
fun getLastPoseForTrackedDeviceIndex(unDeviceIndex: TrackedDeviceIndex_t, pOutputPose: TrackedDevicePose.ByReference,
fun getLastPoseForTrackedDeviceIndex(unDeviceIndex: TrackedDeviceIndex, pOutputPose: TrackedDevicePose.ByReference,
pOutputGamePose: TrackedDevicePose.ByReference)
= EVRCompositorError.of(GetLastPoseForTrackedDeviceIndex!!.invoke(unDeviceIndex, pOutputPose, pOutputGamePose))

@JvmField
var GetLastPoseForTrackedDeviceIndex: GetLastPoseForTrackedDeviceIndex_callback? = null

interface GetLastPoseForTrackedDeviceIndex_callback : Callback {
fun invoke(unDeviceIndex: TrackedDeviceIndex_t, pOutputPose: TrackedDevicePose.ByReference, pOutputGamePose: TrackedDevicePose.ByReference): Int
fun invoke(unDeviceIndex: TrackedDeviceIndex, pOutputPose: TrackedDevicePose.ByReference, pOutputGamePose: TrackedDevicePose.ByReference): Int
}

/** Updated scene texture to display. If pBounds is NULL the entire texture will be used. If called from an OpenGL app, consider adding a glFlush after
Expand Down
43 changes: 14 additions & 29 deletions src/main/kotlin/openvr/lib/ivrOverlay.kt
Original file line number Diff line number Diff line change
Expand Up @@ -745,15 +745,15 @@ open class IVROverlay : Structure {
}

/** Sets the transform to relative to the transform of the specified tracked device. */
fun setOverlayTransformTrackedDeviceRelative(ulOverlayHandle: VROverlayHandle, unTrackedDevice: TrackedDeviceIndex_t,
fun setOverlayTransformTrackedDeviceRelative(ulOverlayHandle: VROverlayHandle, unTrackedDevice: TrackedDeviceIndex,
pmatTrackedDeviceToOverlayTransform: HmdMat34.ByReference)
= EVROverlayError.of(SetOverlayTransformTrackedDeviceRelative!!.invoke(ulOverlayHandle, unTrackedDevice, pmatTrackedDeviceToOverlayTransform))

@JvmField
var SetOverlayTransformTrackedDeviceRelative: SetOverlayTransformTrackedDeviceRelative_callback? = null

interface SetOverlayTransformTrackedDeviceRelative_callback : Callback {
fun invoke(ulOverlayHandle: VROverlayHandle, unTrackedDevice: TrackedDeviceIndex_t, pmatTrackedDeviceToOverlayTransform: HmdMat34.ByReference): Int
fun invoke(ulOverlayHandle: VROverlayHandle, unTrackedDevice: TrackedDeviceIndex, pmatTrackedDeviceToOverlayTransform: HmdMat34.ByReference): Int
}

/** Gets the transform if it is relative to a tracked device. Returns an error if the transform is some other value. */
Expand All @@ -771,14 +771,14 @@ open class IVROverlay : Structure {

/** Sets the transform to draw the overlay on a rendermodel component mesh instead of a quad. This will only draw when the system is drawing the device.
* Overlays with this transform value cannot receive mouse events. */
fun setOverlayTransformTrackedDeviceComponent(ulOverlayHandle: VROverlayHandle, unDeviceIndex: TrackedDeviceIndex_t, pchComponentName: String)
fun setOverlayTransformTrackedDeviceComponent(ulOverlayHandle: VROverlayHandle, unDeviceIndex: TrackedDeviceIndex, pchComponentName: String)
= EVROverlayError.of(SetOverlayTransformTrackedDeviceComponent!!.invoke(ulOverlayHandle, unDeviceIndex, pchComponentName))

@JvmField
var SetOverlayTransformTrackedDeviceComponent: SetOverlayTransformTrackedDeviceComponent_callback? = null

interface SetOverlayTransformTrackedDeviceComponent_callback : Callback {
fun invoke(ulOverlayHandle: VROverlayHandle, unDeviceIndex: TrackedDeviceIndex_t, pchComponentName: String): Int
fun invoke(ulOverlayHandle: VROverlayHandle, unDeviceIndex: TrackedDeviceIndex, pchComponentName: String): Int
}

/** Gets the transform information when the overlay is rendering on a component. */
Expand Down Expand Up @@ -941,21 +941,6 @@ open class IVROverlay : Structure {
: Boolean
}

/** Processes mouse input from the specified controller as though it were a mouse pointed at a compositor overlay with the specified settings.
* The controller is treated like a laser pointer on the -z axis. The point where the laser pointer would intersect with the overlay is the mouse position,
* the trigger is left mouse, and the track pad is right mouse.
*
* Return true if the controller is pointed at the overlay and an event was generated. */
fun handleControllerOverlayInteractionAsMouse(ulOverlayHandle: VROverlayHandle, unControllerDeviceIndex: TrackedDeviceIndex_t)
= HandleControllerOverlayInteractionAsMouse!!.invoke(ulOverlayHandle, unControllerDeviceIndex)

@JvmField
var HandleControllerOverlayInteractionAsMouse: HandleControllerOverlayInteractionAsMouse_callback? = null

interface HandleControllerOverlayInteractionAsMouse_callback : Callback {
fun invoke(ulOverlayHandle: VROverlayHandle, unControllerDeviceIndex: TrackedDeviceIndex_t): Boolean
}

/** Returns true if the specified overlay is the hover target. An overlay is the hover target when it is the last overlay "moused over" by the virtual mouse
* pointer */
fun isHoverTargetOverlay(ulOverlayHandle: VROverlayHandle) = IsHoverTargetOverlay!!.invoke(ulOverlayHandle)
Expand Down Expand Up @@ -1208,7 +1193,7 @@ open class IVROverlay : Structure {
var GetPrimaryDashboardDevice: GetPrimaryDashboardDevice_callback? = null

interface GetPrimaryDashboardDevice_callback : Callback {
fun invoke(): TrackedDeviceIndex_t
fun invoke(): TrackedDeviceIndex
}

// ---------------------------------------------
Expand Down Expand Up @@ -1360,14 +1345,14 @@ open class IVROverlay : Structure {
"GetOverlayTransformOverlayRelative", "SetOverlayTransformOverlayRelative", "ShowOverlay", "HideOverlay",
"IsOverlayVisible", "GetTransformForOverlayCoordinates", "PollNextOverlayEvent", "GetOverlayInputMethod",
"SetOverlayInputMethod", "GetOverlayMouseScale", "SetOverlayMouseScale", "ComputeOverlayIntersection",
"HandleControllerOverlayInteractionAsMouse", "IsHoverTargetOverlay", "GetGamepadFocusOverlay", "SetGamepadFocusOverlay",
"SetOverlayNeighbor", "MoveGamepadFocusToNeighbor", "SetOverlayDualAnalogTransform", "GetOverlayDualAnalogTransform",
"SetOverlayTexture", "ClearOverlayTexture", "SetOverlayRaw", "SetOverlayFromFile", "GetOverlayTexture",
"ReleaseNativeOverlayHandle", "GetOverlayTextureSize", "CreateDashboardOverlay", "IsDashboardVisible",
"IsActiveDashboardOverlay", "SetDashboardOverlaySceneProcess", "GetDashboardOverlaySceneProcess", "ShowDashboard",
"GetPrimaryDashboardDevice", "ShowKeyboard", "ShowKeyboardForOverlay", "GetKeyboardText", "HideKeyboard",
"SetKeyboardTransformAbsolute", "SetKeyboardPositionForOverlay", "SetOverlayIntersectionMask", "GetOverlayFlags",
"ShowMessageOverlay", "CloseMessageOverlay")
"IsHoverTargetOverlay", "GetGamepadFocusOverlay", "SetGamepadFocusOverlay", "SetOverlayNeighbor",
"MoveGamepadFocusToNeighbor", "SetOverlayDualAnalogTransform", "GetOverlayDualAnalogTransform", "SetOverlayTexture",
"ClearOverlayTexture", "SetOverlayRaw", "SetOverlayFromFile", "GetOverlayTexture", "ReleaseNativeOverlayHandle",
"GetOverlayTextureSize", "CreateDashboardOverlay", "IsDashboardVisible", "IsActiveDashboardOverlay",
"SetDashboardOverlaySceneProcess", "GetDashboardOverlaySceneProcess", "ShowDashboard", "GetPrimaryDashboardDevice",
"ShowKeyboard", "ShowKeyboardForOverlay", "GetKeyboardText", "HideKeyboard", "SetKeyboardTransformAbsolute",
"SetKeyboardPositionForOverlay", "SetOverlayIntersectionMask", "GetOverlayFlags", "ShowMessageOverlay",
"CloseMessageOverlay")

constructor(peer: Pointer) : super(peer) {
read()
Expand All @@ -1377,4 +1362,4 @@ open class IVROverlay : Structure {
class ByValue : IVROverlay(), Structure.ByValue
}

val IVROverlay_Version = "IVROverlay_017"
val IVROverlay_Version = "IVROverlay_018"
3 changes: 3 additions & 0 deletions src/main/kotlin/openvr/lib/ivrSettings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,17 @@ val SteamVR_RetailDemo_Bool = "retailDemo"
val SteamVR_IpdOffset_Float = "ipdOffset"
val SteamVR_AllowSupersampleFiltering_Bool = "allowSupersampleFiltering"
val SteamVR_EnableLinuxVulkanAsync_Bool = "enableLinuxVulkanAsync"
val SteamVR_AllowDisplayLockedMode_Bool = "allowDisplayLockedMode"
val SteamVR_HaveStartedTutorialForNativeChaperoneDriver_Bool = "haveStartedTutorialForNativeChaperoneDriver"
val SteamVR_ForceWindows32bitVRMonitor = "forceWindows32BitVRMonitor"


//-----------------------------------------------------------------------------
// lighthouse keys

val Lighthouse_Section = "driver_lighthouse"
val Lighthouse_DisableIMU_Bool = "disableimu"
val DisableIMUExceptHMD_Bool = "disableimuexcepthmd"
val Lighthouse_UseDisambiguation_String = "usedisambiguation"
val Lighthouse_DisambiguationDebug_Int32 = "disambiguationdebug"
val Lighthouse_PrimaryBasestation_Int32 = "primarybasestation"
Expand Down
Loading

0 comments on commit 457f93a

Please sign in to comment.