Skip to content
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

280: Drag Rotate doesn't handle rotation of 10800 degrees #570

Closed
tngreene opened this issue Jun 3, 2020 · 8 comments
Closed

280: Drag Rotate doesn't handle rotation of 10800 degrees #570

tngreene opened this issue Jun 3, 2020 · 8 comments

Comments

@tngreene
Copy link
Contributor

tngreene commented Jun 3, 2020

A user showed me a case of attempting to have a wheel that can revolve 30 times - a rotation between 0 and 10800 degrees.

One part of the autocorrection algorithm knows that this is a real rotation, but when changing this to AA, it gets simplified (I think that's what's going on) and another part of the code says `assert False, "how did we get here?" - it sees it as a no rotation

Right now for them this is a hand edit operation that takes 10 seconds to fix, but, this shouldn't be possible

@tngreene tngreene self-assigned this Jun 3, 2020
@tngreene tngreene changed the title Drag Rotate doesn't handle rotation of 10800 degrees 280: Drag Rotate doesn't handle rotation of 10800 degrees Jun 3, 2020
@lehthanis
Copy link

I have a wheel that is -1440 to +1440 for a total of 2880 degrees and get this same error.

@tngreene
Copy link
Contributor Author

Since this is an start == finish when it shouldn't be as a temporary work around does -1440 to + 1441 degrees work?

@lehthanis
Copy link

lehthanis commented Jun 18, 2020

not really. It allows it to export...but it creates keys like this:

	# 1 Mesh: ElevatorTrimManip
	ANIM_begin
	# static translation
	ANIM_trans	0.01634	0.07452	2.60577011	0.01634	0.07452	2.60577011
	# rotation keyframes
	ANIM_rotate_begin	1	0	0	sim/cockpit2/controls/elevator_trim
	ANIM_rotate_key	-1	-1439.99993079
	ANIM_rotate_key	1	1440.9997612
	ANIM_rotate_end
	# MESH: ElevatorTrimManip	weight: 26
	# MATERIAL: NODRAW
	ATTR_manip_drag_rotate	hand	0.01633501	0.07451951	2.60576773	1	0	0	0	0.99857056	0	-1	1	0	0	sim/cockpit2/controls/elevator_trim		Elevator Trim
	TRIS	372 132
	ANIM_end

Which seems to be about a tiny degree of rotation in the sim... not sure why.

Also it exports if I set it to -90 to 90...and I manually edit the obj text to look like this:

	ANIM_rotate_key	-1	-1440.00020741
	ANIM_rotate_key	1	1440.00020741

@lehthanis
Copy link

Edited code above because my test case did 1440 to -1441...I modified it to be your suggested 1441 to -1440 just in case that made a difference...it did not.

I think it has something to do with range not start == finish. Because it like -90 to 90 just fine.

@lehthanis
Copy link

For the record here's the whole block if I export it with 90 to -90.

	# 1 Mesh: ElevatorTrimManip
	ANIM_begin
	# static translation
	ANIM_trans	0.01634	0.07452	2.60577011	0.01634	0.07452	2.60577011
	# rotation keyframes
	ANIM_rotate_begin	1	0	0	sim/cockpit2/controls/elevator_trim
	ANIM_rotate_key	-1	-90.00020741
	ANIM_rotate_key	1	90.00020741
	ANIM_rotate_end
	# MESH: ElevatorTrimManip	weight: 26
	# MATERIAL: NODRAW
	ATTR_manip_drag_rotate	hand	0.01633501	0.07451951	2.60576773	-1	0	0	90.00020741	-90.00020741	0	-1	1	0	0	sim/cockpit2/controls/elevator_trim		Elevator Trim
	TRIS	372 132
	ANIM_end

@tngreene
Copy link
Contributor Author

After conversation with Ben he says the best fix is to just make a special case: If you're about to go from Euler to AA, and you will only have one reference axis (guaranteed already by previous checks), just use the Euler values instead.

@tngreene
Copy link
Contributor Author

I'm greatly hoping this is a good fix. For some reason my test airplane in X-Plane wouldn't recognize that they were drag_rotates but, the unit test suite passes, so, idk.

@tngreene
Copy link
Contributor Author

tngreene commented Sep 9, 2020

@lehthanis Did beta.3 fix your problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants