gaesup-world 0.2.33 → 0.2.35

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.
@@ -9,42 +9,6 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
- return new (P || (P = Promise))(function (resolve, reject) {
15
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
- step((generator = generator.apply(thisArg, _arguments || [])).next());
19
- });
20
- };
21
- var __generator = (this && this.__generator) || function (thisArg, body) {
22
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
- function verb(n) { return function (v) { return step([n, v]); }; }
25
- function step(op) {
26
- if (f) throw new TypeError("Generator is already executing.");
27
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
28
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
- if (y = 0, t) op = [op[0] & 2, t.value];
30
- switch (op[0]) {
31
- case 0: case 1: t = op; break;
32
- case 4: _.label++; return { value: op[1], done: false };
33
- case 5: _.label++; y = op[1]; op = [0]; continue;
34
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
- default:
36
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
- if (t[2]) _.ops.pop();
41
- _.trys.pop(); continue;
42
- }
43
- op = body.call(thisArg, _);
44
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
- }
47
- };
48
12
  import { jsx as _jsx } from "react/jsx-runtime";
49
13
  import { CameraControls } from "@react-three/drei";
50
14
  import { useFrame, useThree } from "@react-three/fiber";
@@ -57,7 +21,6 @@ import normal from "./control/normal";
57
21
  import orbit from "./control/orbit";
58
22
  import detector from "./detector";
59
23
  export default function Camera(_a) {
60
- var _this = this;
61
24
  var refs = _a.refs, prop = _a.prop, control = _a.control;
62
25
  var worldContext = useContext(GaesupWorldContext);
63
26
  var controllerContext = useContext(GaesupControllerContext);
@@ -106,34 +69,42 @@ export default function Camera(_a) {
106
69
  detector(cameraProp);
107
70
  }
108
71
  });
109
- // moveTo 함수 정의
110
- worldContext.moveTo = function (position, target) { return __awaiter(_this, void 0, void 0, function () {
111
- return __generator(this, function (_a) {
112
- switch (_a.label) {
113
- case 0:
114
- camera.position.copy(position);
115
- if (!(mode.control === "orbit")) return [3 /*break*/, 2];
116
- return [4 /*yield*/, Promise.all([
117
- cameraRef.current.setPosition(position.x, position.y, position.z, true),
118
- camera.rotation.copy(worldContext.activeState.euler),
119
- cameraRef.current.setLookAt(position.x, position.y, position.z, target.x, target.y, target.z, true),
120
- ])];
121
- case 1:
122
- _a.sent();
123
- return [3 /*break*/, 4];
124
- case 2:
125
- if (!(mode.control === "normal")) return [3 /*break*/, 4];
126
- return [4 /*yield*/, Promise.all([
127
- cameraRef.current.setPosition(0, position.y, position.z, true),
128
- camera.rotation.copy(worldContext.activeState.euler),
129
- cameraRef.current.setLookAt(0, position.y, position.z, target.x, target.y, target.z, true),
130
- ])];
131
- case 3:
132
- _a.sent();
133
- _a.label = 4;
134
- case 4: return [2 /*return*/];
135
- }
136
- });
137
- }); };
72
+ // // moveTo 함수 정의
73
+ // worldContext.moveTo = async (
74
+ // position: THREE.Vector3,
75
+ // target: THREE.Vector3
76
+ // ) => {
77
+ // camera.position.copy(position);
78
+ // if (mode.control === "orbit") {
79
+ // await Promise.all([
80
+ // cameraRef.current.setPosition(position.x, position.y, position.z, true),
81
+ //
82
+ // camera.rotation.copy(worldContext.activeState.euler),
83
+ // cameraRef.current.setLookAt(
84
+ // position.x,
85
+ // position.y,
86
+ // position.z,
87
+ // target.x,
88
+ // target.y,
89
+ // target.z,
90
+ // true
91
+ // ),
92
+ // ]);
93
+ // } else if (mode.control === "normal") {
94
+ // await Promise.all([
95
+ // cameraRef.current.setPosition(0, position.y, position.z, true),
96
+ // camera.rotation.copy(worldContext.activeState.euler),
97
+ // cameraRef.current.setLookAt(
98
+ // 0,
99
+ // position.y,
100
+ // position.z,
101
+ // target.x,
102
+ // target.y,
103
+ // target.z,
104
+ // true
105
+ // ),
106
+ // ]);
107
+ // }
108
+ // };
138
109
  return _jsx(CameraControls, { ref: cameraRef });
139
110
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gaesup-world",
3
- "version": "0.2.33",
3
+ "version": "0.2.35",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -12,9 +12,7 @@
12
12
  "build": "vite build",
13
13
  "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
14
14
  "preview": "vite preview",
15
- "prepare": "rm -rf dist && mkdir dist && yarn clean && tsc -p tsconfig.build.json && yarn copy-files",
16
15
  "predeploy": "vite build",
17
- "prepublishOnly": "rm -rf dist/ && npm run build",
18
16
  "deploy": "gh-pages -d dist"
19
17
  },
20
18
  "dependencies": {