Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/controls/OrbitControls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,7 @@ class OrbitControls extends EventDispatcher<StandardControlsEventMap> {
rotateEnd.set(event.pageX, event.pageY)
} else {
const position = getSecondPointerPosition(event)
if (!position) return
const x = 0.5 * (event.pageX + position.x)
const y = 0.5 * (event.pageY + position.y)
rotateEnd.set(x, y)
Expand All @@ -798,6 +799,7 @@ class OrbitControls extends EventDispatcher<StandardControlsEventMap> {
panEnd.set(event.pageX, event.pageY)
} else {
const position = getSecondPointerPosition(event)
if (!position) return
const x = 0.5 * (event.pageX + position.x)
const y = 0.5 * (event.pageY + position.y)
panEnd.set(x, y)
Expand All @@ -810,6 +812,7 @@ class OrbitControls extends EventDispatcher<StandardControlsEventMap> {

function handleTouchMoveDolly(event: PointerEvent) {
const position = getSecondPointerPosition(event)
if (!position) return
const dx = event.pageX - position.x
const dy = event.pageY - position.y
const distance = Math.sqrt(dx * dx + dy * dy)
Expand Down