gaesup-world 0.7.92 → 0.7.94
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.
|
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { quat, vec3 } from "@react-three/rapier";
|
|
13
13
|
export default function innerCalc(prop) {
|
|
14
|
-
var rigidBodyRef = prop.rigidBodyRef,
|
|
14
|
+
var rigidBodyRef = prop.rigidBodyRef, _a = prop.worldContext, activeState = _a.activeState, block = _a.block, dispatch = prop.dispatch;
|
|
15
15
|
activeState.position = vec3(rigidBodyRef.current.translation());
|
|
16
16
|
activeState.velocity = vec3(rigidBodyRef.current.linvel());
|
|
17
17
|
var _euler = activeState.euler.clone();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { quat } from "@react-three/rapier";
|
|
2
2
|
export default function innerCalc(prop) {
|
|
3
|
-
var rigidBodyRef = prop.rigidBodyRef, innerGroupRef = prop.innerGroupRef, linearDamping = prop.controllerContext.character.linearDamping, _a = prop.worldContext, activeState = _a.activeState, states = _a.states, delta = prop.delta;
|
|
3
|
+
var rigidBodyRef = prop.rigidBodyRef, innerGroupRef = prop.innerGroupRef, linearDamping = prop.controllerContext.character.linearDamping, _a = prop.worldContext, activeState = _a.activeState, states = _a.states, block = _a.block, delta = prop.delta;
|
|
4
4
|
if (states.isJumping || rigidBodyRef.current.linvel().y < 0) {
|
|
5
5
|
rigidBodyRef.current.setLinearDamping(linearDamping);
|
|
6
6
|
}
|
|
@@ -24,6 +24,14 @@ export default function calculation(_a) {
|
|
|
24
24
|
rigidBodyRef.current.setTranslation(activeState.position.clone().add(V3(0, 5, 0)), true);
|
|
25
25
|
}
|
|
26
26
|
}, [mode.type]);
|
|
27
|
+
useEffect(function () {
|
|
28
|
+
if (rigidBodyRef && rigidBodyRef.current) {
|
|
29
|
+
if (block.control) {
|
|
30
|
+
rigidBodyRef.current.resetForces(false);
|
|
31
|
+
rigidBodyRef.current.resetTorques(false);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}, [block.control, rigidBodyRef.current]);
|
|
27
35
|
useFrame(function (state, delta) {
|
|
28
36
|
if (!rigidBodyRef ||
|
|
29
37
|
!rigidBodyRef.current ||
|
|
@@ -32,8 +40,9 @@ export default function calculation(_a) {
|
|
|
32
40
|
!innerGroupRef ||
|
|
33
41
|
!innerGroupRef.current)
|
|
34
42
|
return null;
|
|
35
|
-
if (block.control)
|
|
43
|
+
if (block.control) {
|
|
36
44
|
return null;
|
|
45
|
+
}
|
|
37
46
|
var calcProp = {
|
|
38
47
|
rigidBodyRef: rigidBodyRef,
|
|
39
48
|
outerGroupRef: outerGroupRef,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { quat, vec3 } from "@react-three/rapier";
|
|
2
2
|
export default function innerCalc(prop) {
|
|
3
|
-
var rigidBodyRef = prop.rigidBodyRef,
|
|
3
|
+
var rigidBodyRef = prop.rigidBodyRef, _a = prop.worldContext, activeState = _a.activeState, block = _a.block;
|
|
4
4
|
activeState.position = vec3(rigidBodyRef.current.translation());
|
|
5
5
|
activeState.velocity = vec3(rigidBodyRef.current.linvel());
|
|
6
6
|
rigidBodyRef.current.setRotation(quat().setFromEuler(activeState.euler.clone()), false);
|