telescoping hanging rod
This commit is contained in:
parent
55c88406f7
commit
61d911a9e6
4 changed files with 133 additions and 36 deletions
|
@ -1,9 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<manifest
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.dofdev.snake"
|
||||
android:versionCode="48"
|
||||
android:versionName="1.53"
|
||||
android:versionCode="50"
|
||||
android:versionName="1.55"
|
||||
android:installLocation="auto"
|
||||
>
|
||||
<uses-sdk android:minSdkVersion="29" android:targetSdkVersion="32" />
|
||||
|
@ -17,25 +17,43 @@
|
|||
<!-- <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> -->
|
||||
|
||||
<!-- Generic OpenXR items -->
|
||||
<uses-feature android:name="android.hardware.vr.headtracking" android:required="true" android:version="1" />
|
||||
<uses-feature
|
||||
android:name="android.hardware.vr.headtracking"
|
||||
android:required="true"
|
||||
android:version="1"
|
||||
/>
|
||||
<uses-permission android:name="org.khronos.openxr.permission.OPENXR_SYSTEM" />
|
||||
<uses-permission android:name="org.khronos.openxr.permission.OPENXR" />
|
||||
<queries>
|
||||
<provider android:authorities="org.khronos.openxr.runtime_broker;org.khronos.openxr.system_runtime_broker" />
|
||||
<intent> <action android:name="org.khronos.openxr.OpenXRRuntimeService" /> </intent>
|
||||
<intent> <action android:name="org.khronos.openxr.OpenXRApiLayerService" /> </intent>
|
||||
<provider
|
||||
android:authorities="org.khronos.openxr.runtime_broker;org.khronos.openxr.system_runtime_broker"
|
||||
/>
|
||||
<intent> <action
|
||||
android:name="org.khronos.openxr.OpenXRRuntimeService"
|
||||
/> </intent>
|
||||
<intent> <action
|
||||
android:name="org.khronos.openxr.OpenXRApiLayerService"
|
||||
/> </intent>
|
||||
</queries>
|
||||
|
||||
<!-- Vive specific items -->
|
||||
<uses-feature android:name="wave.feature.handtracking" android:required="false" />
|
||||
<uses-feature
|
||||
android:name="wave.feature.handtracking"
|
||||
android:required="false"
|
||||
/>
|
||||
<uses-feature android:name="wave.feature.tracker" android:required="false" />
|
||||
|
||||
<!-- Snapdragon specific items -->
|
||||
<uses-permission android:name="com.qualcomm.qti.qxr.QXRServiceClientPermission" android:required="false" />
|
||||
<uses-permission
|
||||
android:name="com.qualcomm.qti.qxr.QXRServiceClientPermission"
|
||||
android:required="false"
|
||||
/>
|
||||
<queries>
|
||||
<package android:name="com.qualcomm.qti.spaces.services" />
|
||||
<package android:name="com.qualcomm.qti.openxrruntime" />
|
||||
<intent> <action android:name="com.qualcomm.qti.openxr.spaces.intent.action.BIND" /> </intent>
|
||||
<intent> <action
|
||||
android:name="com.qualcomm.qti.openxr.spaces.intent.action.BIND"
|
||||
/> </intent>
|
||||
</queries>
|
||||
|
||||
<!-- Oculus specific items -->
|
||||
|
@ -45,11 +63,26 @@
|
|||
<uses-permission android:name="com.oculus.permission.EYE_TRACKING" />
|
||||
<uses-permission android:name="com.oculus.permission.USE_ANCHOR_API" />
|
||||
<uses-permission android:name="com.oculus.permission.USE_SCENE" />
|
||||
<uses-feature android:name="com.oculus.feature.PASSTHROUGH" android:required="true" />
|
||||
<uses-feature android:name="oculus.software.handtracking" android:required="false" />
|
||||
<uses-feature android:name="com.oculus.software.body_tracking" android:required="false" />
|
||||
<uses-feature android:name="oculus.software.face_tracking" android:required="false" />
|
||||
<uses-feature android:name="oculus.software.eye_tracking" android:required="false" />
|
||||
<uses-feature
|
||||
android:name="com.oculus.feature.PASSTHROUGH"
|
||||
android:required="true"
|
||||
/>
|
||||
<uses-feature
|
||||
android:name="oculus.software.handtracking"
|
||||
android:required="false"
|
||||
/>
|
||||
<uses-feature
|
||||
android:name="com.oculus.software.body_tracking"
|
||||
android:required="false"
|
||||
/>
|
||||
<uses-feature
|
||||
android:name="oculus.software.face_tracking"
|
||||
android:required="false"
|
||||
/>
|
||||
<uses-feature
|
||||
android:name="oculus.software.eye_tracking"
|
||||
android:required="false"
|
||||
/>
|
||||
|
||||
<application
|
||||
android:allowBackup="false"
|
||||
|
@ -59,11 +92,23 @@
|
|||
android:supportsRtl="true"
|
||||
>
|
||||
<!-- Oculus -->
|
||||
<meta-data android:name="com.oculus.supportedDevices" android:value="quest2|quest3|questpro" />
|
||||
<meta-data android:name="com.oculus.handtracking.version" android:value="V2.0" />
|
||||
<meta-data android:name="com.oculus.ossplash.background" android:value="passthrough-contextual" />
|
||||
<meta-data
|
||||
android:name="com.oculus.supportedDevices"
|
||||
android:value="quest2|quest3|questpro"
|
||||
/>
|
||||
<meta-data
|
||||
android:name="com.oculus.handtracking.version"
|
||||
android:value="V2.0"
|
||||
/>
|
||||
<meta-data
|
||||
android:name="com.oculus.ossplash.background"
|
||||
android:value="passthrough-contextual"
|
||||
/>
|
||||
<meta-data android:name="com.oculus.vr.focusaware" android:value="true" />
|
||||
<uses-native-library android:name="libopenxr_forwardloader.oculus.so" android:required="false" />
|
||||
<uses-native-library
|
||||
android:name="libopenxr_forwardloader.oculus.so"
|
||||
android:required="false"
|
||||
/>
|
||||
<!-- Pico -->
|
||||
<meta-data android:name="pvr.app.type" android:value="vr" />
|
||||
<meta-data android:name="handtracking" android:value="1" />
|
||||
|
|
|
@ -54,12 +54,12 @@ todo
|
|||
|
||||
benchmark
|
||||
need to be able to play without moving/turning the box
|
||||
DepthTest Material.DepthTest { get; set; }
|
||||
you could use DepthTest.Greater to draw a glow that indicates an object is behind something.
|
||||
|
||||
start music on egg eat
|
||||
to keep prior tutorial phase focused and a strong indication that auto move has kicked in
|
||||
|
||||
curved hanger
|
||||
|
||||
my tempo (zen mode *after initial release*)
|
||||
on l_con tap (a) btn to step, and repeatedly to set tempo
|
||||
once a tempo has been set you can stop tapping and you'll coast at that tempo
|
||||
|
|
64
src/Arts.cs
64
src/Arts.cs
|
@ -84,22 +84,66 @@ static class Arts
|
|||
box_scale
|
||||
);
|
||||
|
||||
// hanger
|
||||
// telescoping hanging rod
|
||||
if (Mono.in_cone.state && Mono.box_mode == Mono.BoxMode.Hold || Mono.box_mode == Mono.BoxMode.Mount)
|
||||
{
|
||||
float box_head_dist = Vec3.Distance(box_pos, Rig.head.position);
|
||||
Lines.Add(
|
||||
box_m4 * V.XYZ(0, Mono.SD_Y - 0.5f, 0),
|
||||
Rig.head.position + Rig.head.orientation * V.XYZ(0, 6 * U.cm, -box_head_dist),
|
||||
Color.Hex(0x808080FF).ToLinear(),
|
||||
1.0f * U.mm
|
||||
|
||||
Vec3 box_mount = box_m4 * V.XYZ(0, Mono.SD_Y - 0.5f, 0);
|
||||
Vec3 box_handl = Rig.head.position + Rig.head.orientation * V.XYZ(0, 6 * U.cm, -box_head_dist);
|
||||
|
||||
Vec3 head_mount = Rig.head.position + Rig.head.orientation * V.XYZ(0, 6 * U.cm, 0);
|
||||
Vec3 head_handl = Vec3.Lerp(box_handl, head_mount, 0.5f);
|
||||
Vec3[] p = new Vec3[] {
|
||||
box_mount,
|
||||
box_handl,
|
||||
|
||||
head_handl,
|
||||
head_mount,
|
||||
};
|
||||
|
||||
// debug bezier points
|
||||
// for (int i = 0; i < p.Length; i++)
|
||||
// {
|
||||
// Mesh.Sphere.Draw(
|
||||
// mat_justcolor,
|
||||
// Matrix.TS(
|
||||
// p[i],
|
||||
// 2 * U.mm
|
||||
// ),
|
||||
// Color.White
|
||||
// );
|
||||
// }
|
||||
|
||||
Mesh.Sphere.Draw(
|
||||
mat_justcolor,
|
||||
Matrix.TS(
|
||||
box_mount,
|
||||
3 * U.mm
|
||||
),
|
||||
Color.Hex(0x959493FF).ToLinear()
|
||||
);
|
||||
|
||||
int steps = 64;
|
||||
Vec3 pastPos = p[0];
|
||||
float pastThc = 0.0f;
|
||||
for (int i = 0; i < steps; i++)
|
||||
{
|
||||
float t = (float)i / (steps - 1);
|
||||
Vec3 a = Vec3.Lerp(p[0], p[1], t);
|
||||
Vec3 b = Vec3.Lerp(p[1], p[2], t);
|
||||
Vec3 c = Vec3.Lerp(p[2], p[3], t);
|
||||
Vec3 pos = Vec3.Lerp(Vec3.Lerp(a, b, t), Vec3.Lerp(b, c, t), t);
|
||||
float thc = (1.0f + Maths.precision(t, 0.2f) * 2.0f) * U.mm;
|
||||
Lines.Add(
|
||||
Rig.head.position + Rig.head.orientation * V.XYZ(0, 6 * U.cm, -box_head_dist),
|
||||
Rig.head.position + Rig.head.orientation * V.XYZ(0, 6 * U.cm, 0),
|
||||
Color.Hex(0x808080FF).ToLinear(),
|
||||
1.0f * U.mm
|
||||
pastPos,
|
||||
pos,
|
||||
thc != pastThc ? Color.Hex(0x959493FF).ToLinear() : Color.Hex(0x808080FF).ToLinear(),
|
||||
thc
|
||||
);
|
||||
pastPos = pos;
|
||||
pastThc = thc;
|
||||
}
|
||||
}
|
||||
|
||||
// box contents
|
||||
|
|
10
src/Maths.cs
10
src/Maths.cs
|
@ -35,7 +35,10 @@ public static class Maths
|
|||
// public static int roundi(float value) => MathF.Round(value)
|
||||
|
||||
public static float precision(float x, float p)
|
||||
=> round(x * p) / p;
|
||||
{
|
||||
float ps = p < 1.0f ? 1 / p : p;
|
||||
return round(x * ps) / ps;
|
||||
}
|
||||
|
||||
public static float smooth_start(float t) => (t * t * t);
|
||||
public static float smooth_stop(float t)
|
||||
|
@ -43,6 +46,11 @@ public static class Maths
|
|||
float s = sign(t);
|
||||
return (s - ((s - t) * (s - t) * (s - t)));
|
||||
}
|
||||
public static float less_smooth_stop(float t) // [!] messy implementation
|
||||
{
|
||||
float s = sign(t);
|
||||
return (s - ((s - t) * (s - t)));
|
||||
}
|
||||
|
||||
public static float lerp(float a, float b, float t) => a + (b - a) * t;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue