Skip to content

Commit

Permalink
feat: move Floor component from @react-three/jolt to examples app
Browse files Browse the repository at this point in the history
  • Loading branch information
isaac-mason committed Apr 14, 2024
1 parent 2b731ec commit 03f2048
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// Floor component for jolt. it's essentially just a box
import React from 'react';
import { RigidBody } from './RigidBody';
//import { useEffect } from 'react';
import { RigidBody } from '@react-three/jolt';
import * as THREE from 'three';

export const Floor = (props: any) => {
Expand Down
12 changes: 6 additions & 6 deletions apps/examples/src/examples/CubeHeap.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import * as THREE from 'three';
import { useEffect, useRef } from 'react';

import {
RigidBody,
Floor,
BodyState,
InstancedRigidBodyMesh,
RigidBody,
useConst,
useJolt,
useSetInterval,
} from '@react-three/jolt';
import { useConst, useSetInterval } from '@react-three/jolt';
import { useControls } from 'leva';
import { useEffect, useRef } from 'react';
import * as THREE from 'three';
import { Floor } from '../components/Floor';

// this is going to be the instancedMesh version
export function CubeHeap() {
Expand Down
1 change: 0 additions & 1 deletion apps/examples/src/examples/Heightfield.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ export function HeightfieldDemo() {
</RigidBody>
))}
<Heightfield url="heightmaps/wp1024.png" size={512} />
{/* <Floor size="150" position={[0, 0, 0]} /> */}
</>
);
}
3 changes: 2 additions & 1 deletion apps/examples/src/examples/JustBoxes.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { RigidBody, Floor } from '@react-three/jolt';
import { RigidBody } from '@react-three/jolt';
import { Floor } from '../components/Floor';

export function JustBoxes() {
//const { physicsSystem } = useJolt();
Expand Down
11 changes: 5 additions & 6 deletions apps/examples/src/examples/RaycastManyDemo.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { useRef, useEffect } from 'react';
import * as THREE from 'three';
import { useFrame } from '@react-three/fiber';

import {
RaycastHit,
Raycaster,
RigidBody,
useCommand,
useRaycaster,
Raycaster,
RaycastHit,
} from '@react-three/jolt';
import { useCommand } from '@react-three/jolt';
import { useEffect, useRef } from 'react';
import * as THREE from 'three';

// prop holders
const _position = new THREE.Vector3();
Expand Down
10 changes: 5 additions & 5 deletions apps/examples/src/examples/RaycastSimpleDemo.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { useEffect, useRef } from 'react';
import { useThree } from '@react-three/fiber';
import {
RigidBody,
Raycaster,
RaycastHit,
Raycaster,
RigidBody,
useConst,
useJolt,
useMulticaster,
useRaycaster,
Floor,
useSetTimeout,
useUnmount,
useConst,
} from '@react-three/jolt';
import { useEffect, useRef } from 'react';
import * as THREE from 'three';
import { Floor } from '../components/Floor';

export function RaycastSimpleDemo() {
const raycaster: Raycaster = useRaycaster();
Expand Down

0 comments on commit 03f2048

Please sign in to comment.