Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Lint Error for AR Module #298

Merged
merged 43 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
546d9ae
Added AR module
8kdesign Mar 1, 2024
e7d3fe2
Fix missing exit toggle
8kdesign Mar 1, 2024
f7a8e46
Add base64 image
8kdesign Mar 4, 2024
5c266e4
Added export and import objects to json string
8kdesign Mar 4, 2024
8f4db44
Fix json parsing for ui
8kdesign Mar 4, 2024
4f7008a
Clean code and added hit-test controls
8kdesign Mar 5, 2024
1921eb3
Fix error
8kdesign Mar 5, 2024
4e168b8
Fix highlight not working
8kdesign Mar 5, 2024
ffa22b1
Add highlight for UI component
8kdesign Mar 5, 2024
9b72b6a
Improve outline
8kdesign Mar 5, 2024
0ecf155
Fix lighting issue for UI
8kdesign Mar 10, 2024
ca585ae
Merge branch 'master' into ar
8kdesign Mar 10, 2024
60fec15
Improve parsing of state
8kdesign Mar 10, 2024
5d946ac
Remove convert to string
8kdesign Mar 10, 2024
e01f966
Clean up code
8kdesign Mar 10, 2024
0fcaaa6
Clean code
8kdesign Mar 11, 2024
4693f38
Added lint ignore for skeletonutils.js
8kdesign Mar 12, 2024
6236cf7
Remove unrequired width and height variables
8kdesign Mar 17, 2024
61d917c
Clean up calibration library
8kdesign Mar 17, 2024
092de59
Improved documentation for controls library
8kdesign Mar 17, 2024
2649934
Object state library clean up
8kdesign Mar 17, 2024
84413fe
Added more documentation for object library
8kdesign Mar 17, 2024
e5c9ffd
Add syncing of movement
8kdesign Mar 18, 2024
6ae9c24
Merge branch 'master' into ar
8kdesign Mar 18, 2024
31527d1
Merge branch 'ar' of https://github.com/8kdesign/modules into ar
8kdesign Mar 18, 2024
89aa990
Merge branch 'master' into ar
joeng03 Mar 19, 2024
c0ca63a
Address issues brought up in review
8kdesign Mar 19, 2024
d82bd13
Merge branch 'ar' of https://github.com/8kdesign/modules into ar
8kdesign Mar 19, 2024
50d83d5
Rename arObject parameters
8kdesign Mar 19, 2024
589462f
Add ability to get the object in front
8kdesign Mar 26, 2024
5c46bcc
Fix line-of-sight selection
8kdesign Mar 26, 2024
5a41c46
Use saar package
8kdesign Mar 26, 2024
d37a420
Remove imports for ar, replace with saar
8kdesign Mar 26, 2024
00ae101
Increase saar version
8kdesign Mar 26, 2024
298348b
Fix imports
8kdesign Mar 26, 2024
e89c1ee
Fix imports for tab
8kdesign Mar 26, 2024
300cf1b
Remove gl
8kdesign Mar 26, 2024
08b636c
change entries to values
8kdesign Mar 26, 2024
a29ccb7
Fix spring console spam
8kdesign Mar 26, 2024
52b9efc
Merge branch 'master' into ar
8kdesign Mar 26, 2024
9491050
Fix empty catch and other lint issues
8kdesign Mar 26, 2024
394f1e2
Merge branch 'master' into ar-fix
8kdesign Mar 26, 2024
f839258
Merge branch 'ar' into ar-fix
8kdesign Mar 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
},
"resolutions": {
"@types/react": "^18.2.0",
"esbuild": "^0.18.20"
"esbuild": "^0.18.20",
"**/gl": "^6.0.2"
}
}
2 changes: 1 addition & 1 deletion src/bundles/ar/AR.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Vector3 } from 'saar/libraries/misc';
import { ARObject } from 'saar/libraries/object_state_library/ARObject';
import { OverlayHelper, Toggle } from './OverlayHelper';
import { Vector3 } from 'saar/libraries/misc';

