gaesup-world 0.8.43 → 0.8.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,7 +21,7 @@ export function GaeSupProps(_a) {
21
21
  var _c = useContext(GaesupWorldContext), minimap = _c.minimap, activeState = _c.activeState, clickerOption = _c.clickerOption;
22
22
  var dispatch = useContext(GaesupWorldDispatchContext);
23
23
  // clicker
24
- var _d = useClicker(), moveClicker = _d.moveClicker, moveDoubleClicker = _d.moveDoubleClicker;
24
+ var moveClicker = useClicker().moveClicker;
25
25
  useEffect(function () {
26
26
  if (groupRef.current) {
27
27
  var box = new THREE.Box3().setFromObject(groupRef.current);
@@ -46,9 +46,5 @@ export function GaeSupProps(_a) {
46
46
  if (e.srcElement instanceof HTMLDivElement)
47
47
  return;
48
48
  moveClicker(e, false, type);
49
- }, onDoubleClick: function (e) {
50
- if (e.srcElement instanceof HTMLDivElement)
51
- return;
52
- moveDoubleClicker(e, true, type);
53
49
  }, children: children }));
54
50
  }
@@ -1,5 +1,4 @@
1
1
  import { ThreeEvent } from "@react-three/fiber";
2
2
  export declare function useClicker(): {
3
3
  moveClicker: (e: ThreeEvent<MouseEvent>, isRun: boolean, type: "normal" | "ground") => void;
4
- moveDoubleClicker: (e: ThreeEvent<MouseEvent>, isRun: boolean, type: "normal" | "ground") => void;
5
4
  };
@@ -1,19 +1,8 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  import { useContext } from "react";
13
2
  import { V3 } from "../../utils";
14
3
  import { GaesupWorldContext, GaesupWorldDispatchContext, } from "../../world/context";
15
4
  export function useClicker() {
16
- var _a = useContext(GaesupWorldContext), activeState = _a.activeState, mode = _a.mode, clicker = _a.clicker, clickerOption = _a.clickerOption;
5
+ var _a = useContext(GaesupWorldContext), activeState = _a.activeState, mode = _a.mode;
17
6
  var dispatch = useContext(GaesupWorldDispatchContext);
18
7
  var moveClicker = function (e, isRun, type) {
19
8
  if (mode.controller !== "clicker" || type !== "ground")
@@ -33,18 +22,7 @@ export function useClicker() {
33
22
  },
34
23
  });
35
24
  };
36
- var moveDoubleClicker = function (e, isRun, type) {
37
- if (!clicker.isOn || !clickerOption.isRun)
38
- return;
39
- dispatch({
40
- type: "update",
41
- payload: {
42
- clicker: __assign(__assign({}, clicker), { isRun: isRun }),
43
- },
44
- });
45
- };
46
25
  return {
47
26
  moveClicker: moveClicker,
48
- moveDoubleClicker: moveDoubleClicker,
49
27
  };
50
28
  }
@@ -1,11 +1,14 @@
1
1
  import { useContext } from "react";
2
2
  import { GaesupWorldContext } from "../../world/context";
3
3
  export function useTeleport() {
4
- var refs = useContext(GaesupWorldContext).refs;
4
+ var worldContext = useContext(GaesupWorldContext);
5
5
  var Teleport = function (position) {
6
- var _a, _b;
7
- if (refs && refs.rigidBodyRef && refs.rigidBodyRef.current)
8
- (_b = (_a = refs.rigidBodyRef) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.setTranslation(position, true);
6
+ var _a, _b, _c;
7
+ if (worldContext &&
8
+ (worldContext === null || worldContext === void 0 ? void 0 : worldContext.refs) &&
9
+ ((_a = worldContext === null || worldContext === void 0 ? void 0 : worldContext.refs) === null || _a === void 0 ? void 0 : _a.rigidBodyRef) &&
10
+ ((_c = (_b = worldContext === null || worldContext === void 0 ? void 0 : worldContext.refs) === null || _b === void 0 ? void 0 : _b.rigidBodyRef) === null || _c === void 0 ? void 0 : _c.current))
11
+ worldContext.refs.rigidBodyRef.current.setTranslation(position, true);
9
12
  };
10
13
  return {
11
14
  Teleport: Teleport,
@@ -37,7 +37,6 @@
37
37
  z-index: 100000;
38
38
  }
39
39
 
40
- /* padButton isClicked variant */
41
40
  .padButton.isClicked {
42
41
  background: radial-gradient(
43
42
  circle at center,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gaesup-world",
3
- "version": "0.8.43",
3
+ "version": "0.8.45",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,2 +0,0 @@
1
- import { cameraPropType } from "../../physics/type";
2
- export default function detector(cameraProp: cameraPropType): void;
@@ -1,28 +0,0 @@
1
- export default function detector(cameraProp) {
2
- // const { cameraRay, intersectObjectMap } = cameraProp;
3
- //
4
- // const intersects = cameraRay.rayCast.intersectObjects(
5
- // Object.values(intersectObjectMap)
6
- // );
7
- //
8
- // const intersectId = {};
9
- //
10
- // intersects.map(({ object }) => {
11
- // if (object instanceof THREE.Mesh) {
12
- // intersectId[object.uuid] = true;
13
- // }
14
- // });
15
- //
16
- // Object.values(intersectObjectMap).map((mesh) => {
17
- // if (mesh instanceof THREE.Mesh && mesh.material instanceof THREE.Material) {
18
- // const material = mesh.material;
19
- // if (intersectId[mesh.uuid]) {
20
- // material.opacity = 0.2;
21
- // material.transparent = true;
22
- // } else {
23
- // material.opacity = 1;
24
- // material.transparent = false;
25
- // }
26
- // }
27
- // });
28
- }