gaesup-world 0.8.44 → 0.8.46

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.
@@ -1,9 +1,9 @@
1
1
  import { V3 } from "../../utils/vector";
2
2
  export var makeNormalCameraPosition = function (activeState, cameraOption) {
3
- var YDistance = cameraOption.YDistance, ZDistance = cameraOption.ZDistance;
3
+ var XDistance = cameraOption.XDistance, YDistance = cameraOption.YDistance, ZDistance = cameraOption.ZDistance;
4
4
  var cameraPosition = activeState.position
5
5
  .clone()
6
- .add(V3(0, YDistance, ZDistance));
6
+ .add(V3(XDistance, YDistance, ZDistance));
7
7
  return cameraPosition;
8
8
  };
9
9
  export default function normal(prop) {
@@ -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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gaesup-world",
3
- "version": "0.8.44",
3
+ "version": "0.8.46",
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
- }