[1.1.4 (r131M)] Model Rotation Skipping Bug

Bugs that have been resolved.

Moderator: Graf Zahl

Locked
User avatar
Slasher123
Posts: 21
Joined: Sun Jul 13, 2008 8:55
Location: California

[1.1.4 (r131M)] Model Rotation Skipping Bug

Post by Slasher123 »

As discovered in this thread, the models in my project rotate, all at different speeds and directions, but a strange skipping can be observed.

Download the zip in that thread with the pk3 and the demo that shows this skipping bug.

All I know is that commenting out ALL the Rotation-Speed lines from the model definitions eliminated the skip.


EDIT: My system info:

Microsoft Windows XP Professional Service Pack 2
AMD Athlon(tm) 64 X2 Dual
Core Processor 5600+
2.80 GHz, 2.00 GB of RAM
User avatar
Torr Samaho
Developer
Developer
Posts: 160
Joined: Fri Apr 13, 2007 8:26
Location: Germany
Contact:

Post by Torr Samaho »

Fixed. In gl_models.cpp replace

Code: Select all

	if( smf->flags & MDL_ROTATING )
	{
		float offsetAngle = 0.;
		const float time = GetTimeFloat()/200.;
		offsetAngle = ( (time - static_cast<int>(time)) *360. );
		gl.Translatef(smf->rotationCenterX, smf->rotationCenterY, smf->rotationCenterZ);
		gl.Rotatef(offsetAngle*smf->rotationSpeed, smf->xrotate, smf->yrotate, smf->zrotate);
		gl.Translatef(-smf->rotationCenterX, -smf->rotationCenterY, -smf->rotationCenterZ);
	}

by

Code: Select all

	if( smf->flags & MDL_ROTATING )
	{
		float offsetAngle = 0.;
		const float time = smf->rotationSpeed*GetTimeFloat()/200.;
		offsetAngle = ( (time - static_cast<int>(time)) *360. );
		gl.Translatef(smf->rotationCenterX, smf->rotationCenterY, smf->rotationCenterZ);
		gl.Rotatef(offsetAngle, smf->xrotate, smf->yrotate, smf->zrotate);
		gl.Translatef(-smf->rotationCenterX, -smf->rotationCenterY, -smf->rotationCenterZ);
	}
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Post by Graf Zahl »

That only fixed one of the 2 modes but it was easy enough to transfer to the other one, too.
User avatar
Slasher123
Posts: 21
Joined: Sun Jul 13, 2008 8:55
Location: California

Post by Slasher123 »

Wow, I had completely forgotten about this problem. The project I was working on that experienced this problem has been on hold for a long time.

Is this fixed now?
User avatar
Enjay
Developer
Developer
Posts: 4748
Joined: Tue Aug 30, 2005 23:19
Location: Scotland
Contact:

Post by Enjay »

Slasher123 wrote:Is this fixed now?
It should be (thanks Graf and Torr). The changelog for r283 says it has been done. I'll get a build online in a few minutes.

[edit] Wait, Graf has just committed r284, I'll rebuild and put that up instead. [/edit]

[edit2] It's up and it does indeed seem to allow your test map to play without the model skipping problem. [/edit]
User avatar
Torr Samaho
Developer
Developer
Posts: 160
Joined: Fri Apr 13, 2007 8:26
Location: Germany
Contact:

Post by Torr Samaho »

Graf Zahl wrote:That only fixed one of the 2 modes but it was easy enough to transfer to the other one, too.
I think you forgot to multiply time with smf->rotationSpeed in the second mode.

BTW: In case your email notification for PMs here is still broken, please check your inbox.
Locked

Return to “Closed Bugs”