include_HEADERS = \
fg_memory.h \
- fg_random.h \
interpolater.hxx \
leastsqs.hxx \
localconsts.hxx \
point3d.hxx \
polar3d.hxx \
sg_geodesy.hxx \
+ sg_random.h \
sg_types.hxx \
vector.hxx
EXTRA_DIST = linintp2.h linintp2.inl sphrintp.h sphrintp.inl
libsgmath_a_SOURCES = \
- fg_random.c \
interpolater.cxx \
leastsqs.cxx \
polar3d.cxx \
sg_geodesy.cxx \
+ sg_random.c \
vector.cxx
INCLUDES += -I$(top_srcdir) $(ZLIB_INCL)
+++ /dev/null
-// fg_random.c -- routines to handle random number generation
-//
-// Written by Curtis Olson, started July 1997.
-//
-// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Library General Public
-// License as published by the Free Software Foundation; either
-// version 2 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Library General Public License for more details.
-//
-// You should have received a copy of the GNU Library General Public
-// License along with this library; if not, write to the
-// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-// Boston, MA 02111-1307, USA.
-//
-// $Id$
-
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h> // for random(), srandom()
-#include <time.h> // for time() to seed srandom()
-
-#include "fg_random.h"
-
-#ifndef HAVE_RAND
-# ifdef sgi
-# undef RAND_MAX
-# define RAND_MAX 2147483647
-# endif
-#endif
-
-#ifdef __SUNPRO_CC
- extern "C" {
- long int random(void);
- void srandom(unsigned int seed);
- }
-#endif
-
-
-// Seed the random number generater with time() so we don't see the
-// same sequence every time
-void fg_srandom(void) {
- // fgPrintf( FG_MATH, FG_INFO, "Seeding random number generater\n");
-
-#ifdef HAVE_RAND
- srand(time(NULL));
-#else
- srandom(time(NULL));
-#endif
-}
-
-
-// return a random number between [0.0, 1.0)
-double fg_random(void) {
-#ifdef HAVE_RAND
- return(rand() / (double)RAND_MAX);
-#else
- return(random() / (double)RAND_MAX);
-#endif
-}
-
-
+++ /dev/null
-// fg_random.h -- routines to handle random number generation
-//
-// Written by Curtis Olson, started July 1997.
-//
-// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Library General Public
-// License as published by the Free Software Foundation; either
-// version 2 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Library General Public License for more details.
-//
-// You should have received a copy of the GNU Library General Public
-// License along with this library; if not, write to the
-// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-// Boston, MA 02111-1307, USA.
-//
-// $Id$
-
-
-#ifndef _FG_RANDOM_H
-#define _FG_RANDOM_H
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-// Seed the random number generater with time() so we don't see the
-// same sequence every time
-void fg_srandom(void);
-
-// return a random number between [0.0, 1.0)
-double fg_random(void);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif // _FG_RANDOM_H
-
-
--- /dev/null
+// sg_random.c -- routines to handle random number generation
+//
+// Written by Curtis Olson, started July 1997.
+//
+// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the
+// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+//
+// $Id$
+
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h> // for random(), srandom()
+#include <time.h> // for time() to seed srandom()
+
+#include "sg_random.h"
+
+#ifndef HAVE_RAND
+# ifdef sgi
+# undef RAND_MAX
+# define RAND_MAX 2147483647
+# endif
+#endif
+
+#ifdef __SUNPRO_CC
+ extern "C" {
+ long int random(void);
+ void srandom(unsigned int seed);
+ }
+#endif
+
+
+// Seed the random number generater with time() so we don't see the
+// same sequence every time
+void sg_srandom(void) {
+ // fgPrintf( FG_MATH, FG_INFO, "Seeding random number generater\n");
+
+#ifdef HAVE_RAND
+ srand(time(NULL));
+#else
+ srandom(time(NULL));
+#endif
+}
+
+
+// return a random number between [0.0, 1.0)
+double sg_random(void) {
+#ifdef HAVE_RAND
+ return(rand() / (double)RAND_MAX);
+#else
+ return(random() / (double)RAND_MAX);
+#endif
+}
+
+
--- /dev/null
+// sg_random.h -- routines to handle random number generation
+//
+// Written by Curtis Olson, started July 1997.
+//
+// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the
+// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+//
+// $Id$
+
+
+#ifndef _SG_RANDOM_H
+#define _SG_RANDOM_H
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+// Seed the random number generater with time() so we don't see the
+// same sequence every time
+void sg_srandom(void);
+
+// return a random number between [0.0, 1.0)
+double sg_random(void);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif // _SG_RANDOM_H
+
+
#include <plib/sg.h>
#include <plib/ssg.h>
-#include <simgear/math/fg_random.h>
#include <simgear/math/point3d.hxx>
#include <simgear/math/polar3d.hxx>
+#include <simgear/math/sg_random.h>
#include "cloud.hxx"
sgSetVec3( vertex, -size, -size, 0.0f );
sgVec2 base;
- sgSetVec2( base, fg_random(), fg_random() );
+ sgSetVec2( base, sg_random(), sg_random() );
sgSetVec2( tc, base[0], base[1] );
cl->add( color );
vl->add( vertex );
#include <plib/sg.h>
#include <simgear/debug/logstream.hxx>
-#include <simgear/math/fg_random.h>
#include "dome.hxx"
#include <plib/sg.h>
#include <plib/ssg.h>
-#include <simgear/math/fg_random.h>
+#include <simgear/math/sg_random.h>
#include "sky.hxx"
if ( ratio < 1.0 ) {
if ( ! in_puff ) {
// calc chance of entering cloud puff
- double rnd = fg_random();
+ double rnd = sg_random();
double chance = rnd * rnd * rnd;
if ( chance > 0.95 /* * (diff - 25) / 50.0 */ ) {
in_puff = true;
- puff_length = fg_random() * 2.0; // up to 2 seconds
+ puff_length = sg_random() * 2.0; // up to 2 seconds
puff_progression = 0.0;
}
}