gaesup-world 0.6.51 → 0.6.53

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.
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { vec3 } from "@react-three/rapier";
3
3
  import { useContext } from "react";
4
+ import Camera from "../camera";
4
5
  import calculation from "../physics";
5
6
  import { GaesupWorldContext } from "../world/context";
6
7
  import { AirplaneRef } from "./active/airplane";
@@ -11,7 +12,7 @@ export function GaesupComponent(_a) {
11
12
  var _b = useContext(GaesupWorldContext), mode = _b.mode, states = _b.states, rideable = _b.rideable;
12
13
  var enableRiding = states.enableRiding, isRiderOn = states.isRiderOn, rideableId = states.rideableId;
13
14
  calculation(props);
14
- return (_jsxs(_Fragment, { children: [mode.type === "character" && (_jsx(CharacterRef, { props: props, refs: refs, urls: urls })), mode.type === "vehicle" && (_jsx(VehicleRef, { props: props, groundRay: props.groundRay, refs: refs, urls: urls, enableRiding: enableRiding, isRiderOn: isRiderOn, offset: rideableId && rideable[rideableId]
15
+ return (_jsxs(_Fragment, { children: [_jsx(Camera, { refs: refs, prop: props, control: props.keyControl }), mode.type === "character" && (_jsx(CharacterRef, { props: props, refs: refs, urls: urls })), mode.type === "vehicle" && (_jsx(VehicleRef, { props: props, groundRay: props.groundRay, refs: refs, urls: urls, enableRiding: enableRiding, isRiderOn: isRiderOn, offset: rideableId && rideable[rideableId]
15
16
  ? rideable[rideableId].offset
16
17
  : vec3(), children: props.children })), mode.type === "airplane" && (_jsx(AirplaneRef, { props: props, groundRay: props.groundRay, refs: refs, urls: urls, enableRiding: enableRiding, isRiderOn: isRiderOn, offset: rideableId && rideable[rideableId]
17
18
  ? rideable[rideableId].offset
@@ -10,9 +10,8 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
14
  import { useContext, useMemo, useReducer, useRef } from "react";
15
- import Camera from "../camera";
16
15
  import { KeyboardControls } from "@react-three/drei";
17
16
  import { GaesupComponent } from "../component";
18
17
  import { GaesupWorldContext } from "../world/context";
@@ -71,5 +70,5 @@ export function GaesupControllerInner(props) {
71
70
  controllerContext: gaesupControl.value,
72
71
  controllerDispatch: gaesupControl.dispatch,
73
72
  });
74
- return (_jsxs(GaesupControllerContext.Provider, { value: gaesupControl.value, children: [_jsx(Camera, { refs: refs, prop: prop, control: prop.keyControl }), _jsx(GaesupControllerDispatchContext.Provider, { value: gaesupControl.dispatch, children: _jsx(GaesupComponent, { props: prop, refs: refs, urls: props.urls }) })] }));
73
+ return (_jsx(GaesupControllerContext.Provider, { value: gaesupControl.value, children: _jsx(GaesupControllerDispatchContext.Provider, { value: gaesupControl.dispatch, children: _jsx(GaesupComponent, { props: prop, refs: refs, urls: props.urls }) }) }));
75
74
  }
@@ -1,6 +1,6 @@
1
1
  import { Collider, Ray, RayColliderToi } from "@dimforge/rapier3d-compat";
2
- import { GroupProps } from "@react-three/fiber";
3
- import { RapierRigidBody, RigidBodyProps } from "@react-three/rapier";
2
+ import { GroupProps, Props } from "@react-three/fiber";
3
+ import { PhysicsProps, RapierRigidBody, RigidBodyProps } from "@react-three/rapier";
4
4
  import { ReactNode, RefObject } from "react";
5
5
  import * as THREE from "three";
6
6
  import { cameraRayType } from "../camera/type";
@@ -81,5 +81,7 @@ export interface controllerOtherPropType extends RigidBodyProps {
81
81
  groupProps?: GroupProps;
82
82
  rigidBodyProps?: RigidBodyProps;
83
83
  debug?: boolean;
84
+ CanvasProps?: Partial<Props>;
85
+ PhysicsProps?: Partial<PhysicsProps>;
84
86
  }
85
87
  export type controllerType = controllerOtherPropType & Partial<gaesupControllerContextPropType> & callbackType;
@@ -10,7 +10,6 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { useFrame } from "@react-three/fiber";
13
- import { useRapier } from "@react-three/rapier";
14
13
  import { useContext, useEffect } from "react";
15
14
  import { GaesupControllerContext } from "../controller/context";
16
15
  import { useGaesupGltf } from "../hooks/useGaesupGltf";
@@ -21,7 +20,6 @@ import characterCalculation from "./character";
21
20
  import check from "./check";
22
21
  import vehicleCalculation from "./vehicle";
23
22
  export default function calculation(prop) {
24
- var world = useRapier().world;
25
23
  var worldContext = useContext(GaesupWorldContext);
26
24
  var controllerContext = useContext(GaesupControllerContext);
27
25
  var dispatch = useContext(GaesupWorldDispatchContext);
@@ -46,9 +44,7 @@ export default function calculation(prop) {
46
44
  return null;
47
45
  if (block.control)
48
46
  return null;
49
- var calcProp = __assign(__assign({}, prop), { state: state, delta: delta, worldContext: worldContext, controllerContext: controllerContext, dispatch: dispatch,
50
- // world,
51
- matchSizes: getSizesByUrls(controllerContext === null || controllerContext === void 0 ? void 0 : controllerContext.urls) });
47
+ var calcProp = __assign(__assign({}, prop), { state: state, delta: delta, worldContext: worldContext, controllerContext: controllerContext, dispatch: dispatch, matchSizes: getSizesByUrls(controllerContext === null || controllerContext === void 0 ? void 0 : controllerContext.urls) });
52
48
  if (mode.type === "vehicle")
53
49
  vehicleCalculation(calcProp);
54
50
  else if (mode.type === "character")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gaesup-world",
3
- "version": "0.6.51",
3
+ "version": "0.6.53",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",