gaesup-world 0.3.7 → 0.4.0

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.
@@ -29,6 +29,7 @@ export function PassiveCharacter(props) {
29
29
  useFrame(function (_, delta) {
30
30
  if (innerGroupRef && innerGroupRef.current) {
31
31
  innerGroupRef.current.quaternion.rotateTowards(quat().setFromEuler(euler), 10 * delta);
32
+ // innerGroupRef.current.position.copy(position);
32
33
  }
33
34
  });
34
35
  return (_jsx(CharacterInnerRef, { position: position, refs: refs, urls: props.urls, currentAnimation: props.currentAnimation, children: props.children }));
@@ -36,7 +36,7 @@ export function normalDirection(_a) {
36
36
  }
37
37
  else if (mode.controller === "clicker") {
38
38
  activeState.euler.y = Math.PI / 2 - clicker.angle;
39
- activeState.dir.set(-Math.sin(activeState.euler.y), 1, -Math.cos(activeState.euler.y));
39
+ activeState.dir.set(-Math.sin(activeState.euler.y), 0, -Math.cos(activeState.euler.y));
40
40
  }
41
41
  else {
42
42
  // 일반 컨트롤
@@ -32,8 +32,13 @@ export default function impulse(prop) {
32
32
  impulse.setZ(F.z);
33
33
  }
34
34
  rigidBodyRef.current.applyImpulse(impulse, true);
35
- activeState.position = vec3(rigidBodyRef.current.translation());
36
- activeState.velocity = vec3(rigidBodyRef.current.linvel());
35
+ activeState.position =
36
+ // activeState.position.copy(
37
+ activeState.position
38
+ .clone()
39
+ .lerp(vec3(rigidBodyRef.current.translation()), 0.9);
40
+ // );
41
+ activeState.velocity.lerp(vec3(rigidBodyRef.current.linvel()), 0.9);
37
42
  dispatch({
38
43
  type: "update",
39
44
  payload: {
@@ -9,11 +9,9 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- import { quat, vec3 } from "@react-three/rapier";
12
+ import { quat } from "@react-three/rapier";
13
13
  export default function innerCalc(prop) {
14
14
  var rigidBodyRef = prop.rigidBodyRef, innerGroupRef = prop.innerGroupRef, linearDamping = prop.controllerContext.character.linearDamping, _a = prop.worldContext, activeState = _a.activeState, states = _a.states, dispatch = prop.dispatch, delta = prop.delta;
15
- activeState.position = vec3(rigidBodyRef.current.translation());
16
- activeState.velocity = vec3(rigidBodyRef.current.linvel());
17
15
  if (states.isJumping || rigidBodyRef.current.linvel().y < 0) {
18
16
  rigidBodyRef.current.setLinearDamping(linearDamping);
19
17
  }
@@ -1,10 +1,9 @@
1
1
  "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { Leva } from "leva";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
4
3
  import { GaesupWorldContext, GaesupWorldDispatchContext } from "./context";
5
4
  import initGaesupWorld from "./initalize";
6
5
  import "./style.css";
7
6
  export function GaesupWorld(props) {
8
7
  var gaesupProps = initGaesupWorld(props).gaesupProps;
9
- return (_jsx(GaesupWorldContext.Provider, { value: gaesupProps.value, children: _jsxs(GaesupWorldDispatchContext.Provider, { value: gaesupProps.dispatch, children: [_jsx(Leva, { collapsed: true }), props.children] }) }));
8
+ return (_jsx(GaesupWorldContext.Provider, { value: gaesupProps.value, children: _jsx(GaesupWorldDispatchContext.Provider, { value: gaesupProps.dispatch, children: props.children }) }));
10
9
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gaesup-world",
3
- "version": "0.3.7",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/character.glb DELETED
Binary file
package/grass_box.glb DELETED
Binary file