How to use the tar.o.orbitingBody function in tar

To help you get started, we’ve selected a few tar 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 / static / js / docking_position_data.js View on Github external
recalculate: function(data){
    if(this.isLocked()){return}
    this.mutexLock()
    Object.extend(data, {
      "currentUniversalTime": this.adjustUniversalTime(data['t.universalTime']),
      "vesselBody": data['v.body'],
      "targetBody": data['tar.o.orbitingBody'],
      "vesselCurrentPosition": { "relativePosition": null },
      "targetCurrentPosition": { "relativePosition": null },
    })
    this.getPositionsAndRecalculate(data)
  },
github tcannonfodder / houston / static / js / position_data_formatter.js View on Github external
formatTargetVessel: function(positionData, formattedData){
    if(!positionData['tar.type']){ return }
    if(positionData["tar.type"] == "Vessel"){
      var targetCurrentTruePosition = this.truePositionForRelativePosition(
        positionData["targetCurrentPosition"]["relativePosition"],
        this.formatTruePositionVector(positionData.referenceBodies[positionData["tar.o.orbitingBody"]].currentTruePosition)
      )

      formattedData.vessels.push(this.buildVessel({
        name: positionData["tar.name"],
        type: "targetVessel",
        truePosition: targetCurrentTruePosition,
        referenceBodyName: positionData["tar.o.orbitingBody"]
      }))
    }
  },
github tcannonfodder / houston / static / js / ground_track_position_data_formatter.js View on Github external
formatTargetCurrentCoordinates: function(positionData, formattedData){
    if(this.rootReferenceBodyName != positionData["tar.o.orbitingBody"]){ return }
    if(positionData["tar.type"] != "Vessel"){ return }
    var currentPosition = positionData["targetCurrentPosition"]["relativePosition"]
    var info = this.rootReferenceBody(positionData)

    formattedData.targetCurrentCoordinates = this.coordinatesFromVector(currentPosition, info.radius)
  },
github tcannonfodder / houston / static / js / position_data_formatter.js View on Github external
formatTargetVessel: function(positionData, formattedData){
    if(!positionData['tar.type']){ return }
    if(positionData["tar.type"] == "Vessel"){
      var targetCurrentTruePosition = this.truePositionForRelativePosition(
        positionData["targetCurrentPosition"]["relativePosition"],
        this.formatTruePositionVector(positionData.referenceBodies[positionData["tar.o.orbitingBody"]].currentTruePosition)
      )

      formattedData.vessels.push(this.buildVessel({
        name: positionData["tar.name"],
        type: "targetVessel",
        truePosition: targetCurrentTruePosition,
        referenceBodyName: positionData["tar.o.orbitingBody"]
      }))
    }
  },
github tcannonfodder / houston / public / assets / js / position_data_formatter.js View on Github external
formatTargetVessel: function(positionData, formattedData){
    if(!positionData['tar.type']){ return }
    if(positionData["tar.type"] == "Vessel"){
      var targetCurrentTruePosition = this.truePositionForRelativePosition(
        positionData["targetCurrentPosition"]["relativePosition"],
        this.formatTruePositionVector(positionData.referenceBodies[positionData["tar.o.orbitingBody"]].currentTruePosition)
      )

      formattedData.vessels.push(this.buildVessel({
        name: positionData["tar.name"],
        type: "targetVessel",
        truePosition: targetCurrentTruePosition,
        referenceBodyName: positionData["tar.o.orbitingBody"]
      }))
    }
  },
github tcannonfodder / houston / public / assets / js / hohmann-intercept.js View on Github external
getVesselAndTargetInfo: function(data){
    if(this.isnoTarget(data)){return}
    this.targetBody = this.datalink.getOrbitalBodyInfo(data['tar.name'])
    this.targetBody.orbitingBody = this.datalink.getOrbitalBodyInfo(data['tar.o.orbitingBody'])
    this.targetBody.periapsis = data['tar.o.ApA']
    this.vessel.orbitingBody = this.datalink.getOrbitalBodyInfo(data['v.body'])
    this.vessel.periapsis = data['o.ApA']
    this.vessel.altitude = data['v.altitude']
    this.vessel.orbitalVelocity = data['v.orbitalVelocity']

    this.datalink.subscribeToData([
      "b.o.gravParameter["+ this.vessel.orbitingBody.id +"]",
      "b.radius["+ this.vessel.orbitingBody.id +"]",
      "b.o.phaseAngle["+ this.targetBody.id +"]"
    ])
  },
github tcannonfodder / houston / public / assets / js / position_data_formatter.js View on Github external
formatTargetVessel: function(positionData, formattedData){
    if(!positionData['tar.type']){ return }
    if(positionData["tar.type"] == "Vessel"){
      var targetCurrentTruePosition = this.truePositionForRelativePosition(
        positionData["targetCurrentPosition"]["relativePosition"],
        this.formatTruePositionVector(positionData.referenceBodies[positionData["tar.o.orbitingBody"]].currentTruePosition)
      )

      formattedData.vessels.push(this.buildVessel({
        name: positionData["tar.name"],
        type: "targetVessel",
        truePosition: targetCurrentTruePosition,
        referenceBodyName: positionData["tar.o.orbitingBody"]
      }))
    }
  },