mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
feat(awareness): render the Global Context compass from a store
The awareness layer presents the compass ring, heading, cardinal labels and contact bearing markers through subscribeDirectionOverlay(); the application shell publishes them to the gev-awareness-direction store and the scene chrome renders them in the viewer's container.
This commit is contained in:
1 parent
b22e138c55
commit
b96cc37ab5
14 files changed
+389
-100
No files matched your search
@@ -0,0 +1,28 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { shallowRef } from 'vue';
|
||||
|
||||
/**
|
||||
* The Global Context compass and contact direction overlay as its view
|
||||
* renders it. The awareness layer presents it through
|
||||
* `subscribeDirectionOverlay()` and the application shell publishes it here.
|
||||
*/
|
||||
export const useAwarenessDirectionStore = defineStore(
|
||||
'gev-awareness-direction',
|
||||
() => {
|
||||
/**
|
||||
* `{container, hidden, ring, heading, labels, markers}`, or null while
|
||||
* the layer has no overlay. `container` is the element it sits in.
|
||||
*/
|
||||
const overlay = shallowRef(null);
|
||||
|
||||
/**
|
||||
* @param {?object} next A fresh presentation, frozen by the layer; every
|
||||
* publish re-renders.
|
||||
*/
|
||||
function publish(next) {
|
||||
overlay.value = next;
|
||||
}
|
||||
|
||||
return { overlay, publish };
|
||||
},
|
||||
);
|
||||
Reference in new issue
Block a user