From 858822af478733d5cb1b1fb0efc432196160168d Mon Sep 17 00:00:00 2001 From: ad044 Date: Mon, 21 Sep 2020 02:38:51 +0400 Subject: [PATCH] zzzzz --- src/components/BlueOrb/CurrentBlueOrbAtom.tsx | 2 +- src/components/GrayPlanes/GrayPlanes.tsx | 55 ++++++++++--------- src/components/GrayRing.tsx | 15 ++--- src/components/PurpleRing.tsx | 20 +++---- src/resources/blue_orb_directions.json | 14 +++-- src/resources/blue_orb_huds.json | 40 ++++++++++++++ src/resources/blue_orbs.json | 17 ++++-- 7 files changed, 109 insertions(+), 54 deletions(-) diff --git a/src/components/BlueOrb/CurrentBlueOrbAtom.tsx b/src/components/BlueOrb/CurrentBlueOrbAtom.tsx index f1a192c..4921db7 100644 --- a/src/components/BlueOrb/CurrentBlueOrbAtom.tsx +++ b/src/components/BlueOrb/CurrentBlueOrbAtom.tsx @@ -2,5 +2,5 @@ import { atom } from 'recoil' export const currentBlueOrbAtom = atom({ key: 'currentBlueOrbAtom', - default: "0422" + default: "0520" }) diff --git a/src/components/GrayPlanes/GrayPlanes.tsx b/src/components/GrayPlanes/GrayPlanes.tsx index d57f986..df04083 100644 --- a/src/components/GrayPlanes/GrayPlanes.tsx +++ b/src/components/GrayPlanes/GrayPlanes.tsx @@ -44,33 +44,34 @@ const GrayPlanes = memo(() => { }); return ( - - {grayPlaneRefs.map((ref, idx: number) => { - return ( - - - - - ); - })} + // separate wrapper group to make it rotate around [0,0,0] + + + {grayPlaneRefs.map((ref, idx: number) => { + return ( + + + + + ); + })} + ); }); diff --git a/src/components/GrayRing.tsx b/src/components/GrayRing.tsx index 51428a8..9f31681 100644 --- a/src/components/GrayRing.tsx +++ b/src/components/GrayRing.tsx @@ -62,8 +62,9 @@ const GrayRing = memo((props: GrayRingProps) => { vec4 color(vec2 vUv, int quadnum, bool textureexists, int thinperiod, int quadlen, float step) { if (!textureexists) { return vec4(0.259,0.259,0.322, 1); - } else if (quadnum % 2 == 1) { + } else if (uint(quadnum) % uint(2) == uint(1)) { return texture2D(hole, vec2(tolocal(vUv.x, quadlen-thinperiod, step), vUv.y)); + // return vec4(tolocal(vUv.x, quadlen-thinperiod, step), 0, 0, 1); } else if (quadnum == 0) { return texture2D(lof, vec2(tolocal(vUv.x, quadlen-thinperiod, step), vUv.y)); } else { @@ -84,18 +85,18 @@ const GrayRing = memo((props: GrayRingProps) => { int quadlen = int(step)/4; // segment within circle's quad - int quadel = int(segment) % quadlen; + uint quadel = uint(segment) % uint(quadlen); // which quad - int quadnum = int(segment) / quadlen; + int quadnum = int(uint(segment) / uint(quadlen)); // how big thin part is int thinperiod = 8; - if (quadel < thinperiod && isheight(vUv.y, thin)) { + if (quadel < uint(thinperiod) && isheight(vUv.y, thin)) { // thin line gl_FragColor = color(vUv, quadnum, false, thinperiod, quadlen, step); - } else if (quadel == thinperiod) { + } else if (quadel == uint(thinperiod)) { // slope up float dist = tolocal(vUv.x, 1, step); if (vUv.y > slope(1.0-dist, thin) && vUv.y < 1.0-slope(1.0-dist, thin)) { @@ -103,7 +104,7 @@ const GrayRing = memo((props: GrayRingProps) => { } else { gl_FragColor = vec4(0, 0, 0, 0); } - } else if (quadel == quadlen-1) { + } else if (quadel == uint(quadlen-1)) { // slope down float dist = tolocal(vUv.x, 1, step); if (vUv.y > slope(dist, thin) && vUv.y < 1.0-slope(dist, thin)) { @@ -111,7 +112,7 @@ const GrayRing = memo((props: GrayRingProps) => { } else { gl_FragColor = vec4(0, 0, 0, 0); } - } else if (quadel > thinperiod) { + } else if (quadel > uint(thinperiod)) { gl_FragColor = color(vUv, quadnum, true, thinperiod, quadlen, step); } else { // transparent diff --git a/src/components/PurpleRing.tsx b/src/components/PurpleRing.tsx index 7c793aa..d04711c 100644 --- a/src/components/PurpleRing.tsx +++ b/src/components/PurpleRing.tsx @@ -88,18 +88,18 @@ const PurpleRing = memo((props: PurpleRingProps) => { float thick = 1.0; float slopefactor = 1.0; - int halfc = int(step)/2; + uint halfc = uint(step)/uint(2); // segment within circle - int segment = int(floor(vUv.x * step)); - int thinperiod = halfc-8; + uint segment = uint(floor(vUv.x * step)); + uint thinperiod = halfc-uint(8); - int halfel = segment % halfc; + uint halfel = segment % halfc; - if (halfel < thinperiod-1 && istop(vUv.y, thin)) { + if (halfel < thinperiod-uint(1) && istop(vUv.y, thin)) { // thin line top gl_FragColor = color(vUv, step, false); - } else if (halfel == thinperiod - 1) { + } else if (halfel == thinperiod - uint(1)) { // thin line and corner float dist = tolocal(vUv.x, 1, step); float val = 1.0-slope(1.0-dist, thin); @@ -117,10 +117,10 @@ const PurpleRing = memo((props: PurpleRingProps) => { } else { gl_FragColor = vec4(0, 0, 0, 0); } - } else if (halfel == thinperiod+1 && isbottom(vUv.y, thin)) { + } else if (halfel == thinperiod+uint(1) && isbottom(vUv.y, thin)) { // thin line bottom gl_FragColor = vec4(0.325,0.325,0.698, 1); - } else if (halfel == thinperiod + 2) { + } else if (halfel == thinperiod + uint(2)) { // slope up float dist = tolocal(vUv.x, 1, step); float val = 1.0-slope(1.0-dist, thin); @@ -129,10 +129,10 @@ const PurpleRing = memo((props: PurpleRingProps) => { } else { gl_FragColor = vec4(0, 0, 0, 0); } - } else if (halfel > thinperiod + 2 && halfel < thinperiod+7) { + } else if (halfel > thinperiod + uint(2) && halfel < thinperiod+uint(7)) { // thick part gl_FragColor = color(vUv, step, true); - } else if (halfel == thinperiod+7) { + } else if (halfel == thinperiod+uint(7)) { // slope up float dist = tolocal(vUv.x, 1, step); float val = slope(dist, thin); diff --git a/src/resources/blue_orb_directions.json b/src/resources/blue_orb_directions.json index badad3b..6e7d1bb 100644 --- a/src/resources/blue_orb_directions.json +++ b/src/resources/blue_orb_directions.json @@ -33,7 +33,7 @@ "up": "", "down": "", "left": "0506", - "right": "" + "right": "+0520" }, "0515": { "up": "", @@ -47,10 +47,16 @@ "left": "+0517", "right": "" }, - "0500": { - "up": "0508", + "0517": { + "up": "", "down": "", - "left": "+0517", + "left": "+0500", + "right": "" + }, + "0500": { + "up": "", + "down": "", + "left": "0510", "right": "" } } diff --git a/src/resources/blue_orb_huds.json b/src/resources/blue_orb_huds.json index 3837725..18ab469 100644 --- a/src/resources/blue_orb_huds.json +++ b/src/resources/blue_orb_huds.json @@ -178,5 +178,45 @@ "type": "normal", "initial_position": [1.36, 0.13, -8.6] } + }, + "10": { + "long": { + "position": [-0.45, -0.09, -8.6], + "scale": [1, 0.03, 1], + "type": "normal", + "initial_position": [-1.45, -0.09, -8.6] + }, + "boring": { + "position": [0.5, -0.07, -8.6], + "scale": [1, 0.03, 1], + "type": "normal", + "initial_position": [1.48, -0.07, -8.6] + }, + "big": { + "position": [0.35, -0.12, -8.6], + "scale": [0.5, 0.06, 1], + "type": "normal", + "initial_position": [1.36, -0.12, -8.6] + } + }, + "20": { + "long": { + "position": [-0.45, 0.15, -8.6], + "scale": [1, 0.03, 1], + "type": "normal", + "initial_position": [-1.45, 0.15, -8.6] + }, + "boring": { + "position": [0.48, 0.174, -8.6], + "scale": [1, 0.03, 1], + "type": "normal", + "initial_position": [1.48, 0.174, -8.6] + }, + "big": { + "position": [0.36, 0.13, -8.6], + "scale": [0.5, 0.06, 1], + "type": "normal", + "initial_position": [1.36, 0.13, -8.6] + } } } diff --git a/src/resources/blue_orbs.json b/src/resources/blue_orbs.json index 513dff4..1fecf22 100644 --- a/src/resources/blue_orbs.json +++ b/src/resources/blue_orbs.json @@ -37,14 +37,14 @@ "5": { "position": [0.4, 1.87, 1.3], "scale": [0.25, 0.15, 0.25], - "rotation": [0, 0.09, 0], + "rotation": [0, 0.27, 0], "sprite": "Dc", "id": "0513" }, "6": { "position": [-1, 1.87, 0.95], "scale": [0.25, 0.15, 0.25], - "rotation": [0, -0.8, 0], + "rotation": [0, -0.9, 0], "sprite": "Tda", "id": "0515" }, @@ -70,10 +70,17 @@ "id": "0517" }, "10": { - "position": [-1.25, 2.17, -0.5], + "position": [-0.85, 1.87, -1.05], "scale": [0.25, 0.15, 0.25], - "rotation": [0, -1.85, 0], - "sprite": "Tda", + "rotation": [0, -2.45, 0], + "sprite": "Cou", "id": "0510" + }, + "11": { + "position": [1, 2.17, 0.9], + "scale": [0.25, 0.15, 0.25], + "rotation": [0, 0.69, 0], + "sprite": "Cou", + "id": "0520" } }