Added small physics improvments
This commit is contained in:
1 parent
6232bf9498
commit
934c26491c
3 files changed
+22
-9
No files matched your search
@@ -1,12 +1,23 @@
|
||||
import { RigidBody } from "@react-three/rapier";
|
||||
import { RigidBody } from '@react-three/rapier'
|
||||
|
||||
export const Ground = (props) => {
|
||||
return (
|
||||
<RigidBody type="fixed" {...props}>
|
||||
<mesh transparent receiveShadow rotation={[-Math.PI/2 , 0 ,0]}>
|
||||
<RigidBody
|
||||
type='fixed'
|
||||
{...props}
|
||||
>
|
||||
<mesh
|
||||
transparent
|
||||
receiveShadow
|
||||
rotation={[-Math.PI / 2, 0, 0]}
|
||||
>
|
||||
<planeGeometry args={[1000, 1000, 1000]} />
|
||||
<meshStandardMaterial color="yellow" opacity={0} transparent/>
|
||||
<meshStandardMaterial
|
||||
color='yellow'
|
||||
opacity={0}
|
||||
transparent
|
||||
/>
|
||||
</mesh>
|
||||
</RigidBody>
|
||||
);
|
||||
};
|
||||
)
|
||||
}
|
||||
@@ -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
|
||||
>
|
||||
<BallCollider
|
||||
args={[0.5]}
|
||||
@@ -258,10 +259,10 @@ export const PlayerController = () => {
|
||||
isOnFloor.current = true
|
||||
}}
|
||||
/>
|
||||
onCollisionEnter=
|
||||
{/* onCollisionEnter=
|
||||
{(event) => {
|
||||
isOnFloor.current = false
|
||||
}}
|
||||
}} */}
|
||||
</RigidBody>
|
||||
|
||||
<group
|
||||
|
||||
Reference in new issue
Block a user