Compass rose rotation fixes (#6260)

This commit is contained in:
Charles Hacskaylo 2023-02-02 17:18:41 -08:00 committed by GitHub
parent 800062d37e
commit 422b7f3e09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -107,17 +107,21 @@
height="100" height="100"
/> />
</mask> </mask>
<g
class="c-cr-cam-and-body"
:style="cameraHeadingStyle"
>
<!-- Equipment (spacecraft) body holder. Transforms relative to the camera position. --> <!-- Equipment (spacecraft) body holder. Transforms relative to the camera position. -->
<g <g
v-if="hasHeading" v-if="hasHeading"
class="cr-vrover" class="cr-vrover"
:style="camAngleAndPositionStyle" :style="camAngleAndPositionStyle"
> >
<!-- Equipment body. Rotates relative to the camera gimbal value for cams that gimbal. --> <!-- Equipment body. Rotates relative to the camera pan value for cams that gimbal. -->
<path <path
class="cr-vrover__body" class="cr-vrover__body"
:style="camGimbalAngleStyle" :style="camGimbalAngleStyle"
x
fill-rule="evenodd" fill-rule="evenodd"
clip-rule="evenodd" clip-rule="evenodd"
d="M5 0C2.23858 0 0 2.23858 0 5V95C0 97.7614 2.23858 100 5 100H95C97.7614 100 100 97.7614 100 95V5C100 2.23858 97.7614 0 95 0H5ZM85 59L50 24L15 59H33V75H67.0455V59H85Z" d="M5 0C2.23858 0 0 2.23858 0 5V95C0 97.7614 2.23858 100 5 100H95C97.7614 100 100 97.7614 100 95V5C100 2.23858 97.7614 0 95 0H5ZM85 59L50 24L15 59H33V75H67.0455V59H85Z"
@ -126,7 +130,6 @@
<g <g
class="c-cr__cam-fov" class="c-cr__cam-fov"
:style="cameraHeadingStyle"
> >
<g mask="url(#mask2)"> <g mask="url(#mask2)">
<rect <rect
@ -150,6 +153,8 @@
points="0,0 100,0 70,40 70,100 30,100 30,40" points="0,0 100,0 70,40 70,100 30,100 30,40"
/> />
</g> </g>
</g>
</g> </g>
<!-- NSEW and ticks --> <!-- NSEW and ticks -->
@ -305,7 +310,7 @@ export default {
return { transform: `translate(${translateX}%, ${translateY}%) rotate(${rotation}deg) scale(${scale})` }; return { transform: `translate(${translateX}%, ${translateY}%) rotate(${rotation}deg) scale(${scale})` };
}, },
camGimbalAngleStyle() { camGimbalAngleStyle() {
const rotation = rotate(this.north, this.heading); const rotation = rotate(this.heading);
return { return {
transform: `rotate(${ rotation }deg)` transform: `rotate(${ rotation }deg)`
@ -332,14 +337,6 @@ export default {
hasHeading() { hasHeading() {
return this.heading !== undefined; return this.heading !== undefined;
}, },
headingStyle() {
/* Replaced with computed camGimbalStyle, but left here just in case. */
const rotation = rotate(this.north, this.heading);
return {
transform: `rotate(${ rotation }deg)`
};
},
hasSunHeading() { hasSunHeading() {
return this.sunHeading !== undefined; return this.sunHeading !== undefined;
}, },