gaesup-world 0.6.52 → 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
|
|
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 (
|
|
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;
|