Normal Programming Mistake

    aframe-locomotion

    0.2.0 • Public • Published

    A-Frame locomotion

    A collection of A-Frame components, systems and primitives that enable all sorts of locomotion in VR. It't built to be modular, flexible and easy to use. Currently supports smooth locomotion, snap turning and smooth turning. Besides the actual modes of locomotion, there are auxillary components to improve the locomotion experience like a vignette when moving, fading when snap turning and more.

    Try the online examples Aframe locomotion example

    Blog post describing the implementation: A-Frame Adventures 01 - Smooth locomotion and snap turning

    Buy Me a Coffee at ko-fi.com

    Quick start

    To add aframe-locomotion to your A-Frame project, all you have to do is load the aframe-locomotion javascript:

    <script src="https://unpkg.com/aframe-locomotion@0.2.0/dist/aframe-locomotion.umd.min.js"></script>

    This will automatically register the components smooth-locomotion and snap-turn. These need to be attached to the controllers as part of a camera rig, as follows:

    <!-- Camera rig -->
    <a-entity id="rig" position="0 0 0">
        <a-entity id="camera" camera position="0 1.6 0" wasd-controls look-controls></a-entity>
    
        <!-- Hands -->
        <a-entity
            vive-controls="hand: left"
            oculus-touch-controls="hand: left"
            locomotion="target: #rig; reference: #camera">
        </a-entity>
        <a-entity
            vive-controls="hand: right"
            oculus-touch-controls="hand: right"
            snap-turn="target: #rig; reference: #camera">
        </a-entity>
    
    </a-entity>

    Both smooth-locomotion and snap-turn have more properties that can be used to tweak the behaviour. Check the Documentation to learn more or explore the examples.

    Features

    • Smooth locomotion
    • Snap turning (with optional fade transitions)
    • Smooth turning
    • Vignette when moving
    • Nav-mesh support

    Planned features

    • [ ] Velocity effectors (e.g. conveyor belts, moving platforms)
    • [ ] Smooth snap turning
    • [ ] Momentum preservation
    • [ ] Teleport
    • [ ] Flying
    • [ ] Head-collision prevention

    Questions

    If you've got any questions, feedback, suggestions or even want to help out, feel free to reach out to me.

    Install

    npm i aframe-locomotion

    DownloadsWeekly Downloads

    136

    Version

    0.2.0

    License

    MIT

    Unpacked Size

    31.7 kB

    Total Files

    6

    Last publish

    Collaborators

    • mrxz