1.1.0 • Published 6 years ago

aframe-sesh-extras v1.1.0

Weekly downloads
7
License
ISC
Repository
-
Last release
6 years ago

multitouch-look-controls

This is an AFrame free-look camera controller for touchscreen devices. This controller only listens to touch events, however on desktops and in VR mode it will automatically switch over to a normal AFrame look-controls, meaning it will listen to mouse and deviceorientation events. Thus, this controller can be used as a drop-in replacement for look-controls.

The touch gestures are:

  • Single touch drag for pich and yaw
  • Two finger drag to dolly left/right (perpendicular to look direction) and up/down
  • Pinch to zoom (implemented as dolly)

AFrame's default look-controls support touch to yaw, but not the other touch gestures.

API

AttributeDescriptionDefault
enabledIs the controller enabled or not?true
maxPitchMaximum pitch up angle, in degrees15
minPitchMaximum pitch down angle, in degrees-20
xrangeMaximum, or min/max, dolly distance from starting point along X axis5
yrangeMaximum, or min/max, dolly distance from starting point along Y axis-1 1
zrangeMaximum, or min/max, dolly distance from starting point along Z axis5

the [x|y|z]range can be specified as a single number or as a pair of numbers. A single value means the range is bounded as x±xrange, and a pair of values means the bounds will be from x-xrange0 to x+xrange1.

Using

Include in page, then use as a drop-in replacement for look-controls.

You can optionally provide look-controls on the camera with specific parameter settings, e.g. <a-entity camera multitouch-look-controls look-controls="standing:false"></a-entity>. If you do not specify any, a look-controls with default settings will be created automatically. This usually works fine.

<script src="https://morandd.github.io/aframe-multitouch-look-controls/multitouch-look-controls.js"></script>

...
<a-entity camera multitouch-look-controls></a-entity>
1.1.0

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago