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.
- package/dist/gaesup/camera/index.js +37 -66
- package/package.json +1 -3
|
@@ -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 =
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
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.
|
|
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": {
|