fix: Update mesh material visibility for conveyor colliders and adjust MaterialSpawner settings in PhysicsSimulator
This commit is contained in:
@@ -185,7 +185,7 @@ function CurvedConveyorCollider({ points, boundingBox, asset, forward, isPaused
|
||||
>
|
||||
{geometries.map((geometry, index) => (
|
||||
<mesh key={index} geometry={geometry}>
|
||||
<meshStandardMaterial color="skyblue" side={THREE.DoubleSide} transparent opacity={0.5} />
|
||||
<meshStandardMaterial color="skyblue" side={THREE.DoubleSide} transparent opacity={0.5} visible={false}/>
|
||||
</mesh>
|
||||
))}
|
||||
</RigidBody>
|
||||
|
||||
@@ -153,9 +153,10 @@ function NormalConveyorCollider({
|
||||
onCollisionEnter={handleMaterialEnter}
|
||||
onCollisionExit={handleMaterialExit}
|
||||
colliders="trimesh"
|
||||
// visible={false}
|
||||
>
|
||||
<mesh geometry={geometry!}>
|
||||
<meshStandardMaterial color="skyblue" side={THREE.DoubleSide} transparent opacity={0.5} />
|
||||
<meshStandardMaterial color="skyblue" side={THREE.DoubleSide} transparent opacity={0.5} visible={false} />
|
||||
</mesh>
|
||||
</RigidBody>
|
||||
))}
|
||||
|
||||
@@ -155,7 +155,7 @@ function YSplitConveyorCollider({
|
||||
colliders="trimesh"
|
||||
>
|
||||
<mesh geometry={geometry!}>
|
||||
<meshStandardMaterial color="skyblue" side={THREE.DoubleSide} transparent opacity={0.5} />
|
||||
<meshStandardMaterial color="skyblue" side={THREE.DoubleSide} transparent opacity={0.5} visible={false}/>
|
||||
</mesh>
|
||||
</RigidBody>
|
||||
))}
|
||||
|
||||
@@ -6,12 +6,12 @@ function PhysicsSimulator() {
|
||||
return (
|
||||
<>
|
||||
|
||||
{/* <MaterialSpawner
|
||||
position={[0, 3, 0]}
|
||||
spawnInterval={1000}
|
||||
spawnCount={15}
|
||||
/>
|
||||
<MaterialSpawner
|
||||
position={[-2, 5, 3]}
|
||||
spawnInterval={1000}
|
||||
spawnCount={5}
|
||||
/>
|
||||
{/* <MaterialSpawner
|
||||
position={[6, 3, 6]}
|
||||
spawnInterval={1000}
|
||||
spawnCount={5}
|
||||
|
||||
@@ -75,7 +75,8 @@ export default function Scene({ layout }: { readonly layout: 'Main Layout' | 'Co
|
||||
>
|
||||
<Setup />
|
||||
<Collaboration />
|
||||
<Physics gravity={[0, -9.81, 0]} allowedLinearError={50} numSolverIterations={50} debug >
|
||||
{/* <Physics gravity={[0, -9.81, 0]} allowedLinearError={50} numSolverIterations={50} debug > */}
|
||||
<Physics gravity={[0, -9.81, 0]} allowedLinearError={50} numSolverIterations={50} >
|
||||
<Builder />
|
||||
|
||||
<Simulation />
|
||||
|
||||
Reference in New Issue
Block a user