gaesup-world 0.8.39 → 0.8.41
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.
|
@@ -14,7 +14,6 @@ import { vec3 } from "@react-three/rapier";
|
|
|
14
14
|
import { useContext, useEffect, useRef } from "react";
|
|
15
15
|
import * as THREE from "three";
|
|
16
16
|
import { useClicker } from "../hooks/useClicker";
|
|
17
|
-
import { useMovePoint } from "../hooks/useMovePoint";
|
|
18
17
|
import { GaesupWorldContext, GaesupWorldDispatchContext, } from "../world/context";
|
|
19
18
|
export function GaeSupProps(_a) {
|
|
20
19
|
var _b = _a.type, type = _b === void 0 ? "normal" : _b, text = _a.text, position = _a.position, children = _a.children;
|
|
@@ -23,12 +22,6 @@ export function GaeSupProps(_a) {
|
|
|
23
22
|
var dispatch = useContext(GaesupWorldDispatchContext);
|
|
24
23
|
// clicker
|
|
25
24
|
var _d = useClicker(), moveClicker = _d.moveClicker, moveDoubleClicker = _d.moveDoubleClicker;
|
|
26
|
-
var move = useMovePoint().move;
|
|
27
|
-
useEffect(function () {
|
|
28
|
-
if (clickerOption.autoStart) {
|
|
29
|
-
move(activeState.position, false);
|
|
30
|
-
}
|
|
31
|
-
}, [clickerOption.autoStart]);
|
|
32
25
|
useEffect(function () {
|
|
33
26
|
if (groupRef.current) {
|
|
34
27
|
var box = new THREE.Box3().setFromObject(groupRef.current);
|
|
@@ -2,7 +2,7 @@ import { vec3 } from "@react-three/rapier";
|
|
|
2
2
|
import { calcNorm } from "../../utils";
|
|
3
3
|
export default function stop(prop) {
|
|
4
4
|
var _a;
|
|
5
|
-
var rigidBodyRef = prop.rigidBodyRef, _b = prop.worldContext, control = _b.control, clicker = _b.clicker, mode = _b.mode, clickerOption = _b.clickerOption, activeState = _b.activeState
|
|
5
|
+
var rigidBodyRef = prop.rigidBodyRef, _b = prop.worldContext, control = _b.control, clicker = _b.clicker, mode = _b.mode, clickerOption = _b.clickerOption, activeState = _b.activeState;
|
|
6
6
|
var keyS = control.keyS;
|
|
7
7
|
if (keyS && mode.controller === "clicker") {
|
|
8
8
|
clicker.isOn = false;
|
|
@@ -11,7 +11,7 @@ export default function stop(prop) {
|
|
|
11
11
|
// 목적지 도착 (클리커 막기 로직)
|
|
12
12
|
var u = vec3((_a = rigidBodyRef.current) === null || _a === void 0 ? void 0 : _a.translation());
|
|
13
13
|
var norm = calcNorm(u, clicker.point, false);
|
|
14
|
-
if (norm < 1 && mode.controller === "clicker") {
|
|
14
|
+
if ((norm < 1 || clickerOption.autoStart) && mode.controller === "clicker") {
|
|
15
15
|
if (clickerOption.track && clickerOption.queue.length !== 0) {
|
|
16
16
|
clicker.point = clickerOption.queue.shift();
|
|
17
17
|
var v = vec3(clicker.point);
|