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) => (
|
{geometries.map((geometry, index) => (
|
||||||
<mesh key={index} geometry={geometry}>
|
<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>
|
</mesh>
|
||||||
))}
|
))}
|
||||||
</RigidBody>
|
</RigidBody>
|
||||||
|
|||||||
@@ -153,9 +153,10 @@ function NormalConveyorCollider({
|
|||||||
onCollisionEnter={handleMaterialEnter}
|
onCollisionEnter={handleMaterialEnter}
|
||||||
onCollisionExit={handleMaterialExit}
|
onCollisionExit={handleMaterialExit}
|
||||||
colliders="trimesh"
|
colliders="trimesh"
|
||||||
|
// visible={false}
|
||||||
>
|
>
|
||||||
<mesh geometry={geometry!}>
|
<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>
|
</mesh>
|
||||||
</RigidBody>
|
</RigidBody>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ function YSplitConveyorCollider({
|
|||||||
colliders="trimesh"
|
colliders="trimesh"
|
||||||
>
|
>
|
||||||
<mesh geometry={geometry!}>
|
<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>
|
</mesh>
|
||||||
</RigidBody>
|
</RigidBody>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ function PhysicsSimulator() {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|
||||||
{/* <MaterialSpawner
|
|
||||||
position={[0, 3, 0]}
|
|
||||||
spawnInterval={1000}
|
|
||||||
spawnCount={15}
|
|
||||||
/>
|
|
||||||
<MaterialSpawner
|
<MaterialSpawner
|
||||||
|
position={[-2, 5, 3]}
|
||||||
|
spawnInterval={1000}
|
||||||
|
spawnCount={5}
|
||||||
|
/>
|
||||||
|
{/* <MaterialSpawner
|
||||||
position={[6, 3, 6]}
|
position={[6, 3, 6]}
|
||||||
spawnInterval={1000}
|
spawnInterval={1000}
|
||||||
spawnCount={5}
|
spawnCount={5}
|
||||||
|
|||||||
@@ -75,7 +75,8 @@ export default function Scene({ layout }: { readonly layout: 'Main Layout' | 'Co
|
|||||||
>
|
>
|
||||||
<Setup />
|
<Setup />
|
||||||
<Collaboration />
|
<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 />
|
<Builder />
|
||||||
|
|
||||||
<Simulation />
|
<Simulation />
|
||||||
|
|||||||
Reference in New Issue
Block a user