Rolling Issues

Bugs that have been resolved.

Moderator: Graf Zahl

Locked
Major Cooke
Developer
Developer
Posts: 240
Joined: Wed Mar 04, 2009 19:25

Rolling Issues

Post by Major Cooke » Mon Jul 04, 2016 4:57

Sprite X15AA0, as one can see from opening this file, should be rotating around the dead center of the offset pivot instead of rotating the center of the picture itself. Even giving it a hard physical canvas of 514 x 514 didn't work unfortunately.

It's only a rolling sprite too -- that part of Nash's code I didn't touch.

Summon A in console.

When I added a tiny opaque pixel on the other end of the picture where it was all blank, it began working more properly like it should -- that shouldn't have to happen though.
Attachments
test.pk3
Summon A in console
(28.83 KiB) Downloaded 13 times

User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: Rolling Issues

Post by Graf Zahl » Mon Jul 04, 2016 8:34

Looks like the billboarding system had been broken forever:

Code: Select all

				mat.Translate(xcenter, zcenter, ycenter); // move to sprite center

				...

				mat.Translate(-xcenter, -zcenter, -ycenter); // retreat from sprite center
Of course this needs to use the pivot, not the center. I just wonder how this will affect anything older...

Major Cooke
Developer
Developer
Posts: 240
Joined: Wed Mar 04, 2009 19:25

Re: Rolling Issues

Post by Major Cooke » Mon Jul 04, 2016 13:43

I could do some testing for you if you want. What would I use to get the pivots?

Also, if needed we could introduce another flag to toggle between using pivots and actual center.

User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: Rolling Issues

Post by Graf Zahl » Mon Jul 04, 2016 16:48

The pivot is stored in x,y,z.
Feel free to test with this. I won't be able to do anything for the next week because I am on vacation.

Major Cooke
Developer
Developer
Posts: 240
Joined: Wed Mar 04, 2009 19:25

Re: Rolling Issues

Post by Major Cooke » Mon Jul 04, 2016 18:23

Well that was easier than expected. Just needed to remove the sprite center and add x/y/z to it, translate it, and then translate back once finished. This way, the billboarding is left untouched.

Code: Select all

else if (drawRollSpriteActor)
				{
					float xx = -xcenter + x;
					float yy = -zcenter + z;
					float zz = -ycenter + y;
					mat.Translate(xx, yy, zz);
					if (drawWithXYBillboard)
					{
						mat.Rotate(-sin(angleRad), 0, cos(angleRad), -GLRenderer->mAngles.Pitch.Degrees);
					}
					mat.Rotate(cos(angleRad), 0, sin(angleRad), rollDegrees);
					mat.Translate(-xx, -yy, -zz);
				}
Question is though, I can see modders using either means -- from the sprite center or the pivots -- as both are useful. Should I add a flag that switches to one, or just make it the default implementation?

User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: Rolling Issues

Post by Graf Zahl » Mon Jul 04, 2016 18:46

Both may be what's desired so an option would be best here.

Major Cooke
Developer
Developer
Posts: 240
Joined: Wed Mar 04, 2009 19:25

Re: Rolling Issues

Post by Major Cooke » Mon Jul 04, 2016 20:05

https://github.com/coelckers/gzdoom/pull/57/files
https://github.com/rheit/zdoom/pull/715/files

Done. This also fixes pitch being backwards on flatsprites. (Yes, I know, a little ugly... but unfortunately, I tried other methods and they just didn't work out somehow.)

Major Cooke
Developer
Developer
Posts: 240
Joined: Wed Mar 04, 2009 19:25

Re: Rolling Issues

Post by Major Cooke » Tue Jul 12, 2016 21:37

Also, flat sprites will now disable camera facing.

Because this is problematic.
Spoiler: Not Facing Camera
Spoiler: Facing Camera
(That's basically a straight laser beam using perfectly angled/rolled/pitched sprites, which is distorted whenever camera facing is enabled.)

User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: Rolling Issues

Post by Graf Zahl » Tue Jul 12, 2016 22:59

For flat sprites, camera facing is flat out wrong, as the whole concept implies a specific orientation towards the world.

Major Cooke
Developer
Developer
Posts: 240
Joined: Wed Mar 04, 2009 19:25

Re: Rolling Issues

Post by Major Cooke » Wed Jul 13, 2016 0:04

Agreed. It's in my commit too. Any time someone applies +FLATSPRITE it will ignore all camera facing instructions.

Anyway, how's it look otherwise?

Locked

Return to “Closed Bugs”