Skip to content

Commit

Permalink
feat: export HeightfieldProps
Browse files Browse the repository at this point in the history
  • Loading branch information
isaac-mason committed Apr 14, 2024
1 parent 0a37206 commit 2b731ec
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions packages/react-three-jolt/src/components/Heightfield.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
import { useRef, useEffect } from 'react';
import * as THREE from 'three';
import { useTexture } from '@react-three/drei';

import { useJolt, useUnmount } from '../hooks';

import {
//@ts-ignore
imageUrlToImageData,
applyHeightmapToPlane
} from '../heightField/Generators';
import React from 'react';
import React, { useEffect, useRef } from 'react';
import { BodyState } from 'src';
import * as THREE from 'three';
import { applyHeightmapToPlane } from '../heightField/Generators';
import { useJolt, useUnmount } from '../hooks';

type HeightfieldProps = {
export type HeightfieldProps = {
url?: string;
texture?: string;
width?: number;
Expand Down Expand Up @@ -62,6 +55,7 @@ export function Heightfield({
}
getImageData();
}, [url, urlTexture, texture, displacementScale, bodySystem]);

useUnmount(() => {
if (activeBody.current) {
bodySystem.removeBody(activeBody.current);
Expand Down

0 comments on commit 2b731ec

Please sign in to comment.