Git Product home page Git Product logo

pscope-js-sdk's Introduction

perceptoscope

pscope-js-sdk

The javascript SDK for connecting to a Perceptoscope over it's WAMP WebSocket. Works in both NodeJS and the browser.

Example

var pscope = new Perceptoscope('ws://localhost:3000');
pscope.on(Perceptoscope.Events.ROTATION, rotation => {
    console.log(rotation);
});
pscope.connect();

See /examples directory for additional example code.

Documentation

Perceptoscope ⇐ EventEmitter

A connection to perceptope

Extends: EventEmitter

new Perceptoscope(url)

Creates a Perceptope

Param Type Description
url string The websocket url to the perceptoscope ex. ws://localhost:3000

perceptoscope.url ⇒ string

The url of the websocket conection

perceptoscope.rotation ⇒ Quaternion

The current rotation

perceptoscope.hmd ⇒ HMD

Current HMD (Head Mounted Display) configurations

perceptoscope.position ⇒ Point

Current position of the perceptoscope

perceptoscope.connect() ⇒ Promise

Connects to a perceptoscope and fetches intial values for rotation, position and hmd.

perceptoscope.close()

Closes the connection

Perceptoscope.Events object

Properties

Name Value Description
ROTATION "rotation" Fired when rotation changes
POSITION "position" Fired when position changes
HMD "position" Fired when hmd changes
CONNECTED "position" Fired when pscope is connected and has initial data

Types

Quaternion : object

Properties

Name Type
x number
y number
z number
w number

Point : object

Properties

Name Type
x number
y number
z number

HMD : object

Properties

Name Type
fov FieldOfView
left Eye
right Eye

FieldOfView : object

Properties

Name Type
upDegrees number
rightDegrees number
downDegrees number
leftDegrees number

Eye : object

Properties

Name Type
renderRect Rect
eyeTranslation Point

Rect : object

Properties

Name Type
x number
y number
width number
height number

pscope-js-sdk's People

Contributors

adamthesax avatar

Watchers

James Cloos avatar Ben Sax avatar  avatar Bryan Truong avatar rafai avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.