sio2CameraRender

View previous topic View next topic Go down

sio2CameraRender

Post  z8000 on 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

View user profile

Back to top Go down

Re: sio2CameraRender

Post  sw on 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
avatar
sw

Posts : 73
Join date : 2008-10-12

View user profile

Back to top Go down

Re: sio2CameraRender

Post  z8000 on 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

View user profile

Back to top Go down

Re: sio2CameraRender

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top


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