telescoping hanging rod
This commit is contained in:
parent
55c88406f7
commit
61d911a9e6
4 changed files with 133 additions and 36 deletions
|
@ -2,8 +2,8 @@
|
||||||
<manifest
|
<manifest
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.dofdev.snake"
|
package="com.dofdev.snake"
|
||||||
android:versionCode="48"
|
android:versionCode="50"
|
||||||
android:versionName="1.53"
|
android:versionName="1.55"
|
||||||
android:installLocation="auto"
|
android:installLocation="auto"
|
||||||
>
|
>
|
||||||
<uses-sdk android:minSdkVersion="29" android:targetSdkVersion="32" />
|
<uses-sdk android:minSdkVersion="29" android:targetSdkVersion="32" />
|
||||||
|
@ -17,25 +17,43 @@
|
||||||
<!-- <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> -->
|
<!-- <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> -->
|
||||||
|
|
||||||
<!-- Generic OpenXR items -->
|
<!-- 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_SYSTEM" />
|
||||||
<uses-permission android:name="org.khronos.openxr.permission.OPENXR" />
|
<uses-permission android:name="org.khronos.openxr.permission.OPENXR" />
|
||||||
<queries>
|
<queries>
|
||||||
<provider android:authorities="org.khronos.openxr.runtime_broker;org.khronos.openxr.system_runtime_broker" />
|
<provider
|
||||||
<intent> <action android:name="org.khronos.openxr.OpenXRRuntimeService" /> </intent>
|
android:authorities="org.khronos.openxr.runtime_broker;org.khronos.openxr.system_runtime_broker"
|
||||||
<intent> <action android:name="org.khronos.openxr.OpenXRApiLayerService" /> </intent>
|
/>
|
||||||
|
<intent> <action
|
||||||
|
android:name="org.khronos.openxr.OpenXRRuntimeService"
|
||||||
|
/> </intent>
|
||||||
|
<intent> <action
|
||||||
|
android:name="org.khronos.openxr.OpenXRApiLayerService"
|
||||||
|
/> </intent>
|
||||||
</queries>
|
</queries>
|
||||||
|
|
||||||
<!-- Vive specific items -->
|
<!-- 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" />
|
<uses-feature android:name="wave.feature.tracker" android:required="false" />
|
||||||
|
|
||||||
<!-- Snapdragon specific items -->
|
<!-- 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>
|
<queries>
|
||||||
<package android:name="com.qualcomm.qti.spaces.services" />
|
<package android:name="com.qualcomm.qti.spaces.services" />
|
||||||
<package android:name="com.qualcomm.qti.openxrruntime" />
|
<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>
|
</queries>
|
||||||
|
|
||||||
<!-- Oculus specific items -->
|
<!-- Oculus specific items -->
|
||||||
|
@ -45,11 +63,26 @@
|
||||||
<uses-permission android:name="com.oculus.permission.EYE_TRACKING" />
|
<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_ANCHOR_API" />
|
||||||
<uses-permission android:name="com.oculus.permission.USE_SCENE" />
|
<uses-permission android:name="com.oculus.permission.USE_SCENE" />
|
||||||
<uses-feature android:name="com.oculus.feature.PASSTHROUGH" android:required="true" />
|
<uses-feature
|
||||||
<uses-feature android:name="oculus.software.handtracking" android:required="false" />
|
android:name="com.oculus.feature.PASSTHROUGH"
|
||||||
<uses-feature android:name="com.oculus.software.body_tracking" android:required="false" />
|
android:required="true"
|
||||||
<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="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
|
<application
|
||||||
android:allowBackup="false"
|
android:allowBackup="false"
|
||||||
|
@ -59,11 +92,23 @@
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
>
|
>
|
||||||
<!-- Oculus -->
|
<!-- Oculus -->
|
||||||
<meta-data android:name="com.oculus.supportedDevices" android:value="quest2|quest3|questpro" />
|
<meta-data
|
||||||
<meta-data android:name="com.oculus.handtracking.version" android:value="V2.0" />
|
android:name="com.oculus.supportedDevices"
|
||||||
<meta-data android:name="com.oculus.ossplash.background" android:value="passthrough-contextual" />
|
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" />
|
<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 -->
|
<!-- Pico -->
|
||||||
<meta-data android:name="pvr.app.type" android:value="vr" />
|
<meta-data android:name="pvr.app.type" android:value="vr" />
|
||||||
<meta-data android:name="handtracking" android:value="1" />
|
<meta-data android:name="handtracking" android:value="1" />
|
||||||
|
|
|
@ -54,12 +54,12 @@ todo
|
||||||
|
|
||||||
benchmark
|
benchmark
|
||||||
need to be able to play without moving/turning the box
|
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
|
start music on egg eat
|
||||||
to keep prior tutorial phase focused and a strong indication that auto move has kicked in
|
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*)
|
my tempo (zen mode *after initial release*)
|
||||||
on l_con tap (a) btn to step, and repeatedly to set tempo
|
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
|
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
|
box_scale
|
||||||
);
|
);
|
||||||
|
|
||||||
// hanger
|
// telescoping hanging rod
|
||||||
if (Mono.in_cone.state && Mono.box_mode == Mono.BoxMode.Hold || Mono.box_mode == Mono.BoxMode.Mount)
|
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);
|
float box_head_dist = Vec3.Distance(box_pos, Rig.head.position);
|
||||||
Lines.Add(
|
|
||||||
box_m4 * V.XYZ(0, Mono.SD_Y - 0.5f, 0),
|
Vec3 box_mount = 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),
|
Vec3 box_handl = Rig.head.position + Rig.head.orientation * V.XYZ(0, 6 * U.cm, -box_head_dist);
|
||||||
Color.Hex(0x808080FF).ToLinear(),
|
|
||||||
1.0f * U.mm
|
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(
|
Lines.Add(
|
||||||
Rig.head.position + Rig.head.orientation * V.XYZ(0, 6 * U.cm, -box_head_dist),
|
pastPos,
|
||||||
Rig.head.position + Rig.head.orientation * V.XYZ(0, 6 * U.cm, 0),
|
pos,
|
||||||
Color.Hex(0x808080FF).ToLinear(),
|
thc != pastThc ? Color.Hex(0x959493FF).ToLinear() : Color.Hex(0x808080FF).ToLinear(),
|
||||||
1.0f * U.mm
|
thc
|
||||||
);
|
);
|
||||||
|
pastPos = pos;
|
||||||
|
pastThc = thc;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// box contents
|
// 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 int roundi(float value) => MathF.Round(value)
|
||||||
|
|
||||||
public static float precision(float x, float p)
|
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_start(float t) => (t * t * t);
|
||||||
public static float smooth_stop(float t)
|
public static float smooth_stop(float t)
|
||||||
|
@ -43,6 +46,11 @@ public static class Maths
|
||||||
float s = sign(t);
|
float s = sign(t);
|
||||||
return (s - ((s - t) * (s - t) * (s - 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;
|
public static float lerp(float a, float b, float t) => a + (b - a) * t;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue