Skip to content

viewer#1200 Avatar rotates 360 degrees when viewed from the top and below #1240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 19, 2024

Conversation

LLGuru
Copy link
Contributor

@LLGuru LLGuru commented Apr 15, 2024

See #1200

This change applies pitch() to a copy of the mFrameAgent and checks the resulting vertical angle
The new value of mFrameAgent is used only if the resulting vertical angle doesn't exceed the limits

This method is more precise than any attempts to guess the resulting angle before applying pitch()

@@ -1453,48 +1453,70 @@ LLVector3 LLAgent::getReferenceUpVector()
return up_vector;
}


#pragma optimize("", off)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

I felt that I would forget to remove it :-)

@LLGuru LLGuru force-pushed the guru/viewer-1200-avatar-rotates branch from 3b04c12 to 2fb93f7 Compare April 15, 2024 21:46
@LLGuru LLGuru requested a review from marchcat April 15, 2024 21:48
Copy link
Contributor

@marchcat marchcat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's test it.

@@ -112,6 +112,7 @@ class LLAgentCamera
//--------------------------------------------------------------------
public:
void switchCameraPreset(ECameraPreset preset);
ECameraPreset getCameraPreset() const { return mCameraPreset; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the second file in this commit

Copy link
Contributor

@akleshchev akleshchev Apr 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And what would happen with custom presets? Like a rear view, but slightly to the side?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just want to mention that all 3 "default" presets (Front, Rear, Side) can be overwritten. For example, you can set the values of 'Rear' and 'Side' to be the same as 'Front'. Basically, they are almost the same as 'custom' presets, but have their own buttons and default values, stored in the file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the current bug relates to the default preset settings, and the fix as well

We will solve the issues with custom presets when having bugs relates to them, not before

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So in this case, it looks like those bugs will appear in the very first round of testing. Why wait, then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So in this case, it looks like those bugs will appear in the very first round of testing. Why wait, then?

Nothing is changed for custom presets
If we don't have bugs with them right now, why should they appear after this change?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant something like that:

  • Open 'Camer controls'
  • Select 'Front view'
  • Click 'Save as preset' button
  • Choose 'Replace a preset' and select 'Rear'
  • (then repeat and select 'Side')
  • Click 'Save as preset' button once again
  • And save as new preset.

After that the bug will be reproducible on all camera preset views, including REAR, GROUP, CUSTOM.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test plan for QA now includes testing presets, so I'm tentatively approving this.

Copy link
Contributor Author

@LLGuru LLGuru Apr 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the user explicitly sets incorrect preset settings, the bugs like this are expected, but they won't be treated as bugs

For example, if user choses the color scheme with white color for font and background, the text becomes unreadable, but this is not a bug, yes? :-)

}
}
// don't let user pitch if pointed almost all the way down or up
if (gAgentCamera.getCameraMode() == CAMERA_MODE_THIRD_PERSON ||
Copy link
Contributor

@akleshchev akleshchev Apr 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you add this cheack? Won't this negatively affect avatar customization mode which isn't listed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because each preset requires different checks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The avatar customization mode won't be affected because it doesn't use vertical angles close to 1 and 179

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And CAMERA_MODE_FOLLOW? That's a mode where script overrides control over camera and otherwise acts as a CAMERA_MODE_THIRD_PERSON, doesn't appear to affect mouselook

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CAMERA_MODE_FOLLOW also doesn't seem to use critical values of the vertical angle (1 or 179)

Copy link
Contributor

@akleshchev akleshchev Apr 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked and it behaves exactly like CAMERA_MODE_THIRD_PERSON in most cases with the kart, except camera follows behind you in some cases. But it depends on a script, ex: a rocket or a plane can easily trow your camera high up so I suggest checking those cases or at least providing a test plan that would cover them.

Copy link
Contributor Author

@LLGuru LLGuru Apr 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With CAMERA_MODE_FOLLOW your camera could rotate any directions without any action from your side
So this bug doesn't make sense for CAMERA_MODE_FOLLOW

When the vertical angle takes critical values 1 or 179, camera could rotate, and nobody treats this like a bug

@marchcat marchcat self-requested a review April 16, 2024 13:54
@LLGuru LLGuru force-pushed the guru/viewer-1200-avatar-rotates branch from 2fb93f7 to c5a009e Compare April 16, 2024 14:02
@LLGuru LLGuru marked this pull request as ready for review April 16, 2024 14:16
@akleshchev
Copy link
Contributor

But may be retarget it to maint C?

@marchcat
Copy link
Contributor

retarget it to maint C?

Sounds good.

@LLGuru LLGuru merged commit 1fa3bf4 into release/maint-yz Apr 19, 2024
10 checks passed
@LLGuru LLGuru deleted the guru/viewer-1200-avatar-rotates branch April 19, 2024 17:17
@github-actions github-actions bot locked and limited conversation to collaborators Apr 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
4 participants