mirror of
https://github.com/nasa/openmct.git
synced 2024-12-28 00:48:51 +00:00
enable hud for non-gimbling cameras
This commit is contained in:
parent
a82e78365d
commit
0c111f5fa2
@ -30,6 +30,8 @@
|
|||||||
:heading="heading"
|
:heading="heading"
|
||||||
:camera-azimuth="cameraAzimuth"
|
:camera-azimuth="cameraAzimuth"
|
||||||
:transformations="transformations"
|
:transformations="transformations"
|
||||||
|
:has-gimble="hasGimble"
|
||||||
|
:normalized-camera-azimuth="normalizedCameraAzimuth"
|
||||||
:sun-heading="sunHeading"
|
:sun-heading="sunHeading"
|
||||||
/>
|
/>
|
||||||
<CompassRose
|
<CompassRose
|
||||||
@ -37,6 +39,8 @@
|
|||||||
:heading="heading"
|
:heading="heading"
|
||||||
:camera-azimuth="cameraAzimuth"
|
:camera-azimuth="cameraAzimuth"
|
||||||
:transformations="transformations"
|
:transformations="transformations"
|
||||||
|
:has-gimble="hasGimble"
|
||||||
|
:normalized-camera-azimuth="normalizedCameraAzimuth"
|
||||||
:sun-heading="sunHeading"
|
:sun-heading="sunHeading"
|
||||||
:sized-image-dimensions="sizedImageDimensions"
|
:sized-image-dimensions="sizedImageDimensions"
|
||||||
/>
|
/>
|
||||||
@ -46,6 +50,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import CompassHUD from './CompassHUD.vue';
|
import CompassHUD from './CompassHUD.vue';
|
||||||
import CompassRose from './CompassRose.vue';
|
import CompassRose from './CompassRose.vue';
|
||||||
|
import { rotate } from './utils';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@ -63,6 +68,15 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
hasGimble() {
|
||||||
|
return this.cameraAzimuth !== undefined;
|
||||||
|
},
|
||||||
|
// compass ordinal orientation of camera
|
||||||
|
normalizedCameraAzimuth() {
|
||||||
|
return this.hasGimble
|
||||||
|
? rotate(this.cameraAzimuth)
|
||||||
|
: rotate(this.heading, -this.transformations?.rotation ?? 0);
|
||||||
|
},
|
||||||
// horizontal rotation from north in degrees
|
// horizontal rotation from north in degrees
|
||||||
heading() {
|
heading() {
|
||||||
return this.image.heading;
|
return this.image.heading;
|
||||||
|
@ -110,6 +110,14 @@ export default {
|
|||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
|
hasGimble: {
|
||||||
|
type: Boolean,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
normalizedCameraAzimuth: {
|
||||||
|
type: Number,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
sunHeading: {
|
sunHeading: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: undefined
|
default: undefined
|
||||||
@ -138,10 +146,13 @@ export default {
|
|||||||
left: `${ percentage * 100 }%`
|
left: `${ percentage * 100 }%`
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
cameraRotation() {
|
||||||
|
return this.transformations?.rotation;
|
||||||
|
},
|
||||||
visibleRange() {
|
visibleRange() {
|
||||||
return [
|
return [
|
||||||
rotate(this.cameraAzimuth, -this.cameraAngleOfView / 2),
|
rotate(this.normalizedCameraAzimuth, -this.cameraAngleOfView / 2),
|
||||||
rotate(this.cameraAzimuth, this.cameraAngleOfView / 2)
|
rotate(this.normalizedCameraAzimuth, this.cameraAngleOfView / 2)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -275,6 +275,14 @@ export default {
|
|||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
|
hasGimble: {
|
||||||
|
type: Boolean,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
normalizedCameraAzimuth: {
|
||||||
|
type: Number,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
sunHeading: {
|
sunHeading: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: undefined
|
default: undefined
|
||||||
@ -290,15 +298,6 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
hasGimble() {
|
|
||||||
return this.cameraAzimuth !== undefined;
|
|
||||||
},
|
|
||||||
// compass ordinal orientation of camera
|
|
||||||
normalizedCameraAzimuth() {
|
|
||||||
return this.hasGimble
|
|
||||||
? rotate(this.cameraAzimuth)
|
|
||||||
: rotate(this.heading, -this.transformations?.rotation ?? 0);
|
|
||||||
},
|
|
||||||
camAngleAndPositionStyle() {
|
camAngleAndPositionStyle() {
|
||||||
const translateX = this.transformations?.translateX;
|
const translateX = this.transformations?.translateX;
|
||||||
const translateY = this.transformations?.translateY;
|
const translateY = this.transformations?.translateY;
|
||||||
|
Loading…
Reference in New Issue
Block a user