How to use the n.roll function in n

To help you get started, we’ve selected a few n examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tcannonfodder / houston / public / assets / js / navball.js View on Github external
//rotation tweening
    var navballTweenProperties = {
      pitch: this.pitch,
      roll: this.roll,
      heading: this.heading
    }

    var navballTween = new TWEEN.Tween(navballTweenProperties).to({
      // add normalized delta values to current values
      pitch: this.pitch + this.wrapDegDelta(data['n.pitch'] - this.pitch),
      roll: this.roll + this.wrapDegDelta(data['n.roll'] - this.roll),
      heading: this.heading + this.wrapDegDelta(data['n.heading'] - this.heading)
    }, this.datalink.rate)

    this.pitch = data['n.pitch']
    this.roll = data['n.roll']
    this.heading = data['n.heading']

    navballTween.onUpdate(function(){
      this.navballMesh.rotation.order = "ZXY"
      this.navballMesh.rotation.z = Math.toRadians(-navballTweenProperties.roll)
      this.navballMesh.rotation.x = Math.toRadians(navballTweenProperties.pitch)
      this.navballMesh.rotation.y = Math.toRadians(270 - navballTweenProperties.heading)
    }.bind(this))

    this.headingContainer.update(this.heading.toFixed(1) + "°")

    navballTween.start()
  },
github tcannonfodder / houston / static / js / navball.js View on Github external
update: function(data){
    //rotation tweening
    var navballTweenProperties = {
      pitch: this.pitch,
      roll: this.roll,
      heading: this.heading
    }

    var navballTween = new TWEEN.Tween(navballTweenProperties).to({
      // add normalized delta values to current values
      pitch: this.pitch + this.wrapDegDelta(data['n.pitch'] - this.pitch),
      roll: this.roll + this.wrapDegDelta(data['n.roll'] - this.roll),
      heading: this.heading + this.wrapDegDelta(data['n.heading'] - this.heading)
    }, this.datalink.rate)

    this.pitch = data['n.pitch']
    this.roll = data['n.roll']
    this.heading = data['n.heading']

    navballTween.onUpdate(function(){
      this.navballMesh.rotation.order = "ZXY"
      this.navballMesh.rotation.z = Math.toRadians(-navballTweenProperties.roll)
      this.navballMesh.rotation.x = Math.toRadians(navballTweenProperties.pitch)
      this.navballMesh.rotation.y = Math.toRadians(270 - navballTweenProperties.heading)
    }.bind(this))

    this.headingContainer.update(this.heading.toFixed(1) + "°")
github tcannonfodder / houston / static / js / navball.js View on Github external
//rotation tweening
    var navballTweenProperties = {
      pitch: this.pitch,
      roll: this.roll,
      heading: this.heading
    }

    var navballTween = new TWEEN.Tween(navballTweenProperties).to({
      // add normalized delta values to current values
      pitch: this.pitch + this.wrapDegDelta(data['n.pitch'] - this.pitch),
      roll: this.roll + this.wrapDegDelta(data['n.roll'] - this.roll),
      heading: this.heading + this.wrapDegDelta(data['n.heading'] - this.heading)
    }, this.datalink.rate)

    this.pitch = data['n.pitch']
    this.roll = data['n.roll']
    this.heading = data['n.heading']

    navballTween.onUpdate(function(){
      this.navballMesh.rotation.order = "ZXY"
      this.navballMesh.rotation.z = Math.toRadians(-navballTweenProperties.roll)
      this.navballMesh.rotation.x = Math.toRadians(navballTweenProperties.pitch)
      this.navballMesh.rotation.y = Math.toRadians(270 - navballTweenProperties.heading)
    }.bind(this))

    this.headingContainer.update(this.heading.toFixed(1) + "°")

    navballTween.start()
  },
github tcannonfodder / houston / public / assets / js / navball.js View on Github external
update: function(data){
    //rotation tweening
    var navballTweenProperties = {
      pitch: this.pitch,
      roll: this.roll,
      heading: this.heading
    }

    var navballTween = new TWEEN.Tween(navballTweenProperties).to({
      // add normalized delta values to current values
      pitch: this.pitch + this.wrapDegDelta(data['n.pitch'] - this.pitch),
      roll: this.roll + this.wrapDegDelta(data['n.roll'] - this.roll),
      heading: this.heading + this.wrapDegDelta(data['n.heading'] - this.heading)
    }, this.datalink.rate)

    this.pitch = data['n.pitch']
    this.roll = data['n.roll']
    this.heading = data['n.heading']

    navballTween.onUpdate(function(){
      this.navballMesh.rotation.order = "ZXY"
      this.navballMesh.rotation.z = Math.toRadians(-navballTweenProperties.roll)
      this.navballMesh.rotation.x = Math.toRadians(navballTweenProperties.pitch)
      this.navballMesh.rotation.y = Math.toRadians(270 - navballTweenProperties.heading)
    }.bind(this))

    this.headingContainer.update(this.heading.toFixed(1) + "°")

n

Interactively Manage All Your Node Versions

MIT
Latest version published 2 months ago

Package Health Score

92 / 100
Full package analysis