Skip to content

Commit e68896b

Browse files
authored
Merge pull request #357 from taeuscherpferd/Fixing-minecraft-example-after-hook-changes
Fixing minecraft example after hook changes
2 parents 987b540 + 654a2b6 commit e68896b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

examples/minecraft/src/Player.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ export function Player({ lerp = THREE.MathUtils.lerp }) {
3737
backward,
3838
left,
3939
right,
40-
rotationVelocity,
40+
rotationYVelocity,
4141
velocity,
4242
newVelocity,
4343
}: {
4444
forward: boolean
4545
backward: boolean
4646
left: boolean
4747
right: boolean
48-
rotationVelocity: number
48+
rotationYVelocity: number
4949
velocity?: Vector3Object
5050
newVelocity?: THREE.Vector3
5151
}) => {
@@ -59,7 +59,7 @@ export function Player({ lerp = THREE.MathUtils.lerp }) {
5959
//apply rotation
6060
const { x, y, z, w } = rigidBodyRef.current.rotation()
6161
quaternionHelper.set(x, y, z, w)
62-
quaternionHelper.multiply(quaternionHelper2.setFromEuler(eulerHelper.set(0, rotationVelocity, 0, 'YXZ')))
62+
quaternionHelper.multiply(quaternionHelper2.setFromEuler(eulerHelper.set(0, rotationYVelocity, 0, 'YXZ')))
6363
rigidBodyRef.current?.setRotation(quaternionHelper, true)
6464

6565
if (newVelocity) {
@@ -128,7 +128,7 @@ export function Player({ lerp = THREE.MathUtils.lerp }) {
128128
backward,
129129
left,
130130
right,
131-
rotationVelocity: 0,
131+
rotationYVelocity: 0,
132132
velocity,
133133
})
134134

examples/minecraft/src/VRPlayerControl.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@ export function VRPlayerControl({
1313
backward: boolean
1414
left: boolean
1515
right: boolean
16-
rotationVelocity: number
16+
rotationYVelocity: number
1717
velocity?: Vector3Object
1818
newVelocity?: THREE.Vector3
1919
}) => void
2020
}) {
2121
const controllerRight = useXRInputSourceState('controller', 'right')
2222

23-
const physicsMove = (velocity: THREE.Vector3, rotationVelocity: number) => {
23+
const physicsMove = (velocity: THREE.Vector3, rotationYVelocity: number) => {
2424
playerMove({
2525
forward: false,
2626
backward: false,
2727
left: false,
2828
right: false,
29-
rotationVelocity,
29+
rotationYVelocity,
3030
velocity: undefined,
3131
newVelocity: velocity,
3232
})

0 commit comments

Comments
 (0)