From 3ea7ca739f46f087473bfd94da658b5f56f39f9f Mon Sep 17 00:00:00 2001 From: Matt Rice Date: Sun, 28 Jan 2024 20:03:14 -0500 Subject: [PATCH] added clipboard for paddle --- {src/resources/Props_3D => public}/Clipboard.glb | Bin src/components/Ball.tsx | 2 +- src/components/{Clipboard.tsx => Clipboard2.tsx} | 13 +++++-------- src/components/Paddle.tsx | 13 ++++++------- 4 files changed, 12 insertions(+), 16 deletions(-) rename {src/resources/Props_3D => public}/Clipboard.glb (100%) rename src/components/{Clipboard.tsx => Clipboard2.tsx} (60%) diff --git a/src/resources/Props_3D/Clipboard.glb b/public/Clipboard.glb similarity index 100% rename from src/resources/Props_3D/Clipboard.glb rename to public/Clipboard.glb diff --git a/src/components/Ball.tsx b/src/components/Ball.tsx index e6e1bbd..42494f3 100644 --- a/src/components/Ball.tsx +++ b/src/components/Ball.tsx @@ -19,7 +19,7 @@ export function Ball(props: Props) { return; } const ball = rigidBodyRef.current; - if (ball.translation().y < -3) { + if (ball.translation().y < -4.6) { rigidBodyRef.current.setTranslation({ x: 0, y: 5, z: 0 }, true); rigidBodyRef.current.setLinvel({ x: 0, y: 5, z: 0 }, true); state.api.reset(); diff --git a/src/components/Clipboard.tsx b/src/components/Clipboard2.tsx similarity index 60% rename from src/components/Clipboard.tsx rename to src/components/Clipboard2.tsx index 8ae9528..adf3be6 100644 --- a/src/components/Clipboard.tsx +++ b/src/components/Clipboard2.tsx @@ -1,8 +1,3 @@ -/* -Auto-generated by: https://github.com/pmndrs/gltfjsx -Command: npx gltfjsx@6.2.16 src/resources/Props_3D/Clipboard.glb -t -*/ - import * as THREE from "three"; import { useGLTF } from "@react-three/drei"; import { GLTF } from "three-stdlib"; @@ -16,11 +11,13 @@ type GLTFResult = GLTF & { }; }; -export function ClipboardModel(props: JSX.IntrinsicElements["group"]) { +export function Clipboard2(props: JSX.IntrinsicElements["group"]) { const { nodes, materials } = useGLTF("/Clipboard.glb") as GLTFResult; return ( - + @@ -28,4 +25,4 @@ export function ClipboardModel(props: JSX.IntrinsicElements["group"]) { ); } -useGLTF.preload("../resources/Props_3D/Clipboard.glb"); +useGLTF.preload("/Clipboard.glb"); \ No newline at end of file diff --git a/src/components/Paddle.tsx b/src/components/Paddle.tsx index 66ebe4b..a703040 100644 --- a/src/components/Paddle.tsx +++ b/src/components/Paddle.tsx @@ -2,7 +2,7 @@ import { Text } from "@react-three/drei"; import { useFrame } from "@react-three/fiber"; import { ContactForcePayload, - CylinderCollider, + CuboidCollider, RapierRigidBody, RigidBody, } from "@react-three/rapier"; @@ -11,9 +11,8 @@ import { useCallback, useRef } from "react"; import * as THREE from "three"; import { useSnapshot } from "valtio"; import { state } from "@/MiniGame1"; -import { PingPong } from "./Pingpong"; import { useGatherWords } from "../contexts/GatherWordsContext"; -//import { ClipboardModel } from "./Clipboard"; +import { Clipboard2 } from "./Clipboard2"; export function Paddle({ vec = new THREE.Vector3(), @@ -65,14 +64,15 @@ export function Paddle({ colliders={false} onContactForce={contactForce} > - + {count + "\n"} {contextWords @@ -80,8 +80,7 @@ export function Paddle({ .join("\n")} - - {/* */} +