From 934c26491cfdbd09af6d31be43120a29c90662a2 Mon Sep 17 00:00:00 2001 From: Anderson Mancini Date: Wed, 24 Jan 2024 09:44:28 -0300 Subject: [PATCH] Added small physics improvments --- src/App.jsx | 1 + src/components/Ground.jsx | 23 +++++++++++++++++------ src/components/PlayerController.jsx | 7 ++++--- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index c2ec4d3..d803a5c 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -38,6 +38,7 @@ function App() { diff --git a/src/components/Ground.jsx b/src/components/Ground.jsx index 4389fd8..6cf5151 100644 --- a/src/components/Ground.jsx +++ b/src/components/Ground.jsx @@ -1,12 +1,23 @@ -import { RigidBody } from "@react-three/rapier"; +import { RigidBody } from '@react-three/rapier' export const Ground = (props) => { return ( - - + + - + - ); -}; + ) +} diff --git a/src/components/PlayerController.jsx b/src/components/PlayerController.jsx index 9cdf783..92c3e62 100644 --- a/src/components/PlayerController.jsx +++ b/src/components/PlayerController.jsx @@ -239,7 +239,7 @@ export const PlayerController = () => { // SOUND WORK - // console.log(body.current.translation()) + // console.lowg(body.current.translation()) }) return ( @@ -250,6 +250,7 @@ export const PlayerController = () => { position={[8, 20, -96]} centerOfMass={[0, -1, 0]} mass={3} + ccd > { isOnFloor.current = true }} /> - onCollisionEnter= + {/* onCollisionEnter= {(event) => { isOnFloor.current = false - }} + }} */}