Skip to content

Commit 7c0daaa

Browse files
committed
Remove attach="x" to reflect r3f v5
1 parent 0b28aac commit 7c0daaa

File tree

7 files changed

+36
-36
lines changed

7 files changed

+36
-36
lines changed

examples/src/demos/Chain.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ const ChainLink = ({ children, ...props }) => {
3030
return (
3131
<>
3232
<mesh ref={ref} {...props}>
33-
<cylinderBufferGeometry attach="geometry" args={[chainSize[0], chainSize[0], chainSize[1], 8]} />
34-
<meshStandardMaterial attach="material" />
33+
<cylinderBufferGeometry args={[chainSize[0], chainSize[0], chainSize[1], 8]} />
34+
<meshStandardMaterial />
3535
</mesh>
3636
<parent.Provider value={ref}>{children}</parent.Provider>
3737
</>
@@ -45,8 +45,8 @@ const Handle = ({ children, ...props }) => {
4545
return (
4646
<group>
4747
<mesh ref={ref} position={props.position}>
48-
<sphereBufferGeometry attach="geometry" args={[0.5, 64, 64]} />
49-
<meshStandardMaterial attach="material" />
48+
<sphereBufferGeometry args={[0.5, 64, 64]} />
49+
<meshStandardMaterial />
5050
</mesh>
5151
<parent.Provider value={ref}>{children}</parent.Provider>
5252
</group>

examples/src/demos/CompoundBody.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ function Plane(props) {
77
return (
88
<group ref={ref}>
99
<mesh>
10-
<planeBufferGeometry attach="geometry" args={[8, 8]} />
11-
<meshBasicMaterial attach="material" color="#ffb385" />
10+
<planeBufferGeometry args={[8, 8]} />
11+
<meshBasicMaterial color="#ffb385" />
1212
</mesh>
1313
<mesh receiveShadow>
14-
<planeBufferGeometry attach="geometry" args={[8, 8]} />
15-
<shadowMaterial attach="material" color="lightsalmon" />
14+
<planeBufferGeometry args={[8, 8]} />
15+
<shadowMaterial color="lightsalmon" />
1616
</mesh>
1717
</group>
1818
)
@@ -32,12 +32,12 @@ function CompoundBody(props) {
3232
return (
3333
<group ref={ref}>
3434
<mesh castShadow>
35-
<boxBufferGeometry attach="geometry" args={boxSize} />
36-
<meshNormalMaterial attach="material" />
35+
<boxBufferGeometry args={boxSize} />
36+
<meshNormalMaterial />
3737
</mesh>
3838
<mesh castShadow position={[1, 0, 0]}>
39-
<sphereBufferGeometry attach="geometry" args={[sphereRadius, 16, 16]} />
40-
<meshNormalMaterial attach="material" />
39+
<sphereBufferGeometry args={[sphereRadius, 16, 16]} />
40+
<meshNormalMaterial />
4141
</mesh>
4242
</group>
4343
)

examples/src/demos/Constraints.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ const Box = React.forwardRef((props, ref) => {
1515
)
1616
return (
1717
<mesh ref={ref}>
18-
<boxBufferGeometry attach="geometry" args={boxSize} />
19-
<meshNormalMaterial attach="material" />
18+
<boxBufferGeometry args={boxSize} />
19+
<meshNormalMaterial />
2020
</mesh>
2121
)
2222
})
@@ -26,8 +26,8 @@ const Ball = React.forwardRef((props, ref) => {
2626
useFrame((e) => position.set((e.mouse.x * e.viewport.width) / 2, (e.mouse.y * e.viewport.height) / 2, 0))
2727
return (
2828
<mesh ref={ref}>
29-
<sphereBufferGeometry attach="geometry" args={[0.5, 64, 64]} />
30-
<meshNormalMaterial attach="material" />
29+
<sphereBufferGeometry args={[0.5, 64, 64]} />
30+
<meshNormalMaterial />
3131
</mesh>
3232
)
3333
})

examples/src/demos/ConvexPolyhedron.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ function Diamond(props) {
1818

1919
const [ref] = useConvexPolyhedron(() => ({ mass: 100, ...props, args: geo }))
2020
return (
21-
<mesh castShadow receiveShadow ref={ref} geometry={geo} {...props} dispose={null}>
22-
<meshStandardMaterial attach="material" wireframe />
21+
<mesh castShadow receiveShadow ref={ref} geometry={geo} {...props}>
22+
<meshStandardMaterial wireframe />
2323
</mesh>
2424
)
2525
}
@@ -33,8 +33,8 @@ function Cone({ sides, ...props }) {
3333
}, [])
3434
const [ref] = useConvexPolyhedron(() => ({ mass: 100, ...props, args: geo }))
3535
return (
36-
<mesh castShadow ref={ref} {...props} geometry={geo} dispose={null}>
37-
<meshNormalMaterial attach="material" />
36+
<mesh castShadow ref={ref} {...props} geometry={geo}>
37+
<meshNormalMaterial />
3838
</mesh>
3939
)
4040
}
@@ -48,8 +48,8 @@ function Cube({ size, ...props }) {
4848
}, [])
4949
const [ref] = useConvexPolyhedron(() => ({ mass: 100, ...props, args: geo }))
5050
return (
51-
<mesh castShadow ref={ref} {...props} geometry={geo} dispose={null}>
52-
<meshNormalMaterial attach="material" />
51+
<mesh castShadow ref={ref} {...props} geometry={geo}>
52+
<meshNormalMaterial />
5353
</mesh>
5454
)
5555
}
@@ -58,8 +58,8 @@ function Plane(props) {
5858
const [ref] = usePlane(() => ({ type: 'Static', ...props }))
5959
return (
6060
<mesh ref={ref} receiveShadow>
61-
<planeBufferGeometry attach="geometry" args={[5, 5]} />
62-
<shadowMaterial attach="material" color="#171717" />
61+
<planeBufferGeometry args={[5, 5]} />
62+
<shadowMaterial color="#171717" />
6363
</mesh>
6464
)
6565
}

examples/src/demos/CubeHeap.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ function Plane(props) {
88
const [ref] = usePlane(() => ({ ...props }))
99
return (
1010
<mesh ref={ref} receiveShadow>
11-
<planeBufferGeometry attach="geometry" args={[5, 5]} />
12-
<shadowMaterial attach="material" color="#171717" />
11+
<planeBufferGeometry args={[5, 5]} />
12+
<shadowMaterial color="#171717" />
1313
</mesh>
1414
)
1515
}
@@ -37,10 +37,10 @@ function Cubes({ number }) {
3737

3838
return (
3939
<instancedMesh receiveShadow castShadow ref={ref} args={[null, null, number]}>
40-
<boxBufferGeometry attach="geometry" args={boxSize}>
40+
<boxBufferGeometry args={boxSize}>
4141
<instancedBufferAttribute attachObject={['attributes', 'color']} args={[colors, 3]} />
4242
</boxBufferGeometry>
43-
<meshLambertMaterial attach="material" vertexColors={THREE.VertexColors} />
43+
<meshLambertMaterial vertexColors={THREE.VertexColors} />
4444
</instancedMesh>
4545
)
4646
}

examples/src/demos/KinematicCube.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ function Plane({ color, ...props }) {
88
const [ref] = usePlane(() => ({ ...props }))
99
return (
1010
<mesh ref={ref} receiveShadow>
11-
<planeBufferGeometry attach="geometry" args={[1000, 1000]} />
12-
<meshPhongMaterial attach="material" color={color} />
11+
<planeBufferGeometry args={[1000, 1000]} />
12+
<meshPhongMaterial color={color} />
1313
</mesh>
1414
)
1515
}
@@ -24,8 +24,8 @@ function Box() {
2424
})
2525
return (
2626
<mesh ref={ref} castShadow receiveShadow>
27-
<boxBufferGeometry attach="geometry" args={boxSize} />
28-
<meshLambertMaterial attach="material" color="white" side={THREE.DoubleSide} />
27+
<boxBufferGeometry args={boxSize} />
28+
<meshLambertMaterial color="white" side={THREE.DoubleSide} />
2929
</mesh>
3030
)
3131
}
@@ -49,10 +49,10 @@ function InstancedSpheres({ number = 100 }) {
4949

5050
return (
5151
<instancedMesh ref={ref} castShadow receiveShadow args={[null, null, number]}>
52-
<sphereBufferGeometry attach="geometry" args={[1, 16, 16]}>
52+
<sphereBufferGeometry args={[1, 16, 16]}>
5353
<instancedBufferAttribute attachObject={['attributes', 'color']} args={[colors, 3]} />
5454
</sphereBufferGeometry>
55-
<meshPhongMaterial attach="material" vertexColors={THREE.VertexColors} />
55+
<meshPhongMaterial vertexColors={THREE.VertexColors} />
5656
</instancedMesh>
5757
)
5858
}

examples/src/demos/Pingpong/Text.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import fontJson from './resources/firasans_regular.json'
44

55
const font = new THREE.FontLoader().parse(fontJson)
66
const geom = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'].map(
7-
number => new THREE.TextGeometry(number, { font, size: 5, height: 0.1 })
7+
(number) => new THREE.TextGeometry(number, { font, size: 5, height: 0.1 })
88
)
99

1010
const Text = forwardRef(
@@ -17,7 +17,7 @@ const Text = forwardRef(
1717
position={[-(array.length / 2) * 3.5 + index * 3.5, 0, 0]}
1818
key={index}
1919
geometry={geom[parseInt(char)]}>
20-
<meshBasicMaterial attach="material" color={color} transparent opacity={0.5} />
20+
<meshBasicMaterial color={color} transparent opacity={0.5} />
2121
</mesh>
2222
))}
2323
</group>

0 commit comments

Comments
 (0)