export class ARState {
arObjects: ARObject[] = [];
Expand Down
14 changes: 7 additions & 7 deletions src/bundles/ar/ObjectsHelper.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { type Vector3 } from 'saar/libraries/misc';
import {
type ARObject,
CubeObject,
Expand All @@ -18,19 +19,18 @@ import {
RotateToUser,
SpringMovement,
} from 'saar/libraries/object_state_library/Behaviour';
import uniqid from 'uniqid';
import UIBase64ImageComponent from 'saar/libraries/object_state_library/ui_component/UIBase64ImageItem';
import UIColumnItem, {
type HorizontalAlignment,
} from 'saar/libraries/object_state_library/ui_component/UIColumnItem';
import UIImageItem from 'saar/libraries/object_state_library/ui_component/UIImageItem';
import type { UIBasicItem } from 'saar/libraries/object_state_library/ui_component/UIItem';
import UIRowItem, {
type VerticalAlignment,
} from 'saar/libraries/object_state_library/ui_component/UIRowItem';
import UIColumnItem, {
type HorizontalAlignment,
} from 'saar/libraries/object_state_library/ui_component/UIColumnItem';
import UITextItem from 'saar/libraries/object_state_library/ui_component/UITextItem';
import UIImageItem from 'saar/libraries/object_state_library/ui_component/UIImageItem';
import uniqid from 'uniqid';
import { callARCallback } from './AR';
import UIBase64ImageComponent from 'saar/libraries/object_state_library/ui_component/UIBase64ImageItem';
import { type Vector3 } from 'saar/libraries/misc';

// Objects

Expand Down
17 changes: 9 additions & 8 deletions src/tabs/AugmentedReality/AugmentedContent.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { useState, type RefObject, useRef, useEffect } from 'react';
import { usePlayArea } from 'saar/libraries/calibration_library/PlayAreaContext';
import { useControls } from 'saar/libraries/controls_library/ControlsContext';
import { ARObject } from 'saar/libraries/object_state_library/ARObject';
import { useScreenState } from 'saar/libraries/screen_state_library/ScreenStateContext';
import {
getModuleState,
type ARState,
setFrontObject,
} from '../../bundles/ar/AR';
import type { OverlayHelper } from '../../bundles/ar/OverlayHelper';
import { useScreenState } from 'saar/libraries/screen_state_library/ScreenStateContext';
import { usePlayArea } from 'saar/libraries/calibration_library/PlayAreaContext';
import { useControls } from 'saar/libraries/controls_library/ControlsContext';
import { ARObject } from 'saar/libraries/object_state_library/ARObject';

/**
* Content to be shown on screen.
Expand Down Expand Up @@ -160,15 +160,16 @@ export function AugmentedContent(props: ARState) {
fetch('https://worldtimeapi.org/api/timezone/Asia/Singapore')
.then((response) => response.json())
.then((data) => {
let time = new Date(data.datetime).getTime();
let offset = time - new Date().getTime();
const time = new Date(data.datetime).getTime();
const offset = time - new Date().getTime();
setTimeOffset(offset);
console.log('Time offset', offset);
})
.catch((error) => {
console.log(error);
});
} catch {}
} catch {
setTimeOffset(0);
}
}, []);

/**
Expand Down
2 changes: 1 addition & 1 deletion src/tabs/AugmentedReality/AugmentedLayer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ARState } from '../../bundles/ar/AR';
import { PlayAreaContext } from 'saar/libraries/calibration_library/PlayAreaContext';
import { ControlsContext } from 'saar/libraries/controls_library/ControlsContext';
import type { ARState } from '../../bundles/ar/AR';
import { AugmentedContent } from './AugmentedContent';

/**
Expand Down
6 changes: 3 additions & 3 deletions src/tabs/AugmentedReality/StartButton.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useEffect } from 'react';
import type { ARState } from '../../bundles/ar/AR';
import { useScreenState } from 'saar/libraries/screen_state_library/ScreenStateContext';
import { ARButton } from 'saar/libraries/misc';
import { Overlay } from './Overlay';
import { useScreenState } from 'saar/libraries/screen_state_library/ScreenStateContext';
import type { ARState } from '../../bundles/ar/AR';
import { AugmentedLayer } from './AugmentedLayer';
import { Overlay } from './Overlay';

/**
* Toggle to start AR context, for tab.
Expand Down
2 changes: 1 addition & 1 deletion src/tabs/AugmentedReality/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { getModuleState } from '../../bundles/ar/AR';
import { ScreenStateContext } from 'saar/libraries/screen_state_library/ScreenStateContext';
import { getModuleState } from '../../bundles/ar/AR';
import { StartButton } from './StartButton';

/**
Expand Down
Loading