From 49ea0ff4591dd6d51784fed6cdcec4a4f34bc0c5 Mon Sep 17 00:00:00 2001 From: gBarbieri Date: Wed, 21 Feb 2018 10:12:57 +0100 Subject: [PATCH] - fixed empty string - shortened getFieldOrder() --- src/main/kotlin/openvr/lib/ivrApplication.kt | 2 +- src/main/kotlin/openvr/lib/ivrChaperone.kt | 2 +- .../kotlin/openvr/lib/ivrChaperoneSetup.kt | 2 +- src/main/kotlin/openvr/lib/ivrCompositor.kt | 6 +- .../kotlin/openvr/lib/ivrDriverManager.kt | 2 +- .../kotlin/openvr/lib/ivrExtendedDisplay.kt | 2 +- .../kotlin/openvr/lib/ivrNotifications.kt | 4 +- src/main/kotlin/openvr/lib/ivrOverlay.kt | 12 +- src/main/kotlin/openvr/lib/ivrRenderModels.kt | 12 +- src/main/kotlin/openvr/lib/ivrResources.kt | 2 +- src/main/kotlin/openvr/lib/ivrScreenshots.kt | 2 +- src/main/kotlin/openvr/lib/ivrSettings.kt | 2 +- src/main/kotlin/openvr/lib/ivrSystem.kt | 14 +- .../kotlin/openvr/lib/ivrTrackedCamera.kt | 2 +- src/main/kotlin/openvr/lib/openvr.kt | 136 +++++++++--------- src/test/kotlin/main/test.kt | 2 +- 16 files changed, 102 insertions(+), 102 deletions(-) diff --git a/src/main/kotlin/openvr/lib/ivrApplication.kt b/src/main/kotlin/openvr/lib/ivrApplication.kt index 542ccfa..3910e0e 100644 --- a/src/main/kotlin/openvr/lib/ivrApplication.kt +++ b/src/main/kotlin/openvr/lib/ivrApplication.kt @@ -350,7 +350,7 @@ open class IVRApplications : Structure { constructor() - override fun getFieldOrder(): List = Arrays.asList("AddApplicationManifest", "RemoveApplicationManifest", "IsApplicationInstalled", "GetApplicationCount", + override fun getFieldOrder() = listOf("AddApplicationManifest", "RemoveApplicationManifest", "IsApplicationInstalled", "GetApplicationCount", "GetApplicationKeyByIndex", "GetApplicationKeyByProcessId", "LaunchApplication", "LaunchTemplateApplication", "LaunchApplicationFromMimeType", "LaunchDashboardOverlay", "CancelApplicationLaunch", "IdentifyApplication", "GetApplicationProcessId", "GetApplicationsErrorNameFromEnum", "GetApplicationPropertyString", "GetApplicationPropertyBool", "GetApplicationPropertyUint64", "SetApplicationAutoLaunch", "GetApplicationAutoLaunch", diff --git a/src/main/kotlin/openvr/lib/ivrChaperone.kt b/src/main/kotlin/openvr/lib/ivrChaperone.kt index 133f70b..4c7b026 100644 --- a/src/main/kotlin/openvr/lib/ivrChaperone.kt +++ b/src/main/kotlin/openvr/lib/ivrChaperone.kt @@ -142,7 +142,7 @@ open class IVRChaperone : Structure { constructor() - override fun getFieldOrder(): List = Arrays.asList("GetCalibrationState", "GetPlayAreaSize", "GetPlayAreaRect", "ReloadInfo", "SetSceneColor", + override fun getFieldOrder() = listOf("GetCalibrationState", "GetPlayAreaSize", "GetPlayAreaRect", "ReloadInfo", "SetSceneColor", "GetBoundsColor", "AreBoundsVisible_callback", "ForceBoundsVisible") constructor(peer: Pointer) : super(peer) { diff --git a/src/main/kotlin/openvr/lib/ivrChaperoneSetup.kt b/src/main/kotlin/openvr/lib/ivrChaperoneSetup.kt index 481e76d..623b710 100644 --- a/src/main/kotlin/openvr/lib/ivrChaperoneSetup.kt +++ b/src/main/kotlin/openvr/lib/ivrChaperoneSetup.kt @@ -227,7 +227,7 @@ open class IVRChaperoneSetup : Structure { constructor() - override fun getFieldOrder(): List = Arrays.asList("CommitWorkingCopy", "RevertWorkingCopy", "GetWorkingPlayAreaSize", "GetWorkingPlayAreaRect", + override fun getFieldOrder() = listOf("CommitWorkingCopy", "RevertWorkingCopy", "GetWorkingPlayAreaSize", "GetWorkingPlayAreaRect", "GetWorkingCollisionBoundsInfo", "GetLiveCollisionBoundsInfo", "GetWorkingSeatedZeroPoseToRawTrackingPose", "GetWorkingStandingZeroPoseToRawTrackingPose", "SetWorkingPlayAreaSize", "SetWorkingCollisionBoundsInfo", "SetWorkingSeatedZeroPoseToRawTrackingPose", "SetWorkingStandingZeroPoseToRawTrackingPose", "ReloadFromDisk", "GetLiveSeatedZeroPoseToRawTrackingPose", "SetWorkingCollisionBoundsTagsInfo", diff --git a/src/main/kotlin/openvr/lib/ivrCompositor.kt b/src/main/kotlin/openvr/lib/ivrCompositor.kt index ead30eb..498c962 100644 --- a/src/main/kotlin/openvr/lib/ivrCompositor.kt +++ b/src/main/kotlin/openvr/lib/ivrCompositor.kt @@ -178,7 +178,7 @@ open class Compositor_FrameTiming : Structure { this.hmdPose = hmdPose } - override fun getFieldOrder(): List = Arrays.asList("size", "frameIndex", "numFramePresents", "numMisPresented", + override fun getFieldOrder() = listOf("size", "frameIndex", "numFramePresents", "numMisPresented", "numDroppedFrames", "reprojectionFlags", "systemTimeInSeconds", "preSubmitGpuMs", "postSubmitGpuMs", "totalRenderGpuMs", "compositorRenderGpuMs", "compositorRenderCpuMs", "compositorIdleCpuMs", "clientFrameIntervalMs", "presentCallCpuMs", "waitForPresentCpuMs", "submitFrameMs", @@ -272,7 +272,7 @@ open class Compositor_CumulativeStats : Structure { this.numReprojectedFramesTimedOut = numReprojectedFramesTimedOut } - override fun getFieldOrder(): List = Arrays.asList("pid", "numFramePresents", "numDroppedFrames", + override fun getFieldOrder()= listOf("pid", "numFramePresents", "numDroppedFrames", "numReprojectedFrames", "numFramePresentsOnStartup", "numDroppedFramesOnStartup", "numReprojectedFramesOnStartup", "numLoading", "numFramePresentsLoading", "numDroppedFramesLoading", "numReprojectedFramesLoading", "numTimedOut", "numFramePresentsTimedOut", "numDroppedFramesTimedOut", @@ -794,7 +794,7 @@ open class IVRCompositor : Structure { constructor() - override fun getFieldOrder(): List = listOf("SetTrackingSpace", "GetTrackingSpace", "WaitGetPoses", "GetLastPoses", + override fun getFieldOrder()= listOf("SetTrackingSpace", "GetTrackingSpace", "WaitGetPoses", "GetLastPoses", "GetLastPoseForTrackedDeviceIndex", "Submit", "ClearLastSubmittedFrame", "PostPresentHandoff", "GetFrameTiming", "GetFrameTimings", "GetFrameTimeRemaining", "GetCumulativeStats", "FadeToColor", "GetCurrentFadeColor", "FadeGrid", "GetCurrentGridAlpha", "SetSkyboxOverride", "ClearSkyboxOverride", "CompositorBringToFront", "CompositorGoToBack", diff --git a/src/main/kotlin/openvr/lib/ivrDriverManager.kt b/src/main/kotlin/openvr/lib/ivrDriverManager.kt index be4fa67..3f56c98 100644 --- a/src/main/kotlin/openvr/lib/ivrDriverManager.kt +++ b/src/main/kotlin/openvr/lib/ivrDriverManager.kt @@ -41,7 +41,7 @@ open class IVRDriverManager : Structure { constructor() - override fun getFieldOrder(): List = Arrays.asList("GetDriverCount", "GetDriverName", "GetDriverHandle") + override fun getFieldOrder()= listOf("GetDriverCount", "GetDriverName", "GetDriverHandle") constructor(peer: Pointer) : super(peer) { read() diff --git a/src/main/kotlin/openvr/lib/ivrExtendedDisplay.kt b/src/main/kotlin/openvr/lib/ivrExtendedDisplay.kt index 0c5a6ed..ceedec6 100644 --- a/src/main/kotlin/openvr/lib/ivrExtendedDisplay.kt +++ b/src/main/kotlin/openvr/lib/ivrExtendedDisplay.kt @@ -60,7 +60,7 @@ open class IVRExtendedDisplay : Structure { constructor() - override fun getFieldOrder(): List = Arrays.asList("GetWindowBounds", "GetEyeOutputViewport", "GetDXGIOutputInfo") + override fun getFieldOrder()= listOf("GetWindowBounds", "GetEyeOutputViewport", "GetDXGIOutputInfo") constructor(peer: Pointer) : super(peer) { read() diff --git a/src/main/kotlin/openvr/lib/ivrNotifications.kt b/src/main/kotlin/openvr/lib/ivrNotifications.kt index dcec7a8..09998bc 100644 --- a/src/main/kotlin/openvr/lib/ivrNotifications.kt +++ b/src/main/kotlin/openvr/lib/ivrNotifications.kt @@ -27,7 +27,7 @@ open class NotificationBitmap : Structure { this.bytesPerPixel = bytesPerPixel } - override fun getFieldOrder(): List = Arrays.asList("imageData", "width", "height", "bytesPerPixel") + override fun getFieldOrder()= listOf("imageData", "width", "height", "bytesPerPixel") constructor(peer: Pointer) : super(peer) { read() @@ -115,7 +115,7 @@ open class IVRNotifications : Structure { constructor() - override fun getFieldOrder(): List = Arrays.asList("CreateNotification", "RemoveNotification") + override fun getFieldOrder()= listOf("CreateNotification", "RemoveNotification") constructor(peer: Pointer) : super(peer) { read() diff --git a/src/main/kotlin/openvr/lib/ivrOverlay.kt b/src/main/kotlin/openvr/lib/ivrOverlay.kt index d559cbf..4c9e62a 100644 --- a/src/main/kotlin/openvr/lib/ivrOverlay.kt +++ b/src/main/kotlin/openvr/lib/ivrOverlay.kt @@ -150,7 +150,7 @@ open class VROverlayIntersectionParams : Structure { this.eOrigin = origin.i } - override fun getFieldOrder(): List = Arrays.asList("source", "direction", "eOrigin") + override fun getFieldOrder()= listOf("source", "direction", "eOrigin") constructor(peer: Pointer) : super(peer) { read() @@ -180,7 +180,7 @@ open class VROverlayIntersectionResults : Structure { this.distance = distance } - override fun getFieldOrder(): List = Arrays.asList("point", "normal", "uv", "distance") + override fun getFieldOrder()= listOf("point", "normal", "uv", "distance") constructor(peer: Pointer) : super(peer) { read() @@ -258,7 +258,7 @@ open class IntersectionMaskRectangle : Structure { this.height = height } - override fun getFieldOrder(): List = Arrays.asList("topLeftX", "topLeftY", "width", "height") + override fun getFieldOrder()= listOf("topLeftX", "topLeftY", "width", "height") constructor(peer: Pointer) : super(peer) { read() @@ -285,7 +285,7 @@ open class IntersectionMaskCircle : Structure { this.radius = radius } - override fun getFieldOrder(): List = Arrays.asList("centerX", "centerY", "radius") + override fun getFieldOrder()= listOf("centerX", "centerY", "radius") constructor(peer: Pointer) : super(peer) { read() @@ -321,7 +321,7 @@ open class VROverlayIntersectionMaskPrimitive : Structure { this.primitive = m_Primitive } - override fun getFieldOrder(): List = Arrays.asList("primitiveType", "primitive") + override fun getFieldOrder()= listOf("primitiveType", "primitive") constructor(peer: Pointer) : super(peer) { read() @@ -1269,7 +1269,7 @@ open class IVROverlay : Structure { constructor() - override fun getFieldOrder(): List = Arrays.asList("FindOverlay", "CreateOverlay", "DestroyOverlay", + override fun getFieldOrder()= listOf("FindOverlay", "CreateOverlay", "DestroyOverlay", "SetHighQualityOverlay", "GetHighQualityOverlay", "GetOverlayKey", "GetOverlayName", "SetOverlayName", "GetOverlayImageData", "GetOverlayErrorNameFromEnum", "SetOverlayRenderingPid", "GetOverlayRenderingPid", "SetOverlayFlag", "GetOverlayFlag", "SetOverlayColor", "GetOverlayColor", "SetOverlayAlpha", "GetOverlayAlpha", "SetOverlayTexelAspect", diff --git a/src/main/kotlin/openvr/lib/ivrRenderModels.kt b/src/main/kotlin/openvr/lib/ivrRenderModels.kt index 0180664..7bea176 100644 --- a/src/main/kotlin/openvr/lib/ivrRenderModels.kt +++ b/src/main/kotlin/openvr/lib/ivrRenderModels.kt @@ -83,7 +83,7 @@ open class RenderModel_ComponentState : Structure { this.properties = properties } - override fun getFieldOrder(): List = Arrays.asList("trackingToComponentRenderModel", "trackingToComponentLocal", "properties") + override fun getFieldOrder()= listOf("trackingToComponentRenderModel", "trackingToComponentLocal", "properties") constructor(peer: Pointer) : super(peer) { read() @@ -121,7 +121,7 @@ open class RenderModel_Vertex : Structure { this.textureCoord = textureCoord } - override fun getFieldOrder(): List = Arrays.asList("position", "normal", "textureCoord") + override fun getFieldOrder()= listOf("position", "normal", "textureCoord") constructor(peer: Pointer) : super(peer) { read() @@ -167,7 +167,7 @@ open class RenderModel_TextureMap : Structure { this.rubTextureMapData = rubTextureMapData } - override fun getFieldOrder(): List = Arrays.asList("width", "height", "rubTextureMapData") + override fun getFieldOrder()= listOf("width", "height", "rubTextureMapData") constructor(peer: Pointer) : super(peer) { read() @@ -224,7 +224,7 @@ open class RenderModel : Structure { this.diffuseTextureId = diffuseTextureId } - override fun getFieldOrder(): List = Arrays.asList("rVertexData", "vertexCount", "rIndexData", + override fun getFieldOrder()= listOf("rVertexData", "vertexCount", "rIndexData", "triangleCount", "diffuseTextureId") constructor(peer: Pointer) : super(peer) { @@ -257,7 +257,7 @@ open class RenderModel_ControllerMode_State : Structure { this.bScrollWheelVisible = if (bScrollWheelVisible) 1.b else 0.b } - override fun getFieldOrder(): List = Arrays.asList("bScrollWheelVisible") + override fun getFieldOrder()= listOf("bScrollWheelVisible") constructor(peer: Pointer) : super(peer) { read() @@ -501,7 +501,7 @@ open class IVRRenderModels : Structure { constructor() - override fun getFieldOrder(): List = Arrays.asList("LoadRenderModel_Async", "FreeRenderModel", "LoadTexture_Async", "FreeTexture", + override fun getFieldOrder()= listOf("LoadRenderModel_Async", "FreeRenderModel", "LoadTexture_Async", "FreeTexture", "LoadTextureD3D11_Async", "LoadIntoTextureD3D11_Async", "FreeTextureD3D11", "GetRenderModelName", "GetRenderModelCount", "GetComponentCount", "GetComponentName", "GetComponentButtonMask", "GetComponentRenderModelName", "GetComponentState", "RenderModelHasComponent", "GetRenderModelThumbnailURL", "GetRenderModelOriginalPath", "GetRenderModelErrorNameFromEnum") diff --git a/src/main/kotlin/openvr/lib/ivrResources.kt b/src/main/kotlin/openvr/lib/ivrResources.kt index 0741570..cd0e409 100644 --- a/src/main/kotlin/openvr/lib/ivrResources.kt +++ b/src/main/kotlin/openvr/lib/ivrResources.kt @@ -36,7 +36,7 @@ open class IVRResources : Structure { constructor() - override fun getFieldOrder(): List = Arrays.asList("LoadSharedResource", "GetResourceFullPath") + override fun getFieldOrder()= listOf("LoadSharedResource", "GetResourceFullPath") constructor(peer: Pointer) : super(peer) { read() diff --git a/src/main/kotlin/openvr/lib/ivrScreenshots.kt b/src/main/kotlin/openvr/lib/ivrScreenshots.kt index 593d315..03bfe38 100644 --- a/src/main/kotlin/openvr/lib/ivrScreenshots.kt +++ b/src/main/kotlin/openvr/lib/ivrScreenshots.kt @@ -121,7 +121,7 @@ open class IVRScreenshots : Structure { constructor() - override fun getFieldOrder(): List = Arrays.asList("RequestScreenshot", "HookScreenshot", "GetScreenshotPropertyType", "GetScreenshotPropertyFilename", + override fun getFieldOrder()= listOf("RequestScreenshot", "HookScreenshot", "GetScreenshotPropertyType", "GetScreenshotPropertyFilename", "UpdateScreenshotProgress", "TakeStereoScreenshot", "SubmitScreenshot") constructor(peer: Pointer) : super(peer) { diff --git a/src/main/kotlin/openvr/lib/ivrSettings.kt b/src/main/kotlin/openvr/lib/ivrSettings.kt index 84aa779..27b6db4 100644 --- a/src/main/kotlin/openvr/lib/ivrSettings.kt +++ b/src/main/kotlin/openvr/lib/ivrSettings.kt @@ -122,7 +122,7 @@ open class IVRSettings : Structure { constructor() - override fun getFieldOrder(): List = Arrays.asList("GetSettingsErrorNameFromEnum", "Sync", "SetBool", "SetInt32", + override fun getFieldOrder()= listOf("GetSettingsErrorNameFromEnum", "Sync", "SetBool", "SetInt32", "SetFloat", "SetString", "GetBool", "GetInt32", "GetFloat", "GetString", "RemoveSection", "RemoveKeyInSection") constructor(peer: Pointer) : super(peer) { diff --git a/src/main/kotlin/openvr/lib/ivrSystem.kt b/src/main/kotlin/openvr/lib/ivrSystem.kt index cc6ba19..896dd1a 100644 --- a/src/main/kotlin/openvr/lib/ivrSystem.kt +++ b/src/main/kotlin/openvr/lib/ivrSystem.kt @@ -694,7 +694,7 @@ open class IVRSystem : Structure { constructor() - override fun getFieldOrder(): List = Arrays.asList("GetRecommendedRenderTargetSize", "GetProjectionMatrix", + override fun getFieldOrder()= listOf("GetRecommendedRenderTargetSize", "GetProjectionMatrix", "GetProjectionRaw", "ComputeDistortion", "GetEyeToHeadTransform", "GetTimeSinceLastVsync", "GetD3D9AdapterIndex", "GetDXGIOutputInfo", "GetOutputDevice", "IsDisplayOnDesktop", "SetDisplayVisibility", "GetDeviceToAbsoluteTrackingPose", "ResetSeatedZeroPose", "GetSeatedZeroPoseToStandingAbsoluteTrackingPose", "GetRawZeroPoseToStandingAbsoluteTrackingPose", @@ -814,22 +814,22 @@ fun Int.toEVRApplicationTransitionState() = EVRApplicationTransitionState.values open class AppOverrideKeys : Structure { @JvmField - var pchKey = "" // TODO check + var key = "" // TODO check @JvmField - var pchValue = "" + var value = "" constructor() - constructor(pchKey: String, pchValue: String) { - this.pchKey = pchKey - this.pchValue = pchValue + constructor(key: String, value: String) { + this.key = key + this.value = value } constructor(peer: Pointer) : super(peer) { read() } - override fun getFieldOrder(): List = Arrays.asList("pchKey", "pchValue") + override fun getFieldOrder()= listOf("key", "value") class ByReference : AppOverrideKeys(), Structure.ByReference class ByValue : AppOverrideKeys(), Structure.ByValue diff --git a/src/main/kotlin/openvr/lib/ivrTrackedCamera.kt b/src/main/kotlin/openvr/lib/ivrTrackedCamera.kt index 2c8dfcd..1ff6956 100644 --- a/src/main/kotlin/openvr/lib/ivrTrackedCamera.kt +++ b/src/main/kotlin/openvr/lib/ivrTrackedCamera.kt @@ -137,7 +137,7 @@ open class IVRTrackedCamera : Structure { constructor() - override fun getFieldOrder(): List = Arrays.asList("GetCameraErrorNameFromEnum", "HasCamera", "GetCameraFrameSize", + override fun getFieldOrder()= listOf("GetCameraErrorNameFromEnum", "HasCamera", "GetCameraFrameSize", "GetCameraIntrinsics", "GetCameraProjection", "AcquireVideoStreamingService", "ReleaseVideoStreamingService", "GetVideoStreamFrameBuffer", "GetVideoStreamTextureSize", "GetVideoStreamTextureD3D11", "GetVideoStreamTextureGL", "ReleaseVideoStreamTextureGL") diff --git a/src/main/kotlin/openvr/lib/openvr.kt b/src/main/kotlin/openvr/lib/openvr.kt index 4e005a9..0ec6d00 100644 --- a/src/main/kotlin/openvr/lib/openvr.kt +++ b/src/main/kotlin/openvr/lib/openvr.kt @@ -33,7 +33,7 @@ open class VkPhysicalDevice : Structure { constructor() - override fun getFieldOrder(): List = listOf("") + override fun getFieldOrder() = listOf() constructor(peer: Pointer) : super(peer) { read() @@ -47,7 +47,7 @@ open class VkInstance : Structure { constructor() - override fun getFieldOrder(): List = listOf("") + override fun getFieldOrder() = listOf() constructor(peer: Pointer) : super(peer) { read() @@ -79,7 +79,7 @@ open class HmdMat34 : Structure { constructor() - override fun getFieldOrder(): List = listOf("m") + override fun getFieldOrder() = listOf("m") constructor(m: FloatArray) { if (m.size != this.m.size) throw IllegalArgumentException("Wrong array size!") @@ -110,7 +110,7 @@ open class HmdMat44 : Structure { constructor() - override fun getFieldOrder(): List = listOf("m") + override fun getFieldOrder() = listOf("m") constructor(m: FloatArray) { if (m.size != this.m.size) throw IllegalArgumentException("Wrong array size!") @@ -150,7 +150,7 @@ open class HmdVec3 : Structure { constructor() - override fun getFieldOrder(): List = listOf("v") + override fun getFieldOrder() = listOf("v") constructor(v: FloatArray) { if (v.size != this.v.size) throw IllegalArgumentException("Wrong array size!") @@ -195,7 +195,7 @@ open class HmdVec4 : Structure { constructor() - override fun getFieldOrder(): List = listOf("v") + override fun getFieldOrder() = listOf("v") constructor(v: FloatArray) { if (v.size != this.v.size) throw IllegalArgumentException("Wrong array size!") @@ -229,7 +229,7 @@ open class HmdVec3d : Structure { constructor() - override fun getFieldOrder(): List = listOf("v") + override fun getFieldOrder() = listOf("v") constructor(v: DoubleArray) { if (v.size != this.v.size) throw IllegalArgumentException("Wrong array size!") @@ -260,7 +260,7 @@ open class HmdVec2 : Structure { constructor() - override fun getFieldOrder(): List = listOf("v") + override fun getFieldOrder() = listOf("v") constructor(v: FloatArray) { if (v.size != this.v.size) throw IllegalArgumentException("Wrong array size!") @@ -290,7 +290,7 @@ open class HmdQuat : Structure { constructor() - override fun getFieldOrder(): List = listOf("w", "x", "y", "z") + override fun getFieldOrder() = listOf("w", "x", "y", "z") constructor(w: Double, x: Double, y: Double, z: Double) { this.w = w @@ -328,7 +328,7 @@ open class HmdColor : Structure { constructor() - override fun getFieldOrder(): List = listOf("r", "g", "b", "a") + override fun getFieldOrder() = listOf("r", "g", "b", "a") constructor(r: Float, g: Float, b: Float, a: Float) { this.r = r @@ -356,15 +356,15 @@ open class HmdColor : Structure { open class HmdQuad : Structure { @JvmField - var vCorners = arrayOf(HmdVec3(), HmdVec3(), HmdVec3(), HmdVec3()) + var corners = arrayOf(HmdVec3(), HmdVec3(), HmdVec3(), HmdVec3()) constructor() - override fun getFieldOrder(): List = listOf("vCorners") + override fun getFieldOrder()= listOf("corners") - constructor(vCorners: Array) { - if (vCorners.size != this.vCorners.size) throw IllegalArgumentException("Wrong array size!") - this.vCorners = vCorners + constructor(corners: Array) { + if (corners.size != this.corners.size) throw IllegalArgumentException("Wrong array size!") + this.corners = corners } constructor(peer: Pointer) : super(peer) { @@ -378,17 +378,17 @@ open class HmdQuad : Structure { open class HmdRect2 : Structure { @JvmField - var vTopLeft = HmdVec2() + var topLeft = HmdVec2() @JvmField - var vBottomRight = HmdVec2() + var bottomRight = HmdVec2() constructor() - override fun getFieldOrder(): List = listOf("vTopLeft", "vBottomRight") + override fun getFieldOrder()= listOf("topLeft", "bottomRight") - constructor(vTopLeft: HmdVec2, vBottomRight: HmdVec2) { - this.vTopLeft = vTopLeft - this.vBottomRight = vBottomRight + constructor(topLeft: HmdVec2, bottomRight: HmdVec2) { + this.topLeft = topLeft + this.bottomRight = bottomRight } constructor(peer: Pointer) : super(peer) { @@ -404,23 +404,23 @@ open class HmdRect2 : Structure { open class DistortionCoordinates : Structure { @JvmField - var rfRed = FloatArray(2) + var red = FloatArray(2) @JvmField - var rfGreen = FloatArray(2) + var green = FloatArray(2) @JvmField - var rfBlue = FloatArray(2) + var blue = FloatArray(2) constructor() - override fun getFieldOrder(): List = listOf("rfRed", "rfGreen", "rfBlue") + override fun getFieldOrder()= listOf("red", "green", "blue") constructor(rfRed: FloatArray, rfGreen: FloatArray, rfBlue: FloatArray) { - if (rfRed.size != this.rfRed.size) throw IllegalArgumentException("Wrong rfRed array size!") - this.rfRed = rfRed - if (rfGreen.size != this.rfGreen.size) throw IllegalArgumentException("Wrong rfGreen array size!") - this.rfGreen = rfGreen - if (rfBlue.size != this.rfBlue.size) throw IllegalArgumentException("Wrong rfBlue array size!") - this.rfBlue = rfBlue + if (rfRed.size != this.red.size) throw IllegalArgumentException("Wrong red array size!") + this.red = rfRed + if (rfGreen.size != this.green.size) throw IllegalArgumentException("Wrong green array size!") + this.green = rfGreen + if (rfBlue.size != this.blue.size) throw IllegalArgumentException("Wrong blue array size!") + this.blue = rfBlue } constructor(peer: Pointer) : super(peer) { @@ -499,7 +499,7 @@ open class Texture : Structure { constructor() - override fun getFieldOrder(): List = listOf("handle", "eType", "eColorSpac") + override fun getFieldOrder()= listOf("handle", "eType", "eColorSpac") constructor(handle: Long, eType: ETextureType, eColorSpace: EColorSpace) { this.handle = handle @@ -639,7 +639,7 @@ open class TrackedDevicePose : Structure { constructor() - override fun getFieldOrder(): List = listOf("deviceToAbsoluteTracking", "velocity", "angularVelocity", + override fun getFieldOrder()= listOf("deviceToAbsoluteTracking", "velocity", "angularVelocity", "eTrackingResult", "bPoseIsValid", "bDeviceIsConnected") constructor(deviceToAbsoluteTracking: HmdMat34, velocity: HmdVec3, angularVelocity: HmdVec3, @@ -950,7 +950,7 @@ open class VRTextureBounds : Structure { constructor() - override fun getFieldOrder(): List = listOf("uMin", "vMin", "uMax", "vMax") + override fun getFieldOrder()= listOf("uMin", "vMin", "uMax", "vMax") constructor(uMin: Float, vMin: Float, uMax: Float, vMax: Float) { this.uMin = uMin @@ -976,7 +976,7 @@ open class VRTextureWithPose : Texture { constructor() - override fun getFieldOrder(): List = listOf("deviceToAbsoluteTracking") + override fun getFieldOrder()= listOf("deviceToAbsoluteTracking") constructor(deviceToAbsoluteTracking: HmdMat34) { this.deviceToAbsoluteTracking = deviceToAbsoluteTracking @@ -999,7 +999,7 @@ open class VRTextureDepthInfo : Structure { constructor() - override fun getFieldOrder(): List = listOf("handle, projection, range") + override fun getFieldOrder()= listOf("handle, projection, range") constructor(handle: Pointer, projection: HmdMat44, range: HmdVec2) { this.handle = handle @@ -1021,7 +1021,7 @@ open class VRTextureWithDepth : Texture { constructor() : super() - override fun getFieldOrder(): List = listOf("depth") + override fun getFieldOrder()= listOf("depth") constructor(depth: VRTextureDepthInfo) { this.depth = depth @@ -1039,7 +1039,7 @@ open class VRTextureWithPoseAndDepth : VRTextureWithPose { constructor() : super() - override fun getFieldOrder(): List = listOf("depth") + override fun getFieldOrder()= listOf("depth") constructor(depth: VRTextureDepthInfo) { this.depth = depth @@ -1427,7 +1427,7 @@ open class VREvent_Controller : Structure { constructor() - override fun getFieldOrder(): List = listOf("eButton") + override fun getFieldOrder()= listOf("eButton") constructor(button: EVRButtonId) { this.eButton = button.i @@ -1472,7 +1472,7 @@ open class VREvent_Mouse : Structure { constructor() - override fun getFieldOrder(): List = listOf("x", "y", "eButton") + override fun getFieldOrder()= listOf("x", "y", "eButton") constructor(x: Float, y: Float, button: EVRMouseButton) { this.x = x @@ -1501,7 +1501,7 @@ open class VREvent_Scroll : Structure { constructor() - override fun getFieldOrder(): List = listOf("xDelta", "yDelta", "repeatCount") + override fun getFieldOrder()= listOf("xDelta", "yDelta", "repeatCount") constructor(xDelta: Float, yDelta: Float, repeatCount: Int) { this.xDelta = xDelta @@ -1549,7 +1549,7 @@ open class VREvent_TouchPadMove : Structure { constructor() - override fun getFieldOrder(): List = listOf("bFingerDown", "secondsFingerDown", "valueXFirst", "valueYFirst", + override fun getFieldOrder()= listOf("bFingerDown", "secondsFingerDown", "valueXFirst", "valueYFirst", "valueXRaw", "valueYRaw") constructor(fingerDown: Boolean, secondsFingerDown: Float, valueXFirst: Float, valueYFirst: Float, valueXRaw: Float, valueYRaw: Float) { @@ -1603,7 +1603,7 @@ open class VREvent_DualAnalog : Structure { constructor() - override fun getFieldOrder(): List = listOf("x", "y", "transformedX", "transformedY", "eWhich") + override fun getFieldOrder()= listOf("x", "y", "transformedX", "transformedY", "eWhich") constructor(x: Float, y: Float, transformedX: Float, transformedY: Float, which: EDualAnalogWhich) { this.x = x @@ -1638,7 +1638,7 @@ open class VREvent_HapticVibration : Structure { constructor() - override fun getFieldOrder(): List = listOf("containerHandle", "componentHandle", "durationSeconds", "frequency", "amplitude") + override fun getFieldOrder()= listOf("containerHandle", "componentHandle", "durationSeconds", "frequency", "amplitude") constructor(containerHandle: Long, componentHandle: Long, durationSeconds: Float, frequency: Float, amplitude: Float) { this.containerHandle = containerHandle @@ -1666,7 +1666,7 @@ open class VREvent_Notification : Structure { constructor() - override fun getFieldOrder(): List = listOf("userValue", "notificationId") + override fun getFieldOrder()= listOf("userValue", "notificationId") constructor(userValue: Long, notificationId: Int) { this.userValue = userValue @@ -1698,7 +1698,7 @@ open class VREvent_Process : Structure { constructor() - override fun getFieldOrder(): List = listOf("pid", "oldPid", "bForced") + override fun getFieldOrder()= listOf("pid", "oldPid", "bForced") constructor(pid: Int, oldPid: Int, forced: Boolean) { this.pid = pid @@ -1722,7 +1722,7 @@ open class VREvent_Overlay : Structure { constructor() - override fun getFieldOrder(): List = listOf("overlayHandle") + override fun getFieldOrder()= listOf("overlayHandle") constructor(overlayHandle: Long) { this.overlayHandle = overlayHandle @@ -1750,7 +1750,7 @@ open class VREvent_Status : Structure { constructor() - override fun getFieldOrder(): List = listOf("eStatusState") + override fun getFieldOrder()= listOf("eStatusState") constructor(statusState: EVRState) { this.eStatusState = statusState.i @@ -1779,7 +1779,7 @@ open class VREvent_Keyboard : Structure { constructor() - override fun getFieldOrder(): List = listOf("cNewInput", "userValue") + override fun getFieldOrder()= listOf("cNewInput", "userValue") constructor(newInput: String, userValue: Long) { this.cNewInput = newInput.take(8).toByteArray() @@ -1801,7 +1801,7 @@ open class VREvent_Ipd : Structure { constructor() - override fun getFieldOrder(): List = listOf("ipdMeters") + override fun getFieldOrder()= listOf("ipdMeters") constructor(ipdMeters: Float) { this.ipdMeters = ipdMeters @@ -1824,7 +1824,7 @@ open class VREvent_Chaperone : Structure { constructor() - override fun getFieldOrder(): List = listOf("previousUniverse", "currentUniverse") + override fun getFieldOrder()= listOf("previousUniverse", "currentUniverse") constructor(previousUniverse: Long, currentUniverse: Long) { this.previousUniverse = previousUniverse @@ -1853,7 +1853,7 @@ open class VREvent_Reserved : Structure { constructor() - override fun getFieldOrder(): List = listOf("reserved0", "reserved1", "reserved2", "reserved3") + override fun getFieldOrder()= listOf("reserved0", "reserved1", "reserved2", "reserved3") constructor(reserved0: Long, reserved1: Long, reserved2: Long, reserved3: Long) { this.reserved0 = reserved0 @@ -1877,7 +1877,7 @@ open class VREvent_PerformanceTest : Structure { constructor() - override fun getFieldOrder(): List = listOf("fidelityLevel") + override fun getFieldOrder()= listOf("fidelityLevel") constructor(m_nFidelityLevel: Int) { this.fidelityLevel = m_nFidelityLevel @@ -1903,7 +1903,7 @@ open class VREvent_SeatedZeroPoseReset : Structure { constructor() - override fun getFieldOrder(): List = listOf("bResetBySystemMenu") + override fun getFieldOrder()= listOf("bResetBySystemMenu") constructor(resetBySystemMenu: Boolean) { this.bResetBySystemMenu = if (resetBySystemMenu) 1.b else 0.b @@ -1935,7 +1935,7 @@ open class VREvent_Screenshot : Structure { read() } - override fun getFieldOrder(): List = listOf("handle", "type") + override fun getFieldOrder()= listOf("handle", "type") class ByReference : VREvent_Screenshot(), Structure.ByReference class ByValue : VREvent_Screenshot(), Structure.ByValue @@ -1956,7 +1956,7 @@ open class VREvent_ScreenshotProgress : Structure { read() } - override fun getFieldOrder(): List = listOf("progress") + override fun getFieldOrder()= listOf("progress") class ByReference : VREvent_ScreenshotProgress(), Structure.ByReference class ByValue : VREvent_ScreenshotProgress(), Structure.ByValue @@ -1980,7 +1980,7 @@ open class VREvent_ApplicationLaunch : Structure { read() } - override fun getFieldOrder(): List = listOf("pid", "argsHandle") + override fun getFieldOrder()= listOf("pid", "argsHandle") class ByReference : VREvent_ApplicationLaunch(), Structure.ByReference class ByValue : VREvent_ApplicationLaunch(), Structure.ByValue @@ -2004,7 +2004,7 @@ open class VREvent_EditingCameraSurface : Structure { read() } - override fun getFieldOrder(): List = listOf("overlayHandle", "visualMode") + override fun getFieldOrder()= listOf("overlayHandle", "visualMode") class ByReference : VREvent_EditingCameraSurface(), Structure.ByReference class ByValue : VREvent_EditingCameraSurface(), Structure.ByValue @@ -2030,7 +2030,7 @@ open class VREvent_MessageOverlay : Structure { read() } - override fun getFieldOrder(): List = listOf("unVRMessageOverlayResponse") + override fun getFieldOrder()= listOf("unVRMessageOverlayResponse") class ByReference : VREvent_MessageOverlay(), Structure.ByReference class ByValue : VREvent_MessageOverlay(), Structure.ByValue @@ -2061,7 +2061,7 @@ open class VREvent_Property : Structure { read() } - override fun getFieldOrder(): List = listOf("container", "eProp") + override fun getFieldOrder()= listOf("container", "eProp") class ByReference : VREvent_Property(), Structure.ByReference class ByValue : VREvent_Property(), Structure.ByValue @@ -2121,7 +2121,7 @@ open class VREvent_Data : Union { class ByReference : VREvent_Data(), Structure.ByReference class ByValue : VREvent_Data(), Structure.ByValue - override fun getFieldOrder(): List = listOf("controller", "mouse", "scroll", "process", "notification", "overlay", + override fun getFieldOrder()= listOf("controller", "mouse", "scroll", "process", "notification", "overlay", "status", "keyboard", "ipd", "chaperone", "performanceTest", "touchPadMove", "seatedZeroPoseReset", "screenshot", "screenshotProgress", "applicationLaunch", "cameraSurface", "messageOverlay", "property", "dualAnalog", "hapticVibration") } @@ -2147,7 +2147,7 @@ open class VREvent : Structure { constructor() - override fun getFieldOrder(): List = listOf("eEventType", "trackedDeviceIndex", "eventAgeSeconds", "data") + override fun getFieldOrder()= listOf("eEventType", "trackedDeviceIndex", "eventAgeSeconds", "data") constructor(eventType: EVREventType, trackedDeviceIndex: Int, eventAgeSeconds: Float, data: VREvent_Data) { this.eEventType = eventType.i @@ -2192,7 +2192,7 @@ open class HiddenAreaMesh : Structure { constructor() - override fun getFieldOrder(): List = listOf("vertexData", "triangleCount") + override fun getFieldOrder()= listOf("vertexData", "triangleCount") constructor(pVertexData: HmdVec2.ByReference, unTriangleCount: Int) { this.vertexData = pVertexData @@ -2246,7 +2246,7 @@ open class VRControllerAxis : Structure { constructor() - override fun getFieldOrder(): List = listOf("x", "y") + override fun getFieldOrder()= listOf("x", "y") constructor(x: Float, y: Float) { this.x = x @@ -2290,7 +2290,7 @@ open class VRControllerState : Structure { constructor() - override fun getFieldOrder(): List = listOf("packetNum", "buttonPressed", "buttonTouched", "axis") + override fun getFieldOrder()= listOf("packetNum", "buttonPressed", "buttonTouched", "axis") constructor(packetNum: Int, buttonPressed: Long, buttonTouched: Long, axis: Array) { this.packetNum = packetNum @@ -2400,7 +2400,7 @@ open class Compositor_OverlaySettings : Structure { this.transform = transform } - override fun getFieldOrder(): List = listOf("size", "bCurved", "bAntialias", "scale", "distance", "alpha", + override fun getFieldOrder()= listOf("size", "bCurved", "bAntialias", "scale", "distance", "alpha", "uOffset", "vOffset", "uScale", "vScale", "gridDivs", "gridWidth", "gridScale", "transform") constructor(peer: Pointer) : super(peer) { @@ -2727,7 +2727,7 @@ open class CameraVideoStreamFrameHeader : Structure { read() } - override fun getFieldOrder(): List = listOf("eFrameType", "width", "height", "bytesPerPixel", "frameSequence", + override fun getFieldOrder()= listOf("eFrameType", "width", "height", "bytesPerPixel", "frameSequence", "standingTrackedDevicePose") class ByReference : CameraVideoStreamFrameHeader(), Structure.ByReference @@ -2774,7 +2774,7 @@ open class DriverDirectMode_FrameTiming : Structure { read() } - override fun getFieldOrder(): List = listOf("size", "numFramePresents", "numMisPresented", "numDroppedFrames", "reprojectionFlags") + override fun getFieldOrder()= listOf("size", "numFramePresents", "numMisPresented", "numDroppedFrames", "reprojectionFlags") class ByReference : DriverDirectMode_FrameTiming(), Structure.ByReference class ByValue : DriverDirectMode_FrameTiming(), Structure.ByValue diff --git a/src/test/kotlin/main/test.kt b/src/test/kotlin/main/test.kt index 5254c1c..192f711 100644 --- a/src/test/kotlin/main/test.kt +++ b/src/test/kotlin/main/test.kt @@ -81,7 +81,7 @@ class Test : StringSpec() { // val dc = hmd.computeDistortion(EVREye.Left, .5f, .5f) // // -// assert(dc.rfRed[0] in 0..1 && dc.rfRed[1] in 0..1 && dc.rfGreen[0] in 0..1 && dc.rfGreen[1] in 0..1 && dc.rfBlue[0] in 0..1 && dc.rfBlue[1] in 0..1) +// assert(dc.red[0] in 0..1 && dc.red[1] in 0..1 && dc.green[0] in 0..1 && dc.green[1] in 0..1 && dc.blue[0] in 0..1 && dc.blue[1] in 0..1) // // // val m43 = hmd.getEyeToHeadTransform(EVREye.Left)