feat: add steel texture for doors
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
@@ -70,6 +70,7 @@ interface DoorProps {
|
|||||||
function Door({ position, rotation }: DoorProps) {
|
function Door({ position, rotation }: DoorProps) {
|
||||||
const [soundUrl, setSoundUrl] = useState<string | null>(null);
|
const [soundUrl, setSoundUrl] = useState<string | null>(null);
|
||||||
const currentSound = useRef<string | null>(null);
|
const currentSound = useRef<string | null>(null);
|
||||||
|
const steelTex = useTexture('fear/img/steel.png');
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const interval = setInterval(() => {
|
const interval = setInterval(() => {
|
||||||
@@ -91,19 +92,22 @@ function Door({ position, rotation }: DoorProps) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<group position={position} rotation={rotation}>
|
<group position={position} rotation={rotation}>
|
||||||
<mesh position={[0, 2, -0.14]}>
|
{/* frame */}
|
||||||
<boxGeometry args={[2.4, 4.0, 0.2]} />
|
<mesh position={[0, 2, -0.1]}>
|
||||||
<meshStandardMaterial color="#8a8585" roughness={0.8} metalness={0.2} />
|
<boxGeometry args={[2.4, 4.0, 0.2, 4, 4, 1]} />
|
||||||
|
<meshStandardMaterial map={steelTex} color="#8d8d8d" onBeforeCompile={ShaderPatch} />
|
||||||
</mesh>
|
</mesh>
|
||||||
|
|
||||||
<mesh position={[0, 1.95, -0.08]}>
|
{/* panel */}
|
||||||
<boxGeometry args={[2.1, 3.8, 0.1]} />
|
<mesh position={[0, 1.95, -0.0]}>
|
||||||
<meshStandardMaterial color="#4e4b4b" roughness={0.7} metalness={0.2} />
|
<boxGeometry args={[2.1, 3.8, 0.1, 4, 4, 1]} />
|
||||||
|
<meshStandardMaterial map={steelTex} color="#4e4a4a" onBeforeCompile={ShaderPatch} />
|
||||||
</mesh>
|
</mesh>
|
||||||
|
|
||||||
<mesh position={[0.9, 1.8, 0.08]}>
|
{/* handle */}
|
||||||
<boxGeometry args={[0.08, 0.08, 0.15]} />
|
<mesh position={[0.75, 1.8, .085]}>
|
||||||
<meshStandardMaterial color="#4e4b4b" roughness={0.4} metalness={0.2} />
|
<boxGeometry args={[0.3, 0.08, 0.1]} />
|
||||||
|
<meshStandardMaterial map={steelTex} color="#ffffff" onBeforeCompile={ShaderPatch} />
|
||||||
</mesh>
|
</mesh>
|
||||||
|
|
||||||
{soundUrl && (
|
{soundUrl && (
|
||||||
|
|||||||
Reference in New Issue
Block a user