Re: [Crystal-cvs] SF.net SVN: crystal:[38117] CS/branches/soc2012/water/plugins/mesh/ watermesh/object/watermesh.cpp

"res" <[email protected]>
Newsgroups gmane.comp.graphics.crystalspace.devel
Message-ID <[email protected]>
-------- Original-Nachricht --------
> Datum: Fri, 01 Jun 2012 11:51:24 +0000
> Von: [email protected]
> An: [email protected]
> Betreff: [Crystal-cvs] SF.net SVN: crystal:[38117] CS/branches/soc2012/water/plugins/mesh/ watermesh/object/watermesh.cpp

> +csVector3 PrevNode, NewsNode;
> +

Just remember to be careful with global variables...
It looks to me like they're just used for some (throwaway?) debugging code here, but even so, they probably had better been local variables.

> -#define MAX_OCEAN_DISTANCE 200.0f
> +#define MAX_OCEAN_DISTANCE 40000.0f

The original MAX_OCEAN_DISTANCE*MAX_OCEAN_DISTANCE was probably fine (you can assume the compiler computes this constant expression at compiler time); anyhow, if you make the distance a squared distance, I recommend to change the name to reflect that (e.g. MAX_OCEAN_DISTANCE_SQ).

> -  if(dist < (CELL_WID * 2))
> +  if(dist < (CELL_WID * 20))
>      useCell = 4;
> -  else if(dist < (CELL_WID * 3))
> +  else if(dist < (CELL_WID * 30))
>      useCell = 3;
> -  else if(dist < (CELL_WID * 4))
> +  else if(dist < (CELL_WID * 40))
>      useCell = 2;
> -  else if(dist < (CELL_WID * 5))
> +  else if(dist < (CELL_WID * 50))

It is totally not clear what these numbers mean. 20? 4? Not very clear. Could you put them into constants with some descriptive names while you are at it?

-f.r.
-- 
NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone!                                  
Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.