FORUM CLOSED, PLEASE REGISTER AT FORUM.SIO2INTERACTIVE.COM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

sio2CameraRender

2 posters

Go down

sio2CameraRender Empty sio2CameraRender

Post  z8000 Mon Oct 27, 2008 7:39 am

Hi - I just found out about this engine last night. After skimming the source, I noticed this snippet in sio2CameraRender and since there are not comments anywhere in sight (!), and I'm not up on my coffee intake for the day yet, what does this do? It seems to be taking the decimal part of the Z of the camera position and adding it to half the 'height'... Why?

Thanks Smile

Code:
      precision = ( float )( int )( _SIO2camera->mat[14] *= 1000.0f );
      _SIO2camera->mat[14] = ( float )( precision / 1000.0f ) + _SIO2camera->height * 0.5f;      

z8000

Posts : 2
Join date : 2008-10-27

Back to top Go down

sio2CameraRender Empty Re: sio2CameraRender

Post  sw Mon Oct 27, 2008 10:42 am

z8000 wrote:Hi - I just found out about this engine last night. After skimming the source, I noticed this snippet in sio2CameraRender and since there are not comments anywhere in sight (!), and I'm not up on my coffee intake for the day yet, what does this do? It seems to be taking the decimal part of the Z of the camera position and adding it to half the 'height'... Why?

Thanks Smile

Code:
      precision = ( float )( int )( _SIO2camera->mat[14] *= 1000.0f );
      _SIO2camera->mat[14] = ( float )( precision / 1000.0f ) + _SIO2camera->height * 0.5f;      


cut off some number after 0.000 Smile. such as 0.0003432 will be cuted the tail affraid
sw
sw

Posts : 73
Join date : 2008-10-12

Back to top Go down

sio2CameraRender Empty Re: sio2CameraRender

Post  z8000 Mon Oct 27, 2008 11:15 am

anything wrong with round()?
Oh now I see you are keeping precision to 3 decimal places.
How odd.

z8000

Posts : 2
Join date : 2008-10-27

Back to top Go down

sio2CameraRender Empty Re: sio2CameraRender

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum