Compare commits

...

2229 Commits

Author SHA1 Message Date
Tim Moore
9b0ba10b0b Merge branch 'jmt/ref_ptr-conv' into next 2010-05-05 10:42:41 +02:00
jmt
9f9c4cf32c Compile even if OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION is not set. 2010-05-05 10:42:29 +02:00
Tim Moore
536ebf604f Merge branch 'ehofman/framebuffer' into next 2010-05-05 10:39:32 +02:00
ehofman
03a616b737 Add support for EXT_framebuffer_object for Atlas 2010-05-05 10:39:18 +02:00
Tim Moore
0b05f67114 Merge branch 'master' into next 2010-05-05 10:38:26 +02:00
Tim Moore
0ede690580 Merge branch 'maint' 2010-05-05 10:38:18 +02:00
frohlich
d81545a871 Add -ldl for newer ld defaults from fedora 13
Modified Files:
	simgear/screen/Makefile.am
2010-05-05 10:38:09 +02:00
Tim Moore
1cda1fc201 Merge branch 'mathias/intersect' into next 2010-05-05 09:43:40 +02:00
frohlich
490dad7838 Provide a more exact sphere/box test.
Modified Files:
	simgear/math/SGIntersect.hxx simgear/math/SGBox.hxx
2010-05-05 09:43:32 +02:00
Tim Moore
13ecbb8bce Merge branch 'master' into next 2010-05-05 09:40:31 +02:00
Tim Moore
3346bfc9a8 Merge branch 'maint' 2010-05-05 09:40:23 +02:00
frohlich
c5de65f115 Make the bounding volume debug visitor compile again.
Modified Files:
	simgear/scene/bvh/BVHDebugCollectVisitor.hxx
2010-05-05 09:40:06 +02:00
Tim Moore
4fffcf9975 Merge branch 'ehofman/sound' into next 2010-05-05 09:05:35 +02:00
jmt
8962d9b293 Following discussion with Tat and Erik, update how we handle ALUT on Mac; specifically, switch to using an ALUT.framework built from FreeALUT. The ALUT framework is available (initially) from:
http://files.goneabitbursar.com/fg/alut-osx-universal.zip

for testing purposes; autoconf integration and an official home for the
framework will follow once this approach has been tested and confirmed as
sane by other Mac developers!
2010-05-05 09:05:23 +02:00
Tim Moore
050c1560e8 Merge branch 'fredb/msvc-cleanup' into next 2010-05-05 09:03:20 +02:00
fredb
68b3041f50 Remove obsolete file 2010-05-05 09:03:10 +02:00
fredb
1ddd153399 Cleanup MSVC projects 2010-05-05 09:02:58 +02:00
Tim Moore
df0a60caae Merge branch 'ehofman/model' into next 2010-05-05 08:44:32 +02:00
fredb
675c86582d Stuart Buchanan: Fix a bug in the random object placement where the model selected in the case of multiple object definitions in material.xml was random, rather than seeded. 2010-05-05 08:44:18 +02:00
Tim Moore
e6d01ed1a3 Merge branch 'fredb/effect-stuff' 2010-04-25 22:52:35 +02:00
Tim Moore
d8d1064e05 Merge branch 'zan/cubemap' 2010-04-25 22:52:10 +02:00
Tim Moore
5d04cb81ba Merge branch 'fredb/geom-shader' 2010-04-25 22:52:02 +02:00
Tim Moore
5d5906e980 Merge branch 'ehofman/particles' 2010-04-25 22:36:06 +02:00
Tim Moore
2e7b862ad3 Merge branch 'timoore/aptsign' 2010-04-25 22:33:34 +02:00
Tim Moore
ad86e22824 Merge branch 'jmt/magvar' 2010-04-25 22:33:18 +02:00
Tim Moore
536b8a213b Merge branch 'fred/precip' 2010-04-25 22:33:02 +02:00
Tim Moore
2e13877926 Merge branches 'ehofman/propfix' and 'ehofman/sound' 2010-04-25 22:32:44 +02:00
Tim Moore
967d63dec4 Merge branches 'ehofman/config' and 'ehofman/dlerror' 2010-04-25 22:32:14 +02:00
Tim Moore
573c4268b6 Merge branch 'fredb/effect-stuff' into next 2010-04-12 07:25:24 +02:00
fredb
f19e83dcf1 Add a new node "float-property" to be used in float comparision in effect predicates 2010-04-12 07:25:13 +02:00
fredb
caabe8fc87 Add a "scale" parameter that combine xsize and ysize in a vec3 property. There is no vec2 property, so the third component is zero 2010-04-12 07:25:13 +02:00
fredb
7c4e5309fc Declare some material parameters as implicit effect parameters 2010-04-12 07:25:13 +02:00
fredb
542124e90c materials.xml format update
Allow to declare sets of textures that can be used as parameters for effects. Syntax is:
  <texture-set>
   <texture>Terrain/city1.png</texture>
   <texture n="2">Terrain/city1-relief-light.png</texture>
  </texture-set>
  <texture-set>
   <texture>Terrain/city2.png</texture>
   <texture n="2">Terrain/city2-relief-light.png</texture>
  </texture-set>
2010-04-12 07:25:13 +02:00
Tim Moore
e0d02be0f5 Merge branch 'zan/cubemap' into next 2010-04-03 22:49:07 +02:00
Tim Moore
461e6d1b5b Zan's cubemap patch 2010-04-03 22:48:58 +02:00
Tim Moore
d767e6d7eb Merge branch 'fredb/geom-shader' into next 2010-03-30 12:07:50 +02:00
fredb
bff1584012 Geometry shader support 2010-03-30 12:07:38 +02:00
Tim Moore
3d91a11b95 Merge branch 'zan/generate' 2010-03-30 12:04:09 +02:00
Tim Moore
1349b46a8c Merge branch 'jmt/waypt' 2010-03-30 11:53:13 +02:00
Tim Moore
74330ba1dd Merge branch 'timoore/clipgroup' 2010-03-30 11:46:01 +02:00
Tim Moore
64ab227f62 Merge branch 'timoore/effects-anim-rebase' 2010-03-30 11:41:37 +02:00
Tim Moore
1c51fbd1b4 Merge branch 'zan/cloudsort' 2010-03-30 11:40:45 +02:00
Tim Moore
4c2dd553f2 Merge branch 'ehofman/particles' into next 2010-03-27 13:39:55 +01:00
Tim Moore
2fb985afa4 Merge branch 'ehofman/dlerror' into next 2010-03-27 13:39:48 +01:00
ehofman
44c93d5074 Csaba Halasz: fix a compilation error for non-bsd systems that happen to return
const char* from dlerror().
2010-03-27 13:39:37 +01:00
ehofman
dcf07a46aa Allow particles to be frozen on pause. 2010-03-27 13:38:59 +01:00
Tim Moore
284a9e0612 Merge branch 'ehofman/sound' into next 2010-03-16 17:15:34 +01:00
Tim Moore
60349a8690 Merge branch 'ehofman/propfix' into next 2010-03-16 17:15:29 +01:00
ehofman
64072be83c iprovide a slightly more helpfull exception message 2010-03-16 17:15:12 +01:00
ehofman
229abb8412 updated vendor test 2010-03-16 17:14:19 +01:00
Tim Moore
7b1d1fd288 Merge branch 'timoore/clipgroup' into next 2010-03-16 15:44:56 +01:00
Tim Moore
1ca1f6ad22 Remove reference to osgUtil::RegisterRenderBinProxy
This has gone away in recent OSG sources.
2010-03-16 15:42:54 +01:00
Tim Moore
0ad66f4bc4 Merge branch 'zan/generate' into next 2010-03-16 14:27:56 +01:00
fredb
d5757c4fb8 Lauri Peltonen : add the ability to generate tangent vectors for model, terrain or ocean geometry inside the effect file 2010-03-16 14:27:21 +01:00
Tim Moore
7fe40bce86 Merge branch 'jmt/magvar' into next 2010-03-16 14:22:53 +01:00
jmt
5da3d64ede Overload the SGMagVar::update method to take an SGGeod. 2010-03-16 14:22:45 +01:00
Tim Moore
2e93b06ac0 Merge branch 'fred/precip' into next 2010-03-16 14:21:57 +01:00
fredb
1e6aa4b40f Precipitation inside cockpit temporary fix.
Needs a clip distance settable to take account of views and different cockpit size.
2010-03-16 14:21:45 +01:00
Tim Moore
262383395d Merge branch 'timoore/aptsign' into next 2010-03-12 14:32:11 +01:00
Tim Moore
127226c421 Assign texcoords and a color (black) to the backs of airport signs 2010-03-12 14:31:39 +01:00
Tim Moore
fabcb021cb Merge branch 'timoore/effects-anim-rebase' into next 2010-03-11 08:46:22 +01:00
Tim Moore
60ab1ab83e bug fix to animated effect parameters
Some confusion in getting the right property node.
2010-03-11 08:45:58 +01:00
Tim Moore
1f37095087 Merge branch 'timoore/effects-anim-rebase' into next 2010-03-09 11:03:25 +01:00
Tim Moore
93c2f70b64 animate uniform parameters in effects 2010-03-09 11:02:57 +01:00
Tim Moore
b0562df6bb Cleanup of effects parameter animation 2010-03-09 11:02:56 +01:00
Tim Moore
65d6a5c774 Prepare effects animation code to use general functor setters 2010-03-09 11:02:56 +01:00
Tim Moore
650af0f7b0 generalize support for initializing effect parameters from several properties 2010-03-09 11:02:56 +01:00
Tim Moore
cf9de25c25 pass SGReaderWriterXMLOptions object to getGlobalProperty
This supports pathnames relative to a model in effect definitions.
2010-03-09 11:02:56 +01:00
Tim Moore
fc4009aa50 change return value of SGPropertyNode::getPath to std::string
Also get rid of the cached value.
2010-03-09 11:02:56 +01:00
Tim Moore
d04cf4d897 pass SGReaderWriterXMLOptions to effects
This will allow parameters to refer to properties in models, though
that doesn't work yet.
2010-03-09 11:02:56 +01:00
Tim Moore
2e45c67ef2 Merge branch 'zan/stencil' 2010-03-09 10:59:09 +01:00
Tim Moore
b6d8e1f842 Merge branch 'zan/cloudsort' into next 2010-03-03 23:12:49 +01:00
ehofman
284bc364fe Lauri Peltonen: turn on clouds depth sorting 2010-03-03 23:11:01 +01:00
Tim Moore
a050654b4c Merge branch 'jmt/waypt' into next 2010-02-22 09:42:36 +01:00
jmt
7311dae483 Allow a waypoint's target altitude to be modified in-place. 2010-02-22 09:42:28 +01:00
Tim Moore
c57c3cd1d3 Merge branch 'curt/makefile' 2010-02-17 18:01:29 +01:00
Tim Moore
3ec5e85485 Merge branch 'curt/makefile' into next 2010-02-17 07:20:38 +01:00
curt
ff95af0367 Add a missing source file so it will be included with "make dist". 2010-02-17 07:20:21 +01:00
curt
aa9c7d5435 Add a missing .hxx file for "make dist" 2010-02-17 07:20:19 +01:00
Tim Moore
dcc9f33357 Merge branch 'ehofman/sound' into next 2010-02-17 07:19:20 +01:00
ehofman
1ace645505 small fix for when sound is disabled 2010-02-17 07:19:02 +01:00
Tim Moore
dc2b87dce1 Merge branch 'ehofman/config' into next 2010-02-17 07:18:30 +01:00
ehofman
8e47f5d494 John Denker: Fix sneaky bug: 'mylibdir' variable getting trampled. 2010-02-17 07:18:20 +01:00
Tim Moore
333d381f41 Merge branch 'ehofman/config' into next 2010-02-14 19:42:59 +01:00
ehofman
f9b064cc19 Joe User updates by John Denker 2010-02-14 19:42:51 +01:00
Tim Moore
116a6c1b2e Merge branch 'zan/stencil' into next 2010-02-10 15:48:23 +01:00
Tim Moore
c4506b8e6c Merge branch 'ehofman/config' into next 2010-02-10 14:56:36 +01:00
ehofman
6786a7be4a small MacOS fix 2010-02-10 14:55:57 +01:00
ehofman
bb370a304d smnall update for MacOS without framework support 2010-02-10 14:55:57 +01:00
ehofman
fdcf53c688 Properly test for OpenThreads and bail out if it isn't found 2010-02-10 14:55:57 +01:00
Tim Moore
d3f575547c Merge branch 'durk/deadfiles' into next-new 2010-02-06 23:15:09 +01:00
ehofman
68797e51c6 implement a round-robin scheme for random objects to make sure the same type of object is placed at the same spot all the time 2010-02-06 23:12:40 +01:00
durk
c76c55cdee - Remove reference to dead files. 2010-02-06 19:01:58 +01:00
durk
f529ec3018 Update version number. 2010-02-05 11:13:56 +01:00
Tim Moore
ad667be0d7 Merge branch 'fredb/winfix' 2010-02-05 00:23:51 +01:00
fredb
133fa09261 Update version numbers 2010-02-05 00:23:26 +01:00
Tim Moore
acf19cebf8 Stencil operations for effects
From Lauri Peltonen
2010-01-29 19:07:53 +01:00
Tim Moore
5dfa4c0840 Merge branch 'timoore/mat-effect' 2010-01-28 10:31:52 +01:00
Tim Moore
f918602f58 Merge branch 'freb/mingw' 2010-01-28 10:31:40 +01:00
Tim Moore
2cf2dd24a4 Merge branch 'fredb/winfix' 2010-01-28 10:31:11 +01:00
Tim Moore
eefb069d08 Create a different default effect for objects that have material animations 2010-01-27 18:42:48 +01:00
fredb
3dcffc7df8 MINGW patch from Benot Laniel 2010-01-25 14:35:45 +01:00
fredb
b121277142 Update MSVC 9 projects 2010-01-25 14:35:26 +01:00
fredb
d283fcf7b4 Update SimGear version 2010-01-25 14:35:24 +01:00
Tim Moore
e7f151ad02 Merge branch 'ehofman/sound' 2010-01-25 14:02:02 +01:00
Tim Moore
0710b781d3 Merge branch 'torsten/geoequal' 2010-01-25 14:01:52 +01:00
Tim Moore
7c01ad6917 Merge branch 'durk/version' 2010-01-25 14:00:42 +01:00
ehofman
56d2f06631 Silently ignore previous errors to prevent halting the program on silly errors 2010-01-21 11:07:58 +01:00
ehofman
9e47911b19 define _device so testForALCError can use it initialized.. 2010-01-21 11:07:58 +01:00
durk
ef80497fbe Let the version number reflect the current state of the release process. 2010-01-21 06:15:18 +01:00
fredb
e22cf106c2 Change version in comment 2010-01-21 06:13:06 +01:00
fredb
5ffb270ec1 Update simgear config.h version 2010-01-21 06:12:55 +01:00
fredb
f85f3b0f25 Update MSVC 9 project 2010-01-21 06:12:40 +01:00
fredb
e7ec83d626 Win32 fixes 2010-01-21 06:12:30 +01:00
Tim Moore
11479cd8c3 Merge branch 'ehofman/sound' 2010-01-16 23:49:36 +01:00
ehofman
176e760de1 test for an AL or ALC error before calling an ALUT function. 2010-01-16 15:50:29 +01:00
Tim Moore
430c60ed1a Merge branch 'ehofman/sound' 2010-01-13 07:57:35 +01:00
Tim Moore
dfea3623f6 Merge branch 'tat/framework' 2010-01-13 07:57:30 +01:00
Tim Moore
b38783e4cb Merge branch 'ehofman/subsys' 2010-01-11 07:15:11 +01:00
Tim Moore
9382a4c21b Merge branch 'jester/aptsign' 2010-01-11 07:14:51 +01:00
Tim Moore
3cd4c5566f Merge branch 'timoore/effects' 2010-01-11 07:14:23 +01:00
Tim Moore
601c0977df Merge branch 'jmt/geodistance' 2010-01-11 07:10:46 +01:00
ehofman
c56f036bab Tatsuhiro Nishioka:
These patches fixes minor bug in addition to providing --with-openal-framework and --with-cocoa-framework.
Now you can use your own version of OpenAL.framework for selecting various audio output device.
Plus, you can build FG/SG on Snow Leopard with cocoa configuration.
2010-01-05 22:12:37 +01:00
torsten
44dd50c0ef Csaba Halasz:
Fix airport signs by reverting to rev 1.22 of apt_sign.cxx. Tweaked a little to handle missing materials better.
2010-01-05 22:11:57 +01:00
ehofman
56919ae45f MacOS returns an unsopported AL error when a file is not found, work around this. 2010-01-05 22:10:22 +01:00
torsten
6c14e7127d add "operator == ()" to SGGeod and SGGeoc 2010-01-03 10:10:32 +01:00
jmt
578af00b0d Allow geocentric distance computations to return radians. 2010-01-03 10:10:02 +01:00
Tim Moore
d6c0bf69b6 fix up some merge weirdness 2010-01-01 13:32:03 +01:00
ehofman
e8884b4ec0 Also unbind subsystem groups in reverse order and destruct them in reverse order to be consistent. 2009-12-31 19:42:53 +01:00
ehofman
5e79609955 unbind in reverse order to try to prevent order dependency problems. 2009-12-30 00:20:08 +01:00
ehofman
4950c96f1c Rearrange alut error checking a bit 2009-12-30 00:05:01 +01:00
jmt
51b0cf535e XML encodings: support 'ASCII' as an alias for 'US-ASCII' 2009-12-29 23:53:28 +01:00
ehofman
4cc17a7f6e keep a pointer to the OpenAL vendor and renderer for reference 2009-12-27 09:24:24 +01:00
Tim Moore
dca07c5634 Merge branch 'timoore/effects'
Conflicts:
	simgear/scene/model/model.cxx
	simgear/scene/sky/newcloud.cxx
2009-12-20 16:07:00 +01:00
Tim Moore
fd42294faf Merge branch 'ehofman/sound'
Changed include of SGQuat.hxx to SGMath.hxx in
sound/sample_openal.cxx; somehow this happened in a merge commit when
the sound branch was merged to next.
2009-12-20 11:46:28 +01:00
ehofman
c1246e8c4e proper typecasting 2009-12-14 22:46:22 +01:00
Tim Moore
59fc902cfb don't render an EffectGeode if there is no valid technique
Normal geometry has a default effect; geometry with no default effect
is unlikely to look correct with no state set applied. This fixes the
problem of clouds being displayed as multi-colored rectangles when
shader effects are turned off.
2009-12-14 06:52:00 +01:00
ehofman
1fe9755d01 fix a typo. 2009-12-12 00:03:41 +01:00
ehofman
1da09a4706 Don't assign the buffer data to the sample in case it is a file. Test for result when calling load() 2009-12-12 00:03:40 +01:00
ehofman
f3c591469b Fix crash in SGSoundMgr::stop(): do not try to erase buffer items one at a time 2009-12-12 00:03:40 +01:00
ehofman
b1200f9f59 add alcSuspendContext and alcProcessContext again to prevent sound artifacts on hardware accelerated soundcards. 2009-12-06 23:55:08 +01:00
ehofman
47617d6c04 check if suspend, resume and volume changed much from the previous value before setting them. 2009-12-03 06:38:23 +01:00
ehofman
4794ab6095 Fix runtime switching of sound devices. 2009-12-03 06:38:12 +01:00
ehofman
bc85767f19 Updates to allow runtime chaning of the sound device 2009-11-30 22:41:14 +01:00
Tim Moore
e37c218c2a take locks out of ModelRegistry
They should be unnecessary and were causing deadlock with Effects that
load images.
2009-11-29 22:54:02 +01:00
ehofman
a0aaa23904 Add a function to retreive all available playback devices. 2009-11-29 13:04:39 +01:00
ehofman
27a6c72091 initialize volume to a proper value 2009-11-29 13:04:39 +01:00
ehofman
2dcc66f03e Small bugfix 2009-11-29 13:04:38 +01:00
ehofman
d70a05a088 Make it possible to specify a different device name 2009-11-29 13:04:38 +01:00
Tim Moore
c2317edf8a Revert boost requirement to 1.37
I don't want to get into testing for tr1::unordered_map, and the
boost compatibility doesn't exist in 1.34.
2009-11-29 12:42:10 +01:00
Tim Moore
cb7ac404d9 Merge branch 'ehofman/sky' 2009-11-26 23:28:34 +01:00
Tim Moore
5abc6c995f fix a memory leak in newcloud.cxx 2009-11-26 16:30:46 +01:00
ehofman
0f21c39e49 a slightly more readable version of the test 2009-11-26 16:05:46 +01:00
ehofman
f6513127ce Also test for older versions of OpenAL-Sample 2009-11-26 16:05:45 +01:00
Tim Moore
ddd72b2b37 Use an effect for 3d clouds 2009-11-26 11:40:41 +01:00
Tim Moore
7f5df1fb66 Support for shader program attributes in effects
Also, use a hash table for the effect shader program cache.
2009-11-26 11:39:34 +01:00
Tim Moore
2e71b64de1 Better error reporting for effects
Throw an exception when an undefine attribute value is found in an effect.

Also, fix a typo in TexEnvCombine operand attributes.
2009-11-26 11:32:00 +01:00
Tim Moore
45f1f9263f add a property debugging function 2009-11-26 10:38:31 +01:00
ehofman
878288f06a Don't forget to apply the doppler adjustment factor to the listener velocity also 2009-11-24 14:17:54 +01:00
ehofman
406cdf8d16 test for implementations with 'bad' doppler effects and adjust for it. 2009-11-24 14:17:54 +01:00
ehofman
5b28b024ae fix test programs 2009-11-24 14:17:54 +01:00
ehofman
7c693d8107 proper listener velocity calculation, this has no effect yet but is required when other models start emitting sounds. 2009-11-24 14:17:54 +01:00
Tim Moore
b8a6d1ac4d add depth attribute to Effect 2009-11-23 09:15:47 +01:00
Tim Moore
40533f50df Drop required Boost version from 1.37 to 1.34
Use boost/tr1 to bring in std::tr1::unordered_map instead of the Boost
version.
2009-11-22 23:05:11 +01:00
Tim Moore
539ced191b Move tree shaders to an effect
Also, improve effect hash keys.
2009-11-22 00:32:51 +01:00
Tim Moore
1a400b890b Effect file support for GL_VERTEX_PROGRAM_TWO_SIDE and POINT_SIZE 2009-11-22 00:27:53 +01:00
Tim Moore
ebe5a5579c shader language predicate 2009-11-20 22:59:15 +01:00
ehofman
afb18ca75b the wrong name also mislead me: rotate velocity to the proper quat 2009-11-19 23:01:49 +01:00
ehofman
01c62932bd make the relative positions fixed against the body again. 2009-11-18 23:25:55 +01:00
ehofman
6cd8db7b28 Set to default distance attenuation function but change the parameters a but for better sound effects (and most of all quieter sounds at greta distance 2009-11-18 23:25:51 +01:00
ehofman
bb46d91bc6 What do you know, the real problem turned out to be the distance attenuation function.. 2009-11-17 06:43:41 +01:00
Tim Moore
3cd5322496 descend into Effects to find default material animation values 2009-11-16 22:43:41 +01:00
Tim Moore
cadecdcab7 add a transparent texture for effects
This is used as a default texture for the chrome animation.

Also, fix a typo in creating combiners.
2009-11-16 22:42:46 +01:00
Tim Moore
cd4030b7db Make MultiChangeListener derive publicly from SGPropertyChangeListener
Otherwise it doesn't work as a listener!
2009-11-16 22:39:56 +01:00
Tim Moore
0a2264cad4 When instantiating effects, copy user data of any created nodes.
This bug was the cause of the huge memory consumption / death reported at some places:
the BVH data on "raw" .ac models (random objects) was dropped on the floor.
2009-11-15 23:51:08 +01:00
Tim Moore
bb2a02daa8 Bump boost version to 1.37 2009-11-15 01:17:34 +01:00
Tim Moore
5991195062 optimize creation and sharing of effects
Implement equality test and hash for for property trees.  In an
Effect, make a hash table of Effects that inherit from it keyed on
their unmerged property tree. Using that, makeEffect() should return a
single Effect for given property tree description. Animations may
change that in the future...
2009-11-13 22:41:11 +01:00
Tim Moore
54c4055af3 Effects in models working for transparent materials and chrome animation
Implementation of animated effect values via the property system.

Add names for TexEnvCombine attributes
2009-11-13 22:41:11 +01:00
Tim Moore
cb07210bc7 Move Texture unit builder into TexBuilder.cxx
Do the refactoring necessary to make that work.
2009-11-13 22:41:11 +01:00
Tim Moore
3e40d624a8 Effects for models
Basically working, at last. Among other things, create effects in
 models loaded directly from .ac files; this can happen, for example,
with the random models from the materials library.
2009-11-13 22:41:11 +01:00
Tim Moore
63ce675914 Splicing visitor for rewriting scene graphs with a minimum of copying 2009-11-13 22:41:11 +01:00
Tim Moore
14e5e87a4d Dump texture attributes of StateSet into effect property tree
Also, decode blend function.
2009-11-13 22:41:11 +01:00
Tim Moore
e7e81c6639 getStateAttribute utility function
This provides a concise, typesafe way to get attributes from osg::StateSet.

Also, blew away BackRefInserter.
2009-11-13 22:41:11 +01:00
Tim Moore
23d0601d82 Add support for blend functions and alpha test functions in effects 2009-11-13 22:41:11 +01:00
Tim Moore
6db9138eeb wip for effects in models
multi-index for effect attributes
2009-11-13 22:41:10 +01:00
Tim Moore
6a7c200002 remove CopyPolicy from ModelRegistry
Put the responsibility for copying a loaded model directly in
SGReaderWriterXML.
2009-11-13 22:41:10 +01:00
ehofman
e3f70b7125 temporarily remove listener (viewer) and source offsets. they mess things up 2009-11-12 22:59:43 +01:00
Tim Moore
a25e859fa7 fix typo 2009-11-10 22:10:57 +01:00
ehofman
5b2af1f6b3 also recalculate the velocity in update_pos_and_orienation, so pass the north-east-down velocity directly and orientate position, orientation and velocity to OpenGL/OpenAL frames (x-right, y-up and z-back) 2009-11-10 16:29:16 +01:00
ehofman
59df72c4b0 allow sound effects in the configuration file to be added to the 'avionics' sample group by setting '<type>avionics</type>'. 2009-11-10 06:42:26 +01:00
Tim Moore
4e2eb2f24c Move propertyExpression code from flightgear to simgear
Also add a function (possibly redundant) to access the global property
root.
2009-11-09 15:53:10 +01:00
Tim Moore
b905f4b8aa Property system optimizations
Profiling startup with the new effects code exposed some performance
gotchas. The objective is to reduce allocation of std::string
temporaries, especially when looking up node path names. Also, I
changed some paths to initialize strings with strings instead of char *;
this causes less allocation, at least with glibc. Also, eliminate
the old version of find_node and its helper functions by writing the
template version of find_node_aux to handle an explicit index
parameter.

Also, add const char[] as an internal property type

This doesn't actually add a new type to the property system, but allows using
character arrays as arguments to certain templates.
2009-11-09 15:52:54 +01:00
ehofman
fefe87ed1e Remove old MSVC6.0 files that doen't work anymore 2009-11-09 10:45:15 +01:00
ehofman
b66905c2f6 Oops, it was the scenery up vector, not the viewer up vector 2009-11-07 08:52:16 +01:00
ehofman
39472e4d81 Save a costly SGVec3d::fromGeod() calculation 2009-11-07 08:52:16 +01:00
ehofman
85fba1325a pass the geodetic position and view orientation to the sky reposition function 2009-11-05 16:17:29 +01:00
ehofman
0f39f05fa1 small fixes 2009-11-04 23:05:22 +01:00
ehofman
8d551c2664 fix directional sound orientation 2009-11-04 23:05:21 +01:00
ehofman
346a22f684 adjust to recent changes 2009-11-04 23:05:21 +01:00
ehofman
b1571e4437 some small fixes 2009-11-04 23:05:21 +01:00
ehofman
5ac2abe3ab Remove more unneeded code and properly set relative position and sound direction 2009-11-02 23:20:59 +01:00
ehofman
5b15426cc6 Small code reorganization, mostly removing unneeded code 2009-11-02 23:20:59 +01:00
ehofman
1ac944b7c1 Position and orientation fixes thanks to Tim Moore (finaly). Code optimizations by moving code over from SGSoundSample to SGSampleGroup which means it will only run once for every sample group instead of once for every sample. 2009-11-02 23:20:58 +01:00
ehofman
fd90dbb123 silently clip pitch and gain to their maximum values 2009-11-01 21:52:37 +01:00
ehofman
6ccad91537 proper orientation(?) and comment out relative position and direction code since it messes with OpenAL in such a way that volume doesn't work properly anymore 2009-11-01 21:52:37 +01:00
ehofman
c89db53ebf another attempt at getting something useful without any result. 2009-10-31 22:55:32 +01:00
ehofman
4ffd70a42a fix a typo 2009-10-31 22:55:26 +01:00
ehofman
bbeb48a60d fix a gcc version test 2009-10-31 22:55:18 +01:00
ehofman
aefe9bc116 MacOS X fix 2009-10-31 22:54:46 +01:00
ehofman
bcb95f647d add relative pos back in 2009-10-31 00:03:27 +01:00
ehofman
145a7fa146 pass the float pointer to the isNaN function instead of the SGVec3 type 2009-10-29 23:04:17 +01:00
ehofman
06f0b6030a multiply quats in the right order 2009-10-29 23:04:17 +01:00
ehofman
191ee3a0ed Commit the current state of affairs to see if it fixes the position code for others 2009-10-29 23:04:17 +01:00
ehofman
f6358694ae another test program, using real world locations 2009-10-29 23:04:17 +01:00
ehofman
af14d65a98 Fix a bug where a sample was removed from the sample list before it was stopped. Proper listener orientation when inside the airplane (need to find a good solution for outside view). 2009-10-28 23:16:19 +01:00
ehofman
9fe75dc521 also test for NaN in listener code 2009-10-27 22:15:11 +01:00
ehofman
0051bea034 small code reorganization and addition of debugging tests. 2009-10-27 22:15:11 +01:00
ehofman
76c79dba8e FGViewer::recalcLookFrom turned out to be an excellent source of information for prosition and orientation 2009-10-26 23:07:47 +01:00
ehofman
84dc82506a re-enable sound positioning and velocity, test for NaN's and print a message when it happens (debugging, should be removed later on). 2009-10-26 18:50:00 +01:00
ehofman
ae1625734c move all isnan() declarations from sample_group.cxx to compiler.h since it's too important not to have available everywhere. 2009-10-26 18:49:57 +01:00
Tim Moore
e2ce4c0fa9 More include SGMath.hxx to keep MSVC happy 2009-10-26 18:37:27 +01:00
ehofman
a06a15e769 Use shared pointers for any reference to SGSoundSample, fix the constructor of SGSoundSample where data is supplied by the calling program. 2009-10-24 19:29:41 +02:00
ehofman
7c5de29b61 get rid of aut_ptr, it only works with objects that can destroyed with delete (and not even delete[]) which is too limited. take drastic actions to find the sound-not-playing-bug: set all positions and orientations to default all the time. 2009-10-24 19:29:41 +02:00
ehofman
5f9befebae .. and remove some debugging code 2009-10-22 22:52:05 +02:00
ehofman
6a7b885891 revert some test code 2009-10-22 22:52:05 +02:00
ehofman
cd8e7bbdca should use free instead of delete for malloced data. 2009-10-22 22:52:05 +02:00
ehofman
5d731ad8c3 a few more temporarty debugging statements 2009-10-22 22:52:05 +02:00
ehofman
7964270929 fix a memory leak and add some temporary debugging statements. 2009-10-22 22:52:05 +02:00
ehofman
ea513d392e Updates to the test utilies. 2009-10-22 22:52:05 +02:00
ehofman
feba9024eb Fix a pause situation where more code was executed than expected. Unbind an OpenAL buffer from an OpenAL source when requested to stop playing. 2009-10-21 16:25:29 +02:00
ehofman
b3e16ce8e0 use auto_ptr instead 2009-10-19 23:50:17 +02:00
ehofman
31dd77c694 do not yet add the relative sound position to the absolute position, it's generating NaN's at the moment. Fix a bunch of other small bugs 2009-10-19 23:50:17 +02:00
ehofman
ae58f89fbf sigh, forgot another alut* at the wrong place. 2009-10-19 23:50:17 +02:00
ehofman
b3bc36b253 restore some part of the code to prevent an untwanted segmentationf fault. 2009-10-18 18:07:19 +02:00
ehofman
7287509fef Start the sound manager in a deactived state. This means the code now has to activate it explicitly when desired. A non active state means the update function will no be executed. 2009-10-18 18:06:55 +02:00
Tim Moore
b1c49045a8 forward declare Point3D in sg_types.hxx
This avoids sucking in SGMath.hxx -- and therefore a bunch of OSG headers --
into many compilation units.
2009-10-18 12:11:13 +02:00
ehofman
0d5634475c Don't delete the sample data if it wasn't constructed as a file. It's now deleted when calling free_data() by the owner or in the destructor. 2009-10-18 12:07:38 +02:00
ehofman
e6bfe7d40c revert to previous version 2009-10-18 12:07:25 +02:00
ehofman
811cd0653f make sure update_late isn't executed when dt=0 2009-10-17 23:47:20 +02:00
ehofman
e2b8a21ff5 documentation, licensing, copyright and small api updates. 2009-10-17 23:47:06 +02:00
ehofman
24c7941f65 convert _relative_pos to a vector of doubles and set the relative offset 2009-10-17 13:39:34 +02:00
ehofman
600a9ee4c5 _data is not an array of pointer 2009-10-17 13:39:34 +02:00
ehofman
fdfdfedf01 Alut < 1.0 fixes and finaly fix the sound orientation 2009-10-17 13:39:33 +02:00
ehofman
a67688322d Initialization was done much earlier than expected resulting in some sample
groups not being activated (and sample loading using OpenAL/ALUT functions to
be scheduled before OpenAL was initilialized).

fix alutInit counter
remove left over static declaration fro SGSoundMgr::load
2009-10-16 11:14:05 +02:00
ehofman
6fe057e277 add a debugging statement 2009-10-16 11:14:05 +02:00
ehofman
f23e8bfb02 fix for latest changes 2009-10-16 11:14:05 +02:00
ehofman
eab9da98f2 give the sample class as much info as possible to properly position and orientate the sounds. unfortunately at this time orientation seems to be from straight behind which means that sounds that have outer-gain set to 0.0 will not be heard yet. 2009-10-16 11:14:05 +02:00
ehofman
f161992836 Alex Buzin:
I got an error with the Sunday CVS - FG crashed while exiting .
gdb reports SIGSEGV error at file soundmgr_openal.cxx, line 159.

Error was fixed by changing lines 157-159 from:
        buffer_map_iterator buffers_current = _buffers.begin();
        buffer_map_iterator buffers_end = _buffers.end();
        for ( ; buffers_current != buffers_end; ++buffers_current ) {
to :
        buffer_map_iterator buffers_current;
        while(_buffers.size()){
            buffers_current = _buffers.begin();
2009-10-14 00:34:39 +02:00
Tim Moore
40e13b91fe Merge branches 'toresten/geofix', 'jmt/lcase', 'stuart/clouds' and 'jmt/dump' 2009-10-12 10:03:00 +02:00
ehofman
af6824605b proper naming is everything 2009-10-12 00:01:42 +02:00
ehofman
babf58f8d2 Correct (and verrified) position, orientation and velocity vector. Todo: proper sound orientation (the all face forward using the airplane orientation now) and disabling doppler effect when tied to the listener 2009-10-12 00:01:07 +02:00
ehofman
968f5d7693 OpenAL buffer management; add a buffer cache to prevent loading the same sample in memory twice. Especially useful to save memory for multi-aircraft configurations and (later) for AI models. 2009-10-12 00:00:53 +02:00
ehofman
4cc6bd69ae add the option to tie a SampleGroup to the listener position and orientation 2009-10-08 10:17:11 +02:00
ehofman
199437e859 alut pre-1.0 doesn't support aletGetError but then again, this function doesn't get called in that case either so just comment it out at build time 2009-10-08 10:17:11 +02:00
jmt
e5fac0a01d Update the screen-dump code to use osgDB, and hence write out files in more common formats (PNG, JPEG, etc). The PPM writing code is retained for the moment, in case someone other than FG is relying upon it. 2009-10-07 08:20:50 +02:00
ehofman
5d14b84969 fix a typo 2009-10-07 08:19:47 +02:00
ehofman
bcccd06cee (try to) properly align model and viewer 2009-10-07 08:19:33 +02:00
ehofman
6b0ab9a49a default listener (master volume) default to 0.0 to save some ugly code in FlightGear 2009-10-06 07:22:06 +02:00
ehofman
023002ae73 add the alc.h header file vor OpenAL context related code 2009-10-06 07:22:06 +02:00
ehofman
579d384c04 Rename update() to update_late() for the sound manager to be able to initialize it before any other class that uses it. This will allow the SoundManager to be safely accessed in the constructor of those classes. 2009-10-06 07:22:06 +02:00
ehofman
e2e1524454 Initial commit of the new sound system, expect more updates to follow 2009-10-06 07:22:06 +02:00
durk
4a5853c1c2 Stuart Buchanan:
Improvements to the cloudsystem:
        - A new xml format
        - Texture indexing based on the position of the sprite in the cloud
          mass, allowing more control over the texture set.
        - Improved fog and shading
        - Better sprite distribution
        - A more natural distribution of clouds, so no more obvious grids.
2009-10-04 01:41:21 +02:00
Tim Moore
64756d14d0 Back out convertToLowerCase function
It brought in an OSG dependency; we'll just use boost::to_lower_copy instead.
2009-10-01 00:31:36 +02:00
Tim Moore
bac2ef601d Merge branch 'jmt/lcase' into next 2009-09-28 23:51:07 +02:00
Tim Moore
cf3bab89f9 Merge branch 'master' into next 2009-09-28 23:50:56 +02:00
jmt
dfe41ad984 Extend simgear::strutils with convertToLowerCase helper - currently a proxy for osgDB helper of the same name. 2009-09-28 23:50:08 +02:00
ehofman
b784bebaa9 just small fixes 2009-09-28 23:40:06 +02:00
torsten
bcf727cf58 Catch a possible floating point error in SGGeodesy::SGCartToGeod() for cartesian coordinates close to the geocenter region. 2009-09-22 22:44:38 +02:00
Tim Moore
ecd0a53412 Add writeLocalData functions for internal scenegraph classes
This makes the scenegraph dump more complete and therefore more useful.
2009-09-22 12:56:28 +02:00
Tim Moore
3456434e37 check for null effect in EffectCullVisitor
An EffectGeode might not have any effect.
2009-09-18 15:43:46 +02:00
Tim Moore
454c5b1ed2 Merge branch 'tat/configure' into next 2009-09-17 12:25:19 +02:00
torsten
dc2c437a1a Tatsuhiro Nishioka:
Patches for configure.ac and Makefile.am files in FG/SG so Mac developers can build these in a unix way.
These also enables Mac developers to choose either PLIB framework or PLIB static libs.
2009-09-17 12:24:56 +02:00
Tim Moore
819d3f5ded Merge branch 'topic/projection' into next 2009-09-17 12:22:06 +02:00
frohlich
4f802689f2 Correct finite precision issues.
Use consistent function names.
Implement changes consistently over the different vector sizes.

Modified Files:
	SGVec2.hxx SGVec3.hxx SGVec4.hxx
2009-09-17 12:21:42 +02:00
Tim Moore
9cbbe55598 Merge branch 'frohlich/weak' into next 2009-09-17 12:18:33 +02:00
frohlich
7e2dafdcb8 Make the weak pointer work. Some bits were left when importing.
Modified Files:
	SGSharedPtr.hxx SGWeakPtr.hxx
2009-09-17 12:18:07 +02:00
jmt
c7873d68f7 Logging:less verbose sound loading. 2009-09-17 12:13:47 +02:00
jmt
939ec526a8 Logging: quiet down STG parsing. 2009-09-17 12:13:47 +02:00
jmt
b20a635db0 Logging: quiet down model/image loading policy. 2009-09-17 12:13:47 +02:00
jmt
a656bee0df Logging: quiet the BVH building policy. 2009-09-17 12:13:47 +02:00
jmt
42f07e3f14 Logging: quiet material loading. 2009-09-17 12:13:47 +02:00
jmt
5803b05bd5 Logging - downgrade play/stop messages to debug. 2009-09-17 12:13:47 +02:00
John Denker
ccf0ba50c4 Implement vector _projection_ functions. 2009-09-09 23:28:16 +02:00
John Denker
f3bc977d32 Make "repeat" start slower on pick-animation mouse events;
otherwise it is unusable.
2009-09-09 22:54:13 +02:00
ehofman
80609e0816 Dont execute code in case the soundmanager isn't properly initialized 2009-09-09 08:39:56 +02:00
frohlich
795d481ca6 Switch to new vector conversion functions.
Modified Files:
	simgear/math/SGGeod.cxx simgear/math/SGQuat.hxx
	simgear/math/SGVec2.hxx simgear/math/SGVec3.hxx
	simgear/math/SGVec4.hxx simgear/scene/material/Effect.cxx
	simgear/scene/model/SGInteractionAnimation.cxx
	simgear/scene/model/SGMaterialAnimation.cxx
	simgear/scene/model/SGRotateTransform.cxx
	simgear/scene/model/SGScaleTransform.cxx
	simgear/scene/model/SGTranslateTransform.cxx
	simgear/scene/model/animation.cxx
	simgear/scene/model/particles.cxx
	simgear/scene/model/placement.cxx
	simgear/scene/model/shadanim.cxx
	simgear/scene/sky/CloudShaderGeometry.cxx
	simgear/scene/sky/cloud.cxx simgear/scene/sky/cloudfield.cxx
	simgear/scene/sky/dome.cxx simgear/scene/sky/sky.cxx
	simgear/scene/tgdb/GroundLightManager.cxx
	simgear/scene/tgdb/SGOceanTile.cxx
	simgear/scene/tgdb/SGTexturedTriangleBin.hxx
	simgear/scene/tgdb/SGVasiDrawable.cxx
	simgear/scene/tgdb/TreeBin.cxx simgear/scene/tgdb/obj.cxx
 	simgear/scene/tgdb/pt_lights.cxx
	simgear/scene/util/SGUpdateVisitor.hxx
2009-09-09 08:39:55 +02:00
frohlich
1b936b9af8 Fix problem with ocean files not recognized as water.
Move dynamic casts to EffectGeode into the findMaterial method.

Modified Files:
	simgear/scene/material/matlib.cxx
	simgear/scene/material/matlib.hxx
	simgear/scene/model/BoundingVolumeBuildVisitor.hxx
2009-09-09 08:39:55 +02:00
frohlich
f141cc28b0 Add some comments.
Make sure floating point constants do not introduce useless upcasts.
Remove now unused and not really usefull method.

Modified Files:
	simgear/math/SGQuat.hxx
2009-09-05 17:01:58 +02:00
ehofman
4cb64b58be Also install coremag.hxx since it is being used by JSBSim now 2009-09-05 17:01:58 +02:00
frohlich
028af34d3d Remove unused member.
Modified Files:
	simgear/scene/util/SGSceneFeatures.hxx
2009-09-05 17:01:58 +02:00
frohlich
ce54997be5 Should be now more easy to make use of SGMath without having osg.
Modified Files:
	simgear/scene/sky/dome.cxx simgear/math/SGGeod.cxx
	simgear/math/SGGeod.hxx simgear/math/SGQuat.hxx
	simgear/math/SGVec2.hxx simgear/math/SGVec3.hxx
	simgear/math/SGVec4.hxx
2009-09-05 17:01:58 +02:00
frohlich
3d213fa713 Return a osg::Vec value instead of a non const reference.
Modified Files:
 	scene/model/SGMaterialAnimation.cxx
2009-09-05 17:01:58 +02:00
frohlich
e71f3790ce Avoid the non const SGVec*::osg() method.
Modified Files:
 	SGTranslateTransform.cxx SGScaleTransform.cxx
 	SGRotateTransform.cxx
2009-09-05 17:01:58 +02:00
frohlich
67b9cba4d3 Use const refs for const data.
Modified Files:
 	simgear/scene/model/CheckSceneryVisitor.hxx
	simgear/scene/model/CheckSceneryVisitor.cxx
2009-09-05 17:01:58 +02:00
torsten
78a471f684 Spare one node in the scenegraph if there is no <offsets> 2009-09-02 23:43:13 +02:00
timoore
d4289c5d54 Change trees code to use a faster OpenGL path
The (random) dimensions of a large number of trees is stored in an
array shared by all the tree geodes. The coordinates of the origin of
each tree are replicated in an another array. This allows an entire
block of trees to be rendered with a few OpenGL calls, instead of one
function call per tree.
2009-08-25 16:14:13 +02:00
torsten
0c17c5440a support osgText in models 2009-08-25 09:11:27 +02:00
torsten
c4116da564 support osgText in models. See docs/README.osgtext for details 2009-08-25 09:11:27 +02:00
torsten
d0821953bb Don't load materials without a name 2009-08-23 21:37:03 +02:00
torsten
e782adef94 Avoid NAN due to floating point rounding errors 2009-08-23 21:37:03 +02:00
ehofman
d3572c2562 prevent division by zero 2009-08-23 21:37:03 +02:00
torsten
1f3838b155 Alan Teeder: fix incomplete dbg_printf for non-gcc. 2009-08-23 21:37:03 +02:00
torsten
6aa459073e don't build tabbed_value_test, swap_test, openal_test1 and openal_test2 by default. 2009-08-23 21:37:03 +02:00
torsten
0932c33185 warning fix: unused variables 2009-08-23 21:37:03 +02:00
torsten
5e542aa841 extinguish many warnings (at least for gcc) 2009-08-23 21:37:03 +02:00
torsten
6d53abd5af warning fix: initializing members in the order they are declared keeps gcc happy 2009-08-23 21:37:03 +02:00
torsten
3ea58bf8db warning fixes 2009-08-23 21:37:03 +02:00
torsten
71a4c2c3d2 extinguish many warnings (at least for gcc) 2009-08-23 21:37:03 +02:00
torsten
a3e391a523 warning fix: abort program and spit out a message if getNumPrims() is called with unknown mode. (Shouldn't happen anyway) 2009-08-23 21:37:02 +02:00
torsten
9cb15b302c warning fix: unused variable 2009-08-23 21:37:02 +02:00
torsten
15c1a28d37 warning fix, unused code 2009-08-23 21:37:02 +02:00
torsten
d3a500e54e don't use uninitialized variables 2009-08-23 21:37:02 +02:00
torsten
a0a5eb8aef warning fixes 2009-08-23 21:37:02 +02:00
torsten
a92955eade warning fixes 2009-08-23 21:37:02 +02:00
torsten
f043f3d4f9 warning fixes 2009-08-23 21:37:02 +02:00
torsten
992a057a1b warning fix (multiline comment) 2009-08-23 21:37:02 +02:00
torsten
07da1e7e1a warning fix 2009-08-23 21:37:02 +02:00
torsten
2c07222ef6 warning fixes 2009-08-23 21:37:02 +02:00
torsten
918e315d47 Warning fix: array subscript is above array bounds 2009-08-23 21:37:02 +02:00
ehofman
c824731bc6 Expose the color of the sun (which is not the scene specular color anymore) 2009-08-23 21:37:02 +02:00
ehofman
0c39caa622 Differentiate between sun color (based in visibility) and scene color (based on humidity) 2009-08-23 21:37:02 +02:00
torsten
1f1e28baf8 Stuart Buchanan: I've been working on a small patch to allow trees to be grouped together into woods. This allows what seems to me to be a more realistic grouping of trees for farmland in particular. 2009-08-09 23:56:10 +02:00
fredb
0c303389d6 Compile under MSVC9 2009-08-09 23:56:10 +02:00
timoore
01a896ef5b New effects from Till Busch: crops, water, landmass
As shown at LinuxTag, with modifications from Tim Moore: the base
landmass texture is mixed with the steepness and snow effects. Till's
new syntax for textures in effect files was also added. syntax for
textures. Also, syntax for accessing internal textures, such as Till's
3D noise texture, was added.

Several bugs in the effect inheritance algorithm were fixed.
2009-08-09 23:56:10 +02:00
torsten
0e5e760135 Allow multiple <button> elements for <action> elements in pick animations. Nice to have to have a single action for mouse-button and mouse-wheel. 2009-08-08 00:49:40 +02:00
fredb
7e7d877874 Fix case typo 2009-07-27 23:47:15 +02:00
fredb
57ccb6fd6b Suppress warnings 2009-07-27 23:47:15 +02:00
fredb
efa2876e29 Compile latest SimGear under MSVC9 2009-07-27 23:47:15 +02:00
Tim Moore
59ef7d8fd1 Create a singleton for the parser table 2009-07-19 23:05:04 +02:00
Tim Moore
1f308c9ec3 Move definition of SGRawBase<...>::printOn out of simgear namespace
They are declared in the global namespace, and MSVC insists that they be
defined there.
2009-07-19 22:39:16 +02:00
Tim Moore
4943d3aa53 Add missing return statements 2009-07-18 10:12:59 +02:00
Tim Moore
828d561113 Store material data with Effect
Somehow this got left out, which broke ground intersection queries.
2009-07-17 16:18:12 +02:00
Tim Moore
fcf72a7123 Change references to property types
BOOL, FLOAT etc. conflict with typedefs in windows.h, so these types
are referred to using the props:: namespace.
2009-07-17 14:52:58 +02:00
Tim Moore
d3f5bc6e2d Changed SGRawValue::DefaultValue to an inline function.
This avoids MSVC bugs in declaring templated specializations of static members.
2009-07-17 11:40:36 +02:00
Tim Moore
f525a05be8 Use SGAtomic's compareAndExchange instead of a new SGSwappable class
Also, eliminate the __declspec(32) of that class which is causing problems
in osg::buffered_object.
2009-07-17 00:29:48 +02:00
Tim Moore
fc7ec4299e include file change to make simgear work with OSG 2.9.X again 2009-07-16 23:09:10 +02:00
Tim Moore
21d053b1b6 Fix effects code to work with OSG 2.8.2-rc4 2009-07-16 18:33:27 +02:00
Tim Moore
68e64a5aa7 Use std::back_inserter instead of my local hack
BackRefInsertIterator is probably broken and may not be needed at all.
2009-07-16 13:02:07 +02:00
timoore
8e718fe288 Add new Effects files to vcproj 2009-07-16 12:09:45 +02:00
timoore
efec9070e1 Fixes for technique predicates
Get tests based on properties and OpenGL extensions working.
2009-07-16 12:09:44 +02:00
timoore
e3646d4d4a more effects features
Materials can specify an effect.

Add support for PolygonMode and initial support for Uniform.
2009-07-16 12:09:44 +02:00
timoore
4219f16f61 Construct effects from property lists
The material code constructs a property list from its input parameters.

Enable dumping of Pass and Technique objects to a file.

Default effect now uses texture node instead of texture0
2009-07-16 12:09:44 +02:00
timoore
c3b1802e95 materials use only simgear::Effect
Eliminate SGMaterial::get_state function.

Use Effect in BVH visitor, ocean tile generation, and airport signs.
2009-07-16 12:09:44 +02:00
timoore
40fe078021 Use Effect to implement point lights
This allows different OpenGL features (point sprites, point attenuation) to
be used depending on hardware support.
2009-07-16 12:09:44 +02:00
timoore
a5a6600e74 Use SGExpressions for evaluating a Technique's validity 2009-07-16 12:09:44 +02:00
timoore
03b9303f22 Overhaul of SGExpression
Polymorphic additions to expressions: Add an expression base class
with a method for dynamically determining the type of an expression.

Add variables, predicates and boolian expressions.

Support for parsing trees of expressions
2009-07-16 12:09:44 +02:00
timoore
b5a59ea6f9 Work in progress for Technique validation 2009-07-16 12:09:44 +02:00
timoore
c6b2124129 Use Effects in materials library, and therefore in scenery 2009-07-16 12:09:44 +02:00
timoore
d320a6facb Effects framework 2009-07-16 12:09:43 +02:00
timoore
0793c2cb8c Blow away unused SGMaterialLib::add_item functions 2009-07-16 12:09:43 +02:00
timoore
d14755abb8 cleanup
Add support for boost::mem_fn to SGSharedPtr.

Remove a couple of "using" declarations from scene/model/model.hxx
2009-07-16 12:09:43 +02:00
timoore
abd4aa2e6b Add PropertyList typedef for vectors of property list nodes. 2009-07-16 12:09:43 +02:00
timoore
58417e78e5 Add a method to setStringValue that takes a std::string argument 2009-07-16 12:09:43 +02:00
timoore
390eb1c6e9 Don't cache results of getDisplayName
Return a std::string result instead of char *.
2009-07-16 12:09:43 +02:00
timoore
d4c6530a72 Add VEC3D and VEC4D property types
Add "extended" argument to readProperties, which controls whether the vector
 property types are accepted by the XML reader.
2009-07-16 12:09:43 +02:00
timoore
ff17b44a41 Extend properties to support new property types.
An SGRawBase class has been added as a base class to the SGRawValue
hierarchy so that SGPropertyValue functions don't necessarily need to
know the type of the value stored in the node.

A new SGRawValueContainer class stores properties that shouldn't be
stored in the node itself. PropertyTraits indicates if a type is
stored in the property node or externally.

Add getValue and SetValue template member functions to SGPropertyNode.

Read and write new extended properties.

Rearrange props.hxx a bit so that the template magic actually works.

Split out extended raw value virtual functions into a seperate base class.

SGRawExtended is chosen as a base class of SGRawValue for extended property
types.
2009-07-16 12:09:43 +02:00
timoore
5bd2d47571 Cleanup of properties
Change most uses of the SGPropertyNode _value union to use static_cast.

Move SGPropertyNode::Type out of the class into simgear::props namespace. Add
a PropertyTraits class so that templates can calculate the property type tag
based on a C++ type.

In destructor, delete _value.val if it is not 0 (and the property is not
aliased).
2009-07-16 12:09:43 +02:00
fredb
f8e475cd34 Refactor GLX only debug code 2009-07-15 12:50:49 +02:00
fredb
a05e063949 Compile when not GLX 2009-07-12 00:52:07 +02:00
ehofman
eb06a90109 Geoff McLane:
add a bunch of debugging code to find a persistant bug for Atlas/Map and fix them one by one.
2009-07-12 00:52:07 +02:00
fredb
e2f6632fee Support MSVC 64-bit architecture 2009-07-02 08:51:12 +02:00
fredb
5c5c583dcc Add MSVC90 (VS2008) project files 2009-07-02 08:51:12 +02:00
fredb
0d8d5c02d0 Update MSVC 7.1 projects - Put PLIB and FLTK in 3rdParty 2009-07-02 08:51:12 +02:00
frohlich
382e0c6ad2 Remove unneeded explicit scenegraph deletion.
Modified Files:
	simgear/scene/tgdb/TileCache.cxx
 	simgear/scene/tgdb/TileEntry.cxx
	simgear/scene/tgdb/TileEntry.hxx
2009-07-02 08:51:12 +02:00
fredb
a8d1c44408 Remove unmaintained, outdated and misleading project files. Use VC7.1 projects instead 2009-07-02 08:51:12 +02:00
fredb
78b4318c34 Suppress warnings 2009-07-02 08:51:12 +02:00
fredb
b47031a099 Win32 fix 2009-07-02 08:51:12 +02:00
frohlich
0f7b65a921 Provide a thread safe SGWeakPtr implementation.
Extend SGAtomic with atomic exchange and add.
Import updates from the original implementation of that in OpenFDM.

Modified Files:
 	Makefile.am SGAtomic.cxx SGAtomic.hxx SGReferenced.hxx
 	SGSharedPtr.hxx
Added Files:
 	SGWeakPtr.hxx SGWeakReferenced.hxx
2009-06-25 10:13:03 +02:00
fredb
33f7903aeb Update MSVC 7.1 projects 2009-06-25 10:13:02 +02:00
fredb
f3c2740917 Win32 fix 2009-06-25 10:13:02 +02:00
frohlich
09a57c7a52 No observed_ptr needed.
Modified Files:
	simgear/scene/model/ModelRegistry.cxx
2009-06-25 10:13:02 +02:00
frohlich
9068f0606e Remove unused headers.
Modified Files:
	simgear/scene/tgdb/TileEntry.cxx
2009-06-25 10:13:02 +02:00
frohlich
c577b7e369 Propagate the lanel loader through the options.
Modified Files:
	simgear/scene/model/SGReaderWriterXML.cxx
2009-06-25 10:13:02 +02:00
frohlich
5850464ba7 Move the carrier interactive geometry configuration into the model files.
Modified Files:
	Makefile.am animation.cxx
Added Files:
	SGInteractionAnimation.hxx SGInteractionAnimation.cxx
2009-06-23 10:42:42 +02:00
ehofman
50e240d5e4 Move the texture code to FlightGear/utils/Modeller 2009-06-23 10:42:42 +02:00
frohlich
75c2a45b25 Add some trailing spaces ...
Modified Files:
 	./simgear/math/SGIntersect.hxx
2009-06-23 10:42:42 +02:00
jmt
c958d63897 Fix a warning from GCC - 'ALIAS' was unhandled in the switch stmt. 2009-06-23 10:42:42 +02:00
Tim Moore
b633b8d0d3 change MAX_PATH to max_path to avoid Windows compilation problems 2009-06-17 11:37:21 +02:00
Tim Moore
76948416a9 overhaul sg_throwable to behave like a proper exception
Make sg_throwable inherit from std::exception.

change exception objects to contain C strings: exception objects should not
include objects, like std::string, whose copy constructor could throw.
2009-06-16 11:11:13 +02:00
fredb
f4a527c57c Add a simple class to subdivide Bezier curves 2009-06-15 10:23:22 +02:00
fredb
c491baff0e Remove unused variable 2009-06-15 10:23:21 +02:00
frohlich
6d05fc6f57 Finally get rid of that member in the SGModelData callback.
Move call of SGModelData::modelLoaded directly into the xml reader.

Modified Files:
 	simgear/scene/model/SGPagedLOD.cxx
 	simgear/scene/model/modellib.hxx
 	simgear/scene/model/modellib.cxx
 	simgear/scene/model/SGReaderWriterXML.cxx
2009-06-15 10:23:21 +02:00
frohlich
ca53add820 Mark static transforms as static.
Modified Files:
	simgear/scene/tgdb/TileEntry.cxx
2009-06-15 10:23:21 +02:00
frohlich
6fe3099ab4 Revert a change from 2009/06/07.
Should make the Nasal code for some xml models work again.

Modified Files:
 	simgear/scene/model/SGPagedLOD.cxx
	simgear/scene/model/SGReaderWriterXML.cxx
 	simgear/scene/model/modellib.cxx
	simgear/scene/model/modellib.hxx
2009-06-15 10:23:21 +02:00
frohlich
a34eceb327 Also handle PagedLOD nodes frame count in the update visitor.
Modified Files:
 	simgear/scene/util/SGUpdateVisitor.hxx
2009-06-11 15:55:12 +02:00
frohlich
c9042c3186 Also test against bounds when updating the scene.
Modified Files:
	simgear/scene/util/SGUpdateVisitor.hxx
2009-06-11 15:55:12 +02:00
jmt
b46fe0d51c Fix waypoint test, thanks Martin. 2009-06-11 15:55:12 +02:00
jmt
6d1d3173fe Extend SGWaypoint with track and speed data, and compute tracks with the
distance in SGRoute.
2009-06-11 15:55:12 +02:00
fredb
030d044d03 Win32 fix 2009-06-11 15:55:12 +02:00
jmt
29fb8e0f74 Fix bad interaction between CourseAndDistance overloads and use of implicit
SGWaypoint construction from SGGeod.
2009-06-11 15:55:11 +02:00
jmt
6e326976d5 Update route/waypoint tests for revised API 2009-06-11 15:55:11 +02:00
jmt
03a7d72a62 Change SGWaypoint to use SGGeod internally. Remove some unused code, to
support cartesian waypoints and compute distance off a cartesian route.
Add a helper to access the total route distance.

Should not cause any visible functionality change.
2009-06-11 15:55:11 +02:00
frohlich
f913febd71 More cleanup.
Modified Files:
	simgear/scene/model/SGReaderWriterXML.cxx
2009-06-11 15:55:11 +02:00
frohlich
daa0fbdc6b Do not modify danymically generated textures.
Modified Files:
	simgear/scene/model/ModelRegistry.cxx
2009-06-11 15:55:11 +02:00
frohlich
d4c52b599d Provide something more sensible for the properties root
for the modelLoaded call. MAy be this needs to be revisited, but in any
case better than constant zero.

Modified Files:
 	simgear/scene/model/SGPagedLOD.cxx
	simgear/scene/model/modellib.cxx
2009-06-11 15:55:11 +02:00
frohlich
ec88373eb7 Cleanup.
Modified Files:
	simgear/scene/model/SGReaderWriterXML.cxx
2009-06-11 15:55:11 +02:00
frohlich
4286cafdeb Doing the compilers job: constant propagation.
This variable is nowhere set except to zero.

Modified Files:
	model/SGPagedLOD.cxx model/SGReaderWriterXML.cxx
	model/modellib.cxx model/modellib.hxx
2009-06-11 15:55:11 +02:00
frohlich
3880d8e2f2 Slight cleanup.
Remive last reference to plibs file utility library.

Modified Files:
 	simgear/scene/model/SGReaderWriterXML.cxx
2009-06-11 15:55:11 +02:00
frohlich
671c84ad44 Remove unused header.
Modified Files:
	simgear/scene/tgdb/TileEntry.cxx
2009-06-11 15:55:11 +02:00
frohlich
a0d687bb24 Use osgDB::FileUtils instead of plib file utils.
Modified Files:
 	simgear/scene/material/mat.cxx
2009-06-11 15:55:10 +02:00
frohlich
704385ff0a Replace SGPlacementTrans usage with osg::PositionAttitueTransform.
Remove SGPlacementTrans.
Update build system.

Modified Files:
	SimGear.dsp projects/VC7.1/SimGear.vcproj
	projects/VC8/SimGear.vcproj simgear/scene/model/Makefile.am
	simgear/scene/model/placement.cxx
	simgear/scene/model/placement.hxx
	simgear/scene/tgdb/TileEntry.cxx
	simgear/scene/tgdb/TileEntry.hxx
Removed Files:
 	simgear/scene/model/placementtrans.cxx
 	simgear/scene/model/placementtrans.hxx
2009-06-11 15:55:10 +02:00
frohlich
81a657edec Use osg's builtin mechanisms to traverse only in range nodes with the
update visitor.

Modified Files:
	simgear/scene/util/SGUpdateVisitor.hxx
 	simgear/scene/tgdb/TileEntry.cxx
 	simgear/scene/model/placementtrans.cxx
2009-06-11 15:55:10 +02:00
frohlich
9d0bad29c0 Invent a property root if not given in the options struct.
Modified Files:
	simgear/scene/model/SGReaderWriterXML.cxx
2009-06-03 23:43:45 +02:00
ehofman
2fb8e32104 test for addChild also 2009-06-03 00:08:05 +02:00
ehofman
c522e499b2 find the last index instead of the last pos for addChild 2009-06-03 00:08:05 +02:00
frohlich
4700955480 Avoid empty search path extensions for the case that only the bucket index
number is given.

Modified Files:
	scene/tgdb/TileEntry.cxx
2009-06-03 00:08:05 +02:00
frohlich
2c66081fa4 When loading stg files honour the original path if given.
Modified Files:
	simgear/scene/tgdb/ReaderWriterSTG.cxx
	simgear/scene/tgdb/TileEntry.cxx
	simgear/scene/tgdb/TileEntry.hxx
2009-06-03 00:08:05 +02:00
frohlich
855e88da43 Enable stg loading by filename.
Modified Files:
	simgear/scene/tgdb/ReaderWriterSTG.cxx
2009-06-03 00:08:05 +02:00
mfranz
ad302db9a8 segfault-- 2009-06-03 00:08:04 +02:00
frohlich
bfa5fff500 Cleanup.
Additional null pointer checks.
Simplify redundant interface arguments.

Modified Files:
	simgear/scene/material/mat.cxx simgear/scene/material/mat.hxx
	simgear/scene/material/matlib.cxx
	simgear/scene/material/matlib.hxx
	simgear/scene/tgdb/ReaderWriterSTG.cxx
	simgear/scene/tgdb/SGReaderWriterBTG.cxx
	simgear/scene/tgdb/SGReaderWriterBTGOptions.hxx
	simgear/scene/tgdb/TileEntry.cxx
	simgear/scene/tgdb/TileEntry.hxx simgear/scene/tgdb/obj.cxx
2009-06-03 00:08:04 +02:00
frohlich
01c64fd554 Give the models properties as an argument to the init callback.
Modified Files:
 	SGPagedLOD.cxx
2009-06-03 00:08:04 +02:00
mfranz
13a2b92a32 remove duplicated header entry 2009-05-19 23:53:25 +02:00
frohlich
29e79f8f61 Also note the btg reader header in the build system.
Modified Files:
	scene/tgdb/Makefile.am
2009-05-19 23:53:24 +02:00
frohlich
8f7527ede0 Restore the special capability of the btg reader to read compressed files.
Modified Files:
 	scene/tgdb/SGReaderWriterBTG.cxx
 	scene/tgdb/SGReaderWriterBTG.hxx
2009-05-19 23:53:24 +02:00
frohlich
7cd149a4d8 Implement current osgDB::ReaderWriters supportsExtension interface instead
of the previous one.

Modified Files:
 	model/SGReaderWriterXML.cxx model/SGReaderWriterXML.hxx
 	tgdb/ReaderWriterSTG.cxx tgdb/ReaderWriterSTG.hxx
 	tgdb/SGReaderWriterBTG.cxx tgdb/SGReaderWriterBTG.hxx
2009-05-19 23:53:24 +02:00
frohlich
e45912fd8a Attach the ModelData to the options instead of the userdata field.
Modified Files:
	simgear/scene/model/SGPagedLOD.cxx
	simgear/scene/model/SGReaderWriterXML.cxx
2009-05-19 23:53:24 +02:00
ehofman
56c4ba67c6 * Add a function to create a node after the laste node with the same name
(this frees the xml property loader from keeping track of the number of
    nodes with the same name that have already been added to the property
    tree).
 * make some small code cleanups at the core of the property tree.
2009-05-18 00:36:46 +02:00
Tim Moore
7e7ce2f38e Merge branch 'maint' into next 2009-05-18 00:34:06 +02:00
frohlich
7dc9eba2d0 Make SimGear compile with osg trunk
Modified Files:
	simgear/scene/model/SGPagedLOD.cxx
 	simgear/scene/model/SGPagedLOD.hxx
 	simgear/scene/sky/cloud.cxx simgear/scene/sky/moon.cxx
	simgear/structure/OSGVersion.hxx
2009-05-16 16:18:54 +02:00
mfranz
f91d96b51a - fix one broken #include path (in a not usually compiled test app)
- turn four #include paths from the "foo" form to <foo>

The quotes form is normally only used for headers with path relative
to the including file's path, though the standard doesn't strictly
mandate this. This is consistent with the rest of sg, it makes the
code's intent clearer and helps to find headers. (And it's a few
milliseconds faster, too.)
2009-05-16 16:18:37 +02:00
mfranz
bc19609147 tcpserver: typo 2009-05-16 16:17:39 +02:00
mfranz
1ccaf3a0bd fix leaks 2009-05-16 16:17:39 +02:00
ehofman
03bfd829da add a bit of comment 2009-05-02 00:40:09 +02:00
fredb
e1f7a1e0a0 Stuart Buchanan :
This patch changes the shader so the diffuse light element is applied based on the co-linearity of the light vector and the viewing vector. I think this makes sense, as the tree textures don't represent a surface themselves.
2009-05-02 00:40:09 +02:00
ehofman
ceeac0ecf0 Revert most of the previous patch, it didn't improve the dome since it wat adjusting the wrong bads 2009-04-15 23:03:07 +02:00
frohlich
c9d0eac739 Put some annotations into the loaded models names.
Modified Files:
	simgear/scene/model/modellib.cxx
2009-04-15 23:03:07 +02:00
frohlich
8f24d924ee Remove a newline printf, probably left over from development.
Modified Files:
	dome.cxx
2009-04-15 23:03:07 +02:00
ehofman
8537cc9edf Let the fog color transition into the sky dome to give a more natural effect 2009-04-15 23:03:07 +02:00
ehofman
58f3985567 Fix a NaN at higher altitudes: sin_beta could become greater than 1.0 which is hard to understand for asin. 2009-04-15 23:03:07 +02:00
frohlich
872db67f21 Remove unused variables.
Modified Files:
	simgear/bucket/newbucket.hxx
2009-04-15 23:03:07 +02:00
Tim Moore
006f90997a Merge branch 'maint' into next 2009-03-31 00:04:30 +02:00
torsten
26b4776394 fix wrong bucket calculation for western hemisphere, close to poles, full-degree-longitude calculations.
set_bucket computed false left border, if the span was greater than 1, longitudes were less than zero
and longitudes were within SG_EPSILON on a full degree. Example: -179.0, +87.5 returned -176, 87
but should return -180, 87.
Discovered by Brian Schack
2009-03-30 18:43:39 +02:00
frohlich
66c64459e6 Makes more sense to process the orientation in this order.
Modified Files:
	simgear/scene/model/placement.cxx
2009-03-30 18:42:45 +02:00
frohlich
dc8657f57f Clean up placementtrans a bit.
Modified Files:
 	simgear/scene/model/placement.cxx
 	simgear/scene/model/placementtrans.cxx
	simgear/scene/model/placementtrans.hxx
2009-03-30 18:42:45 +02:00
frohlich
9d647b90e0 Zap aliasing compiler warnings.
Modified Files:
 	simgear/io/lowlevel.cxx
2009-03-30 18:42:45 +02:00
frohlich
f5730c950b Remove second, identical to the first one license header.
Modified Files:
 	simgear/scene/model/SGScaleTransform.cxx
2009-03-30 18:42:45 +02:00
frohlich
15d37daebd Remove unused header.
Modified Files:
	simgear/scene/tgdb/TileEntry.cxx
2009-03-30 18:42:45 +02:00
frohlich
795c9876af Make it compile with gcc-4.4.
Modified Files:
	simgear/debug/logstream.hxx
2009-03-30 18:42:45 +02:00
frohlich
45f653167d Make use of optimized matrix multiplication routines in osg.
Modified Files:
	simgear/scene/model/SGTranslateTransform.cxx
2009-03-30 18:42:45 +02:00
frohlich
403d9b6ac1 No longer change the material properties for ac models on the fly.
Modified Files:
	simgear/scene/model/ModelRegistry.cxx
2009-03-30 18:42:45 +02:00
frohlich
722af5f659 Cleanup. Use already structured data instead of copying stuff. 2009-03-18 07:53:51 +01:00
frohlich
471b9f02ec Add const accessors.
Modified Files:
	simgear/ephemeris/ephemeris.hxx
2009-03-18 07:53:51 +01:00
frohlich
fd294b6f98 Make sure the boundingvolumes for the btg files are as high as possible
in the scenegraph.

Modified Files:
	simgear/scene/tgdb/SGReaderWriterBTG.cxx
2009-03-18 07:53:51 +01:00
frohlich
88baaa72be Use triangle sphere intersection directly.
Modified Files:
	simgear/scene/bvh/BVHSubTreeCollector.cxx
2009-03-18 07:53:50 +01:00
frohlich
61084cf1ba Make triangle sphere intersection tests usable with mixes types.
Modified Files:
	simgear/math/SGIntersect.hxx
2009-03-18 07:53:50 +01:00
frohlich
5b63f0755a Preparations for improoved timing behaviour.
Modified Files:
	simgear/scene/bvh/BVHMotionTransform.cxx
	simgear/scene/bvh/BVHMotionTransform.hxx
	simgear/scene/bvh/BVHSubTreeCollector.cxx
2009-03-18 07:53:50 +01:00
frohlich
9eb5cf6c98 Add a reference time to the velocity stuff.
Modified Files:
	simgear/scene/model/ModelRegistry.cxx
	simgear/scene/model/placement.cxx
	simgear/scene/model/placement.hxx
	simgear/scene/util/SGSceneUserData.hxx
2009-03-18 07:53:50 +01:00
frohlich
679db5a22b The chunked stuff is no longer needed for the ground tiles.
... I (Mathias Froehlich), believe that it is more performant (for the GPU) to
build the biggest indexed sets possible at the expense of tight culling.
I (Mathias Froehlich) also know that the CPU is more performant on smaller chunks
building the old flat groundcache on such tiles. :)
So this code *was* to balance these two contrary requirements to some degree.

Now we have optimized datastructures for drawing and differently optimized
datastructures for intersection tests.


Modified Files:
	simgear/scene/tgdb/obj.cxx
2009-03-18 07:53:50 +01:00
frohlich
0e35168bdb Also align the ocean tiles with some horizontal axis.
This way the bounding boxes for this geometry is slightly smaller.
Helps ground intersection stuff to avoid the ocean triangles earlier.

Modified Files:
	simgear/scene/tgdb/SGOceanTile.cxx
2009-03-18 07:53:50 +01:00
frohlich
035dcc7ab7 Improove bounding volume building in the scenery loading process.
Refactor common code in the BoundingVolumeBuildVisitor.hxx.

Modified Files:
	simgear/scene/model/BoundingVolumeBuildVisitor.hxx
	simgear/scene/model/ModelRegistry.cxx
	simgear/scene/model/ModelRegistry.hxx
2009-03-18 07:53:50 +01:00
frohlich
252deed5b9 Make the debug geometry stuff work with a time argument.
Modified Files:
	simgear/scene/bvh/BVHDebugCollectVisitor.hxx
2009-03-18 07:53:50 +01:00
fredb
c2c4cad753 Compile under windows 2009-03-18 07:53:50 +01:00
frohlich
42e76477cf Make sure each carrier gets its own valocity.
Modified Files:
	simgear/scene/model/ModelRegistry.cxx
2009-03-18 07:53:50 +01:00
mfranz
1eade74e5a warning-- 2009-03-18 07:53:50 +01:00
frohlich
f1f0fa0aa9 Make use of posix clocks if available.
Have a more general timestamp implementation.
Very useful for higher accuracy timings.

Modified Files:
	simgear/structure/subsystem_mgr.cxx
	simgear/structure/subsystem_mgr.hxx
	simgear/timing/testtimestamp.cxx simgear/timing/timestamp.cxx
	simgear/timing/timestamp.hxx
2009-03-18 07:53:49 +01:00
frohlich
deef158822 Use a reference counted pointer for the condition.
Modified Files:
	simgear/sound/xmlsound.hxx simgear/sound/xmlsound.cxx
2009-03-11 20:06:57 +01:00
frohlich
fef2006663 Remove unused methods.
Modified Files:
	material/matmodel.hxx material/matmodel.cxx
2009-03-11 20:06:57 +01:00
frohlich
5c97fd576a Make local functions static.
Modified Files:
	model/SGReaderWriterXML.cxx
2009-03-11 20:06:56 +01:00
frohlich
c4eb6b7b65 Remove unused functions/includes ...
Modified Files:
	simgear/scene/tgdb/userdata.hxx
	simgear/scene/tgdb/userdata.cxx
2009-03-11 20:06:56 +01:00
frohlich
31324761cc Zap SGLocation.
Modified Files:
 	projects/VC7.1/SimGear.vcproj projects/VC8/SimGear.vcproj
 	simgear/scene/model/Makefile.am
	simgear/scene/model/placement.cxx
 	simgear/scene/model/placement.hxx
Removed Files:
 	simgear/scene/model/location.cxx
	simgear/scene/model/location.hxx
2009-03-11 20:06:56 +01:00
frohlich
e495f03ee9 Ignore winding order since it is ignored later anyway.
Only emit fully defined primitives.

Modified Files:
	simgear/scene/model/BoundingVolumeBuildVisitor.hxx
2009-03-11 20:06:56 +01:00
frohlich
f5769627e4 Use SGGeod in the model placement.
Modified Files:
	simgear/scene/model/placement.cxx
	simgear/scene/model/placement.hxx
2009-03-11 20:06:56 +01:00
frohlich
06ad73f85b Add convenience function to keep position with just an other elevation.
Modified Files:
	simgear/math/SGGeod.hxx
2009-03-11 20:06:56 +01:00
frohlich
fa20363853 First step for something doing static friction stuff.
Add an id field to identify BVHMotionTransforms.
Provide a factory for ids.
Use that to identify velocity data.
Track the lowermost id in the visitors.

Modified Files:
	simgear/scene/bvh/BVHLineSegmentVisitor.cxx
	simgear/scene/bvh/BVHLineSegmentVisitor.hxx
 	simgear/scene/bvh/BVHMotionTransform.cxx
	simgear/scene/bvh/BVHMotionTransform.hxx
	simgear/scene/bvh/BVHNearestPointVisitor.hxx
	simgear/scene/bvh/BVHNode.cxx simgear/scene/bvh/BVHNode.hxx
	simgear/scene/util/SGSceneUserData.cxx
	simgear/scene/util/SGSceneUserData.hxx
2009-03-05 10:32:06 +01:00
frohlich
2564432e71 Avoid duplicate triangles.
Modified Files:
	simgear/scene/bvh/BVHStaticGeometryBuilder.hxx
2009-03-05 10:32:06 +01:00
frohlich
addf47600d Remove the StaticLeaf visitor slot.
Add a nearest point visitor.

Modified Files:
	BVHBoundingBoxVisitor.hxx BVHDebugCollectVisitor.hxx
	BVHLineSegmentVisitor.cxx BVHLineSegmentVisitor.hxx
	BVHStaticGeometryBuilder.hxx BVHStaticLeaf.cxx
	BVHStaticLeaf.hxx BVHSubTreeCollector.cxx
	BVHSubTreeCollector.hxx BVHVisitor.hxx Makefile.am bvhtest.cxx
Added Files:
	BVHNearestPointVisitor.hxx
2009-03-05 10:32:06 +01:00
frohlich
7f534a7966 Crude hack to work around my today introduced collision tree sharing problem.
Modified Files:
	simgear/scene/model/ModelRegistry.cxx
2009-03-05 10:32:06 +01:00
frohlich
eabffece1f Don't waste space with too huge stl containers.
Modified Files:
	simgear/scene/bvh/BVHStaticGeometryBuilder.hxx
2009-03-05 10:32:06 +01:00
frohlich
afed842ad1 Don't waste space with too huge stl containers.
Modified Files:
	simgear/scene/bvh/BVHStaticData.hxx
2009-03-05 10:32:06 +01:00
fredb
c46cfb5d47 Win32 fix 2009-03-05 10:32:06 +01:00
frohlich
34fe42bbd9 Build boundingvolumes in the model loading phase.
Modified Files:
	ModelRegistry.hxx ModelRegistry.cxx
Added Files:
	BoundingVolumeBuildVisitor.hxx
2009-03-05 10:32:06 +01:00
fredb
0c1d96b749 Update MSVC 7.1 projects - Add the BVH library 2009-03-05 10:32:06 +01:00
fredb
9b67f52d56 SGMatrix<T>::preMultTranslate should return self ( as postMultTranslate do ) 2009-03-05 10:32:06 +01:00
fredb
d37907d35d BVHLineSegmentVisitor::setLineSegmentEnd doesn't return anything 2009-03-05 10:32:05 +01:00
frohlich
fee8d0cf78 Implement setters for velocity notes in the model placement code.
Modified Files:
	simgear/scene/model/placement.cxx
	simgear/scene/model/placement.hxx
2009-03-05 10:32:05 +01:00
frohlich
f5f9c6b81f More data to attach to the user data field.
Modified Files:
 	simgear/scene/util/SGSceneUserData.hxx
2009-03-05 10:32:05 +01:00
frohlich
4e3460a34b Include the bounding volume tree on the build system.
Modified Files:
 	configure.ac simgear/scene/Makefile.am
2009-03-05 10:32:05 +01:00
frohlich
8545b6ce6b Initial commit of the bounding volume tree implementation.
The aim is to prove a better collion model in plenty ways.

Added Files:
 	.cvsignore BVHBoundingBoxVisitor.hxx
	BVHDebugCollectVisitor.hxx BVHGroup.cxx BVHGroup.hxx
	BVHLineGeometry.cxx BVHLineGeometry.hxx
	BVHLineSegmentVisitor.cxx BVHLineSegmentVisitor.hxx
	BVHMotionTransform.cxx BVHMotionTransform.hxx BVHNode.cxx
	BVHNode.hxx BVHStaticBinary.cxx BVHStaticBinary.hxx
	BVHStaticData.hxx BVHStaticGeometry.cxx BVHStaticGeometry.hxx
	BVHStaticGeometryBuilder.hxx BVHStaticLeaf.cxx
	BVHStaticLeaf.hxx BVHStaticNode.cxx BVHStaticNode.hxx
	BVHStaticTriangle.cxx BVHStaticTriangle.hxx
 	BVHSubTreeCollector.cxx BVHSubTreeCollector.hxx
	BVHTransform.cxx BVHTransform.hxx BVHVisitor.hxx Makefile.am
	bvhtest.cxx
2009-03-05 10:32:05 +01:00
frohlich
e417903c23 Additions for the boundingvolumes
Modified Files:
	SGGeometryTest.cxx SGIntersect.hxx SGLineSegment.hxx
	SGTriangle.hxx
2009-03-05 10:32:05 +01:00
frohlich
81eae3fa48 Rotate the scenery tiles so that the horizont is axis aligned.
This might help culling and much more the upcomming collision tree.

Modified Files:
	simgear/scene/tgdb/obj.cxx
2009-02-27 23:34:15 +01:00
frohlich
90c58087e8 Make material get helper function static.
Modified Files:
 	simgear/scene/material/matlib.cxx
 	simgear/scene/material/matlib.hxx
2009-02-27 23:34:15 +01:00
frohlich
19bc1e6313 Initialize random number for the tests.
Define the triangles center by the weighted sum of the vertices.

Modified Files:
	SGGeometryTest.cxx SGTriangle.hxx
2009-02-27 23:34:15 +01:00
frohlich
4a4e8c87b8 Use template arguments instead of hard coded double.
Modified Files:
	simgear/math/SGTriangle.hxx
2009-02-27 23:34:15 +01:00
frohlich
f04e559dc2 Initialize uninitialized variables.
Adapt the precision bounds to what matches the expectations of IEEE math.

Modified Files:
	SGMathTest.cxx
2009-02-27 23:34:15 +01:00
frohlich
8e5e657344 Fix problem in unit quaternion return.
Modified Files:
	SGQuat.hxx
2009-02-27 23:34:15 +01:00
frohlich
a4f1f62068 Make make check link again.
Modified Files:
	simgear/math/Makefile.am
2009-02-27 23:34:15 +01:00
frohlich
a3e279f06f The scenery center is history for a long time now.
Remove that from the transforms.

Modified Files:
	simgear/scene/model/placement.hxx
	simgear/scene/model/placementtrans.cxx
	simgear/scene/model/placementtrans.hxx
2009-02-22 23:49:45 +01:00
frohlich
d11954e80c Small cleanups, bug fixes and improovements to the geometry/math stuff.
Modified Files:
	simgear/math/SGBox.hxx simgear/math/SGIntersect.hxx
	simgear/math/SGLineSegment.hxx simgear/math/SGMatrix.hxx
	simgear/math/SGPlane.hxx simgear/math/SGRay.hxx
	simgear/math/SGSphere.hxx simgear/math/SGVec2.hxx
	simgear/math/SGVec3.hxx simgear/math/SGVec4.hxx
2009-02-22 23:49:45 +01:00
durk
812170ebce Torsten Dreyer: the rotate animation has two ways to define a axis
1. by using center/x-m and axis/[xyz]
2. by using axis/[xyz]1-m and axis/[xyz]2-m

The translate animation only supports method 1. and here comes a patch that
enables method 2 for this animations, too.
2009-02-22 23:49:45 +01:00
fredb
fdd3c77298 Fix to compile with MSC 2009-02-22 23:49:45 +01:00
Tim Moore
342de209a2 Merge branch 'topic/nasal' into next 2009-02-16 00:48:00 +01:00
mfranz
caeb32488e "io.flush() implementation from Melchior. Also add a final filetype
element to the io.stat() array, which has been sitting around on my
box for a while and doesn't seem to have broken anything."  -- Andy

(forward port from nasal/cvs)
2009-02-16 00:46:29 +01:00
Tim Moore
ff7e70f4d5 Merge branch 'topic/gcintersect' into next 2009-02-13 10:07:15 +01:00
Tim Moore
950f51909c New getPrimitive function.
This searches for the primitive found in an OSG intersection query.
2009-02-13 09:40:05 +01:00
Tim Moore
f86e6d344c Make SGSubsystemGroup::Member copy constructor private.
The copy constructor wouldn't make any sense and would confuse ownership of
the subsystem pointer. Problem noted by John Denker.
2009-02-07 00:37:47 +01:00
Tim Moore
08581282dd Merge branch 'topic/cloudz' into next 2009-02-06 19:16:19 +01:00
Tim Moore
e1e47e76ec Turn off z buffer writes for clouds.
This is standard practice for semi-transparent objects and should cut down
on the flickering and other sorting artifacts.
2009-02-06 17:48:23 +01:00
fredb
3ff059848c Update MSVC 7.1 projects - Remove pthreads dependency 2009-02-04 11:07:27 +01:00
Tim Moore
22c7df5936 Merge branch 'maint' into next 2009-02-04 11:03:20 +01:00
Tim Moore
81a44d1340 Merge branch 'releng/1.9.1' into maint 2009-02-04 11:02:30 +01:00
durk
2c089e6166 Synchronize the version number with our mainantance release. 2009-02-04 11:01:39 +01:00
Tim Moore
589dae7b0c Build trees under a transform note that is rotated to Z-up.
This allows the tree geometry to be shared across the entire scene because it
doesn't need to be rotated for each scenery tile.
2009-01-30 11:18:08 +01:00
Tim Moore
3ff13189aa Don't expand all the trees into display lists.
This can chew up large amounts of memory for questionable gains. We do
let the tree model geometry be in a display list if OSG chooses to put
it there.

Various renaming and cleanup. Save some memory by reverting
ShaderGeometry's base class back to osg::Drawable.
2009-01-30 11:17:02 +01:00
Tim Moore
7151c3fac1 Merge branch 'topic/yontree' into next 2009-01-28 07:53:38 +01:00
Tim Moore
3e023b77dd Merge branch 'maint' into next 2009-01-28 07:53:31 +01:00
durk
e3fc89890c For the first time (no pun intended) in almost ten years time (again no
pun intended) that I'm touching the time library.

 Brian Schack reported that the traffic scheduler messes up the timestamps
 of the atlas network output. As it turns out, the c library functions
 asctime, and gmtime use a static copy of the tm struct to do the internal
 formatting. Our linux port of the SGTime class, incidentally, also stored
 it's master time stamp in this very same struct. Thus, formatting an
 arbitrary time value, would have the unwanted side effect of time travel.
 Usually, this would go unnoticed, because the actual time parameters would
 be updated before any damage could be done. But unwanted side effects, as
 in Brian's example could occur.

 On the MSVC port this appears to not have been a problem. Since that port
 used a copy of the tm struct to store it's master time stamps. Since the
 MSVC code also compiles cleanly on linux, it seems to be the way to go to
 use that approach. In addition, it also removes some conditional compile
 directives.

 I've only run a short test, but didn't see any undesirable side effects.
2009-01-28 07:46:55 +01:00
mfranz
ce2a6cfe5c Csaba HALASZ: set _arg even if there's no <command> (crash fix) 2009-01-28 07:46:31 +01:00
Tim Moore
31d9eaf54c Use osg::Geometry code to draw trees ourselves.
This reverts back in the direction of Yon's original patch: the model is
drawn within ShaderGeometry::drawImplementation. This saves a lot of memory
over the previous approach of creating a PrimitiveSet for each model.
2009-01-28 07:43:09 +01:00
Tim Moore
781c445d14 Merge branch 'topic/modelopt' into next 2009-01-23 23:27:48 +01:00
Tim Moore
26a416399f Merge branch 'topic/yontree' into next 2009-01-23 23:27:37 +01:00
Tim Moore
f7dc7f039e QuadTreeBuilder: create leaves on demand
This avoids lots of empty leaves.
2009-01-23 19:30:29 +01:00
Tim Moore
3c74fea087 Rewrite ShaderGeometry to use display lists and OSG primitives.
Based on a patch from Yon Uriarte.

Eliminate _trees list from ShaderGeometry

Use the position and scale values that are already available.
2009-01-23 19:29:18 +01:00
Tim Moore
be0635bfd3 Optimize empty groups from .ac models
The OSG optimizer seems to have changed since this work was originally done.
2009-01-23 16:11:23 +01:00
Tim Moore
6723ef95c2 Merge branch 'maint' into next 2009-01-19 00:13:07 +01:00
Tim Moore
1a8fd62680 Protect against division by zero in QuadTreeBuilder
This could only happen when there's one leaf in the tree, or all the objects
happen to have the same position. Noticed by Csaba Halaz
2009-01-19 00:04:59 +01:00
Tim Moore
8b57ed46b1 Sort cloud sprites using std::sort, based on projected Z.
A "cleanup" of cloud sorting.
2009-01-16 00:37:40 +01:00
Tim Moore
25c08e56c2 Merge branch 'foo' into next 2009-01-15 22:52:11 +01:00
jmt
0f148b6ab6 Fix linkage of test programs with OpenThreads. 2009-01-15 22:49:00 +01:00
jmt
47575fe357 Commit Benoit Laniel's patch which converts more SimGear pieces to use
OpenThreads primitives directly.
2009-01-15 22:49:00 +01:00
jmt
7c14453b5a Since we're now sure 1.9.1 will not be released from trunk, here's Yon
Uriarte's patch to convert SGReferenced over to OpenThread's atomic int.
2009-01-15 22:49:00 +01:00
Tim Moore
a47d5536fa Merge branch 'maint' into next 2009-01-14 22:34:20 +01:00
Tim Moore
db8f7f21e8 Remove OptionsPusher and manipulation of osgDB dataFilePathList.
The bug it worked around has been fixed in the OSG ac3d loader, and changing
the path list has unpleasant multithreading implications.
2009-01-14 22:13:12 +01:00
Tim Moore
3c312c55f1 Merge branch 'maint' into next 2009-01-14 12:13:44 +01:00
Tim Moore
2d11419cba SGPropertyNode must increment / decrement the reference counter in an aliased
node.

From Csaba Halász.
2009-01-14 12:10:23 +01:00
Tim Moore
07a4508944 Merge branch 'topic/mat-anim' into next 2009-01-13 22:58:45 +01:00
Tim Moore
62913739bb Merge branch 'maint' into next 2009-01-13 22:52:19 +01:00
Tim Moore
55e9d8d944 SGMaterialAnimation: Don't install an update callback if values are static 2009-01-13 15:35:15 +01:00
Tim Moore
a9439d58c7 SGMaterialAnimation: factor out update of osg::Material 2009-01-13 13:15:34 +01:00
fredb
800ad40c4c Csaba/Jester : fix the material animation and display night textures 2009-01-13 10:37:38 +01:00
Tim Moore
62864637a3 Merge branch 'maint' into next 2009-01-12 13:14:31 +01:00
fredb
4d4ac7ea24 fix end of file 2009-01-12 13:13:04 +01:00
fredb
119651482d ignore generated files 2009-01-12 13:12:50 +01:00
timoore
ecf0a1a736 Fix include path 2009-01-08 23:06:23 +01:00
jmt
94942d1ac4 Add some syntactic helpers to allow distance/course to be queried between
two geodetic points. This still entails a full _geo_inverse_wgs_84 call,
but makes call sites neater.
2009-01-08 23:05:12 +01:00
jmt
b0a5b54949 Fix test-program linkage now sgmath depends on sgstructure. 2009-01-02 23:52:46 +01:00
jmt
ac57eab8ac Fix a potential crash when OSG is misconfigured, and an appropriate image
loading plugin cannot be found.
2008-12-26 11:42:04 +00:00
mfranz
74a4144193 compilation fix: <cstring> for strcmp() 2008-12-22 18:01:34 +00:00
mfranz
5c44cb0f01 - shininess is in the rage 0..128
- restore fg/plib compatibility (there is/was no <shininess> group)
  (we may want to change that in the (near?) future, though)
2008-12-21 15:01:11 +00:00
durk
c044d711ef Documentation update regarding OpenAL and OSG. 2008-12-20 09:10:43 +00:00
curt
f2132f6a7d Attempt to sort out the version number mess in preparation for a 1.9.0 release. 2008-12-19 20:39:59 +00:00
fredb
69871b15ff Stuart Buchanan :
Attached is yet another 3D clouds patch, to fix the following:
1) The 3D clouds were not modified by the cloud coverage, due to some problems with osg::Switch
2) METAR changes to cloud coverage were not obeyed.
3) Making changes via the Cloud dialog had no effect unless 3D clouds were toggled.
4) Cloud cover was too sparse.
5) 3D Stratus clouds caused performance issues on some hardware (fixed by removing 3D stratus from cloudlayers.xml - it will now be a 2D layer).
2008-12-19 07:39:09 +00:00
mfranz
f4ec02a592 James TURNER: make the index of the current waypoint available 2008-12-18 22:51:58 +00:00
fredb
53f7743678 Stuart :
the 3D clouds now respect changes to the environment caused by updated METAR etc.

It also increases the AlphaFunc as suggested by Tim.
2008-12-14 18:47:30 +00:00
fredb
15893bc558 Csaba/Jester : fix a problem with tex transform animation 2008-12-12 20:02:44 +00:00
fredb
73b974f1b5 Csaba/Jester : fix a problem with material animation 2008-12-12 19:57:25 +00:00
fredb
0e7bdc208b Print the name of the file generating an OpenAL error 2008-12-12 07:41:44 +00:00
fredb
e0a07b7a92 Stuart :
- Removes the cloud type re-use code - I think they aren't worth the graphical artefacts that they cause in light of Tim's improvements
- Changes the transparency of the clouds. Previously, the clouds were transparent at 0m distance, opaque at 200m, then gradually more transparent to the fog limits. This meant they were generally quite transparent. Now, they are opaque from 200m to 15km, then become transparent at 20km. A side effect of this is that the current textures could probably benefit from being made slightly transparent to improve the blending of the sprites against each other.
2008-12-11 08:24:35 +00:00
fredb
4da58e8846 Update MSVC 7.1 projects. Add Boost 2008-12-11 08:23:37 +00:00
timoore
966b9e5c2b Use a singleton Fog attribute for all 3D clouds.
Don't update this Fog with any kind of update callback; instead, update from
the sky repaint method.
2008-12-10 22:39:48 +00:00
timoore
1625192c81 Use StateAttributeFactory for CullFace and ShadeModel attributes 2008-12-10 22:39:23 +00:00
timoore
c5e8c6603c Use Boost singleton template for our singletons 2008-12-10 22:39:02 +00:00
timoore
37e541d326 Render cloud layers with face culling
Also, allow definition of colors for the cloud layer corners for debugging.
2008-12-10 22:38:34 +00:00
timoore
862a827fe6 Add cullFaceFront as a state attribute to the StateAttributeFactory 2008-12-10 22:38:14 +00:00
timoore
b96c5c9e4b Render sky with depth test off.
Also, don't set BACKGROUND_BIT for cloud layers.
2008-12-10 22:37:52 +00:00
durk
f7e91f1f08 Finalizing the preparation of SimGear-1.99.5-rc2. 2008-12-10 18:20:36 +00:00
fredb
2d77178ba3 Stuart Buchanan :
- Replaces simple shader attributes with vectors (this was missed out of the last patch by mistake)
- Includes Yon's Fog update code (Thanks!)
- Fixes a bug since 1.0 where --enable-real-weather-fetch stopped the other weather scenarios from working.
2008-12-06 23:02:42 +00:00
fredb
b38e6d8bf3 Ugly hack to fix a memory corruption problem 2008-12-06 23:01:24 +00:00
fredb
b601cdb6a5 Stuart Buchanan :
This provides the following enhancements & bug fixes
- Fix the chequer-board bug.
- Add proper cloud coverage function - so scattered clouds are now truly scattered.
- Add real-time control for visibility range.
- Use a limited set of clouds rather than generating a completely new Geode for each cloud. This saves sorting and display time.
- Add controls to Rendering dialog to allow fine-tuning of the number of sprites, cloud visibility and the number of different types of cloud.
- Add some variance to the sort back-off to avoid all clouds being sorted at the same time.
- Pack attributes into vectors for performance
- Re-order the cloud type determination code so that if a cloud layer could either be stratus or cumulus, cumulus is used.
- Lowered the cloud level in the standard cloud configuration slightly so a cumulus layer is generated rather than stratus.

These last two mean that you should see some 3D cumuli if disabling real weather fetch.

My thanks to Yon Uriarte for his help with performance work.
2008-12-04 20:56:03 +00:00
fredb
2803154213 Stuart:
Attached is another clouds patch. This does the following:
1) Puts the 3D clouds in a cloud rendering bin, to reduce the transparent edge problem. Viewing 3d clouds against a 2D layer _above_ it now blends correctly. There is still a problem when viewing a layer below the 3d clouds, and I'm not sure if/how I'll manage to solve that. Thanks to Tim for pointing me at the correct code (again).
2) Performance improvement by calculating the Bounding box when the cloud is generated rather than ever time it is requested.
2008-11-30 23:06:18 +00:00
timoore
ae5297e6d7 logstream improvements from Yon Uriarte
Avoid descending into iostream when a message won't be logged.
2008-11-29 00:17:29 +00:00
fredb
fa7490fb38 Stuart:
> Something has changed in the environment manager which means that clouds
> generateion is now inconsistent. I'm still tracking it down, as my recent
> changes shouldn't have affected this.

Well, the cause was a bug in my code, but it didn't expose itself until we moved
to multiple cameras. The attached patch fixes the problem.

I've also put in a new heuristic to improve the frame-rate. Clouds that are already sorted
are likely to still be sorted in subsequent frames. Therefore I've put in a back-off
mechanism for the bubble-sort pass. This should mean that if you stay completely
stationary, once the clouds become sorted they will eventually only perform a
bubble sort pass every 128 frames.
2008-11-26 07:28:10 +00:00
timoore
bad80521a8 Track time in TileCache; assign new tiles the current time 2008-11-24 22:08:31 +00:00
fredb
8303e30033 Stuart :
> Warning: detected OpenGL error 'valeur non valide' after RenderBin::draw(,)

Fixed in the patch below. For some reason the shader didn't like index 16 being used...

The patch also fixes the chequer-board effect that was causing very sparse cloud cover.
2008-11-24 20:26:12 +00:00
fredb
27de1e271e Stuart Buchanan :
Attached is a small patch for 3D clouds.
It provide the following:
1) Proper spherical distribution of sprites (previously they were distributed cylindrically - whoops)
2) Better shading, so the bottom of the cloud is darker than the top.
3) Fixed a couple of texture sizing bugs.
2008-11-23 12:14:56 +00:00
timoore
98cecfe940 Templates for interacting with OSG objects 2008-11-21 14:48:15 +00:00
timoore
2e65538fb5 Template functions and overloaded functions for accessing property values.
These are useful for writing templates that manipulate properties.
2008-11-18 22:16:58 +00:00
curt
e6371cbf9c Manuel Massing:
Attached is a small fix for the sorting in CloudShaderGeometry.cxx.
I think the sorting problem stems from the osg idiosyncracy
to store transposed matrices...so the intuitive

       osg::Vec4f p = vm * osg::Vec4f(_cloudsprites[i]->position.osg(), 1.0f);

needs to be replaced with...

       osg::Vec4f p = vm.preMult(osg::Vec4f(_cloudsprites[i]->position.osg(), 1.0f);

The patch also optimizes the distance calculation - it evaluates the distances
in model space instead of eye space, which reduces computation to a dot-
product instead of a matrix multiplication.
2008-11-09 15:39:54 +00:00
fredb
0b8b6ac56a Stuart Buchanan :
It fixes the following issues (to a greater or lesser extent):
1) Performance. Quad trees used to improve culling, and the sprites are placed on the surface of a sphere rather than
randomly throughout the cloud, requiring fewer textures. This saves about 5-10fps on my machine.
2) Disabled 3D clouds have no performance impact. Previously they were still in the scenegraph. Now they are removed.
3) Clouds are now loaded on start-up, and don't require the scenario to be changed, they also work with METAR.
4) The cloud field is shifted as you travel. There's a small bug in that the clouds "jump" as you reach the edge of the field.
5) Iterative sorting of sprites. This doesn't appear to solve the alpha blending problem completely, but may help a bit.
2008-11-06 21:58:07 +00:00
timoore
cc17cc4af7 Respect precipitation-enable property
From Csaba Halász
2008-10-31 09:46:23 +00:00
timoore
6afd7e1a38 enable world coordinate particle fix 2008-10-30 23:51:41 +00:00
curt
91e22c1fb3 Tidy up for a source code "snapshot" release. 2008-10-30 17:51:00 +00:00
fredb
ad6129816d 3D clouds from Stuart Buchanan. Need a recent driver update, --enable-clouds3d option and a Weather Scenario to show up 2008-10-26 09:37:13 +00:00
curt
409db9d7ef Fix a few spelling errors. 2008-10-23 18:46:55 +00:00
mfranz
2ccd58e917 fix regression: sgLoad3DModel_internal should not make assumptions
about the type of SGModelData. This *can* have to do with Nasal,
but doesn't have to. That's entirely that class instance's business.
2008-10-18 18:44:36 +00:00
mfranz
7585ad430a add global switch for particle systems 2008-10-17 21:15:58 +00:00
mfranz
c105c5a449 allow to modify the XML animation config of a loaded submodel by
defining an <overlay> branch, which is copied over the submodel's
properties before the animations are evaluated
2008-10-14 13:01:01 +00:00
mfranz
54065b59a1 Move omit-node part from startElement to endElement to allow nodes
of this type to have children. We have to save the omit state on the
stack for that.
2008-10-14 11:03:39 +00:00
durk
f9250ae522 Syd Adams: Replace rgb with png. 2008-10-14 05:04:43 +00:00
mfranz
2f8621ed3d s/multiplayer/multiplay/, as this seems to be the slightly more
official version (--multiplay option, /sim/multiplay/ properties etc.)
2008-10-10 09:48:03 +00:00
mfranz
98a3e7cffa if a model XML file contains a <multiplayer> block, copy its contents
to the model's property root (/ai/models/multiplayer[*])
2008-10-09 22:20:33 +00:00
andy
d7f2966216 Yeah, I really shouldn't be in the lexer 2008-09-30 21:52:44 +00:00
andy
8687b214e7 Another lexer fix 2008-09-30 20:19:01 +00:00
andy
f5f1f0da8e Fix broken lex.c checkin 2008-09-30 19:06:34 +00:00
andy
818359bfd0 Fixes for bugs shaken out in the recent push: die properly for nil
indexes in slices.  Fix string conversion issue with bare "+" and "-".
Fix lexing of exponent expressions such that "1e" is not a number.
2008-09-30 16:48:36 +00:00
fredb
8174005ac8 MINGW patch by Csaba Halasz 2008-09-28 08:11:10 +00:00
andy
0180cae8c3 Fix parsing for degenerate cases like a[,] a[:] and {:}. The slicing syntax exposed the low-level generators to some new cases. 2008-09-26 19:18:19 +00:00
andy
dd1ea541ec Sync with Nasal upstream (Melchior already had a chance to test this,
so hopefully not too much breaks).  New syntax features:

1. Call-by-name function arguments.  You can specify a hash literal in
place of ordered function arguments, and it will become the local
variable namespace for the called function, making functions with many
arguments more readable.  Ex:

   view_manager.lookat(heading:180, pitch:20, roll:0, x:X0, y:Y0, z:Z0,
                       time:now, fov:55);

Declared arguments are checked and defaulted as would be expected:
it's an error if you fail to pass a value for an undefaulted argument,
missing default arguments get assigned, and any rest parameter
(e.g. "func(a,b=2,rest...){}") will be assigned with an empty vector.

2. Vector slicing.  Vectors (lists) can now be created from others
using an ordered list of indexes and ranges.  For example:

   var v1 = ["a","b","c","d","e"]

   var v2 = v1[3,2];   # == ["d","c"];
   var v3 = v1[1:3];   # i.e. range from 1 to 3: ["b","c","d"];
   var v4 = v1[1:];    # no value means "to the end": ["b","c","d","e"]
   var i = 2;
   var v5 = v1[i];     # runtime expressions are fine: ["c"]
   var v6 = v1[-2,-1]; # negative indexes are relative to end: ["d","e"]

The range values can be computed at runtime (e.g. i=1; v5=v1[i:]).
Negative indices work the same way the do with the vector functions
(-1 is the last element, -2 is 2nd to last, etc...).

3. Multi-assignment expressions.  You can assign more than one
variable (or lvalue) at a time by putting them in a parenthesized
list:

   (var a, var b) = (1, 2);
   var (a, b) = (1, 2);               # Shorthand for (var a, var b)
   (var a, v[0], obj.field) = (1,2,3) # Any assignable lvalue works

   var color = [1, 1, 0.5];
   var (r, g, b) = color;  # works with runtime vectors too
2008-09-26 18:22:12 +00:00
timoore
19aac5b14c Keep non-local particles in a Z-up frame that is periodically moved.
This eliminates jitter and other rendering problems.
For the moment this is dependent on an osg fix.

Also, don't read wind properties from FlightGear; provide a mechanism
for fg to set the wind.
2008-09-11 10:19:05 +00:00
ehofman
f3f8a211cd Make sure the compiler is aware that SGModelData a child of osg::Referenced, now gcc-3.3 will compile. 2008-09-04 08:52:47 +00:00
fredb
3edcbc3b99 Use a more relevant library name 2008-08-31 18:39:49 +00:00
fredb
5a1cc8745e Update version 2008-08-31 18:35:02 +00:00
timoore
12495547c4 Don't use osgDB::SharedStateManager::share in SGLoadTexture2D
It is not safe to call this function from the database pager thread;
in any event, state sets and textures created in the database pager
will get passed through the SharedStateManager anyway.
2008-08-29 07:39:05 +00:00
curt
ff654ab094 - Update SimGear.dsp
- Assign an arbitrary prerelease version number
- Fix a "make dist" problem.
2008-08-28 17:52:43 +00:00
andy
e55f55cd3e Fix typing error with fgetc in readln(). On most boxes, this would
cause a spurious EOF when there was a 0xff in the stream.  But on PPC,
char is unsigned (for reasons known only to IBM) and it would loop
forever.
2008-08-25 16:53:34 +00:00
timoore
29aad066f0 pointers in Particles object should be ref_ptr 2008-08-11 08:32:13 +00:00
timoore
74d3bdc68c Return eof after a number of reptetitions of file input. 2008-08-07 22:24:01 +00:00
fredb
7f9b3a8666 Update MSVC 7.1 projects - Adapt to OSG 2.6.0-rc1 : location of header files should now be searched in the install directory, here ..\..\..\install\msvc71\OpenSceneGraph\include 2008-08-02 11:31:47 +00:00
ehofman
426f6de16f final fixes for SG_USING_STD removal 2008-07-29 08:25:17 +00:00
timoore
cf19b81dd4 forward declare osg::DrawElementsUShort for real 2008-07-29 02:54:48 +00:00
ehofman
d4c7e95092 Replace SG_USE_STD() by using std:: 2008-07-28 07:52:13 +00:00
fredb
aa07b5bdd8 GL/wgl.h never existed, and a glx equivalent is not needed 2008-07-27 18:04:13 +00:00
ehofman
c7cbb22667 - remove the SG_GLxxxx_H #defines, since OSG provides its own versions
- this exposed a bizarre issue on Mac where dragging in <AGL/agl.h> in
   extensions.hxx was pulling in all of Carbon to the global namespace
   - very scary. As a result, I now need to explicitly include CoreFoundation
   in fg_init.cxx.
 - change SG_USING_STD(x) to using std::x

Issues:

 - the logic for X11 and Win32 in RenderTexture and extensions is tortured,
   please see if you agree I got all the ifdefs correct.
2008-07-27 16:10:36 +00:00
fredb
ff72b68731 Remove unneeded inclusions of windows.h, GL.h and GLU.H 2008-07-27 15:15:33 +00:00
fredb
433be0e46b Maybe a more portable way to do it 2008-07-25 21:33:54 +00:00
fredb
900607034e Compile again with MSVC 2008-07-25 21:27:46 +00:00
ehofman
733e6fa14f Reduce compiler.h to almost nothing (but it's worth keeping around I think, for
the MSVC and MipsPro warning stuff).

As a result of this patch, simgear/sg_traits.h can be deleted. So can SGCMath.h,
but I'll do that separately.

There is one more 'mechanical' change to come - getting rid of SG_USING_STD(X),
but I want to keep that separate from everything else. (There's another mechnica
l change, replacing <math.h> with <cmath> and so on *everywhere*, but one step a
t a time)
2008-07-25 18:35:40 +00:00
ehofman
cd72eb20c6 Attached patches remove BORLANDC, and hence SG_MATH_EXCEPTION_CLASH and SG_INCOM
PLETE_FUNCTIONAL from SimGear and FlightGear.

As a result, SG_HAVE_STD_INCLUDES is now *always* set, so I will get the boring
fixes for that done, but separately. I'm still auditing the other things in comp
ilers.h - there's a lot that can die now BORLAND is gone.
2008-07-25 10:39:20 +00:00
ehofman
d754e616a5 remove a workaround for the C++ / stdlibary bug which existed aeons ago on Mac. 2008-07-25 08:34:15 +00:00
ehofman
d613e0a488 Patch to remove macintosh and MWERKS from Simgear. 2008-07-24 19:16:50 +00:00
timoore
942fa53ed9 Add repeat option to SGFile.
This supports auto-looping over a playback file, for demos and such.
2008-07-19 16:01:20 +00:00
timoore
1729841083 Eliminate empty default constructor for SGReaderWriterBTGOptions 2008-07-19 16:00:58 +00:00
mfranz
315d83bc88 s/getChild/getNode/ (otherwise "start/size" wouldn't work) 2008-07-12 15:31:29 +00:00
mfranz
223aa0ccd5 - XML interface changes:
* condition at top level
  * <start|end>/<color|size> hierarchy
  * wind/gravity -> bool
  * rename some properties (rotspeed -> rotation-speed, etc.)
  * unit suffixes
- remove redundant code
- warnings--
2008-07-12 14:06:11 +00:00
mfranz
38494a48d8 fix SGPropertyNode::LAST_USED_ATTRIBUTE 2008-07-10 10:33:32 +00:00
mfranz
38456bddb5 write-protection warning: use simplified path 2008-07-09 17:31:55 +00:00
mfranz
b8a12b0e5b let readProperties() refuse to overwrite write-proteced properties 2008-07-09 16:17:52 +00:00
mfranz
2d37c0aa42 remove redundant #defines (they are already in compiler.h) 2008-06-22 18:07:50 +00:00
timoore
c8c693db53 From Benoit Laniel: replace SG threading constructs with those from OpenThreads
Also, move any static local mutexes up to global level.
2008-06-12 08:14:40 +00:00
fredb
cdff0fceea Update MSVC 7.1 projects 2008-06-08 16:45:13 +00:00
mfranz
3b6f47aea1 warnings-- 2008-06-07 14:45:22 +00:00
timoore
7bc37651c3 add OSGVersion.hxx to VC7.1 project file 2008-06-02 20:26:07 +00:00
timoore
4fe43c3e50 OSG DatabasePager interface change in 2.5.1
Move OSG version macro from FlightGear to simgear
2008-06-02 20:22:16 +00:00
timoore
0826b7c3ca Replace header files istream and ostream with iosfwd 2008-06-02 20:21:50 +00:00
timoore
d219c5c4c6 Don't include <iostream> and "using" declarations in header files
<iostream> sucks in expensive initialization of the standard streams
and isn't appropriate in a header file. Use <istream> and <ostream>
instead.

using declarations should never appear at global scope in a header
file; source files get to decide what they want to use in their
namespace.
2008-06-02 20:21:27 +00:00
fredb
1a498348ee Fix non threadsafe code 2008-06-01 17:25:05 +00:00
fredb
c6b03555f7 Report abnormal condition 2008-05-31 12:08:17 +00:00
fredb
bb1a270532 Update MSVC 7.1 projects 2008-05-31 12:06:30 +00:00
fredb
69ea4b846a Fix a problem in loading models with paged LOD in some circunstances ( debug with MSVC for instance ) 2008-05-31 12:05:11 +00:00
fredb
373a0e4a7d Use bool instead of int to represent boolean values 2008-05-31 10:02:43 +00:00
mfranz
f4f5ab2392 xmlsound: warning-- 2008-05-21 14:51:39 +00:00
mfranz
b20b3229bf add <delay-sec> parameter that defines how many seconds after triggering
the sound should be played (default: 0)
2008-05-21 14:47:06 +00:00
mfranz
77fb93bb61 update library version requirements 2008-05-19 15:17:55 +00:00
fredb
ec72b46dcb Win32 fix 2008-05-15 06:19:15 +00:00
timoore
367f1813de sg: move most scenery-related code to simgear
From Till Busch
2008-05-14 22:07:50 +00:00
mfranz
74116057a7 Till BUSCH: enable HOT intersection tests on random buildings 2008-05-01 12:21:52 +00:00
mfranz
9deb40216e Nicolas: let SGPath::create_dir() return success/failure (for screenshot) 2008-04-26 15:25:29 +00:00
mfranz
daef76ec0b Till BUSCH:
"tim recently noticed the database pager was repeatedly loading and unloading
the same objects. he also tracked down the problem to missing bounding sphere
information in osgDB::PagedLOD. this is a simplicistic approach to fix this:
SGPagedLOD will now remember whatever value it sees for getBound() after
loading a child. this patch will make database pager run much calmer."
2008-04-25 08:41:29 +00:00
timoore
569a29fbbc Fix new livery code
It turns out that the database pager causes the texture image to be
unloaded after it is applied, so the image and its file name may not
be available for doing the livery substitution. Ask a work around we
set the name of the texture to its file name.
2008-04-24 22:06:06 +00:00
fredb
0c06bfd3d9 Update MSVC 7.1 projects 2008-04-23 22:09:23 +00:00
timoore
8f46f2cac8 Rewrite livery texture replacement to copy StateSet objects
Also, add a NodeAndDrawableVisitor that descends into osg::Drawable.

That motivation for this is that it's a bad idea to modify state sets
that the osgDB::SharedStateManager might be keeping.
2008-04-23 18:13:50 +00:00
mfranz
8f48515b80 Till BUSCH:
this is a small (-1/+3) patch to fix pick animations on scenery objects.
since picking apparently doesn't care for polygon offsets, the objects
got into the picklist in the wrong way. now, no matter if the "highlight
group" or the "normal group" gets hit first, the callback will fire.
2008-04-23 12:28:45 +00:00
timoore
c7dab4abea rewrite of sky dome code
Add more points to the dome, giving it a dome shape rather than a
dunce cap shape.

Represent as OpenGL DrawElements instead of as triangle strips.

Only calculate have the sky colors and reflect those across the dome.
2008-04-14 21:44:21 +00:00
fredb
5e4c4725bc Update MSVC 7.1 projects 2008-04-14 06:27:26 +00:00
timoore
9861d74221 Fixes for compiling with gcc 4.3
Include standard header files and qualify with std:: where needed.

Add "const" to various char parameters and variables.
2008-04-13 21:11:44 +00:00
fredb
bb3b606820 Allows to load submodels with path relative to current model path.
Submodel path must be prefixed by ./ otherwise path is relative to fg_root ( current behavior )
2008-04-02 22:25:12 +00:00
timoore
09fb51189e Change the tile light group node mask to traverse VASI lights too.
The change to set the light group node mask to LIGHTS_BITS caused
VASI/PAPI lights to not be displayed during the day. This patch fixes
that and optimizes VASI creation a bit.
2008-03-24 21:41:30 +00:00
fredb
bd19899bbc Update MSVC 7.1 projects 2008-03-22 11:39:01 +00:00
fredb
b69753fb76 Win32 fix 2008-03-22 11:38:50 +00:00
timoore
9dc1b5f6f5 model paging patch from Till Busch
Comments from Till:
I started the project at the end of february with a simple idea: move all
3d-model loading to the DatabasePager-thread. my first attempts looked
promising, though they were a little too optimistic (or naive?). the patch
has evolved a lot since.

currently it does the following things:
1. revive SGModelLib, move functions for xml-model-loading there

2. replace all calls to sgLoad3dModel with calls to either
SGModelLib::loadModel() or SGModelLib::loadPagedModel()
almost all models will be loaded by the DatabasePager. the few exceptions are:
your own plane, shared models in scenery, random objects, AIBallistic models.

3. simplify mode-loading functions (avoid passing around fg_root)

4. avoid supurious MatrixTransform nodes in loaded models

5. fix some memory leaks
2008-03-22 09:30:26 +00:00
mfranz
55c1ac36e3 - warnings--
- make one-shot sounds subject to volume and pitch control (To get
  constant volume/pitch during the whole lifetime, just *configure*
  the sound that way.)
2008-03-20 17:20:54 +00:00
timoore
c12e6cdc09 rationalize node masks a bit 2008-03-17 08:46:23 +00:00
curt
85562e8b95 argh, missed 1.8.4 in one spot. 2008-03-15 16:33:49 +00:00
curt
fd34cc0b87 Simgear also enforces plib-1.8.5 in order to build. 2008-03-15 16:32:36 +00:00
timoore
6322393782 From Till Busch: use install -p if possible 2008-03-11 13:44:43 +00:00
fredb
1f9e954610 Update MSVC 7.1 projects 2008-03-09 22:09:52 +00:00
mfranz
6491746809 use new arrow shortcuts for compatibility reasons (will be removed later) 2008-03-04 11:48:51 +00:00
timoore
6d2f1ff81e cleanup of precipitation contribution
Reindent everything to Stroustrup style and make member variable style
consistent.

Remove unused header files.

SGPrecipitation is now a subclass of osg::Referenced.

Initialize snow and ice intensity to 0 directly. The methods that set
the intensities change the value slowly and so don't work when the
initial value is garbage.
2008-03-04 08:58:33 +00:00
timoore
c724e5fb20 precipitation effects from Nicolas Vivien 2008-03-04 08:54:00 +00:00
timoore
600726976c Add methods to SGGeod to return OSG Matrix objects for local frames.
Methods have been added for Z down (simulation) and Z up frames.
2008-03-04 08:53:27 +00:00
fredb
49b5c2058d Initialize variables before using them 2008-03-02 16:49:07 +00:00
durk
21df21b144 Olaf Flebbe: Micro update to the MSVC8 Project files. 2008-03-02 16:09:57 +00:00
fredb
620e71e800 Update MSVC 7.1 projects 2008-02-28 21:25:44 +00:00
mfranz
db2216848d don't reset visibility modifier in the M5SM case 2008-02-20 23:36:27 +00:00
mfranz
cfffe91ed5 Syd ADAMS: remove season suffix, this is now done via <condition>s 2008-02-16 22:09:40 +00:00
mfranz
a95aed1047 remove getRootNode(), as this resets the model root 2008-02-16 17:01:01 +00:00
mfranz
2883a36c76 Csaba HALASZ: implement conditional (e.g. seasonal) texture loading at startup 2008-02-15 17:54:01 +00:00
timoore
ac4245013f Cleanup of particles contribution
Put particles classes inside simgear namespace

Refactored some redundant code

Reworked local frame math to use OSG math classes as much as possible
2008-02-15 06:44:24 +00:00
timoore
b09e484492 particles from Tiago_G 2008-02-15 06:44:05 +00:00
timoore
dc63ddb010 Small cleanup of tree shader 2008-02-07 23:01:32 +00:00
timoore
09778a8eab Minor cleanup of Stuart Buchanan's tree patch.
Separate random objects and random trees for real.
2008-02-07 23:01:16 +00:00
timoore
8cbe9f1bd0 Second trees patch from Stuart Buchanan
Adds random variation of tree texture maps
2008-02-07 23:00:23 +00:00
timoore
be61689458 Cleanup and performance tuning of the random trees code.
The QuadTreeBuilder class was completely revamped as a templated class
to support flexible creation of scene graph quad trees, and a major
bug was fixed as well. Now it actually generates quadtrees instead of
some weird striped thing.

One StateSet is shared among all the "forests." The trees are drawn
after normal terrain objects to minimize some of the transparency
related artifacts.

Lighting was implemented in the ShaderGeometry shader (for both
polygon sides). Ambient-diffuse values for trees are hard-coded in
TreeBin.cxx.

DotOsg wrappers were added for ShaderGeometry so it can be output in
the scene graph dump.
2008-02-02 23:01:27 +00:00
timoore
4b63bc051e Random trees from Stuart Buchanan
Stuart's new file SGTreeBin.hxx has been split into 4 files:
TreeBin.[ch]xx and ShaderGeometry.[ch]xx.
2008-02-02 23:01:05 +00:00
timoore
a098ba5e79 Memory leak fixes from Till Busch 2008-01-24 23:05:18 +00:00
fredb
edee4b3fe5 Update MSVC 7.1 projects 2008-01-17 21:41:48 +00:00
timoore
0c9013e60e fix memory leaks in random object code
Don't allocate mt structures (for the random number generator) on the heap.
2008-01-17 08:28:15 +00:00
fredb
701c4bcf27 Avoid spitting gazillion 'Cannot find image file "" ' message on the console while loading random objects 2008-01-12 08:50:21 +00:00
frohlich
22f2fac56b Modified Files:
simgear/scene/model/animation.cxx:
	Change factor/offset order for texture animations.
	Fixes remaining bug with texture animations.
2008-01-07 22:05:48 +00:00
timoore
605125c0e7 Random object support from Stuart Buchanan
In addition to Stuart's changes, there's an independent quad tree
builder class for constructing loose quad trees from scene graph nodes.

Stuart also implemented changes to the random number generator suggested by
Andy Ross.
2008-01-06 15:04:43 +00:00
fredb
65d0ee126a Update MSVC 7.1 projects 2008-01-04 21:45:41 +00:00
fredb
4db6435090 Remove warnings 2008-01-04 21:45:14 +00:00
timoore
4383fd3c45 Give the sky a BACKGROUND_BIT nodemask
Add a MODEL_BIT and tag clouds with that.

Remove vestigial post_root from sky code.
2008-01-04 07:33:42 +00:00
timoore
b6be76b0ab background node mask 2008-01-04 07:33:23 +00:00
frohlich
92d8fa1193 Modified Files:
simgear/scene/model/SGClipGroup.cxx
	simgear/scene/model/SGClipGroup.hxx Update the clip group.
2007-12-31 15:49:01 +00:00
frohlich
9c51bf3edf Modified Files:
simgear/scene/model/animation.cxx: Create animation inputs if not
	already there. Fixes broken texture animations from past checkin.
2007-12-31 15:48:02 +00:00
frohlich
cf0e4e6f8c Modified Files:
Makefile.am SGPickCallback.hxx: add proirities for pick callbacks.
2007-12-26 19:19:51 +00:00
frohlich
c3719f35e3 Modified Files:
animation.cxx animation.hxx: Make use of the expression stuff.
	Factors out common code with other animations stuff in flightgear.
2007-12-26 19:12:04 +00:00
frohlich
0b1f074bcf Modified Files:
Makefile.am
Added Files:
	SGExpression.cxx SGExpression.hxx: Add not yet complete but already
	usable expression tree. Will be used with the panel code.
2007-12-26 19:10:40 +00:00
frohlich
7fe8514434 Modified Files:
scene/model/SGClipGroup.cxx: Oops, add missing simgear_config.h
2007-12-26 19:08:45 +00:00
frohlich
37c4dcf8ba Modified Files:
Makefile.am
Added Files:
	SGClipGroup.cxx SGClipGroup.hxx: Add helper group node for reuse
	of clipping planes. Will be used for the panel code.
2007-12-26 19:05:06 +00:00
frohlich
e33dd3c499 Modified Files:
simgear/props/props.hxx: Add a bunch of convinience functions.
2007-12-26 19:03:21 +00:00
timoore
94be52886e Pass ReaderWriter options to SGMaterialAnimation
It needs to grab the path list from options in order to support the texture
change animation.
2007-12-23 23:33:04 +00:00
timoore
6646aa5644 Fix tiny bugs in sun constructor and repaint code 2007-12-22 23:01:36 +00:00
timoore
d556eba296 Add StateAttributeFactory files to VS project file 2007-12-21 06:29:36 +00:00
timoore
a5b573b2d3 optimize groups from .AC file optimizer run 2007-12-21 06:25:40 +00:00
timoore
18d30ea8fa Repaint 2D cloud layers using texture combiner
Don't change the color in the cloud layer geometry
2007-12-21 06:25:13 +00:00
timoore
4324ffccf4 Fix cloud layer - point lights visibility issue
Move point lights to render bin 8, clouds to render bin 9. Turn on
AlphaFunc for cloud layers.

Create a StateAttributeFactory object to create and share common state
objects.
2007-12-21 06:24:53 +00:00
fredb
182ee9d7e4 Update MSVC 7.1 projects 2007-12-18 22:25:24 +00:00
timoore
68c1cfed46 Use node masks and shared state sets to manage ground lights
Do away with the switch in each terrain tile for the ground lights. They are
turned on by node masks now.

Share state sets among all the light nodes and manage the fog values through a
"GroundLightManager" instead of having separate state sets and callback
functions for each group in each tile.
2007-12-13 23:30:24 +00:00
timoore
1159784538 minor fix to ModelRegistry and syntax changes for Windows
Create the local path in the right order in OptionsPusher. When
OptionsPusher is used, put it inside a new code block so the order of
destruction with respect to the mutex on reader functions id clear.

Add #include <algorithm> to top of ModelRegistry.cxx.

Change include syntax in PathOptions.cxx
2007-12-11 11:07:21 +00:00
timoore
e683b5fdec Check for null options before changing path in registry 2007-12-10 08:30:43 +00:00
timoore
3c409c5070 Work around osg Registry path list problems
The OSG reader plugins overwrite the path list passed in options with the local
directory of the file being read, forcing you to set the path list in
the Registry. I think this a bug, but in the meantime here's a workaround.
2007-12-09 22:38:10 +00:00
timoore
4b7361dfe7 Add operator!= to SGBucket 2007-12-07 23:35:04 +00:00
timoore
037d5c11a5 Add option to SGLoadTexture2D to load dynamic textures 2007-12-07 09:13:34 +00:00
mfranz
95d857e091 - comparison: don't crash if second element is missing
- better messages ("panel"?!)
2007-12-06 17:57:41 +00:00
timoore
4efa087cd1 Don't modify OSG Registry with file path
To set a path when loading model files, use an osg ReaderWriter::Options object.

Put locks in ModelRegistry::readNode and ModelRegistry::readImage to avoid
conflicts when files are loaded from both the pager and the main thread.
2007-12-04 22:38:40 +00:00
fredb
60f0003436 Update MSVC 7.1 projects 2007-12-02 12:28:30 +00:00
timoore
fdb265cd6e Change the main ModelRegistry callback function to stash the substituted file in the cache. 2007-11-29 23:56:49 +00:00
timoore
34704a17f2 Avoid copying drawables and dirtying display lists.
For the alpha-test animation, use an OVERRIDE attribute on the state
set of the top level node instead of copying drawables and state sets
throughout the model.

As a temporary hack in the blend animation, don't use display lists in
the cloned drawables.

These changes are aimed at cutting down the number of display lists
that the pager needs to compile.
2007-11-29 23:56:31 +00:00
timoore
4a959ec2fd rewrite ModelRegistry callbacks as a template with pluggable policy classes
In a big effort to improve use of the object cache, provide a
ModelRegistryCallback template class with different policies for
substitution,  caching, optimization, etc.

Change SGTexDataVarianceVistor to make StateSets static too.
2007-11-29 23:56:09 +00:00
timoore
f182886fce Start of cleanup of scene graph node masks 2007-11-29 23:55:35 +00:00
timoore
2fbaddbecf Move SGReadFileCallback from model.cxx to public class ModelRegistry
Move SGReadFileCallback and all its help classes into a new
ModelRegistry class that also provides an interface to add custom
callbacks for specific file extensions. SGReaderWriterBTG uses that to
keep any further processing from being done on .btg files. Various
namespace-releated cleanup was done on this code too.
2007-11-29 23:55:01 +00:00
timoore
cafcecf03d StateSet optimizations
Use only one shared StateSet to control GL_NORMALIZE. This removes
thousands of state sets from the scene graph.

Fix a typo that was causing two copies of groundLights0 to be added to
each tile.
2007-11-18 23:31:03 +00:00
timoore
49473845cf Some scene graph optimizations
When loading terrain, use DrawElementsUShort where possible.

Don't chunk unconnected triangles in the terrain into seperate
Geometry sets; make the sets as big as possible.
2007-11-18 23:30:34 +00:00
durk
d4d4ed22a0 Minor documentation updates. 2007-11-18 14:21:41 +00:00
durk
240ed6f0b1 Refined debug timing control:
- Added a SampleStatistic class (from the old deprecated libg++) library.
 - Make time statistics and printing conditionable
 - Added an interface function to switch time stamp collection and printing
   on and off from the application (defaults to off).
2007-11-17 09:16:58 +00:00
frohlich
084a24e958 Improove texture sharing. 2007-11-09 05:55:50 +00:00
frohlich
cd9e3648e9 Update node masks 2007-11-09 05:52:58 +00:00
curt
7ed51be4e6 In the original flightgear native/binary scenery terrain data format, we
used short's extensively to represent counts of objects (number of points,
number of texture coordinates, number of traingle strips, etc.) and we used
shorts to index into larger structures.  But this capped many of our structure
sizes to a maximum of 32768.

By switching to unsigned shorts in the future, we can double the maximum
object/index counts without losing anything.  This was a pretty major
oversight in our original specification.

I have bumped up the native object file version from 6 to 7 and added code
in the reader to maintain full backwards compatibilty with version 6
scenery files (i.e. the current 0.9.10 scenery release.)

Curt.
2007-11-05 21:42:29 +00:00
durk
0c8358ae67 - A few fixes to ensure SimGear compiles again on cygwin.
* on cygwin, isnan is declared in ieeepf.h
  * CYGWIN is a special case in that it is windows based, but sometimes
    folows unix conventions. SGAtomic compilation failed on an illegal
    volatile type cast without the additional __CYGWIN__ define check.
2007-10-15 18:49:50 +00:00
durk
25cefd9129 * Fixed memory leak in RenderTexture.cpp (tiny, but still...)
* Added Timestamping debugging code to SGSubsystems (ported from plib
  branch).
2007-10-14 13:46:13 +00:00
timoore
af75c0ca0c Add ability to override existing model files with .osg files.
This enables off-line optimization of models and other special effects.
2007-10-12 22:46:35 +00:00
timoore
a91b2629d3 Manage OSG object cache explicitly
Don't have Registry::ReadNodeImplementation store its results in the
object cache; instead store the optimized model in the cache.
2007-10-12 22:46:13 +00:00
mfranz
de9070dba1 better standard compliance: allow empty top level tags (<PropertyList>) 2007-10-10 12:45:53 +00:00
timoore
813b518b6f Don't reset the random texture base when rebuilding a cloud layer
This fix removes obnoxious visuals (texture jumping) when a cloud
layer is moved due to a metar update or, more significantly, when
switching from metar to a scenario. Also, I switched to using a TexMat
to displace the cloud texture in order to avoid writing the texture
array every frame.
2007-10-04 20:53:22 +00:00
timoore
c47e800f60 Order the cloud layers properly using OSG RenderBin 2007-10-02 21:43:52 +00:00
timoore
8398f45d43 ocean state set in osg::Geometry
Put the ocean tile state set in osg::Geometry, not the osg::Geode, so that
is readily available during intersection testing and can be used to find the
corresponding SGMaterial.

Problem reported by grtux (gh.robin@laposte.net)
2007-09-30 19:51:49 +00:00
timoore
aeaaa50f6c Fix material animations with only a <texture-prop>
On 8/31/07, K. Hoercher <wbhoer@gmail.com> wrote:
> > Some notes:
> > - I found that in order to make the example from model-howto.html work
> > ( starting at "To make a texture replaceable at runtime") one has to
> > specify a valid (i.e. loadable) <texture>  in the material animation.

The cause seems to be the condition in SGMaterialAnimation.cxx l.277
ignoring any texture update by the UpdateCallback (only there
<texture-prop> is looked at)  without an already existing stateSet.
That in turn will not be created with a <texture-prop> alone l. 379ff.

Unless I overlooked some compelling reason contradicting, I'd like to
suggest allowing for a stateSet to be created for those situations
too. I think that would match the behaviour of animation.cxx
(PRE_OSG_PLIB_20061029) and is imho the more expected and also
documented one.
2007-09-05 22:12:00 +00:00
durk
f33ce846b8 Change "FlightGear" to "SimGear" of course. 2007-09-01 12:57:53 +00:00
durk
4718b9dc07 Added a check for OpenSceneGraph and created some basic documentation. 2007-09-01 12:55:46 +00:00
durk
fba00f7c5a Add separate check for openal and ALUT, as these are now separate. 2007-09-01 10:04:36 +00:00
durk
3360383fd7 Documentation fixes: Updated the contents of README.plib and README.OpenAL
Also make sure that these files are included in the release. This is
required, since ./configure refers to these files.
2007-09-01 09:45:21 +00:00
timoore
6c30f62693 Add curvature to ocean tiles.
An apron around the tile hides cracks with coastal tiles.

The VectorArrayAdapter, which lives in the simgear namespace, is a useful
utility class for treating vectors as 2D arrays.
2007-08-12 21:03:43 +00:00
timoore
ab5b0382da Ocean tile detail work in progress 2007-08-12 21:02:54 +00:00
fredb
671f3f5890 Update MSVC 7.1 projects 2007-08-12 13:40:16 +00:00
fredb
9bae445624 Fix a typo 2007-08-12 13:32:42 +00:00
frohlich
30529ccdf5 Modified Files:
projects/VC7.1/SimGear.vcproj projects/VC8/SimGear.vcproj
	simgear/math/Makefile.am simgear/math/SGGeoc.hxx
	simgear/math/SGGeodesy.cxx simgear/math/SGGeodesy.hxx
	simgear/math/polar3d.hxx simgear/math/sg_geodesy.hxx
	simgear/math/sg_types.hxx
Removed Files:
	simgear/math/polar3d.cxx simgear/math/sg_geodesy.cxx
	simgear/math/sg_memory.h:
	Remove sg_memory.h It is unused anyway and should not be required
	in a c++ world. Move distance course functions to the SG* type
	system. Move the implementation into SGGeodesy.cxx. Remove some of
	the old Point3D Based sg* functions that are already unused.
2007-08-07 05:26:21 +00:00
frohlich
a8a02d3a2e Modified Files:
projects/VC8/SimGear.vcproj:
	MSVC8 Build system updates from Olaf Flebbe.
2007-08-07 04:59:09 +00:00
andy
5da33ca244 Melchior discovered that call(call) would crash due to a longstanding bug with argument parsing 2007-08-01 22:46:12 +00:00
andy
04c1e95f08 Fix crash in code generator for some bad lvalue expressions 2007-08-01 22:33:01 +00:00
andy
2186fc1fc7 Add ppc64 to the list of supported platforms based on testing by Tom Callaway at Red Hat 2007-07-31 20:57:21 +00:00
timoore
fb49a9192e Fix ocean texture scaling problem. 2007-07-31 06:39:26 +00:00
curt
ccbc5abec6 Remove an extern SGSky *thesky reference that isn't used in the code anyway.
The original code forced a dependency in SimGear back to something that is
defined globaly in FlightGear, not a great strategy for a library with some
"general purpose" intentions.
2007-07-31 01:21:21 +00:00
timoore
7aa6fd479d OSG Reader and Writer for BTG files
This is part of a somewhat long road towards terrain database paging using
OSG's database pager thread.
2007-07-29 22:32:58 +00:00
frohlich
3fcc16c1a0 Modified Files:
simgear/math/SGGeoc.hxx: Fix unit conversion problem
2007-07-27 19:27:24 +00:00
timoore
b3e0298189 SimGear: Typo in Thanks file
Fix typo

Author: Hans Ulrich Niedermann <hun@n-dimensional.de>
Committer: Tim Moore <moore@redhat.com>
2007-07-23 22:00:31 +00:00
timoore
7e1fe7d852 SimGear: Properly print compilers in configure.ac
Print $CC and $CXX using the proper configure.ac mechanism

Author: Hans Ulrich Niedermann <hun@n-dimensional.de>
Signed-off-by: Tim Moore <timoore@redhat.com>
2007-07-23 21:45:11 +00:00
timoore
5d7d77d4b6 Allow parallel make ("make -j2") by giving make the opportunity to
determine dependencies.

As in subdirectory foo/bar, $(top_builddir)/foo/bar is defined to be the
current directory, this does not cause any regressions.

From Hans Ulrich Niedermann (hun@n-dimensional.de)
2007-07-22 22:37:26 +00:00
timoore
418856769b Support for reading and writing nodes in .osg files, plus some new accessors. 2007-07-22 20:06:20 +00:00
mfranz
46a32dd3ee coding style fixes 2007-07-22 13:58:26 +00:00
mfranz
ecb4dc57b4 Maik JUSTUS: workaround for broken Doppler effect in OpenAL
mf: this patch is meant to be removed as soon as OpenAL got fixed. (The
    OpenAL developers acknowleged the bug and announced that it'll get
    fixed.) For removal try
    $ cd simgear/sound
    $ cvs diff -rAFTER_OPENAL_DOPPLER_WORKAROUND -rBEFORE_OPENAL_DOPPLER_WORKAROUND|patch
2007-07-22 13:50:24 +00:00
mfranz
89d426470b Maik JUSTUS: Doppler fixes (add option to turn off Doppler for sounds that
shouldn't be affected -- marker beep, ATIS messages, etc.)

mf: this is the first part of the original patch. It is supposed to contain
    fixes that are not caused by OpenAL bugs, and thus aren't meant to be
    reverted later. The second part will contain a temprary workaround for
    OpenAL bugs. Unfortunately, I had to do the split myself as the contributor
    refused to do it.
2007-07-22 13:33:23 +00:00
mfranz
23c7a1b5b7 - close loophole through which one could sneak in illegal property names
containing slashes, colons and all sorts of evil characters. In Nasal
  this could be done via props.globals.getChild("1!@#$//[]{}", 0, 1).setValue(0);
  The cause is that getChild() hands the given name directly over to an
  alternative SGPropertyNode ("convenience") constructor which sets the
  name without any checks.
- unify exception messages: first character is lower case
2007-07-17 14:52:51 +00:00
frohlich
3b21e9434f Modified Files:
simgear/route/route.hxx: Remove unused include.
2007-07-08 08:43:40 +00:00
frohlich
d4a4428e64 Modified Files:
simgear/route/waypoint.hxx simgear/route/waypoint.cxx: Use const
	refs where possible.
2007-07-08 08:43:15 +00:00
mfranz
2dfc057135 replace exit() by throw sg_exception(). Of course, we have to be aware
that interdependencies between sg libs are generally unwelcome, but
sg_exception is a rather basic part, and it's already used by xml, props,
scene, sound and, of course, structure. Since props and xml are core
libs, we can assume that sg_exceptions are available.  (OK'ed by Curt)
2007-07-02 15:42:19 +00:00
mfranz
a25eebef9b add SG_ORIGIN macro that expands to a string __FILE__":"__LINE__
Note that __LINE__ is a number and can't be directly used in string
context, which makes the macro worthwhile. (IMHO :-)
2007-07-02 12:55:10 +00:00
mfranz
741c4ca15a back out last changes (radar patch) 2007-06-29 22:45:37 +00:00
mfranz
0bcdf2e4dc easyxml.cxx: add missing endXML visitor call
testEasyXML.cxx: beef it up
2007-06-29 10:46:52 +00:00
mfranz
cd5a720211 Vivian MEAZZA: add support for aircraft radar signatures 2007-06-24 08:09:07 +00:00
mfranz
5cb04946b0 don't only complain that the volume is larger than 1.0, but say how much
it actually is
2007-06-23 16:48:01 +00:00
mfranz
c8953c6275 Maik JUSTUS: fix/implement directional sound 2007-06-21 21:46:21 +00:00
mfranz
e8dc9c9454 d'oh ... beautify the TRACE message that we actually see! :-} 2007-06-19 18:22:32 +00:00
mfranz
a0c325681f beautify TRACE message 2007-06-19 18:11:06 +00:00
mfranz
8d3bf19422 sooner than planned: fix "scale" animation offsets (1 -> 0) 2007-06-17 21:01:40 +00:00
fredb
4477867ef4 Update MSVC 7.1 projects 2007-06-16 16:14:23 +00:00
fredb
e696c884dc MSVC 7 compilation 2007-06-16 16:13:29 +00:00
mfranz
80bcaa49e6 Nick WARNE: add file name to screenshot info line 2007-06-14 20:20:18 +00:00
mfranz
0096c1bb02 advance tracing messages from SG_INFO to SG_ALERT. If a developer has
demanded tracing, then he shouldn't get these important messages buried
in thousands of lines of meaningless bulk.
2007-06-11 16:09:50 +00:00
mfranz
38b37a068d - allow for (rather unusual) ////// cloud groups
- fix potential use of uninitialized memory: dew
2007-06-09 18:36:56 +00:00
frohlich
0281f31df2 Modified Files:
simgear/scene/material/mat.cxx simgear/scene/material/mat.hxx
	simgear/scene/util/SGSceneFeatures.cxx
	simgear/scene/util/SGSceneFeatures.hxx:
	Olaf Flebbe: Make use of SGSceneFeatues for anisotropic filtering,
	clean up.
2007-06-08 06:50:16 +00:00
frohlich
40b182c550 Removed Files:
simgear/scene/tgdb/leaf.cxx: Now obsolete but not yet removed.
2007-06-08 06:40:56 +00:00
frohlich
d1dedc7511 Modified Files:
scene/tgdb/SGOceanTile.cxx: add missing transform for the ocean
	tile.
2007-06-03 18:28:14 +00:00
frohlich
04cd9b3eb6 Modified Files:
simgear/scene/model/model.cxx
	simgear/scene/util/SGSceneFeatures.cxx
	simgear/scene/util/SGSceneFeatures.hxx:
	Make sure textures are shared. Do not rely on a graphics
	context to be available on model loading.
2007-06-03 18:21:04 +00:00
andy
de6003367d Sync with Nasal upstream. Mostly fixes to naContinue(), which
FlightGear doesn't use.  Also includes a performance fix for the
call() builtin that should help Melchior, who was measuring lower
performance for the props.Node() interface than the getprop/setprop
API.
2007-05-30 22:49:41 +00:00
frohlich
a5f42eeddf Modified Files:
projects/VC8/SimGear.vcproj: Olaf FLebbe win32 build system.
2007-05-30 13:16:53 +00:00
frohlich
a8ba041b67 Modified Files:
simgear/scene/model/SGMaterialAnimation.cxx:
	Olaf Flebbe: Use brakets around bitwise operations.
	Greetings from LinuxTag, Berlin ... :)
2007-05-30 13:07:05 +00:00
curt
e700fc6f34 I guess we aren't using explicit destructors here. 2007-05-30 12:34:24 +00:00
curt
af29d3d257 Make an explicit destructor so the compiler doesn't get confused about
non matching exception types with the implicitely defined destructor.
2007-05-29 19:38:17 +00:00
frohlich
487701a143 Modified Files:
simgear/scene/model/Makefile.am
	simgear/scene/model/animation.cxx
	simgear/scene/model/animation.hxx
Added Files:
	simgear/scene/model/SGRotateTransform.cxx
	simgear/scene/model/SGRotateTransform.hxx
	simgear/scene/model/SGScaleTransform.cxx
	simgear/scene/model/SGScaleTransform.hxx
	simgear/scene/model/SGTranslateTransform.cxx
	simgear/scene/model/SGTranslateTransform.hxx:
	Factor out some useful classes.
2007-05-28 07:13:07 +00:00
frohlich
f32e037c58 Modified Files:
simgear/scene/material/mat.cxx simgear/scene/material/mat.hxx:
	Olaf Flebbe: Improoved texture filtering.
2007-05-28 05:13:03 +00:00
frohlich
8bd903dd96 Modified Files:
SGAtomic.hxx: Also use atomic compiler intrinsics on SGI
2007-05-28 05:06:14 +00:00
frohlich
560c100484 Modified Files:
simgear/bucket/newbucket.cxx simgear/bucket/newbucket.hxx
	simgear/io/decode_binobj.cxx simgear/io/sg_binobj.cxx
	simgear/io/sg_binobj.hxx simgear/math/SGVec2.hxx
	simgear/math/SGVec3.hxx simgear/math/SGVec4.hxx
	simgear/scene/material/mat.hxx
	simgear/scene/material/matlib.cxx
	simgear/scene/material/matlib.hxx
	simgear/scene/model/Makefile.am simgear/scene/tgdb/Makefile.am
	simgear/scene/tgdb/obj.cxx simgear/scene/tgdb/obj.hxx
	simgear/scene/tgdb/pt_lights.cxx
	simgear/scene/tgdb/pt_lights.hxx
	simgear/scene/util/Makefile.am
	simgear/scene/util/SGNodeMasks.hxx
	simgear/scene/util/SGTextureStateAttributeVisitor.cxx
Added Files:
	simgear/scene/model/SGOffsetTransform.cxx
	simgear/scene/model/SGOffsetTransform.hxx
	simgear/scene/tgdb/SGDirectionalLightBin.hxx
	simgear/scene/tgdb/SGLightBin.hxx
	simgear/scene/tgdb/SGOceanTile.cxx
	simgear/scene/tgdb/SGOceanTile.hxx
	simgear/scene/tgdb/SGTexturedTriangleBin.hxx
	simgear/scene/tgdb/SGTriangleBin.hxx
	simgear/scene/tgdb/SGVasiDrawable.cxx
	simgear/scene/tgdb/SGVasiDrawable.hxx
	simgear/scene/tgdb/SGVertexArrayBin.hxx
	simgear/scene/util/SGEnlargeBoundingBox.cxx
	simgear/scene/util/SGEnlargeBoundingBox.hxx
	simgear/scene/util/SGSceneFeatures.cxx
	simgear/scene/util/SGSceneFeatures.hxx
Removed Files:
	simgear/scene/tgdb/leaf.hxx simgear/scene/tgdb/vasi.hxx:
	Reorganize tile loaders.
	Build bigger leafs for the tiles.
	Move runway light colors into materials.xml.
	Split out classes that might be useful at other places.
	Avoid static storage on binobject loading.
2007-05-28 05:00:28 +00:00
andy
52444d177b GCC on ppc linux uses a different architecture symbol than the same compiler on OS X 2007-05-25 15:49:10 +00:00
frohlich
b4f7ff29ef Modified Files:
SGVec3.hxx: Fix a problem in perpendicular triangle computation.
	Solves problem with invalid triangles in ground picking ...
2007-05-18 07:29:37 +00:00
frohlich
f7c6a5bfa2 Modified Files:
SGVec2.hxx SGVec3.hxx SGVec4.hxx point3d.hxx: Provide ordering
	relations for use with std::less in tree bases std:: containers.
2007-05-18 04:46:11 +00:00
curt
6fe14f7a6b Fix a compiler warning. 2007-05-16 16:08:17 +00:00
curt
786e5addd8 Fix various compiler warnings. 2007-05-16 16:07:03 +00:00
mfranz
2e9a15f523 Tim Moore 2007-05-15 22:28:08 +00:00
mfranz
bb0d2ddc53 add Mathias and Maik (to make it look less selfish that I add myself :-)
I'm sure I forgot a lot of people, but it's a start.
2007-05-15 22:02:06 +00:00
mfranz
702fb014a5 s/resistence/resistance/ 2007-05-13 11:53:06 +00:00
frohlich
834eab9457 Modified Files:
simgear/bucket/newbucket.hxx simgear/scene/material/mat.cxx
	simgear/scene/material/matlib.cxx
	simgear/scene/material/matlib.hxx
	simgear/scene/model/location.cxx
	simgear/scene/tgdb/apt_signs.cxx simgear/scene/tgdb/leaf.cxx
	simgear/scene/tgdb/leaf.hxx simgear/scene/tgdb/obj.cxx
	simgear/scene/tgdb/obj.hxx
	simgear/scene/util/SGUpdateVisitor.hxx: Reorganize scenegraph to
	simplify top level structure.
2007-05-08 06:11:15 +00:00
mfranz
a85da04601 Add method to return the number of attached listeners. Listeners have become
a much more important feature than they were two years or something ago, and
it's helpful for debugging and exploration to get this important node property
shown in property tree dumps or in the property browser (verbose mode).
2007-05-07 14:03:44 +00:00
mfranz
414f1c27e4 - fix bug where a property tree saved with writeProperties() and read back
in with readProperties() would not look the same, because element indices
  of '0' were even dropped when a node has a "secret" value *and* children

- introduce "omit-node" modifier attribute for the "include" attribute.
  This inserts the given file in place of the including node, while the
  node is dropped. This is desirable for multiple includes (which can't
  be done by multiply using the "include" attribute, as this isn't valid
  XML spec syntax)
2007-05-06 17:33:15 +00:00
mfranz
c76e2eb900 better warning text for <global> in material animations 2007-05-05 11:16:35 +00:00
frohlich
c523e15302 Modified Files:
SGMaterialAnimation.cxx SGMaterialAnimation.hxx:
	Tim Moore: overhaul the material animation.
2007-05-05 09:15:18 +00:00
frohlich
2dc8de295d Modified Files:
simgear/scene/model/animation.hxx
	simgear/scene/model/shadanim.cxx: Tim Moore: the crom shader.
2007-05-03 19:46:13 +00:00
andy
d645fd6327 Empty vectors work much better as the result of sorting an empty array
than nil does...
2007-05-02 22:29:35 +00:00
andy
219a7f3a07 Fix crash when sorting newly-allocated empty vectors 2007-05-02 22:24:45 +00:00
mfranz
d95e3e0055 don't rely on a compressed scanline being properly closed
(GIMP apparently generates corrupted files)
2007-04-28 23:13:13 +00:00
mfranz
2cc31ff425 SGTexture::read_rgb(a)_texture:
- support greyscale and greyscale/alpha format
- cleanup & make it faster
2007-04-28 12:30:38 +00:00
frohlich
8258fd7d9f Modified Files:
projects/VC8/SimGear.vcproj: Olaf Flebbe: Updates to the win32
	build system.
2007-04-21 12:24:43 +00:00
frohlich
784cca2233 Modified Files:
simgear/scene/material/mat.cxx simgear/scene/material/mat.hxx:
	Olaf Flebbe: make anisotroüpic filtering configurable.
2007-04-21 12:13:16 +00:00
andy
436539a700 Melchior found a bug with negative values in default function arguments 2007-04-06 20:35:38 +00:00
andy
dcb3da9f28 sync with Nasal CVS (added a sort() builtin) 2007-04-06 14:52:06 +00:00
mfranz
a354c841f1 Csaba HALASZ:
- fix bug that messed up leg distances after inserting and deleting waypoints
  not at the end of the route
- move add_waypoint() and delete_waypoint from hxx to cxx
- beef up routetest
2007-04-06 09:54:35 +00:00
fredb
3824f064cd Update MSVC 7.1 projects 2007-04-03 11:35:19 +00:00
fredb
cba6db752b Avoid potential memory leak problems when exceptions are thrown by using reference objects 2007-04-03 11:25:07 +00:00
andy
a458e26581 Fix typo in _M_IX86 2007-04-02 21:32:41 +00:00
andy
9d68727a84 Rewrite substr() to properly clamp its argument ranges and handle negative start arguments as offset-from-end values 2007-04-02 18:28:38 +00:00
andy
38b9a874e0 Add missing free functions for win32 2007-04-02 17:34:47 +00:00
andy
7a680fb9f2 Use __FUNCTION__, which works on gcc and MSVC 7/8, instead of
__func__, which while standardized works only with gcc.  I'll wait for
bug reports from VC6 before bothering with fallback code...
2007-04-02 16:14:54 +00:00
andy
a5f9262adb Melchior points out that NaN/Inf behavior is not platform-independent.
So toss a runtime error ("floating point error") when any of the math
library functions produce a non-finite value.  Note that these are not
the only locations that can do that (simply dividing by zero will
produce an Inf), but it's still proper behavior.
2007-03-30 16:42:22 +00:00
andy
b05e32fa8c Sync with Nasal CVS (soon to become Nasal 1.1). Notable new features:
Nasal now supports calls to "subcontexts" and errors can be thrown
across them, leading to complete stack traces when call() is used,
instead of the truncated ones we now see.

Vectors can now be concatenated using the ~ operator that used to work
only for strings.

Better runtime error messages in general due to a fancier
naRuntimeError() implementation

A big data size shrink on 64 bit systems; the size of a naRef dropped
by a factor of two.

"Braceless code blocks" have been added to the parser, so you can
write expressions like "if(a) b();" just like in C.  Note that there's
still a parser bug in there that fails when you nest a braced block
within a braceless one.

Character constants that appear in Nasal source code can now be
literal multibyte UTF8 characters (this was always supported for
string literals, but character constants were forced to be a single
byte).

New modules: "bits", "thread", "utf8" and (gulp...) "io".  The bits
library might be useful to FlightGear, the utf8 one probably not as
Plib does not support wide character text rendering.  The thread
library will work fine for spawning threads to do Nasal stuff, but
obviously contact with the rest of FlightGear must be
hand-synchronized as FlightGear isn't threadsafe.  The io library is
no doubt the most useful, as it exposes all the basic stdio.h
facilities; it's also frighteningly dangerous when combined with
networked code...
2007-03-29 18:50:12 +00:00
mfranz
53d8cff835 Csaba HALASZ: when a path_cache ceases to exist, unregister from all nodes
that had been told that this node is linking to them

mf: remove old erase-by-key methods; they are now unused and always were
    problematic, so they won't be used in the future either
2007-02-17 10:50:49 +00:00
mfranz
00fe97ff88 - don't leak node in both hash_table:🪣:erase()
- remove bad code from hash_table:🪣:erase(const char *) that was
  introduced with the last patch. (This function isn't used anywhere and
  is scheduled for removal. Leaving it in for now as a reference.)
- remove leaves first in remove_from_path_caches()

- cosmetics: indentation, one trailing space, variable name change, comment
  (Sorrry for mixing that with actual code, but I think it's easy to see.)
2007-02-16 15:32:21 +00:00
andy
607511fd64 Don't crash when destroying a SGBinding object if the property node it
was loaded from lacks a parent.  Patch from ndim on IRC
2007-02-14 23:14:00 +00:00
mfranz
8663c265d8 Maik JUSTUS:
"""
- make every node maintain list of properties that link to it
- add functions to erase node by address from hash bucket/entry in their
  path caches, so that all references can be removed
- if a node is removed, it (and all children, grandchildren, ...) calls
  all linked properties to remove them from their path-cache


This fixes problems with the aerotow over multiplayer and maybe some
other problems, where nodes are queried by name.
"""
2007-02-11 11:05:23 +00:00
andy
6c5d35d6ce "bias" argument to texture animations by Ron Jensen 2007-02-07 19:21:24 +00:00
mfranz
95532cb318 fix error message 2007-02-05 21:41:40 +00:00
frohlich
4d91bc5908 Modified Files:
ephemeris.cxx ephemeris.hxx stardata.cxx:
	one must not do changes just before checkin,
	one most not do changes just before checkin,
	[ last message repeated 100 times ]
2007-02-02 18:16:42 +00:00
frohlich
b13900402d Modified Files:
ephemeris.cxx ephemeris.hxx stardata.cxx stardata.hxx: Throw out sg.h
2007-02-02 18:09:27 +00:00
frohlich
1bb6c03bd0 Modified Files:
simgear/scene/util/SGNodeMasks.hxx
	simgear/scene/model/animation.cxx:
	More finegrained cull masks
2007-02-02 07:00:54 +00:00
frohlich
1445949e31 Modified Files:
projects/VC8/SimGear.vcproj: Olaf Flebbe: renenable static build
2007-01-31 21:40:59 +00:00
frohlich
360d3834ca Modified Files:
SGIntersect.hxx SGVec3.hxx SGVec4.hxx: Add convinience methods
2007-01-30 20:12:15 +00:00
fredb
aacdcad529 restore 'double checked locking' 2007-01-29 08:19:13 +00:00
frohlich
ad9341835f Modified Files:
model.cxx: Better texture sharing, fix problem with rotation order
2007-01-28 20:04:56 +00:00
frohlich
b028adb6af Modified Files:
simgear/structure/SGAtomic.cxx: Plug memory leak originating from
	wrong atomic fallback operations.
2007-01-28 20:03:43 +00:00
fredb
39f683b272 Ensure a reference on the cube map texture is always held 2007-01-26 20:30:02 +00:00
ehofman
a6c46c89eb *** empty log message *** 2007-01-23 10:07:36 +00:00
fredb
d534cf6f02 Better fix for the constant scale factor problem 2007-01-21 11:15:36 +00:00
fredb
dd4326f7c4 Support constant scaling factor 2007-01-21 10:33:34 +00:00
fredb
40aecd688e Don't segfault when dir is empty 2007-01-16 21:34:18 +00:00
frohlich
63730a6e2c Modified Files:
animation.cxx: Add a visible configuration option to the pick
	animation.
2007-01-15 19:01:20 +00:00
frohlich
4d4d26aef8 Modified Files:
projects/VC8/SimGear.vcproj: Olaf Flebbe, MSVC8 buildsystem changes.
2007-01-15 17:32:17 +00:00
mfranz
de6b32d8c6 writePropeties(): create dir if necessary 2007-01-12 21:24:50 +00:00
fredb
a0af7f0524 Update MSVC 7.1 project file and fix win32 compilation 2007-01-09 21:58:04 +00:00
frohlich
c043bd3422 Modified Files:
SGSceneUserData.hxx SGSceneUserData.cxx: Remove default argument
2007-01-07 12:25:32 +00:00
frohlich
18ae1d6940 Modified Files:
animation.cxx: Change the pick animation to better handle different
	mouse buttons.
2007-01-07 11:53:21 +00:00
frohlich
d6f64f9773 Modified Files:
SGSceneUserData.hxx SGPickCallback.hxx Makefile.am
Added Files:
	SGSceneUserData.cxx: Cleanup and replace the pick callback with
	such a list.
2007-01-07 11:52:19 +00:00
frohlich
db99a4cb90 Modified Files:
animation.cxx: Add a button argument to that animation.
	The default is to accept any mouse button.
2007-01-07 08:34:03 +00:00
fredb
108689661f Add a prototype simgear_config.h for MSVC 7.1 and a rule to build it. 2007-01-06 17:01:58 +00:00
fredb
d3e00dba8e Add a prototype simgear_config.h for MSVC 7.1 and a rule to build it.
At Olaf requests, add MSVC 8 specific symbols to remove pedantic warnings
2007-01-06 16:52:50 +00:00
fredb
fcd33e5035 Remove redundant directory ( projects as a whole is already there ) 2007-01-06 16:47:57 +00:00
frohlich
af9082cd9f Modified Files:
moon.cxx: The moo's state like it was with plib
2007-01-06 15:08:40 +00:00
fredb
6a0bb18fca Refresh MSVC6 project file 2007-01-06 14:45:21 +00:00
fredb
8aa8d87781 Fix a typo 2007-01-06 14:44:54 +00:00
fredb
4998af8d7a Add SGBinding.[ch]xx to the MSVC 7.1 project 2007-01-04 22:24:23 +00:00
fredb
c6aa95f3f3 std::find is defined in <algorithm> 2007-01-04 22:23:40 +00:00
frohlich
481be29366 Modified Files:
Makefile.am animation.cxx animation.hxx: Add animation to execute
	a command on scenery pick
2007-01-04 12:55:16 +00:00
frohlich
3617b6ad8c Modified Files:
Makefile.am SGNodeMasks.hxx
Added Files:
	SGPickCallback.hxx SGSceneUserData.hxx: Preparations for generic
	scenery picking.
2007-01-04 12:52:50 +00:00
frohlich
3fb8e19a38 Modified Files:
condition.hxx: Also derive from SGReferenced
2007-01-04 12:51:13 +00:00
frohlich
2ea2f1b4f2 Modified Files:
Makefile.am commands.cxx commands.hxx
Added Files:
	SGBinding.cxx SGBinding.hxx: Move FGBinding to SGBinding
2007-01-04 12:47:12 +00:00
frohlich
26cb8ec4f1 Modified Files:
SGIntersect.hxx: Make it compile with win32
2006-12-28 13:25:14 +00:00
frohlich
7fe56bea86 Modified Files:
obj.cxx: Some kind of polygon offset for GL_POINTS.
2006-12-27 10:33:37 +00:00
frohlich
11b16b8a86 Modified Files:
Makefile.am SGReferenced.hxx
Added Files:
	SGAtomic.cxx SGAtomic.hxx:
	Make the reference counts thread safe.
2006-12-27 10:07:19 +00:00
frohlich
de020ee695 Modified Files:
Makefile.am SGMathTest.cxx SGQuat.hxx SGVec3.hxx
Added Files:
	SGBox.hxx SGGeometry.hxx SGGeometryFwd.hxx SGGeometryTest.cxx
	SGIntersect.hxx SGLineSegment.hxx SGPlane.hxx SGRay.hxx
	SGSphere.hxx SGTriangle.hxx:
	Small updates to the vector code, new geometry and collision
	classes for use with a bv tree to speed up collission tests.
	Also included is a rought unit test for the collissions.
2006-12-27 09:23:39 +00:00
ehofman
3b83487611 Wether you like it or not, MispPro needs these libraries referenced 2006-12-23 12:15:05 +00:00
fredb
09bab4f162 memcpy needs #include <string.h> 2006-12-17 17:52:15 +00:00
fredb
49fcc799ca Port jpgfactory to OSG 2006-12-16 17:29:16 +00:00
fredb
10bc803775 Project files for MSVC 7.1 aka .NET 2003 2006-12-16 13:12:48 +00:00
frohlich
4f40770fc6 Modified Files:
simgear/math/SGVec3.hxx: fix spelling
2006-12-14 05:24:16 +00:00
frohlich
a4495c6ef1 Modified Files:
simgear/scene/sky/bbcache.cxx simgear/scene/sky/bbcache.hxx
	simgear/scene/sky/cloudfield.cxx
2006-12-08 12:22:10 +00:00
frohlich
67d837c4ec Modified Files:
SGVec3.hxx: Generate any perpandicular vector to a given one.
2006-12-08 12:17:30 +00:00
frohlich
138825af6d Modified Files:
point3d.hxx: Add explicit conversion functions to SGVec*
2006-12-08 12:16:56 +00:00
frohlich
c093841336 Modified Files:
simgear/scene/model/animation.cxx: Fix a problem of muliple
	texturre transform not finding the correct configuration.
2006-12-05 06:14:41 +00:00
frohlich
2df1da4226 Return void instead of bool. 2006-12-05 05:43:13 +00:00
frohlich
2792d60e2d Modified Files:
simgear/screen/extensions.hxx: Make it compile on macos
2006-12-03 17:44:27 +00:00
frohlich
656a3ace07 Modified Files:
simgear/scene/material/mat.cxx: Put solid scenery into the
	opaque render bin
2006-12-03 17:27:46 +00:00
frohlich
aec8e88c14 Modified Files:
simgear/scene/util/SGNodeMasks.hxx: Add pickable bit
2006-12-03 17:02:40 +00:00
frohlich
bdd5ca140d Modified Files:
simgear/scene/model/Makefile.am
	simgear/scene/model/animation.cxx
	simgear/scene/model/animation.hxx
	simgear/scene/model/model.cxx
	simgear/scene/model/persparam.cxx
	simgear/scene/model/persparam.hxx
	simgear/scene/model/shadanim.cxx
Added Files:
	simgear/scene/model/SGMaterialAnimation.cxx
	simgear/scene/model/SGMaterialAnimation.hxx
	Big animation overhaul. Improoves animation correctness.
2006-12-03 16:57:20 +00:00
frohlich
8b3b0def03 Modified Files:
SGUpdateVisitor.hxx: Include light information.
2006-12-03 16:46:23 +00:00
frohlich
6440ece177 Modified Files:
SGMisc.hxx: Add clip and periodic normalize functions.
2006-12-02 15:59:23 +00:00
frohlich
bd3518637c Modified Files:
SGVec2.hxx SGVec3.hxx SGVec4.hxx: Add inf norm function
2006-12-02 15:57:55 +00:00
frohlich
aef2a1c484 Modified Files:
interpolater.cxx interpolater.hxx: Enable reading tables directly
	from our dom like tree.
2006-12-02 15:56:55 +00:00
frohlich
a4b28e5737 Modified Files:
simgear/scene/sky/oursun.cxx: Fix the 'sun has wrong size' bug.
	Thanks to Mark Akermann.
2006-11-27 17:11:35 +00:00
frohlich
a3bc2eb836 Modified Files:
simgear/math/interpolater.cxx simgear/math/interpolater.hxx
	simgear/props/condition.cxx simgear/props/condition.hxx
	simgear/scene/model/animation.cxx
	simgear/scene/model/animation.hxx: Optimize interpolation table
	lookup by using a std::map.
2006-11-21 18:44:54 +00:00
frohlich
3059da5805 Modified Files:
SGVec2.hxx SGVec3.hxx SGVec4.hxx: Implement min/max for vectors
2006-11-21 18:39:57 +00:00
frohlich
18d5a492c8 Modified Files:
model.cxx: Tweak model optimizations
2006-11-20 18:19:02 +00:00
frohlich
160b0ea7d9 Modified Files:
placementtrans.cxx placementtrans.hxx: Make use of that view
        information in the update visitor
2006-11-20 18:17:56 +00:00
frohlich
4dd1267bea Modified Files:
SGUpdateVisitor.hxx: Store some view imformation in the
	update visitor.
2006-11-20 18:15:34 +00:00
fredb
b5c4328682 Mac fix from Ima Sudonim 2006-11-18 18:58:51 +00:00
frohlich
571fc69ef4 Modified Files:
VC8/SimGear.vcproj: Import buildsystem from Olaf Flebbe
2006-11-14 21:15:20 +00:00
frohlich
f51595cfc9 Modified Files:
animation.hxx animation.cxx: Improove material/texture/blend animation
2006-11-14 21:09:44 +00:00
frohlich
d54aea0036 Modified Files:
animation.cxx animation.hxx: Fix crash on A-10 load
2006-11-12 10:32:42 +00:00
frohlich
51bb2974bc Modified Files:
model.cxx: Leave it to osg when to do mipmapping.
2006-11-12 07:28:59 +00:00
frohlich
7a859061fd Modified Files:
model.cxx: Reset the database path past the whole model is loaded
2006-11-12 07:23:42 +00:00
frohlich
cefa9fcd75 Modified Files:
SGQuat.hxx: Make const method const
2006-11-12 07:22:44 +00:00
frohlich
d3bacd0b73 Modified Files:
simgear/scene/material/mat.cxx
	simgear/scene/material/matlib.cxx simgear/scene/sky/cloud.cxx
	simgear/scene/sky/dome.cxx simgear/scene/sky/moon.cxx
	simgear/scene/sky/oursun.cxx simgear/scene/sky/sphere.cxx
	simgear/scene/sky/stars.cxx simgear/scene/tgdb/apt_signs.cxx
	simgear/scene/tgdb/leaf.cxx simgear/scene/tgdb/leaf.hxx
	simgear/scene/tgdb/obj.cxx simgear/scene/tgdb/pt_lights.cxx
	simgear/scene/util/SGDebugDrawCallback.hxx
	simgear/screen/Makefile.am: Use color arrays for every geode.
	Just use osg::Material instead of osg::Material and the associated
	mode.
2006-11-10 05:30:37 +00:00
frohlich
b94a98fc90 Modified Files:
scene/model/model.cxx: Next step in direction liveries
2006-11-09 05:42:06 +00:00
fredb
e0b2687231 copysign is already in compiler.h 2006-11-07 21:31:17 +00:00
frohlich
cc6179a4dd Modified Files:
simgear/screen/extensions.cxx simgear/screen/extensions.hxx: Avoid
	the assumption that with glx-1.4 glXGetProcAddress is available -
	use dlsym to get that function.
2006-11-07 17:49:36 +00:00
fredb
e947bac4a3 This class is for plib only 2006-11-07 07:22:48 +00:00
frohlich
11ecbb6ca7 Modified Files:
mat.cxx: Fix dark scenery problem.
2006-11-07 06:40:35 +00:00
frohlich
322789cd4c Modified Files:
simgear/Makefile.am: Make 'make distclean' work
2006-11-07 06:02:47 +00:00
frohlich
f28464dba0 Modified Files:
projects/VC8/SimGear.vcproj: Olaf Flebbe: updated project files
2006-11-07 05:55:46 +00:00
frohlich
8f6456b1f8 Modified Files:
simgear/scene/util/SGUpdateVisitor.hxx: Only traverse active
	children.
2006-11-07 05:47:00 +00:00
frohlich
1f32786c82 Modified Files:
simgear/scene/util/SGDebugDrawCallback.hxx
	simgear/math/SGQuat.hxx: Olaf Flebbe: Make it compile on some more
	win32 variants.
2006-11-07 05:46:25 +00:00
fredb
829c729ee9 Don't try to load textures when no name is given 2006-11-06 21:59:02 +00:00
fredb
5d3aacb892 Attempt to fix the APIENTRY problem. It looks like a problem in OSG, or a conflict between OSG and plib/pui 2006-11-03 18:08:46 +00:00
fredb
741e9c5ed5 For some reason I don't know yet, the APIENTRY stuff in osg/GL is broken for some files. Include the real windows.h until we find why. 2006-11-03 10:04:58 +00:00
fredb
1408c1b623 add copysign definition for MSVC 2006-11-03 09:57:02 +00:00
fredb
c256f8d09e Win32 compilation fix 2006-11-02 17:40:54 +00:00
frohlich
55c018c525 Modified Files:
SGMath.hxx: Attempt to help IRIX builds
2006-11-02 13:37:23 +00:00
frohlich
3fa94b5143 Modified Files:
projects/VC8/SimGear.sln projects/VC8/SimGear.vcproj: Import Olafs
	project files
2006-11-02 06:15:14 +00:00
frohlich
5127e2f89c Modified Files:
Makefile.am SGMath.hxx SGMathFwd.hxx SGMatrix.hxx SGQuat.hxx
Added Files:
	SGVec2.hxx
	Improove the matrix functions. Improove the quaterion functions.
	Add the 2d vector.
2006-11-01 21:25:21 +00:00
mfranz
3175fa3aca + .deps/ 2006-11-01 21:24:24 +00:00
frohlich
5614174b39 Modified Files:
simgear/scene/model/Makefile.am
	simgear/scene/model/animation.cxx
	simgear/scene/model/animation.hxx
	simgear/scene/model/modellib.cxx
	simgear/scene/model/modellib.hxx
Removed Files:
	simgear/scene/model/personality.cxx
	simgear/scene/model/personality.hxx:
	Updates to the animation system.
	Personality can be implemented easier now
2006-10-31 06:26:50 +00:00
frohlich
39fc52fe0a Modified Files:
Makefile.am SGStateAttributeVisitor.hxx
 	SGTextureStateAttributeVisitor.hxx
Added Files:
	SGStateAttributeVisitor.cxx SGTextureStateAttributeVisitor.cxx:
	Move implementation into cxx files
2006-10-31 06:14:38 +00:00
frohlich
81188705b1 Modified Files:
simgear/math/SGQuat.hxx: Initialize with zero not with null pointer
2006-10-31 05:37:45 +00:00
frohlich
63c4873d8a Modified Files:
simgear/screen/extensions.cxx simgear/screen/extensions.hxx:
	use glXGetProcAddress if approriate
2006-10-31 05:36:50 +00:00
frohlich
1a85dcd890 Modified Files:
simgear/timing/timestamp.hxx: Remove reimplemented default
	implementations
2006-10-31 05:33:48 +00:00
frohlich
27470fc504 Modified Files:
configure.ac: Add a configure flag for osg
2006-10-30 19:56:09 +00:00
mfranz
65d18445d3 Makefile(.in) 2006-10-29 20:08:27 +00:00
frohlich
84dd54b33a Modified Files:
configure.ac simgear/environment/visual_enviro.cxx
	simgear/ephemeris/ephemeris.cxx
	simgear/ephemeris/ephemeris.hxx simgear/ephemeris/stardata.cxx
	simgear/ephemeris/stardata.hxx simgear/math/SGMatrix.hxx
	simgear/math/SGQuat.hxx simgear/math/SGVec3.hxx
	simgear/math/SGVec4.hxx simgear/scene/Makefile.am
 	simgear/scene/material/mat.cxx simgear/scene/material/mat.hxx
	simgear/scene/material/matlib.cxx
	simgear/scene/material/matlib.hxx
	simgear/scene/material/matmodel.cxx
	simgear/scene/material/matmodel.hxx
	simgear/scene/model/Makefile.am
	simgear/scene/model/animation.cxx
	simgear/scene/model/animation.hxx
	simgear/scene/model/custtrans.hxx
	simgear/scene/model/model.cxx simgear/scene/model/model.hxx
	simgear/scene/model/modellib.cxx
	simgear/scene/model/modellib.hxx
	simgear/scene/model/personality.cxx
	simgear/scene/model/personality.hxx
	simgear/scene/model/placement.cxx
	simgear/scene/model/placement.hxx
	simgear/scene/model/placementtrans.cxx
	simgear/scene/model/placementtrans.hxx
	simgear/scene/model/shadanim.cxx
	simgear/scene/model/shadowvolume.hxx
	simgear/scene/sky/cloud.cxx simgear/scene/sky/cloud.hxx
	simgear/scene/sky/cloudfield.cxx simgear/scene/sky/dome.cxx
	simgear/scene/sky/dome.hxx simgear/scene/sky/moon.cxx
	simgear/scene/sky/moon.hxx simgear/scene/sky/newcloud.cxx
	simgear/scene/sky/oursun.cxx simgear/scene/sky/oursun.hxx
	simgear/scene/sky/sky.cxx simgear/scene/sky/sky.hxx
	simgear/scene/sky/sphere.cxx simgear/scene/sky/sphere.hxx
	simgear/scene/sky/stars.cxx simgear/scene/sky/stars.hxx
	simgear/scene/tgdb/apt_signs.cxx
	simgear/scene/tgdb/apt_signs.hxx simgear/scene/tgdb/leaf.cxx
	simgear/scene/tgdb/leaf.hxx simgear/scene/tgdb/obj.cxx
	simgear/scene/tgdb/obj.hxx simgear/scene/tgdb/pt_lights.cxx
	simgear/scene/tgdb/pt_lights.hxx
	simgear/scene/tgdb/userdata.cxx
	simgear/scene/tgdb/userdata.hxx simgear/scene/tgdb/vasi.hxx
	simgear/screen/jpgfactory.cxx simgear/screen/tr.cxx
	simgear/structure/Makefile.am simgear/threads/SGThread.hxx
Added Files:
	simgear/scene/util/Makefile.am
	simgear/scene/util/SGDebugDrawCallback.hxx
	simgear/scene/util/SGNodeMasks.hxx
	simgear/scene/util/SGStateAttributeVisitor.hxx
	simgear/scene/util/SGTextureStateAttributeVisitor.hxx
	simgear/scene/util/SGUpdateVisitor.hxx
Removed Files:
	simgear/screen/ssgEntityArray.cxx
	simgear/screen/ssgEntityArray.hxx
	simgear/structure/ssgSharedPtr.hxx
	Big BLOB on the way to OSG.
2006-10-29 19:27:08 +00:00
curt
7c410d36e3 wim van hoydonck:
Updated to World Magnetic Model 2005.
2006-10-28 22:12:48 +00:00
mfranz
98a603a570 - don't need a guarded pointer here
- shorten variable, fix indentation
2006-10-24 20:28:08 +00:00
mfranz
5876052170 allow to switch on/off at runtime a whole imported <model> via <condition>:
<model>
      <path>some/model.xml</path>
      <condition>
          <property>model/switch</property>
      </condition>
  </model>

Of course, one could add "select" animations for all <object-name> in the
<model>, but this is tedious and can hardly be done e.g. for all
objects in all instruments in $FG_ROOT/Aircraft/Instruments-3d/ etc.

The feature will be used in the bo105, so that civilian variants can
have a HSI instrument, where military variants have a TACAN etc.
2006-10-24 19:44:38 +00:00
durk
f8303b4623 Compile time fixes needed to build SimGear on recent cygwin versions. 2006-10-22 19:42:17 +00:00
durk
20005a7a22 Make configuration script compatible with "home-built" openal libraries
on cygwin.
2006-10-22 19:41:16 +00:00
mfranz
4f0bfbab21 - // This will come back and remove
- // the current item each time.  Is
- // that OK?

No, it is not OK. This messes up the vector and confuses the iterator.
And it leads to crashes. Better read the vector in reverse order.
2006-10-22 13:08:09 +00:00
curt
811442832e Step #1 towards abandoning the original point lighting scheme in favor of
sprite based lighting.
2006-10-19 03:36:22 +00:00
frohlich
40811311d7 Modified Files:
SimGear.vcproj: Import changes from Olaf
2006-09-30 07:11:16 +00:00
durk
198de211f8 Memory leak fix. 2006-09-30 05:11:25 +00:00
fredb
9f5412fa9d Win32 only : Don't alloc a console when it is not needed 2006-09-27 20:16:32 +00:00
fredb
0dc9de81ae Add a simple program to benchmark SGTimeStamp::stamp() 2006-09-02 11:21:22 +00:00
fredb
5b8f42ce5e Make the SGTimeStamp behave under Windows just like for other environments 2006-08-31 18:26:45 +00:00
fredb
5314274ed6 Use getNodeValue as initially planned 2006-08-28 19:38:23 +00:00
ehofman
c831856711 MispPro requires an explicit declaration. 2006-08-28 18:53:36 +00:00
curt
1bade6d796 Frederic Bouvier:
Make line feed behavior consistent between linux/windows.
2006-08-26 14:02:17 +00:00
fredb
629a4a950e Better encapsulation for personality 2006-08-25 19:25:56 +00:00
mfranz
aebb1f6ec8 compile (gcc 4.1.0)
("In member function 'T SGPersonalityParameter<T>::shuffle()':
28: error: there are no arguments to 'sg_random' that depend on a template
parameter, so a declaration of 'sg_random' must be available")
2006-08-24 23:03:52 +00:00
fredb
6e42bc55e0 Reorganize personality parameters and add personality to translate, blend and scale animations 2006-08-24 22:46:40 +00:00
frohlich
1235fba7ee Remove duplicate linker line in the resulting Makefile 2006-08-08 05:05:09 +00:00
fredb
7a459db022 Win32 fix 2006-07-30 21:02:36 +00:00
frohlich
607987def5 Remove fastmath funktions like discussed on the list.
Add a new header with forward declarations of the SGMath stuff.
2006-07-30 07:48:06 +00:00
frohlich
397ec62180 Clean up scenery center handling. 2006-07-27 16:34:32 +00:00
durk
9315210fbe Mark's dynamic sun color changes. 2006-07-27 05:15:20 +00:00
curt
5127990a43 Additional functionality for animated point lights (i.e. approach light
rabbits, REIL, VASI/PAPI, etc.)

This allows the calling layer (i.e. FlightGear) better control over the use
of OpenGL point drawing extensions.
2006-07-21 15:45:01 +00:00
curt
40ad2b155a Updated dist content. 2006-07-12 15:08:00 +00:00
mfranz
a0412d026c remove the last redundant "delete" check in all of fgfs/sg (except JSBSim) 2006-07-05 09:31:36 +00:00
andy
7d2134c488 The previous update (and, embarassingly, the "nasal 1.0" release I
announced on Freshmeat.net) was broken.  This is the proper
break/continue fix.
2006-07-05 02:52:06 +00:00
andy
d894f52b97 Been hacking at Nasal recently:
Fix bug with break/continue inside of a foreach or forindex: Don't pop
the vector/index inside OP_EACH, do it at the end of the loop.

In the process, discovered and fixed a scary corruption issue with
continue; it never really worked right, although simple usage was
likely to get away without crashing.  Both the continue's OP_BREAK and
the cleanup code at the end of a loop would pop the "mark" stack,
leading to an underflow.  Introduced an OP_CONTINUE which adjusts
stack but doesn't change markTop

Re-inline the PUSH macro.  This thing is called all over the place
from the inner loop.  If the problem is intra-expression side effects,
then just use another expression in the macro.

Return an empty vector when requesting zero-length subvec, not nil

Have call() return the call stack in the error vector; see docs on
plausible.org/nasal or ask Andy about this feature.

Default closure()'s level argument to zero, not nil

Add an optional "file name" argument to compile()
2006-07-03 05:13:27 +00:00
mfranz
735f475c24 actually query the <condition> that is already set up in SGShaderAnimation 2006-07-01 20:06:05 +00:00
mfranz
353dd73e24 add knots <-> feet-per-second conversion constants 2006-06-25 11:55:56 +00:00
fredb
49fe06498a Compile again on Win32 platforms 2006-06-17 22:02:32 +00:00
frohlich
bc95ec8084 Make at least the header aliasing safe. 2006-06-17 16:04:28 +00:00
frohlich
f79906bf16 Make it compile with gcc-3.3.6 2006-06-17 16:04:05 +00:00
fredb
b3262fcb80 Compile again on Win32 platforms 2006-06-16 10:03:38 +00:00
mfranz
52b8f924aa add float_to_int() rounding function from Cockpit/hud_opts.hxx. The original
file said "(c) FlightGear Project" and "probably written by Norman Vine".
2006-06-16 09:29:54 +00:00
frohlich
52f57160aa Add dist and distSqr functions 2006-06-15 19:13:24 +00:00
frohlich
6d4f23919c Remove unused extern decls 2006-06-15 19:12:57 +00:00
frohlich
899623f71b Remove deprecated, now unused functions. 2006-06-15 08:52:21 +00:00
frohlich
c5d677ac7b Small cleanups to the SGGeo[dc] classes, provide more hooks to use them directly 2006-06-15 08:27:31 +00:00
frohlich
c75270a9fc Use function argument in va_start instead of local variable. 2006-06-15 06:14:46 +00:00
frohlich
1588a379eb Remove now unused function 2006-06-11 13:59:59 +00:00
frohlich
72d2075828 Modified Files:
simgear/scene/material/mat.cxx simgear/scene/material/mat.hxx
	simgear/scene/material/matlib.cxx
	simgear/scene/material/matlib.hxx simgear/scene/tgdb/leaf.cxx
	simgear/scene/tgdb/obj.cxx
	Attach userdata to groundtile scenegraph leafs that contains
	a SGMaterial reference to the material of that leaf.
	Add (physical) material properties to the material definitions.
	Plug a memory leak with GlyphSigns.
2006-06-11 13:30:59 +00:00
frohlich
e99c682637 Preliminary material lookup hooks - still unoptimized. 2006-06-08 05:54:23 +00:00
mfranz
c815f70831 whoops, sorry (Yes, it *was* tested, but then I made another "trivial"
change and ...)
2006-05-24 10:16:09 +00:00
mfranz
0da50eaa79 if we are going to die we better tell all our listeners 2006-05-24 09:37:44 +00:00
mfranz
b0af84a549 add optional position argument to SGRoute::add_waypoint(). Default is -1,
which appends the WP like it used to. Valid vector indices insert the WP
at this position.
2006-05-08 11:31:16 +00:00
fredb
b9631e8521 Mac fix 2006-05-04 05:58:59 +00:00
fredb
f664f7a201 Fix the initial texture path problem. Loaders are setting the one given to ssgLoad as the default one behind our back :-( 2006-04-29 08:09:51 +00:00
fredb
f72b3882c3 Redefine the default PLIB loader behavior : don't clear the texture cache after every model load 2006-04-28 18:05:46 +00:00
mfranz
ea47a2973c add method to delete any waypoint (last waypoint if n is out of range) 2006-04-28 15:43:13 +00:00
frohlich
04be9ca670 Pigeons remaining fix for the soundmanager crashes. 2006-04-25 18:47:37 +00:00
mfranz
6f0baf6ca9 thanks to Erik's texture map I can now drop empty.rgb altogether and just
specify the same texture in the "foo.lighted" and "foo.unlighted" material
entry. This also allows to drop the state cloning and thereby solves the
most urgent apt_signs.cxx TODO. :-)
2006-04-22 13:41:06 +00:00
ehofman
1f5ec6b8d5 Add a texture cache mechanism. Fortunately this oly seems affective for empty.rgb ... 2006-04-22 09:38:14 +00:00
mfranz
a2a91520aa don't allow new command name to overwrite material name 2006-04-20 17:46:40 +00:00
mfranz
fd7b5d3de7 - don't use hard-coded emission values for unlighted signs, but load both
states from material.xml (separate <material> entries for now)
- clone state less often: not once per sign element, but once per material
  switch (TODO: clone only once per material)
2006-04-20 16:06:00 +00:00
mfranz
30ea844c43 fix "unknown.rgb" path (the wrong path was the reason why we always only
got plib's lowres red-white chequer-board pattern along with an error
message, and not ours ... which is much prettier, but also bigger.
(Should we downscale it?)
2006-04-20 15:20:40 +00:00
mfranz
efac53b121 make headers include headers they depend on, don't rely on the c(xx)
file to do that. (This is a requirement for header precompiling.)
2006-04-17 11:29:01 +00:00
mfranz
73c0ef59c1 rename OBJECT_TAXI_SIGN to OBJECT_SIGN. This isn't about taxi signs any
more, but all sorts of signs. Now is the best time to get rid of a
misleading name.
2006-04-14 14:50:08 +00:00
mfranz
7e65ab2d3b add <condition> support to textranslate & texrotate animation 2006-04-12 20:27:38 +00:00
mfranz
fec769f632 set sign orientation such, that when the sign heading=0, one looks straight
on the sign face when looking North
2006-04-12 12:13:03 +00:00
mfranz
90e42642b6 lower signs 2006-04-11 23:04:24 +00:00
mfranz
9d9610a882 add minimalistic backside to signs as a temporary solution 2006-04-11 21:32:15 +00:00
mfranz
1fc81f4b66 re-add hard-coded vertical distance. The coordinates should be surface
points and not add this distance, which depends on the sign housing/hardware,
after all.
2006-04-11 17:34:17 +00:00
mfranz
4f0b1e847c - commands do now have to start with @
- add commands @size, @material, @light
- make "BlackSign" texture default
- make @B, @R, @L, @Y open close their frames automatically (this can be
  avoided by setting the @material manually)
- add number variants for those 4 sign commands: @Y2, @B5, etc (according
  to the spec; defaulting to the respective biggest panel size, i.e. @B = @B3)
(detailed description will be added to $FG_ROOT/Docs/)
2006-04-11 15:57:08 +00:00
mfranz
9567ac32f2 remove obsolete files (on request by Christian Mayer, who has introduced them):
- they are not used anywhere in sg/fgfs
- and are very clearly *not* GPL compatible!
2006-04-10 16:36:52 +00:00
andy
8dd9cfa2a6 Manabu Nishiyama (non-FlightGear Nasal user) discovered an
uninitialized data bug in naHash_cget().  When the hashcode field of
naStr was introduced, I forgot to set it in this function, which
creates a temporary naStr on the stack.
2006-04-10 16:21:17 +00:00
mfranz
dbda8ef893 drop xscale member again, and use xsize/ysize instead. (One interface
element less to confuse people.)
2006-04-10 15:32:55 +00:00
mfranz
cd143c15d5 rewrite of OBJECT_TAXI_SIGN code. The name is a bit misleading, as this
type can also create runway signs. (/me thinks about changing that ...)
2006-04-09 19:51:00 +00:00
mfranz
509a388ccc support for font textures. They are normal (but rather lenghty) <material>,
but contain <glyph> entries with <name>, <left> and <right>. The latter two
describe where in the texture a letter or symbol begins and where it ends.
(range 0-1). <xscale> defines a horizontal scaling factor.
2006-04-09 19:21:13 +00:00
curt
76c6482495 v0.3.10 changes. 2006-04-05 18:42:45 +00:00
mfranz
010a44f831 protect ssg pointers to avoid occasional crashes (of course it would be
nicer if the Occluder would always get removed before its model branch,
but that's not easily enforcable)
2006-03-30 14:13:22 +00:00
curt
e6b0d644d4 v0.3.10-pre3 updates. 2006-03-27 18:48:36 +00:00
curt
02dc68c899 Olaf Flebbe:
Unfortunatly the original SimGear Project I submitted contained local
changes which I didn't intend to submit. Please use this file instead...
2006-03-27 16:32:15 +00:00
mfranz
11ac97cd09 If the author of this message isn't alerted enough to *fix* this, then I'm
sure the users won't do that either. This is regularly triggerd and leads
to meaningless error reports.
2006-03-26 08:22:26 +00:00
mfranz
61f6565321 more guarded pointers (we are still getting spurious crashes on exit because
of that)
2006-03-24 23:24:20 +00:00
curt
55d951f211 Initial revision. 2006-03-24 19:06:05 +00:00
mfranz
143ce6fcd5 remove so that complete dir can be dropped 2006-03-23 22:05:22 +00:00
curt
e264c6ad2e Updates to remove unneeded and old version of zlib source. 2006-03-23 21:59:59 +00:00
curt
036b6785f1 Remove old depricated files. There is a much newer version of zlib
available and just about every unix-based platform already comes with this.
2006-03-23 21:52:03 +00:00
curt
caf5cc90ae v0.3.10-pre2 updates. 2006-03-23 16:37:35 +00:00
mfranz
b05e98b1b6 Vassilii KHACHATUROV: rain fix, cleanup, read formerly hard-coded values
from provided node

"* minor redundant gl call in DrawCone2 optimized away (twice per frame)
* corrected the glRotatef() order in drawRain even further (a less
obvious mistake than before, which is noticed by looking skywards and wiggling
the mouse in the view direction change mode)
* all the "magic numbers" used in the rain rendering code have been
provided a default (based on the old hardcoded value) in a form of a
define, and a meaningfully named static member in SGEnviro"
2006-03-23 15:39:00 +00:00
mfranz
31d0779377 Vassilii KHACHATUROV: fix typos, add/fix comments, change variable names 2006-03-22 16:02:55 +00:00
andy
6b056e915e Oops, implement the previously-mentioned fix without breaking support
for omitting a length argument to mean "the rest of the vector".
2006-03-21 23:12:30 +00:00
andy
9d6c0dc580 The original code (rather oddly) interprets a length of zero in
subvec() to mean "the whole vector".  Melchior showed a use case
(removal of the first element from a vector) where getting a
zero-length subvector is actually desired.  And since I can't come up
with a good reason for why the "feature" was there in the first place,
out it goes...
2006-03-21 22:22:47 +00:00
andy
6e973e07f4 Melchior discovered that cmp() was just wrong, failing to actually
inspect the string pointers.  It also failed to properly sort strings
where one is a prefix of the other.  It looks to me like I just never
finished this, and it ended up in CVS because it just happened to
compile...
2006-03-21 21:57:00 +00:00
curt
c8098b9eac Updates for v0.3.10-pre1. 2006-03-20 19:22:20 +00:00
mfranz
ed20ce388a - better error message when submodel loading failed
- use alignmainmodel node in callback (not used anywhere yet)
2006-03-17 19:01:52 +00:00
andy
33e01e431d The handle gets nulled out if the user has closed the file; don't pass that
null to fclose() in a garbage collection destructor too...
2006-03-16 18:01:56 +00:00
andy
7d631e4959 Fix broken checkin in iolib.c. Also add the 'bits' library, which has a buf()
function needed to make convenient use of io.read().
2006-03-15 19:42:37 +00:00
andy
29eb566448 Melchior found the first bug -- report EOF as nil in readln(). 2006-03-15 19:35:30 +00:00
andy
a770d2a972 Add the Nasal I/O library so Melchior can play with it. Not enabled currently (see NasalSys.cxx in the flightgear CVS) 2006-03-15 18:09:50 +00:00
mfranz
688cffb031 --warnings 2006-03-14 15:55:24 +00:00
mfranz
2cccc26541 --warnings 2006-03-14 15:49:29 +00:00
mfranz
f96f083bb5 close zone.tab file after having read all entries 2006-03-14 12:58:28 +00:00
mfranz
2e078aff7d prevent animations from losing nodes, because other processes removed them
(We are currently getting a lot of aborts in the condition code when
running MP. I don't expect this to fix it, but a bug is a bug.)

(reviewed by Fred, who also fixed *my* bugs :-)
2006-03-14 10:38:06 +00:00
mfranz
bd1f192dc4 Better use a node that is very clearly not used by other services
(e.g. animations). The data class doesn't mind.
2006-03-12 18:56:48 +00:00
mfranz
b62f241051 activate model load/unload callback again. It turned out *not* to be the
cause for the MP crashes -- the same crashes did still occur without it.
2006-03-12 10:09:34 +00:00
ehofman
95d1ac354e Mac OS X fixes from Ima Sudonim. 2006-03-11 22:20:19 +00:00
mfranz
54728f5d57 commenting out Nasal in scenery models for now. This could be responsible
for an MP/AI crash. Still investigating.
2006-03-10 22:58:24 +00:00
mfranz
d9356b0f86 warning-- 2006-03-09 16:17:35 +00:00
ehofman
6b68d9d90b Alexander Powell:
Add MAC OS X Render Texture support:

Most texture modes seem to work on my Powerbook, but I don't have a wide array
of machines to test it on otherwise.

If you have problems, please let me know and I'll see if I can help track down
the source of the bug.  I'd love to keep working on it if time permits (I use
RenderTexture in a few other projects), so I'll keep you informed if there are
any changes that I make for the better.
2006-03-09 09:54:43 +00:00
mfranz
359a8c4a81 model.[ch]xx:
add abstract class SGModelData. If a pointer to such a class is handed over
  to sgLoad3DModel, then its modelLoaded() method is called with path, property
  node and branch. And then it's added to the scene graph so that it's
  destroyed when the model branch is removed from the graph.

modellib.[ch]xx:
  only cache objects when asked to. This is the case for OBJECT_SHARED
  and random objects (like before), but no longer for OBJECT_STATIC.
  These are now removed from the graph when they are "out of sight". This
  prevents accumulation of static models, and makes destroying model data
  possible (e.g. removing Nasal modules)

matmodel.cxx:
  set cache flag for random objects (same behavior as before)
2006-03-09 09:03:57 +00:00
mfranz
dcb95d131b - new FSF addresses
- coplied license headers from h(xx) files to respective c(xx) files
- removed trailing spaces
- fixe $Id$
- fixed typos
2006-03-08 18:16:08 +00:00
david
f4e37ba7c0 Ignore generated binaries. 2006-03-04 13:27:11 +00:00
ehofman
1cbceec0e1 Mathias Frhlich:
zero out all parent pointers, else they might be dangling.
2006-03-04 12:46:29 +00:00
ehofman
5b3c5407a1 Mathias Frhlich:
I have some bugfixes which will avoid fg just crashing if the sound device
could not be opened.
2006-03-03 15:11:35 +00:00
fredb
27a120c7c3 Wrong config file name 2006-02-26 11:02:21 +00:00
andy
375f3e8bc1 Fix from Melchior: Set static values at every condition change, not only initially. 2006-02-22 20:50:35 +00:00
fredb
a75b4af374 Melchior FRANZ:
- don't unlock an already unlocked mutex (Someone wanted to be on
  the safe side with this, but the result is undefined and makes
  pthread_mutex_destroy fail. Reference: manpage for
  pthread_mutexattr_gettype/The Open Group[1]: "Attempting to
  unlock a mutex of this type which is not locked results in
  undefined behaviour.")

- re-enabled all subsystem destructors again (this has been disabled
  because fgfs hung on exit, due to the mutex destroy failure from
  above.)


Reference:
  http://www.opengroup.org/onlinepubs/007908799/xsh/pthread_mutexattr_gettype.html
2006-02-21 12:59:31 +00:00
ehofman
b2a4cd488d Back out the previous patch. 2006-02-21 10:47:20 +00:00
ehofman
1d8d203e9e Declare specified functions, otherwise MIPSpro bails out. 2006-02-21 09:48:33 +00:00
ehofman
4e7fe460a5 Melchior FRANZ:
- new FSF address
- removed a few hundred trailing spaces
- fixed a few $Id$ lines
- copied two license headers from *.hxx files to their respective
  *.cxx counterparts
- added two test aps to .cvsignore
- don't unlock an already unlocked mutex (Someone wanted to be on
  the safe side with this, but the result is undefined and makes
  pthread_mutex_destroy fail. Reference: manpage for
  pthread_mutexattr_gettype/The Open Group[1]: "Attempting to
  unlock a mutex of this type which is not locked results in
  undefined behaviour.")
- re-enabled all subsystem destructors again (this has been disabled
  because fgfs hung on exit, due to the mutex destroy failure)
2006-02-21 09:40:12 +00:00
ehofman
9be14a63b1 Mathias Froehlich: Add license information. 2006-02-20 15:12:13 +00:00
ehofman
afd3c76088 Mathias Frhlich:
This patch makes use of the vectors now available in simgear with that past
patch. And using that it simplyfies the carrier code somehow.

- Small additional factory's to the quaternion code are done in the simgear
  part. Also more explicit unit names in the factory functions.
- The flightgear part makes use of them and simplyfies some computations
  especially in the carrier code.
- The data part fixes the coordinate frames I used for the park positions in
  the carrier to match the usual ones. I believed that I had done so, but it
  was definitly different. Also there are more parking positions avaliable now.
2006-02-19 17:22:17 +00:00
ehofman
6b697506c3 Melchior FRANZ:
- change SG back to FG (this was accidently changed in three wrong
  places when I prepared the file for SG)
- correct length for the proxy id detection
- set (guessed) deposit depth < 1mm correctly
- set deposit type string
- formatting
2006-02-19 17:13:37 +00:00
fredb
3eba296157 Missing defines 2006-02-18 16:19:54 +00:00
fredb
1b51de08f5 Add missing include files needed by the new math code under windows 2006-02-18 13:24:24 +00:00
fredb
3e37f3fa54 Fix Code generation option for debug build 2006-02-18 12:04:37 +00:00
fredb
a18679e95d Remove compiler warnings 2006-02-17 21:57:13 +00:00
curt
0154f81e33 Clean up some compiler warnings. 2006-02-17 15:13:42 +00:00
ehofman
366931952b Remove unused files. 2006-02-17 09:59:27 +00:00
ehofman
606fc352aa Melchior FRANZ:
This patch fixes the sound of 737, Concorde and others, if fgfs
was compiled with newer gcc versions (e.g. gcc 4.0.2). These compilers
implement the c++ standard more strictly, and thus don't guarantee
that c-style casted pointers to different data types really point
to the same address. This is only guaranteed for union members.
2006-02-17 09:23:40 +00:00
ehofman
75f817b39c Mathias Frhlich:
The patch adds a vector lib I have put together during the last time,
it is just handy and interfaces well with s(s)g*. Together with some small
modifications this will later also interface well with OpenSceneGraphs
vectors/matrices. Using this vector kernel is targeted to have a handy
matrix/vector lib available and to provide a scenegraph independent vector
type for use with a small scenegraph wrapper aimed for a smooth transition to
openscenegraph.

That vector code also includes an improoved geodetic conversion routine I
have found some time ago published in the 'journal of geodesy' which avoids
iterative computations for that purpose.

Also the geodetic position class is more typesafe and unitsafe than the
Point3D currently is.

That part is relatively old and in use in my local trees for several months
now.
2006-02-17 09:22:04 +00:00
ehofman
0bc49bf244 Olaf Flebbe:
This patch makesFlightGear at least compile on MSVC. I hope I have removed
reference of my other local changes. DSP and DSW files are included for
reference. They have been reconstructed with am2dsp.pl. I had to introduce a
change to am2dsp because of the need of filenames with embedded spaces. (Yuck)

The major direction is to remove clutter like the _USE_MATH_DEFINES and
have it on the compiler command line sice there is no central include
file. You will have to put it on the command line for your locale
Project files, if it not there, already. I added the
_CRT_SECURE_NO_DEPRECATE define for 2005, since it does no harm to other
VC version.

Third Party Libs like plib, OpenALSDK, freeglut, pthreads-win32, zlib
are unpacked as is side by side. Only change put the includes of OpenAL
into include/AL rather directly into include.
2006-02-17 08:58:56 +00:00
fredb
930a84b459 Outputing 6 digits is not enough for a double 2006-02-07 20:50:35 +00:00
ehofman
21c89e8163 Vassilii Khachaturov:
Fix the current buggy rain orientation behaviour for the views attached to the
aircraft (while still inheriting bugs with the views attached to anything else).
2006-02-02 09:56:48 +00:00
ehofman
b3770cd26c Expose the sun halo texture handle. 2006-01-31 15:14:02 +00:00
ehofman
0cd4d44bd3 Expose GL_COORD_REPLACE 2006-01-31 15:13:12 +00:00
ehofman
af15e73e64 create an absolute value before calling log or log10, this adds support for sound on negative numbers (thrust reverse for example). 2006-01-30 20:30:56 +00:00
ehofman
33f176b8f9 Melchior FRANZ:
add optional arg to SGPropertyNode::addChangeListener that triggers
the listener function call initially. This is useful for cases where
a freshly installed listener wants to treat the current property
value as changed from 'unknown' to the actual value right away.

Examples can be found in the Nasal incarnation setlistener(),
where we have for example this (in $FG_ROOT/Nasal/gui.nas):

  INIT = func {
      ...
      setlistener("/sim/rendering/fps-display", fpsDisplay);
      if (getprop("/sim/rendering/fps-display")) {
          fgcommand("dialog-show", props.Node.new({"dialog-name": "fps"}));
      }
  }


That is: we first attach a listener that cares for changes to the FPS
display switch, but then we have to manually open the dialog initially.
That's a duplication of code and could be as simple as this
(INIT part only):

  INIT = func {
      ...
      setlistener("/sim/rendering/fps-display", fpsDisplay, 1);
  }

That is: the optional third arg makes fpsDisplay be called initially,
and then again with every write action. My first solution was in the
Nasal code only, but Andy (rightfully) says that this should rather
be in sg.
2006-01-30 10:56:34 +00:00
ehofman
42f21972fd On a second thought, disable smooth shaded lines for all segments of the lightning. 2006-01-27 15:27:43 +00:00
ehofman
2d79e54c46 Disable smooth lines for certain lightning segments. 2006-01-27 15:18:45 +00:00
ehofman
224408b0e8 Add support for point sprites. 2006-01-26 09:15:42 +00:00
fredb
610e447d7c The sample is now managed by a SGSharedPtr and shouldn't be deleted explicitely 2006-01-24 21:49:56 +00:00
ehofman
c2c0e19305 Mathias Frhlich:
Incorporating the shared ptr code:
- All scenegraph references from SimGear
- SGMaterial which already had a reference counter uses now that common
  infrastructure.
- SGMatModel is now counted.
- SGSoundSample from SimGear
- And the corresponding change for the sound samples in flightgear which fixes
  a latent crash if FGBeacon would evern be deleted.
2006-01-24 14:44:35 +00:00
ehofman
e8c4b0d57c Mathias Frhlich:
Use the new automatic reference counter instead of doing
that ourselfes.
2006-01-12 13:47:04 +00:00
fredb
36e7684d9a MSVC vsnprintf ( in fact _vsnprinft ) returns -1 when the buffer is too short 2006-01-10 20:25:46 +00:00
fredb
795c079af0 Use the new SGPath::create_dir function
Ensure no triangles array could have more than 32767 vertices, a PLIB limit.
2006-01-07 13:21:36 +00:00
curt
94e1d3f0fc John Ellson:
This patch fixes this SimGear compile error on x86_64 Fedora Development with gcc-4.1:

placement.hxx:49: error: extra qualification ‘SGModelPlacement::’ on member ‘init’
2006-01-04 16:44:08 +00:00
ehofman
1df002de81 MinGW fixes. 2006-01-04 09:08:35 +00:00
ehofman
b7115659b3 Make the sgi code the default to prevent future problems. 2006-01-03 17:40:49 +00:00
ehofman
258ec6b89a Save some memory. 2006-01-03 17:34:00 +00:00
ehofman
d1ecdfc510 Fix the persisent IRIX bug. 2006-01-02 13:32:16 +00:00
ehofman
a807e66d4a prevent confusion by not using a standard name. 2006-01-02 10:04:10 +00:00
ehofman
8f9921d00c Mathias Frhlich:
Add the basic infrastructure for a reference counter class.
Adding it now (without using it) enables Mathias and others to
prepare some memory reduction code.
2005-12-29 12:00:29 +00:00
ehofman
99bc4e9a87 Vassilii Khachaturov:
clean up some build warnings caught with gcc-4.0.
2005-12-19 12:52:02 +00:00
ehofman
9289cfdde9 Frederic Bouvier:
Fix a problem where the directory being created is made relative when in fact
it's absolute. It also tightens things a bit on the Windows side.

Erik:

Make the section that splits up the directory in a lists of parent directories
a standalone function.
2005-12-19 10:22:27 +00:00
ehofman
bedbe3caad Frederic: this patch to sg_path.cxx will filter out false alarms when directory already exists. 2005-12-18 09:37:37 +00:00
ehofman
2e329426ab Frederic Bouvier:
The create_dir was totally broken. No function was used at the right place
except mkdir. This patch now create directories without segfaulting.


Erik:

This was my bad, I've been using a really slow computer for the last ten months
and recompiling SimGear with a change to the properties code takes ages, so
once in a while I apply something not entirely tested. This is one really bad
example which shouldn't have happened. Thanks to Frederic for fixing it.
2005-12-17 22:12:53 +00:00
ehofman
4c68d03457 Add the subdir to the path before trying to create it, instead of afterwards. 2005-12-17 15:41:48 +00:00
ehofman
0911fa4fa2 MSVC fixes. 2005-12-17 15:32:43 +00:00
ehofman
c5737c5f74 Try to detect the proper type for mode_t 2005-12-17 15:15:09 +00:00
ehofman
106198fa20 Stefan Seifert: Add the posibility to specify a userarchive attribute which could be used to save user prefferences at program exit. 2005-12-17 15:11:37 +00:00
ehofman
4eb74a3c93 Add a function to create aa new directory 2005-12-17 15:06:56 +00:00
ehofman
3f0bcc9568 Mathias Frhlich:
Detect whether we support pubuffers at runtime using the GLX extension string.


Erik:

Add support to compile TestRenderTexture if GLUT is installed.
2005-12-14 10:28:16 +00:00
ehofman
f0c35fde6d MacOs X fix. 2005-12-11 13:41:57 +00:00
ehofman
8357eeb762 Vassilii Khachaturov:
* in some cases more specific sg exception types were used in place
  of the more generic one, e.g., sg_io_exception instead of sg_exception
  when the context of the error was an IO error
* in some cases, the error message was made more specific
* minor style fix for exception rethrowing --- using throw; whenever
  a re-throw is made; sometimes optimizing away the exception symbol name
  in the catch handler at all
* more specific catch handlers added in some places -- e.g.,
  an sg_io_exception caught ahead of sg_exception
2005-12-11 13:35:05 +00:00
ehofman
61da54d6ca add swap_test to .cvsignore 2005-12-11 13:26:30 +00:00
ehofman
efea47833d Add a proper return statement for MSVC. 2005-12-11 12:51:51 +00:00
ehofman
24ea08b6d3 Vassilii: help those
using the Doxygen docs.
2005-12-06 18:45:14 +00:00
ehofman
2808b334ed Mathias: silence some valgrind warnings so that you can concentrate better on the real problems. 2005-12-06 18:29:28 +00:00
ehofman
96159cf739 How did this end up there?? 2005-11-27 09:48:51 +00:00
ehofman
577dfa4f54 Initialize glut before using it. 2005-11-27 09:46:58 +00:00
ehofman
66075d620e More WIN32 fixes. 2005-11-23 09:28:02 +00:00
ehofman
60f1d21914 Oops, WIN32 typo fix. 2005-11-22 18:42:16 +00:00
ehofman
b108621a59 * Use SimGear's logging facility isntead of printf's.
* Hopefuly fix a nasty (mostly ATI related) bug.
2005-11-22 18:03:26 +00:00
curt
4a4e703f16 Changes for v0.3.9 (final). 2005-11-17 20:54:06 +00:00
curt
61984730ac Add a small accessor function to expose local timezone offset. 2005-11-17 15:30:07 +00:00
curt
f196d3bab8 Fix a small spelling mistake. 2005-11-15 21:43:34 +00:00
ehofman
7da45cb49e Revert to the original (0.9.8) version, it causes more problems than it solves (did actually solve any?) 2005-11-14 18:25:17 +00:00
ehofman
e994305da6 Put in public domain, Curtis wants it (because net_fdm.hxx depends on it) and I created the other functions. 2005-11-13 09:42:38 +00:00
ehofman
2af37b484e Let the application free the buffer data. 2005-11-12 12:22:23 +00:00
ehofman
faf41f7d96 Prevent a possible memory leak. 2005-11-12 12:17:04 +00:00
ehofman
7629e29397 add a missing character. 2005-11-12 10:55:22 +00:00
ehofman
1cff7fcfea Make a clear separation between loading a sound file into main memroy and sending it to the driver. This prevents data to be loaded into the main memory (or onto the soundcard's memory) when it's not needed. 2005-11-12 10:26:21 +00:00
ehofman
694cf6e958 Expose some internals. 2005-11-11 13:19:58 +00:00
curt
0e12fbb2a0 v0.3.9-pre3 updates. 2005-11-11 00:44:59 +00:00
ehofman
450ad45882 MSVC fix. 2005-11-10 09:57:58 +00:00
ehofman
d674e50591 gcc 4.0 fix. 2005-11-10 09:55:57 +00:00
andy
61f2f4b761 Architectural fix allowing the "tip" popups (FOV, view name, etc...)
to pop themselves down while the simulator is paused.

The problem was with the "real time" queue in the event manager,
causing the third argument of Nasal's settimer() (a flag for "sim
time") to be ignored.  Inverts the default sense of the argument, as
there are lots of uses of settimer() in the current code, almost none
of which want to use real time.

Note this fix introduces a header file incompatibility in SimGear --
be sure to update.
2005-11-09 20:34:14 +00:00
curt
baa2f49b14 v0.9.9-pre2 changes. 2005-11-09 18:47:40 +00:00
curt
8c0bd234d8 v0.9.9-pre2 changes (just the version number!) 2005-11-09 18:41:49 +00:00
curt
c4fd41562f Spelling fixes and other small corrections. 2005-11-05 20:32:45 +00:00
curt
a1d1b4e49f Some pre-release updates. 2005-11-05 19:30:52 +00:00
curt
96fb7a45f7 Add a code comment for future thought. 2005-11-05 18:47:29 +00:00
ehofman
d5eedd2c65 Move Curt's ssgEntityArray experiment over to SimGear. 2005-11-01 09:45:10 +00:00
ehofman
fe4f907099 Remove some unused code. 2005-10-30 15:02:58 +00:00
ehofman
1b45eaf3de Mathias Frhlich:
I guess the most important memory leaks are plugged now.
Just by inspection: An other memory leak in Simgear.
2005-10-27 08:21:58 +00:00
ehofman
cfbc0a1579 MSVC fix. 2005-10-27 08:21:00 +00:00
ehofman
db1b99d8dd Back out the shared mutex code since it only works when the mutex is in shared
memory[1], something we don't support anyhow.
This also fixes a FreeBSD compile problem.

[1] http://hypermail.linklord.com/new-httpd.old/2002/Jan/0557.html
2005-10-26 11:19:58 +00:00
ehofman
65a880e9fa Oops, ALUT 1.0 requires a little more work than expected. 2005-10-25 18:05:23 +00:00
ehofman
37b4005d3e Alex Romosan:
* Use "const string&" rather than "string" in function calls when appropriate.
* Use "const Point3D&" instead of "Pint3D" in function calls when appropriate.
* Improved course calculation in calc_gc_course_dist()
* Safer thread handling code.

Vassilii Khachaturov:

Dont use "const Point3D&" for return types unless you're absolutely sure.

Erik Hofman:

* Use SGD_(2)PI(_[24]) as defined in simgear/constants.h rather than
  calculating it by hand every time.
2005-10-25 13:48:58 +00:00
ehofman
70faa252e7 Prepare for ALUT version 1.0 2005-10-25 13:06:25 +00:00
ehofman
3620be8dbc Cosmetic updates. 2005-10-23 14:04:42 +00:00
ehofman
21c64dd60f Slightly update the seasonal texture support code. 2005-10-23 13:47:46 +00:00
ehofman
fb69d790ce Add support for seasons. 2005-10-23 13:31:13 +00:00
ehofman
debd066edd Melchior FRANZ:
The attached patch makes remove_child() available as removeChild(pos, keep).
That's consistent with getChild. Only renamed remove_child to removeChild and
added a check for validity of the pos argument.

removeChildren() will be used in input.cxx, and a lot in the upcoming
dynamic new_gui dialogs, which are aiming at replacing the hard-coded
dialogs. I'll discuss them on the list once the infrastructure is
in place. (The <hide> gui property was one part of it.)
2005-10-23 11:55:48 +00:00
ehofman
f58d81b1e9 Harald JOHSEN: the sky color now fades to black with altitude 2005-10-23 11:46:41 +00:00
ehofman
8d507f161b Remove some dead code. 2005-10-22 11:07:00 +00:00
ehofman
b015f7c801 Harald JOHNSEN:
I have corrected a few bugs with the owner draw gauge, weather radar code and heat-haze effect.

- shadanim.cxx :
  the heat/haze effect was showing artifacts when using a screen resolution >
  1024 pixels.
2005-10-16 17:23:59 +00:00
ehofman
80abe952ba Ima Sudonim remembered me there is still one problem for gcc Vs. 3.4 or later under Cygwin. This fixes it. 2005-10-15 14:59:02 +00:00
andy
c12162407c Fix memory leak discovered by Mathias Froehlich 2005-10-14 16:42:32 +00:00
ehofman
7f5c3b223a Mathias Frhlich:
This one, removes some virtual qualifiers at a private member class of
SGPropertyNode. These virtual qualifiers are really useless and stop the
compiler from inlineing these functions. I gain a single frame with my
favourite aircraft per second!
2005-10-14 16:27:06 +00:00
ehofman
2f3e4ebf39 Mathias Frhlich:
I have done a valgrind run in flightgear. Just start it up and close it at the
fist change I had about half an hour later.

property-leak.diff:
   A leak in the property system which I could even notice in top.

texture-leak.diff:
    minor one, but fixed is fixed ...
2005-10-14 16:21:57 +00:00
curt
2c14f8587e Use an unsigned vs. signed short to double our element capacity for higher
resolution scenery.
2005-10-12 16:43:26 +00:00
ehofman
42224052e2 Martin Spott:
make GCC on Solaris8 happy.
2005-10-12 08:59:39 +00:00
curt
a8dd5aa0fc Fix a small typo. 2005-10-11 18:56:45 +00:00
ehofman
f3d0a9bc3f David Luff:
The following patch needs to be applied to fix the errors that Georg
Vollnhals was getting whilst attempting to compile SimGear with gcc-3.4.x
2005-10-09 09:37:35 +00:00
ehofman
d629b9e36a Harald JOHNSEN:
- shadanim.cxx, animation.hxx :
  new chrome (sphere mapping) shading ;
  disabled the loading of the fresnel VP until it is fixed ;
2005-10-08 11:52:48 +00:00
ehofman
4d54ba2200 Another Solaris fix. 2005-10-06 14:39:12 +00:00
ehofman
0035ef9194 Martin Spott: Use standardized Sun directive. 2005-10-06 11:06:27 +00:00
ehofman
fcb20296d7 MSYS fix. 2005-10-06 09:45:36 +00:00
ehofman
6bb9080017 MSVC fixes. Frederic: MSVC has no ssize_t type 2005-10-06 08:25:14 +00:00
ehofman
bbde16dc08 Remove a leftover. 2005-10-04 11:49:24 +00:00
ehofman
ac9716f193 Cygwin fixes(?), it's a good idea to do it this way anyhow. 2005-10-01 11:41:59 +00:00
ehofman
8a2bc1c21b Cygwin fixes. 2005-09-29 12:05:22 +00:00
ehofman
942b474ad7 Fix an oops. 2005-09-28 08:03:44 +00:00
ehofman
f3ef9b671f Back out a patch from Sept. 25th. Setting the *factor* to 0.0 by default isn't generally a good idea. 2005-09-28 08:00:33 +00:00
curt
3538631e8e Make some adjustment to low level serial port configuration flags for unix. 2005-09-26 21:01:17 +00:00
ehofman
1577ab04e1 Vivian Meazza:
Correct the bug in the translate animation where the offset was part of the
multiplication. It now behaves like all other animations:
out = (prop * factor) + offset

I feel strongly that the existing is wrong and must be corrected - it is non-op
if the offset is zero as I have found to my cost! It is just a typo I expect.

The diff also provides non-op default values for the scale animation.

I've also included Harald's latest eye-candy animation which allows us to
have a very smart heat-haze for exhausts. They have been tested by me and
others on Linux and Cygwin. You might like to upload these - I have a
revised Hunter ready to go as soon as they are uploaded.
2005-09-25 07:44:50 +00:00
curt
7f2dfaa5b4 Add eof() support to SGIOChannel/SGFile. 2005-09-24 12:28:14 +00:00
curt
fd126746f7 Add an eof() method to SGFile. 2005-09-23 20:13:43 +00:00
ehofman
63f7e9feb0 AMD64 and sgi fixes. 2005-09-23 12:30:25 +00:00
ehofman
5eb380e103 Platform compatibility fix. 2005-09-22 13:43:09 +00:00
ehofman
832e821919 Add some linefeeds. 2005-09-22 09:15:10 +00:00
ehofman
197e3f144d Create our own stdint.h(xx) implementation and use it where needed. 2005-09-22 09:11:27 +00:00
ehofman
056b5b41e2 Prepare for Openal 1.1 and a separate alut library 2005-09-21 09:22:51 +00:00
andy
15d40fd64a Oops, Frederic caught an inline declaration that had snuck into the code. 2005-09-20 21:38:08 +00:00
andy
979d3da69c Sneak a Nasal update in before the next release. This version
*appears* to work correctly on all systems to which I have access
(i386 linux/win32, x86_64 linux, powerpc OS X, Sparc Solaris 10), but
not all systems are capable of running fgfs.  Beyond that, multiple
threading bugs were fixed, and the naCall() API changed slightly to
support named function arguments.

NOTE: this introduces a change in the external API, and therefore this
change *must* be compiled against current FlightGear code.
2005-09-20 21:09:34 +00:00
ehofman
72984cc4a8 Don't refference simgear_config.h because this header gets installed :-( 2005-09-18 21:05:04 +00:00
ehofman
0a7a815124 int64_t is in stdint.h by default. 2005-09-18 09:21:54 +00:00
ehofman
1ce68a49c6 MSVC fix. 2005-09-18 09:19:07 +00:00
ehofman
b1b6abf285 Use inttypes.h specified types. This is the standard and fixes some 64-bit problems. 2005-09-15 17:06:31 +00:00
ehofman
9dfd6970f1 Better XML error catching, proposed by Richard Harrison. 2005-09-15 16:54:27 +00:00
ehofman
3583c13339 Vivian Meazza:
After much trial and tribulation, Harald came up with a fix for the bug
which has been plaguing Cygwin for a couple of weeks now.

It's only a couple of lines. I've tested it exhaustively, and it seems to
cure the problem of Cygwin failing to start.
2005-09-05 13:30:38 +00:00
ehofman
00ab198c9f Mathias Frhlich:
There was a patch from Manuel Masing a few months ago which cleaned up
SGLocation's way depending on input values. That means that with that patch
SGLocation does no longer have calls with unneeded input arguments.
I took his patch and integrated that into flightgear and made maximum use of
that changes.
2005-09-05 13:23:55 +00:00
ehofman
669d9a89ca Mathias Frhlich:
just a few split out patches from my zoo of local work ...

The patch to simgear-glxproc.diff changes dlopen to not open a specific library.
If it is used with a NULL argument, we just get a handle to the current running
binary including all loaded libraries. This has the advantage that we do not
rely on the name of libGL on the specific platform.
Also a user can link with his own different named libGL or with a static libGL.a

Then the render texture again ...

glxQueryVersion turns out to return the  minimum of the client libraries glx
version and the servers glx version. *All* Xorg servers return 1.2 here.
So we never get the glxPBuffer functions  which are the only ones working with
ati's drivers ...
Reverted back to checking the required functions and just use them if they are
there. Still prefering the glx standard variants since they work on ati's
drivers ...
2005-09-05 09:02:56 +00:00
ehofman
9c54603726 Add some more defines as specified in FlightGear/src/Network/net_fdm_mini.hxx 2005-09-05 08:22:30 +00:00
ehofman
dc09a50472 Mac OS X fixes from Markus Morawitz
stdint.h replacement defines for Windows and Sun from Frederic et all.
2005-09-05 08:17:37 +00:00
ehofman
68eb7031e2 Harald JOHNSEN:
- model.cxx :
  load the 2.5D panels before the animations so that the panels can be used in
  animations his solve the problem of 2.5D panels visible outside of the
  aircraft (one can add a null animation to put the panel at the top of the
  aircraft graph so it is drawn first) and this adds the possibility to have
  billboarded/popup panels.

- newcloud.cxx :
  removed 'this' pointer cast for amd64 compiler.
2005-08-22 17:44:35 +00:00
ehofman
19623cac21 Cygwin fix. 2005-08-10 08:04:39 +00:00
ehofman
4ca25ca533 Harald JOHNSEN:
added a cull test on fields
2005-07-31 08:56:27 +00:00
ehofman
178c49a430 Fix a problem with systems that don't define GLXPbufferSGIX or GLXFBConfigSGIX 2005-07-31 08:46:37 +00:00
ehofman
32e2cd9f06 Harald JOHNSEN:
This is the low level shader class for Simgear.
It's the code from Roman Grigoriev with a few adaptations.
2005-07-31 07:59:08 +00:00
ehofman
7aa514d9ba MacOS-X fixes. 2005-07-27 08:02:11 +00:00
andy
7c2575d723 Josh discovered a bug parsing negative numbers with leading zeros
("-0.3") which also affected ones of the form "-.3".  This got
introduced a few months back, I'm not sure how it went undetected for
so long...
2005-07-21 23:03:26 +00:00
ehofman
f93ea20d5e Harald JOHSEN:
Changes
=======

- shadowvolume.cxx, renderer.cxx :
  - reduced the polygon offset a bit to eliminate some artifact ;
  - changed again the cleanup code for objects inside a tile because it could crash on rare occasion ;
  - the culling of shadow casters has been rewritten to traverse the scene graph, it should be
    a bit faster when there is a lot of objects ;
  - the range selector was not correctly handled, sometimes the wrong LOD was casting shadows.
  - added the option to display aircraft's transparent objects after the shadows, this will
    reduce the problem of shadows being hidden by the transparent object (propeller disk,
    rotor, etc). A side effect is that aircraft's transparent objects won't receive shadows
    anymore. This is usually a good thing except when the aircraft use a 'transparent'
    texture where it should not. A transparent texture in the plib context is a texture
    with an alpha channel or a material with alpha <= 0.99.

- model.cxx, animation.cxx, shadowvolume.cxx :
  - added an optional <condition> under the <noshadow> animation

- tower.cxx
  - correct a rare bug where all occurences of the aircraft are not deleted from the
  departure list causing a crash in FGTower::CheckDepartureList function.
2005-07-18 16:57:20 +00:00
ehofman
73cb6ff00d Adjustments to better support GLX1.3 and ATI drivers. 2005-07-13 12:00:30 +00:00
ehofman
72267fa60b Harald JOHNSEN:
Melchior has found another bug, I tried to skip some computation for a few
frames but that introduced some bad rendering bug with the aircraft moving
parts.
I corrected that and reduced a bit the cpu usage for ground objects.
2005-07-06 08:44:25 +00:00
ehofman
6b6a27e849 Another update, the previous one could crash if you leave the surrounding tiles (try Set aircraft in air and choose a distant airport). 2005-07-05 18:53:16 +00:00
ehofman
daea10121c Somehow gcc allows function overriding but MIPSpro doesn't. Fix this. 2005-07-05 18:00:58 +00:00
ehofman
999a1e514b Harald JOHNSEN:
- shadow volume vertex are now shared, using DrawElements instead of repeated
  calls to glVertex, this can improve performance on some systems.
- added a rendering path that use the alpha channel instead of the stencill
  buffer.
- releasing memory when tiles objects are destroyed
- objects sub parts will not cast shadows if their name begins with "noshadow"
  or if they are in a <noshadow> animation

- bbcache.cxx :
   don't ask for a 32 bits context when the primary context is only 16 bits

- RenderTexture.cpp :
   corrected a crash when asking for a second rendering context
   on win32 and extensions not being supported

- model.cxx, animation.cxx :
   added a <noshadow> animation, added an animation type needed by the shadow
   code.
2005-07-05 17:08:27 +00:00
ehofman
be30960366 Make sure it works with the lates version of OpenAL. 2005-07-04 09:20:11 +00:00
ehofman
38e5084018 Restore the old behavior. Additions are likely. 2005-06-30 19:10:18 +00:00
ehofman
fdd9bb1af6 Melchior FRANZ:
- check for isTied() and refcount has to be made *before* we go into
  recursion, so as to pertain subtrees of refcounted nodes, even if there
  are no refcounted/tied nodes *in* this tree
- return value inverted, because it's more logical to say
  removeChildren() == true --> everything removed;  false --> failed
- further cleanup
2005-06-29 09:41:07 +00:00
ehofman
81546820ab Frederic: Also copy the attributes over to the new tree. 2005-06-28 11:19:41 +00:00
ehofman
84e87f0e8a Due to a misunderstanding of what removeChild() actually does, some used it to detach a subtree from the main tree. The previous patch broke that behaviour so a new function call detchChild() is now added. 2005-06-28 11:19:09 +00:00
ehofman
901592a88e fix return value 2005-06-27 17:48:13 +00:00
ehofman
24f908d9be Melchior FRANZ:
- introduce removeChildren() and removeChildren(name)  to remove all children
  or all with a given name
- let removeChild() and removeChildren() also remove child trees, and let them
  return a "dirty" boolean that indicates if one or more subnodes had to be
  kept because of refcounting (removeChild returned a SGPropertyNode_ptr before)
- make alias/unalias increase/decrease the refcounter
- don't remove refcounted or tied nodes

This patch makes the SGPropertyNode_ptr actually useful. Until today, they did
proper refcounting (except for aliases), but no other part did check this counter.

But SGPropertyNode_ptr aren't only useful for the first time, they are now
highly recommended for every place that relies on a node address, and wants
to "lock" it (so that removeChild(ren) will never try to remove them). This
is not guaranteed for SGPropertyNode* (and never was). Of course, that's not
an imminent problem, as only four places currently use removeChild(ren) and
these are careful to only remove their own data.
2005-06-27 13:49:28 +00:00
ehofman
f62ff0ad66 Harald JOHNSEN:
Changes
=======

New volumetric shadows for FlightGear.

There is now two new checkboxes in the rendering dialog to enable/disable shadows
for the user aircraft and for static scenery objects (ie those defined in the .stg files).
AI and random objects are not handled for the moment.


known bugs
==========
- ghost objects
2005-06-26 17:16:45 +00:00
ehofman
8e0ecbeb8f Remove the 'old' 3D clouds code. 2005-06-25 11:22:06 +00:00
ehofman
095367f760 Melchior: Make the (lack of) axis or center location definitions more consistent. 2005-06-12 11:23:28 +00:00
ehofman
5d34eb12e0 Melchior FRANZ:
This is the more elegant solution that Andy had proposed in a response
to my RFC on Nasal initialization code in joystick configuration files.
As Nasal is initialized last (for good reason), subsystem can currently
not use it for initializing. postinit() is called on all subsystems
after all have been initialized.
2005-06-11 08:39:26 +00:00
ehofman
d4e760efe1 fix a coredump situation, discovered by Melchior. 2005-06-08 14:07:53 +00:00
ehofman
75ab8e697b Harald JOHSEN:
Changes
=======

- changed the rotation of sprites, they don't rotate strangely when we
  approach them now
- corrected the strange movement of clouds when banking quickly
- it no more rain above cloud layers
- add a radar echo container used by the weather radar instrument
2005-05-30 09:04:57 +00:00
andy
f4b05d46ed Fix two crash conditions Ampere found. These are just temporary
patches; my private version has rewritten both of these functions
(ironically fixing these bugs in the process) to handle negative
offsets meaning "from the end".
2005-05-29 16:13:48 +00:00
ehofman
04c5f2c36a Melchior FRANZ:
Turn the material animation's <transparency> property into a group, with
members <alpha-prop>/<alpha>, <offset-prop>/<offset>, <factor-prop>/<factor>,
<min>, and <max>. The "material" animation can now fully replace "blend" and
"alpha-test" (--> <threshold>) animations, with enhanced possibilities:
The "material" animation can be used for one or more explicit objects (like
"blend"), but also for all objects that share one material (<global>), which
avoids problems with objects being forced together into one tree. Also, an
object doesn't have to be semitransparent or textured with a semitransparent
texture to make blending work. Unlike the "blend" animation, the "material"
animation also makes fully opaque and untextured objects transparent. (This
fixes the bo105's formerly semi-transparent rotor.)

Erik:
The blend animation and alpha-test animation are depreciated as of now.
2005-05-24 08:13:09 +00:00
ehofman
db50f95482 Melchior FRANZ:
Currently, the material animation sets glColorMaterial(GL_AMBIENT_AND_DIFFUSE)
for all material properties. This breaks emission-only (e.g. cockpit lighting
for the p51d) or specular-only animation. ==> set glColorMaterial only where
it is really required.
2005-05-23 16:35:00 +00:00
ehofman
0e52a08a47 MSVC fix. 2005-05-22 09:18:56 +00:00
ehofman
7b5d49ef60 Harald JOHSNEN:
Changes
=======

- correct the transparency probleme when old 3d clouds were enabled
 (rendering context with an alpha channel)
- changed rain cone orientation, it can now be viewed from helicopter or chase
  view (still not tower view)
- clouds are a bit more yellow/red at dawn/dusk
- weather data is now correctly propagated to the interpolator, this correct
  visibility, wind, etc
- the 'metar' weather scenario now immedialty reuse the real metar data
- real metar no more overwrite custom weather scenario
2005-05-22 08:09:08 +00:00
ehofman
430ba60b33 MSVC fix. 2005-05-22 07:35:39 +00:00
ehofman
3af1f3bc63 Make removeChild() work (again?) 2005-05-17 09:56:08 +00:00
ehofman
bdcb94af81 gcc fix. 2005-05-15 09:34:04 +00:00
ehofman
2ea9e723c2 Harald JOHNSEN:
This is another update for the cloud code, a lot of lines but this time I have started to add the doxygen doc.

Misc
====

- corrected a bug when RTT is not available, the current rendering context was
  altered
- if RTT is not available then 3d clouds are not drawn at all
- impostors lighting is now recomputed when the sun changes position
- distant objects are no more seen in front of clouds
- blending of distant clouds is a bit better now
- litle optimization of code (uses a less cpu time)
- use layer wind speed and direction (no more hardcoded wind)
- fov is no more hardcoded

Changes
=======

- clouds (cu only) are dissipating/reforming (experimental)
- compute a turbulence factor that depends on surrounding clouds and type of
  clouds (experimental)
- clouds shapes are defined in cloudlayers.xml
- type of clouds present in a layer is also defined in cloudlayers.xml
- cloud layers are generated from metar and other misc. data (in progress)
- added a rain effect around the viewer (enabled in the rendering dialog and
  when the metar property says so)
- added a lightning effect (enabled in the rendering dialog) : cb clouds spawn
  new lightnings
- added a dialog to select from different weather source : metar/property,
  a 'fair weather' environment and a 'thunderstorm' environment.
2005-05-15 09:27:00 +00:00
ehofman
e19091d809 Melchior: Only change types when explicitly requested. 2005-05-09 16:18:41 +00:00
ehofman
64ab59c0e0 Melchior FRANZ:
Vivian pointed out that a redefined Ctrl-U key binding didn't work
correctly. I found out that this is, because the definition in
$FG_ROOT/keyboard.xml sets <value type="bool"> for binding[1],
and ... [better sit down first!] ... and assigning <value type="double">
in a *-set.xml file doesn't *really* set "double" as new type!

Instead, the boolean is kept, and a double sqeezed into it. In other
words: once tainted as bool, you can throw all doubles in the universe
on a property node, and all it will accept is 0 and 1. Without warning!

BTW: I changed the patch: I was overly cautious: clear_value() does already
care for ties and for setting NONE, so we just need to make that public as
clearValue(), and use that. Makes the patch a bit more verbose, though.  :-/
2005-05-09 14:31:41 +00:00
ehofman
4707b363aa Solaris fix. 2005-05-07 08:46:04 +00:00
andy
1a72245c15 Properly release the mod lock when returning from a runtime error.
Ampere discovered that the interpreter would deadlock at runtime if it
hit such a condition during initialization.
2005-05-04 20:17:28 +00:00
ehofman
dea7b9050d Phil Cazzola:
This is a minor bug fix for sgBucketDiff().
If you crossed the bucket size boundary, the answer for dx could be wrong.

E.g.
 going from   0:0, 21:7  to 0:7, 21:7   would give you dx = 7 (correct)
 but going from 0:0, 21:7 to 0:3, 22:0 would give you dx = 6 (instead of 7)

Previously it differenced the center longitudes of the buckets.  When you
cross a boundary, the center point of the larger bucket now lies on the edge of the smaller bucket.

The result was a dx with an integer + 1/2 bucket, which rint() was rounding to the nearest even int.

This function only seems to be used in TerraGear.
2005-05-01 08:50:39 +00:00
ehofman
3bd810fedc Make use of the repeatable sg_random() function so display systems can synchronize 3d clouds too. 2005-04-30 10:00:16 +00:00
ehofman
f9cbf8361d Add a seed function that gives the same random seed within a ten minute period of time. This should be useful for synchronizing display systems. 2005-04-30 09:59:12 +00:00
ehofman
eccd4d0325 Mathias:
I have done a patch to eliminate the jitter of 3D-objects near the viewpoint
(for example 3D cockpit objects).
The problem is the roundoff accuracy of the float values used in the
scenegraph together with the transforms of the eyepoint relative to the
scenery center.

The solution will be to move the scenery center near the view point.
This way floats relative accuracy is enough to show a stable picture.

To get that right I have introduced a transform node for the scenegraph which
is responsible for that shift and uses double values as long as possible.
The scenery subsystem now has a list of all those transforms required to place
objects in the world and will tell all those transforms that the scenery
center has changed when the set_scenery_center() of the scenery subsystem is
called.
The problem was not solvable by SGModelPlacement and SGLocation, since not all
objects, especially the scenery, are placed using these classes.

The first approach was to have the scenery center exactly at the eyepoint.
This works well for the cockpit.
But then the ground jitters a bit below the aircraft. With our default views
you can't see that, but that F-18 has a camera view below the left engine
intake with the nose gear and the ground in its field of view, here I could
see that.
Having the scenery center constant will still have this roundoff problems, but
like it is now too, the roundoff error here is exactly the same in each
frame, so you will not notice any jitter.

The real solution is now to keep the scenery center constant as long as it is
in a ball of 30m radius around the view point. If the scenery center is
outside this ball, just put it at the view point.

As a sideeffect of now beeing able to switch the scenery center in the whole
scenegraph with one function call, I was able to remove a one half of a
problem when switching views, where the scenery center was far off for one or
two frames past switching from one view to the next. Also included is a fix
to the other half of this problem, where the view position was not yet copied
into a view when it is switched (at least under glut). This was responsible
for the 'Error: ...' messages of the cloud subsystem when views were
switched.
2005-04-29 14:37:27 +00:00
ehofman
e0decf1233 Mathias:
have done a patch to eliminate the jitter of 3D-objects near the viewpoint
(for example 3D cockpit objects).
The problem is the roundoff accuracy of the float values used in the
scenegraph together with the transforms of the eyepoint relative to the
scenery center.

The solution will be to move the scenery center near the view point.
This way floats relative accuracy is enough to show a stable picture.

To get that right I have introduced a transform node for the scenegraph which
is responsible for that shift and uses double values as long as possible.
The scenery subsystem now has a list of all those transforms required to place
objects in the world and will tell all those transforms that the scenery
center has changed when the set_scenery_center() of the scenery subsystem is
called.
The problem was not solvable by SGModelPlacement and SGLocation, since not all
objects, especially the scenery, are placed using these classes.

The first approach was to have the scenery center exactly at the eyepoint.
This works well for the cockpit.
But then the ground jitters a bit below the aircraft. With our default views
you can't see that, but that F-18 has a camera view below the left engine
intake with the nose gear and the ground in its field of view, here I could
see that.
Having the scenery center constant will still have this roundoff problems, but
like it is now too, the roundoff error here is exactly the same in each
frame, so you will not notice any jitter.

The real solution is now to keep the scenery center constant as long as it is
in a ball of 30m radius around the view point. If the scenery center is
outside this ball, just put it at the view point.

As a sideeffect of now beeing able to switch the scenery center in the whole
scenegraph with one function call, I was able to remove a one half of a
problem when switching views, where the scenery center was far off for one or
two frames past switching from one view to the next. Also included is a fix
to the other half of this problem, where the view position was not yet copied
into a view when it is switched (at least under glut). This was responsible
for the 'Error: ...' messages of the cloud subsystem when views were
switched.
2005-04-29 14:36:50 +00:00
ehofman
100927f16c Harald Johnsen: Fix a 'terrible' bug with culling of the clouds. 2005-04-26 20:14:37 +00:00
ehofman
bb670f6658 IRIX fixes. 2005-04-26 09:08:58 +00:00
ehofman
d37992aaf9 Harald Johnson:
Changes
=======

- corrected some strange behavior when playing with the render dialog options
- the density slider is now working : if you are fps limited and still want to see clouds in
  the distance you should play with that
- added the choice for texture resolution, its more comprehensible now (before it was
  wrongly allways choosing 64x64 textures)
- changed the initial texture size : you now have 64 texture of 64x64, this uses 1Mo of
  texture memory (before it was 20 texture of  256x256, that took more memory and there was
  not enought impostors)
- sun vector is now right so the lighting is a bit better
- removed useless sort and light computations for impostors, this should save a lot of cpu
- blending of distant cloud is more accurate now
- clouds are now positioned correctly, they don't try to escape you anymore
- no more red/white boxes around cloud
- textures are now filtered (no more big pixels)

known bugs
==========

- distant objects are seen in front of clouds
2005-04-26 08:30:38 +00:00
ehofman
9048ee533d Don't refference GLUT but GLU instead. 2005-04-24 13:55:20 +00:00
ehofman
2b1e5927ca This one time I did a commit using Linux. <sigh> 2005-04-24 11:45:34 +00:00
ehofman
b5e03030d1 Harald Johnson:
- new and updated sources for the new volumetric clouds
- 2 new textures for the clouds
- an update to the render dialog to enable/disable and change a few parameters
  for the new clouds
2005-04-24 11:16:50 +00:00
andy
65056bfa72 Support for a "forindex(idx; list) {...}" construct analagous to
foreach, except that the variable gets the index instead of the list
element.  Should be useful, and took almost no code to implement.

Support for operator/assignment syntax: +=, -=, *=, /= and ~= now do
what you think they should.

Library support for a bind() function (see the docs Andy is still
writing), allowing runtime modifications to function lexical
environments.
2005-04-22 21:54:16 +00:00
andy
c50bb90374 Fix clamping of the minimum hash size, because the Melchior discovered
that the column math goes wacky when lgalloced is allowed to be
  zero.
Augment the find() function to take a starting index.
Fix strc() to use a default index of zero.
Fix parser precedence of TOK_MINUS, so that "a-b-1" means (a-b)-1 and
  not a-(b-1).
2005-04-19 14:19:46 +00:00
ehofman
ec4fc265e0 Non gcc fixes. 2005-04-19 12:30:12 +00:00
andy
8ea41af5c4 Fix crash in the code generator when compiling a (now illegal, because
"var" is a reserved word) expresssion of the vorm "var=<expr>".
2005-04-18 20:43:29 +00:00
andy
966331dac7 Upgrade to nasal 1.0 test candidate 2005-04-18 19:48:47 +00:00
andy
cf056bace7 Fix boolean semantics so that the empty string evaluates to false, and
numeric strings are false if their numeric values are false.
2005-03-30 18:45:01 +00:00
ehofman
405a455906 Melchior FRANZ:
Re-organisation: <diffuse>, <ambient>, <emission>, <specular> are
now groups with members <red>, <green>, <blue>, <factor>, <offset>,
and their <*-prop> forms. Additionally, there's an option <property-base>
that can be used to set a path that is prepended to all <*-prop> paths.
It defaults to an empty string. Rationale: see model-howto.html.
2005-03-28 09:13:45 +00:00
andy
3a8b431a5b Don't parse a single "e" or "E" as a numerical zero. You need a
numerical prefix to use the 1.0e12 notation, "e" alone is not enough.
2005-03-22 20:28:47 +00:00
ehofman
3ce0c17237 Melchior FRANZ:
here is the promised material animation. It looks a bit longish, but that
wasn't avoidable -- there are simply too many parameters to consider. I tried
hard, though, to make the animation fast by only doing the necessary stuff.
It doesn't affect the frame rate here with my test model. The animation is
heavily based on Jim's "material-emission" animation.

* implementation of the "material" animation (this required to make the
  texture path available) + documentation update ($FG_ROOT/Docs/)
* fix some more return values (texture animations, and select) for the
  shadow problem (and some in anticipation of other problems  :-)
* fix compiler warning
2005-03-22 13:12:51 +00:00
ehofman
61a2e0f104 Melchior FRANZ:
the cause for the disappearing shadows is, that SimGear doesn't tell plib
to call the pre-traversal-callback function on culled objects. These calls,
however, are necessary to execute the transform animation that does, for
example, translate a shadow back into the frustum! Curretnly, the callback
is only executed, and the shadow only magically pops up again, when the object
enters the frustum because the view has changed significantly.

The plib documentation does only talk about TRUE and FALSE for possible
return values from the pre-traversal-callback. But src/ssgEntity.cxx reads
like this:

   int ssgEntity::preTravTests ( int *test_needed, int which )
   ...
       int result = (*preTravCB)(this,which) ;

       if ( result == 0 ) return FALSE ;
       if ( result == 2 ) *test_needed = 0 ;
   ...

So the return value needs to be 2 to bypass the cull test for pretraversal,
and get the pretraversal in any case. I only changed the return values in
four animations: scale, rotate, translate, and range, because these are
the most likely to move an object out of the frustum. It's not necessary
for blend/alpha/texture manipulation etc. Of course, this is a bit more work
for plib, but the performance will probably not be affected, because:

* these four animations are mainly used for the aircraft model (the spin
  and billboard (trees!) animations are not affected)

* the number of extra nodes to process is quite low

* a part of the time spent for the extra nodes to be processed, was before
  used for workarounds that are now not necessary any more

I didn't observe a frame rate drop, at least.
2005-03-19 10:19:30 +00:00
andy
7c44251216 Oops, fixed the wrong test 2005-03-12 15:51:37 +00:00
andy
26e70664d6 Off by one error when printing exact poweres of ten 2005-03-12 15:49:53 +00:00
andy
8ac27cc798 Fix an infinite loop (due to an overflow condition) when printing some
very large numbers.
2005-03-11 21:49:31 +00:00
andy
d314164fed Fix the fixes. Note that "." had the same problem as "+" and "-", and
that we can still match non-identical constants if they are both
strings with the same numerical value.
2005-03-11 20:39:07 +00:00
andy
d2cbed151b Don't parse the strings "+" and "-" as numerical zeros. Also fix the
code generation of constant objects to use real identity and not Nasal
equality, so (e.g.) the constants 1 (number) and "1.0" (string) do not
get turned into the same object in the generated code.
2005-03-11 19:07:06 +00:00
ehofman
fc06ae58b2 Ima Sudonim:
I have (hopefully) generated a patch for a previously mentioned simgear  problem for a hang condition in mac os x.  Mentioned in  <http://baron.flightgear.org/pipermail/flightgear-devel/2005-February/ 035004.html>
2005-03-10 08:58:48 +00:00
ehofman
a8768c78a2 automake 1.8+ fixes 2005-02-15 18:13:15 +00:00
ehofman
ee8763f60d More MacOS X fixes 2005-02-12 12:44:46 +00:00
ehofman
db633330fe Fixes from Norman for users running Cugwin with the XServer package installed. 2005-02-11 15:19:04 +00:00
ehofman
c1ffafd663 MacOS X fix(?) 2005-02-11 15:07:22 +00:00
ehofman
72f35dc914 Comment out GLX code for MacOS and (hopefully) add some MacOS AGL compattible code. More needs to be done though. 2005-02-01 10:35:43 +00:00
ehofman
e5f82f53b9 MacOS doesn't have glx.h 2005-01-31 18:29:38 +00:00
ehofman
e39e6893e0 Jim Wilson:
Fix a couple of loose ends and missed edits on the earlier patch.  For the
most part no change in functionality.
2005-01-31 18:21:12 +00:00
ehofman
9ab77d65f4 Cygwin fixes 2005-01-31 18:07:40 +00:00
ehofman
8ed96cad1d Windows fixes. 2005-01-29 11:44:01 +00:00
ehofman
7795eb8239 Jim Wilson:
This patch adds support to the model animation system for modifying emissive
states on the fly so that it is possible to make "lights" appear to dimm.

This is an example of a configuration entry which should explain how it is used:


 <animation>
  <type>material-emission</type>
  <object-name>Face</object-name>
  <property>/controls/lighting/instruments-norm</property>
  <emiss-red>1.0</emiss-red>
  <emiss-green>0.8</emiss-green>
  <emiss-blue>0.5</emiss-blue>
 </animation>

Note the color entries are the emissive colors when the "property" value is
1.0.  They are useful for tinting the light.   The "property" itself must be
float or double and is clamped to values between 0 ~ 1.0 inclusively.   The
"property" value is multiplied against the colors to get the actual material
properties.  Thus property value 0.0 = darkest, and 1.0 = brightest.
2005-01-29 10:31:25 +00:00
ehofman
207c7ab1e0 MSVC fix. 2005-01-28 15:23:26 +00:00
ehofman
27af79684f Frederic Bouvier:
code.c is C code ( according to the file extension ), so variables should be declared at the beginning of the function.
2005-01-28 15:21:29 +00:00
ehofman
6b61a8eed1 use a proper delete[] 2005-01-28 15:15:23 +00:00
ehofman
181e6eac75 MSVC fixes 2005-01-28 09:32:57 +00:00
ehofman
fd1979857c Fix an NVIDIA problem. 2005-01-27 17:49:22 +00:00
ehofman
448bc3facd Add a RenderTexture test program. 2005-01-27 10:56:22 +00:00
ehofman
97cabadb88 Melchior FRANZ:
If alcOpenDevice( NULL ) is NULL, then context is never assigned a
value, and it's pointless to ask for it in the next "if". But as the
ALCcontext that context points to doesn't seem to be fully defined
(OpenAL bug), valgrind still complains ...


Erik Hofman:
Extend this some further and define context=0 otherwise and check for
context != 0 before using it.
2005-01-27 10:47:09 +00:00
ehofman
8e284a70b7 Melchior FRANZ:
Trying to find the bug in tower.cxx (that crashes fgfs quite frequently
for me!), I'm playing with valgrind again. Until I'm in the ATC subsystem
there will be some other bugs and nitpicking along the way.

valgrind doesn't like that imgage->tmp is once allocated with new and
once with new[], sometimes with malloc() (via map), and sometimes freed
with delete (not delete[]!) and sometimes with free(). With simple types
such as GLubyte this shouldn't really make a difference, but anyway.

Also, I promised that I'd send patches for "if (foo) delete foo;" as
I'm making other changes to concerned files. texture.cxx is one with a
few occurrences thereof. (Remember: C++ explicitly allows to delete
null-pointers, so this check is redundant, and hence not tolerated in
other projects, such as KDE. Doesn't have to impress us, of course.  :-)

Also, fixes 4 signed/unsigned warnings (gcc 3.3.4)
2005-01-27 10:42:31 +00:00
ehofman
73f9febe06 Add Mark Haris' RenderTexture class based on SimGear's extesion support files. 2005-01-27 10:39:15 +00:00
andy
6a6cc22e9c Move error handling in setupFuncall above the stack frame creation.
The error properly belongs to the enclosing scope, not the called
(non-)function.  This bug was fixed a few months back in my private
tree, but Melchior just discovered that the new Concorde scripts
tickle it.  I really need to re-synchronize SimGear with my own Nasal
tree...
2005-01-25 22:37:22 +00:00
ehofman
b293639b76 Add a bunch of extensions in preparation of render-to-texture support. 2005-01-25 18:33:59 +00:00
curt
f06036be09 Frederic Bouvier:
The Beaver triggered a problem ( uninitialized variable ). Here is the updated
code.
2005-01-24 21:46:12 +00:00
curt
867571af78 Frederic Bouvier:
this is the animation code that do randomisation of the spin animation. The XML tags are modified to support the syntax below :

  <use-personality type="bool">true</use-personality>
  <factor>
    <random>
      <min>1.8</min>
      <max>2.2</max>
    </random>
  </factor>
  <starting-pos-deg>
    <random>
      <min>0</min>
      <max>360</max>
    </random>
  </starting-pos-deg>

instead of usual :

  <factor>1.42</factor>
  <starting-deg-pos>42.0</starting-deg-pos>
2005-01-24 19:49:35 +00:00
ehofman
f6314d3124 Erik Hofman
1. Remove the dependency on alut  which (on certein platforms) might pose
   some restrictuons on commercial use.

2. Create a sound source just prior to playing the sound and destroy it
   again when the sound has stopped. This should greatly reduce the
   error reports from Windows users.
2005-01-24 15:51:37 +00:00
ehofman
1e87dd7903 Melchior FRANZ:
The following patches to SimGear & FlightGear ...

- create an FGMetar abstraction layer, whose purpose is:
  * provide defaults for unset values
  * interpolate/randomize data (GREATER_THAN)
  * derive additional values (time, age, snow cover)
  * consider minimum identifier (CAVOK, mil. color codes)
- add rain/hail/snow/snowcover support on the METAR side
- add max age of METAR data handling (currently set to
- add support for an external METAR cache proxy server
- add CAVOK handling
- set missing year/month in regular METAR messages
- fix a small bug in metar.cxx (wrong return value)
2005-01-20 09:28:04 +00:00
curt
3b6af2f0c2 Ready for 0.3.8 release. 2005-01-18 14:34:13 +00:00
curt
5bdff41641 Require plib-1.8.4 2005-01-17 21:48:05 +00:00
ehofman
67e9d105cb Use the double precission pow() function to get Solaris compiling. 2005-01-16 08:52:22 +00:00
ehofman
f1fc99f16f Solaris fix 2005-01-15 14:24:28 +00:00
ehofman
f89e359d53 Solaris fix. 2005-01-15 14:22:56 +00:00
ehofman
77ec170a50 MingW/MSYS fix 2005-01-15 14:18:30 +00:00
ehofman
34320f5f20 Eliminate some compiler warnings about converting float to int. 2005-01-15 11:57:34 +00:00
ehofman
a26271e46e Add a make_bumpmap and a make_maxcolorwindow function, modify the make_normalmap function to maximize the color window before proceding. 2005-01-15 10:48:40 +00:00
ehofman
e2e7466250 Add support for contrast. 2005-01-14 15:52:56 +00:00
ehofman
1e24cc4643 little endian fixes. 2005-01-14 14:27:57 +00:00
ehofman
dfc23c3528 Add a make_grayscale function and call it from make_normalmap automatically, removing the need to do it make_grayscale prior to calling make_normalmap. 2005-01-14 13:36:38 +00:00
ehofman
cd11a5dc27 Fix a mistake. 2005-01-14 13:12:44 +00:00
ehofman
899734296b Add a function to calculate the normalmap from a regular texture. 2005-01-14 13:08:57 +00:00
ehofman
7a3a81c152 RGBA textures can be made monochrome also 2005-01-14 10:12:00 +00:00
ehofman
e62a4a05ac Fix a few bugs and add a make_monochrome() function 2005-01-14 10:09:21 +00:00
ehofman
463ca207ce Some small updates to the saving code. 2005-01-13 18:35:56 +00:00
ehofman
da6e1b31ea Fix a crash situation. 2005-01-13 18:05:46 +00:00
ehofman
8c783b1680 Update the code a bit more, add a function to retreive the last error string and add a function to write SGI texture fils. 2005-01-13 14:47:31 +00:00
curt
efce88ff12 - Fix a couple oops's in cloud.cxx
- In sky.cxx blend low density cloud layers (few/scattered) into nothing (but
  don't touch visibility distance) as we approach them so we can fly through
  clean.
- For high density cloud layers (broken/overcast) we do not fade the layers
  out, but we fade visibility to nearly nothing as we approach the layer.
2005-01-11 16:02:39 +00:00
curt
01608b7e18 Add a method to SGCloudLayer to set overall cloud alpha. This gives us the
capability to slowly fade a cloud layer in or out.

We use this effect in combination with lowering visibility as we approach
a cloud layer to hide the fact that it is simply a 2d textured polygon being
drawn across the sky.
2005-01-11 15:21:58 +00:00
david
a5f0e0395a Do not reduce visibility when passing through a 'few' or 'scattered'
cloud layer (i.e. <50% coverage).  This is a quick hack rather than a
proper fix, but it will at least make it possible to get above a
scattered layer VFR.
2005-01-10 23:34:52 +00:00
ehofman
0b723174fd Add support for binding a thread to a specific CPU (IRIX only at this time). 2005-01-09 10:24:54 +00:00
ehofman
5d248bf0df Frederic Bouvier:
It comes to me that the bulk of all problem reports, especially from Windows users, have it's cause in an obsolete sound driver. These messages should direct them to the right solution before complaining.
2005-01-08 11:47:19 +00:00
curt
c039ccdeb0 Updates for 0.3.8-pre2 release. 2005-01-03 19:05:32 +00:00
ehofman
d88fb32a73 Melchior FRANZ:
My recent fix for the load/save fgfs.sav feature was a bit too ambitious.
While aliases lead to abortion before, I tried to copy them properly,
although this wasn't a requirement. Unfortunately, this seems to have
worked for absolute aliases only, not for relative ones, and hence broke
several panel instruments. The attached patch backs most of the previous
patch out again, and goes a simpler route: just ignore aliases.
2004-12-23 13:32:01 +00:00
ehofman
37ac409586 Melchior FRANZ:
fgLoadFlight() loads a property file ("fgfs.sav") to a new property tree,
and then copies that over to the main tree. copyProperties() didn't know
how to handle type SGPropertyNode::ALIAS and hence threw an exception that
made fgfs abort.

The attached patch adds support for ALIAS to copyProperties(): aliased
nodes are created in the target tree if necessary, and then linked like in
the source tree. It seemed useful to add an optional argument to
props.[ch]xx/getType() that would indeed return the property type "ALIAS"
for aliased nodes, and not the type of the node that it refers to. The patch
also fixes a bug in writeNode() that caused extra lines after alias entries.

If there's resistance to the change to getType() (David?) I can easily use
isAlias(). This just makes copyProperties() a tad uglier, but I can live with
it. It's useful for scanning a tree, though, if an alias node can be treated
exactly like all other nodes, without automatic redirection.
2004-12-19 10:19:14 +00:00
ehofman
7b24e94c66 gcc 4.0 fix. 2004-12-18 10:53:54 +00:00
ehofman
e12cd2a50c Initialize volume to inaudiable at startup. 2004-12-16 13:15:13 +00:00
curt
98b2ba4fc1 More prerelease updates. 2004-12-15 16:45:57 +00:00
curt
2f0afdccc1 Prerelease updates. 2004-12-15 16:34:14 +00:00
ehofman
79734df554 Threads detection code cleanup and FreeBSD fixes. 2004-12-13 20:31:44 +00:00
ehofman
c52657fa1a This was too quick, now pthreads isn't detected on IRIX (and other platforms?) anymore. This needs some more thought. 2004-12-08 15:12:11 +00:00
ehofman
9cac8409cd FreeBSD fix. 2004-12-08 15:00:45 +00:00
ehofman
18703ce02d AIX fix 2004-12-05 09:36:49 +00:00
curt
709a166bd6 Oops, 2nd try ... 2004-12-02 15:08:54 +00:00
curt
8048e6297c Martin Spott: Revised handling of missing isnan() on earlier versions of
FreeBSD.
2004-12-02 15:00:26 +00:00
curt
fb0dded103 Fix a typo for the Mac OSX platform. 2004-12-01 17:37:43 +00:00
curt
055e969e7a Fix a dumb bug. 2004-11-21 21:46:02 +00:00
curt
f10db8a30e Fix a dumb bug for FreeBSD. 2004-11-21 21:45:35 +00:00
ehofman
c19af3525e Melchior FRANZ:
At last I've found the reason why fgfs crashed routinely for me. When I still
used KDE's artsdsp (preloads lib with OSS replacement functions) I saw
this crash only occasionally. After letting OpenAl communicate with artsd
directly (by means of ~/.openalrc setting), I got the crash always when
I left fgfs.

This bug may also have crashed fgfs when running with sound daemons other than
aRts.
2004-11-21 17:05:42 +00:00
curt
7c60ccfc35 I don't understand why FreeBSD doesn't see isnan() after including math.h
but it doesn't.  Trying the apple approach to fixing isnan results in an
infinite loop (making me wonder what happens on OSX?)  This is an alternative
approach to checking isnan() on freebsd ...
2004-11-21 03:13:54 +00:00
curt
84cba33aab FreeBSD fix. 2004-11-20 19:11:08 +00:00
ehofman
a52b1ec64f MSVC fix. 2004-11-20 12:35:28 +00:00
curt
f30c4720ae Update a few more instances of my email address. 2004-11-19 21:47:05 +00:00
curt
7fc8c02688 My old email address is no longer valid ... point to my web page. 2004-11-19 21:44:16 +00:00
curt
54a7a0d534 Ooops, fix an unintentional line wrap. 2004-11-18 19:12:17 +00:00
curt
8d73160a75 Abstract out location of gl.h, glut.h, and glu.h includes so that we can
make the Mac platform happy since they put these in a different place compared
to the rest of the world.
2004-11-18 19:10:34 +00:00
andy
ff10602c65 Make sure that timer delay values are positive-definite, otherwise
user code that wants to use zero delay to mean "next frame" will get
stuck in an infinite loop.
2004-11-17 19:37:45 +00:00
ehofman
ca50fe386d Roy Vegard Ovesen:
I've added two new debug log types for the instrumentation and systems. They
used to use the autopilot debug log, because I couldn't figure out how to
make new log types. Well, now I have figured it out.  ;-)
2004-10-24 09:29:56 +00:00
ehofman
39f3c6e41d Frederic Bouvier:
This is a patch to make display list usage optional. They are on by default.
Use --prop:/sim/rendering/use-display-list=false to use immediate mode.
There is also a change in exception handling in main.cxx and bootstrap.cxx
2004-10-17 17:06:50 +00:00
ehofman
ba1b96e518 Roy Vegard Ovesen:
I'm working on a route manager in the GPS module. So I've added a name
parameter to the waypoint class in Simgear. I use the existing ID parameter
to store the ID, for example KLAX, and the name parameter to store the name,
San Francisco Intl.
2004-10-16 12:23:53 +00:00
ehofman
ef486b2cc6 Remove the refference to fgsg 2004-10-14 13:35:11 +00:00
curt
06f3cb4f8e Fix a couple bugs in openal detection. I should actually generate a new
configure and test it, rather than testing the old configure script.
2004-10-13 20:18:35 +00:00
curt
074f5ff996 Oops, missed a part of the previous change. 2004-10-13 19:52:13 +00:00
curt
8c26f32d5f Add a sanity check for the existance of OpenAL. If not there, bail from
the configure script with an appropriate/helpful message.
2004-10-13 19:51:38 +00:00
curt
9a2ee54389 Final 0.3.7 changes. 2004-10-12 14:35:42 +00:00
ehofman
ab69c03698 Fix a typo. 2004-10-11 07:56:08 +00:00
ehofman
fab1f4e7a0 Frederic: Ignore display lists when using the blend animation. 2004-10-11 07:37:42 +00:00
ehofman
41eed484c1 Adding the panel was a step too far for Linux, causing a segfault. 2004-10-10 19:38:46 +00:00
ehofman
7d18f9bdde Remove a phantom makeDList call (probably an old one from my code. 2004-10-10 19:16:25 +00:00
ehofman
3a48c3de7a Check for the plib version when using display lists, just to be sure. 2004-10-10 19:05:25 +00:00
ehofman
d769a9936b Frederic: Include FGPanelNode in the display list generation process. 2004-10-10 18:43:11 +00:00
ehofman
1697cb3b1a Frederic: Use display lists for 3d models also. 2004-10-10 17:49:27 +00:00
ehofman
62aa32a417 Reverse the declaration order. jpgRenderFrame (formerly known as trRenderFrame) is now declared as a NULL function pointer and assignment of the proper function is now done in FlightGear (jpgRenderFrame=FGRenderer::update). 2004-10-06 09:57:31 +00:00
ehofman
a0d0852838 David Luff:
The one-liner removes a lot of re-definition warnings on Cygwin.
2004-09-30 09:43:11 +00:00
ehofman
2f479cae69 Small update for future use. 2004-09-19 09:08:12 +00:00
curt
4820d57fa8 Expose the size() method for locked and blocking thread queues. 2004-09-15 15:28:58 +00:00
curt
04e3b0b3c1 Fix another case where the direction vector is not initialized which can
lead to openal "inrange" assertions, crashing FlightGear.
2004-09-15 15:28:14 +00:00
curt
a7f78b9f68 direction vector needs to be initialized, otherwise garbage data could cause
openal to generate an assertion, aborting the top level app.
2004-09-10 20:44:42 +00:00
curt
f3d8eb4665 Tweaks for 0.3.7-pre1 2004-09-10 18:16:06 +00:00
curt
090f79b951 Add support for parsing an xml stream from an in memory buffer, rather than
just from a specified file name.
2004-09-10 15:57:52 +00:00
ehofman
88c0dbf661 Add support for audio orientation: direction and cone definition. This currently only works for internal view and tower view because those set the listener position correctly. 2004-09-08 11:15:57 +00:00
ehofman
9e3822ceaf Remove a left over of ancient times. 2004-08-19 12:18:20 +00:00
ehofman
007b0a8fe6 this simple patch will enable the direct use of Point3D::get_n() instead of making duplications to call sgCartToGeod 2004-08-17 08:31:51 +00:00
ehofman
7f0ebf8871 this simple patch will prevent to have fog in Clear cload layers. 2004-08-17 08:28:35 +00:00
ehofman
5414e94a1a change the log level of the initialization of OpenAL. This prevent a console popup for no reason on Windows. 2004-08-15 09:24:12 +00:00
curt
461dee8657 Tweaks for official 0.3.6 release. 2004-07-29 21:36:41 +00:00
ehofman
297b6193fe Make gcc 2.95.* compile again. 2004-07-29 08:30:10 +00:00
ehofman
4b74e40a5f Use the SimGear default notation. 2004-07-28 14:13:16 +00:00
ehofman
5a9b08dec2 IRIX fixes (at least). 2004-07-28 13:59:57 +00:00
ehofman
5e6f9f79a2 IRIX fix (at least). 2004-07-28 13:16:54 +00:00
curt
e2f93e6ae1 Tweaks for 0.3.6-pre3 2004-07-27 21:18:14 +00:00
curt
93314b59fb Fix a minor warning message. 2004-07-24 19:21:15 +00:00
ehofman
29269c6686 Correct a typo that produces segfault during cleanup on some systems. 2004-07-22 08:04:18 +00:00
curt
3c84b6e2f6 Tweaks for 0.3.6-pre2 2004-07-21 21:22:21 +00:00
ehofman
04fb708543 Frederic Bouvier:
I just discovered this : state() is not valid when _level==0,
because it is doing:
{ return _state_stack[_state_stack.size() - 1]; }
and is returning a wrong index fetch ( 0 - 1 ) == -1

Moreover, st is not used when _level==0 so the line can be moved
to a safer place.
2004-07-21 10:52:40 +00:00
ehofman
df302f277c Test for alutInit in libopenal.so and in libalut.so for Cygwin builds. 2004-07-19 14:59:51 +00:00
ehofman
5e63e663bb alut is now part of libopenal.so 2004-07-17 14:01:00 +00:00
ehofman
ca10cb2d37 Weak excuse, but it's getting late. Do clipping right this time. 2004-07-16 21:00:46 +00:00
ehofman
c9854153f8 Clip to volume to 1.0 if necessary. 2004-07-16 20:36:01 +00:00
curt
129e3c6326 Tweaks in preparation for the 0.3.6-pre1 release. 2004-07-14 22:01:15 +00:00
ehofman
66996711ae Make sure that a directory name containing a '.' doesn't screw up the ::base() and ::extension() functions. 2004-07-05 16:39:02 +00:00
ehofman
8fe37cea51 Remove the need to append a trailing / to the texture-path string. 2004-07-05 13:40:37 +00:00
ehofman
de64b6f267 Allow the use of a <texture-path/> tag to specify the directory containing the textures for this model. 2004-07-05 11:42:19 +00:00
ehofman
9a9d9c7cc1 Use #elif instead of #else if 2004-07-03 11:16:53 +00:00
ehofman
a191e9762a Frederic Bouvier:
I have 3 issues that are fixed by this set of patches.

1. In extensions.cxx
  #else if !defined( WIN32 )  must be changed by
  #elif !defined( WIN32 ) because the text after #else
  seems to be ignored

2. banner is not available on windows, only cygwin

3. ANSI escape sequences are not interpreted on the
   windows console. We just have garbage that is hard
   to read.
2004-07-03 10:59:00 +00:00
curt
a7b35c6e22 If we pass in a position or velocity of nan, openal will generate an assertion.
Under rare circumstances we could encounter a non-cooperative external fdm
that could trigger this condition.  This patch catches the problem and returns
rather than letting FG get killed.
2004-07-01 19:05:37 +00:00
ehofman
5034346b67 Some small updates. 2004-06-27 08:09:56 +00:00
ehofman
661f64b902 Work around a broken dlopen/dlclose Linux implementation. 2004-06-27 07:49:40 +00:00
ehofman
bbc83f721c Frederic Bouvier:
this patch correct the cloud repositionning that
made them going against the wind. Now the clouds
and the windsock show the same direction.
2004-06-25 10:59:59 +00:00
david
01f4541331 Ignore generated files. 2004-06-15 12:47:52 +00:00
ehofman
0e4a894f62 Be a bit anoying (and a tad more descriptive) about OpenAL volume errors for some time. 2004-06-13 11:59:36 +00:00
ehofman
1c135a9b5b Frederic Bouvier:
Do state sorting by material before adding primitives
in the tile branch. I thought I could see a bit of
improvement in framerate but it is not the case on my setup.
I don't see a degradation though
2004-06-12 21:03:45 +00:00
ehofman
e65c85ce73 Frederic Bouvier:
I am still experimenting with the
code. Here is so far the best I could achieve. The
dark aspect of clouds at dusk or dawn is far better
than the problems of transparency of the previous
version.
2004-06-07 18:49:32 +00:00
ehofman
26b58991f9 MingW fix. 2004-06-07 12:43:29 +00:00
ehofman
8390df37ca Add an 'add(str)' function that adds a search path separator and appends the str. 2004-06-07 09:50:32 +00:00
ehofman
371fc73f24 Tweak the doppler effect. 2004-06-04 16:59:12 +00:00
ehofman
921dae5444 Revert the previous patch. There was already a class availble that allows for that. It's just that the description doesn't explain too much. 2004-05-28 08:42:59 +00:00
ehofman
9b3abbec89 Tweak the bump-mapped 2d cloud color a bit. 2004-05-27 18:00:03 +00:00
ehofman
6935baba5b Add the possibillity to parse a user data pointer to getter and satter functions. This adds a convenient way to get the 'this' pointer to the static functions. 2004-05-27 13:03:01 +00:00
ehofman
dec1e32f96 Use a different coloring scheme. 2004-05-25 07:58:33 +00:00
ehofman
710c2ccfcd MacOSX fix that never got applied before. 2004-05-21 16:27:16 +00:00
ehofman
8e66e534ae mingw32 fix 2004-05-21 15:07:25 +00:00
ehofman
0f5f30b993 Updates from Frederic to use 2 texture units and a color blend function rather than 3 texture units. 2004-05-21 14:50:49 +00:00
ehofman
b199f733f7 Frederic Bouvier:
Melchior spotted a problem where we can crash an airplane into the
beacon's beam. The patch below enable to mask out a branch from HOT
traversal, whatever the animation.

The beacon.xml file is also included. It has a
<enable-hot type="bool">false</enable-hot> in a halo branch
2004-05-20 14:18:15 +00:00
ehofman
0cdcf3a3e0 Make sure there will be no previous declaration errors. 2004-05-20 14:02:40 +00:00
ehofman
8e09486e82 Patch from Frederic. Adds support for bump-mapped (multi textured) 2d clouds, includeing support code. 2004-05-20 13:24:48 +00:00
ehofman
0c24b78573 Fred: include more check against null pointers and a raise in log level for missing objects. 2004-05-15 12:45:51 +00:00
ehofman
1436be9699 Solve the endless loop problem for the DC-3 and prevent a potential segmentation fault. 2004-05-14 19:46:12 +00:00
curt
0489ad7c62 Add a function to globally set volume (aka AL_GAIN) 2004-05-14 15:47:01 +00:00
curt
c553570533 Oops, fix a typo. 2004-05-11 22:39:21 +00:00
curt
bda112297f Frederic Bouvier:
I was not very happy with the size of the halo, so
I created a new animation to control it. Now we can
control the scale value with the distance from the
viewer to the object. The towers are now beginning to
look good. They might need some tuning though. If
you want to play, locate in radio-*.xml this code :

 <animation>
  <type>dist-scale</type>
  <object-name>RedLight.2</object-name>
  <interpolation>
   <entry><ind>0</ind><dep>0.1</dep></entry>
   <entry><ind>500</ind><dep>0.3</dep></entry>
   <entry><ind>16000</ind><dep>3</dep></entry>
  </interpolation>
 </animation>

You get the idea ? ind is the distance, dep is the
resulting scale value.
The medium tower appears brighter than the tall one,
because the lights are closer to each other. Maybe
they need a smaller scale factor at distance. Feel
free to modify these values if you find a better
setup.

About the code : I renamed flash to custtrans because the
ssg branch is now less specialized. It needs a callback
to compute the so called 'custom transformation'. It can
be used for the SGFlashAnimation and the new
SGDistScaleAnimation. So please cvs remove flash.[ch]xx and
add custtrans.[ch]xx. I also undo some of the code I send
you yesterday that was totally useless. It is replaced by
something simpler and that works.

There is also a patch to matmodel.cxx. This is not related
and was something I forgot. Its purpose is to set the
alpha test on material billboard models that are likely to
be trees to lessen a transparency weird effect with clouds.
2004-05-11 22:21:24 +00:00
curt
331a4e4406 I had overlooked a few memory allocation/deallocation issues for audio buffers.
Hopefully this helps clean those up.
2004-05-10 21:22:50 +00:00
curt
a9faf8ceff Frederic Bouvier:
I modified the included animation.cxx to have a randomly displaced
time origin, to break the unison. And the flashing period is also
random as you noticed. I also put all the flashing light of the pole
in the same animation so they flash in the same rhythm.
2004-05-10 20:27:30 +00:00
curt
2866d1ace9 Frederic Bouvier:
Fix a memory leak, and brownian animation, if not motion.

I have 2 new files : personality.[ch]xx . They store the personality
data that would be deleted when the object is destroyed, instead
of staying in the animation maps. I also manage the current animation
step better and the towers are not flashing randomly now.
Makefile.am is updated.
2004-05-10 14:59:02 +00:00
curt
11a74f7a31 Frederic Bouvier:
modellib.cxx :
  Add a branch between the model and its transformation to add
 a unique identifier for the model. I called it "personality
 branch" and it maintains a "current_object" in SGAnimation.
 Animations specifically written to support it ( currently only
 the timed animation ) can add a degree of variety among the
 occurrences of the same model that would look otherwise cloned.

flash.[ch]xx :
  Better compute the view vector. The flash is now syncronized with
 its axis even at the edge of the screen.

animation.[ch]xx :
  Lots of changes :
 - add a condition to 'rotate', 'spin', 'translate' and 'range'.
  When a condition is specified *and* it evaluates to false, the
  animation becomes a no-op. Possible usage : no rotation during
  daylight, LOD range variable along the day, ...

 - use different durations for each branch in the timed animation.
  Enable the use of multiple <branch-duration-sec>, one for each
  <object-name> specified. Usage : strobes with flash light.

 - allow randomization of the <branch-duration-sec>, by using
  <random><min>_min_value_</min><max>_max_value_</max></random>.
  The value computed once is between _min_value_ and _max_value_.

 - implement model personality in timed animation. If
  <use-personality type="bool">true</use-personality> is specified,
  a different set of duration is created for every model in the
  scenegraph using this animation. Best if used with randomization.
  When using strobes where the population of the same object is
  dense, it avoids the "cheasy" clone effect.
2004-05-10 14:35:58 +00:00
ehofman
634a2035ee Add fast functions for exp2, pow, log2, root, sin/cos/tan, asin/acos/atan along with abs, neg and sgn. 2004-05-08 12:58:29 +00:00
ehofman
ffada9257d Frederic Bouvier:
this patch introduce a new kind of animation and ssg branch.
I called them flash animation, because they help me to
enhance the look of the rotating beacon and possible future
lighthouse. It computes the cosine of the angle between an
arbitrary axis, transformed by the current modelview matrix,
and the view direction. No trig involved, just a dot/scalar
product.

The computed value can be modified by three parameters,
power, factor and offset, according to the formulae :

 value = factor * pow( cosine, power ) + offset.

It is clamped between a minimum and a maximum.
This value is then used as the scale factor of a matrix
transformation applied to the children of the SGFlash
branch.

The xml syntax, with default values, is :

<animation>
 <type>flash</type>
 <object-name>HaloObject</object-name>
 <center>
  <x-m>0</x-m>
  <y-m>0</y-m>
  <z-m>0</z-m>
 </center>
 <axis>
  <x>0</x>
  <y>0</y>
  <z>1</z>
 </axis>
 <power>1</power>
 <factor>1</factor>
 <offset>0</offset>
 <min>0</min>
 <max>1</max>
 <two-sides>false</two-sides>
</animation>
2004-05-07 16:42:59 +00:00
andy
e09164e5b3 Robustify the SGTimerQueue destructor. There have been reports of
crashes on deletion.
2004-05-03 18:43:53 +00:00
andy
de1a5f3034 Add a destructor for SGEventMgr. We don't own the pointer, so we
can't free it.  Just zero it out.
2004-05-03 18:39:25 +00:00
andy
86e83faef3 Changes to get SimGear to configure and compile out-of-the-box on
a MinGW target:

Link against alut.dll in addition to openal32.dll.

Remove some preprocessor defines from compiler.h that were
confusing the mingw and/or libstdc++ headers (I put the _isnan
one back in the only file it was used).

Hack a broken sleep() call into the OpenAL sample programs so
that they will compile (but not work) in a non-POSIX environment.

Change the header file ordering in sample_openal.hxx to get
around some really weird interactions between MinGW's windows.h
and the gcc iostream header.
2004-04-30 00:44:04 +00:00
curt
9f06c8df76 Hopefully fix a chicken/egg linking problem for people who've never built
or installed simgear before.
2004-04-29 21:14:44 +00:00
curt
6e511de7db Add support for specifying a positional offset relative to the listener.
This allows us to "place" cockpit sounds.  For example, we can make left
engine sound come out of the left speaker, right engine out the right
speaker, etc.
2004-04-28 20:37:49 +00:00
curt
e34aae9982 Add default openal libs for cygwin. 2004-04-28 19:19:05 +00:00
curt
675b388b8e Lower verbosity level. 2004-04-28 03:59:10 +00:00
curt
7d239fe4ac Expose the ability to specify how the sound volume fades relative to
distance from the listener.  This let's us configure "interior" cockpit
sounds versus "exterior" engine type sounds.
2004-04-28 03:57:13 +00:00
curt
edd92caba1 Tweak default source audio parameters. 2004-04-27 21:11:21 +00:00
curt
5c3b4abf42 Expose some of the positional components of the OpenAL API. 2004-04-27 20:45:58 +00:00
ehofman
d3a3466b14 Make sure the prototype definition of sleep() is found (at least for IRIX). 2004-04-27 08:59:31 +00:00
curt
4399383781 Oops, one addtional tweak. 2004-04-26 22:07:19 +00:00
curt
bb383998bb Update the SoundSample api so we can request that a copy of the sample be
kept in memory and accessible.
2004-04-26 22:02:14 +00:00
curt
ffeb174ca1 Give these two methods slightly less misleading names. 2004-04-26 16:17:21 +00:00
curt
a90d74dde8 David Luff:
Fix comments for two functions.
2004-04-26 15:55:29 +00:00
curt
9d7fd79e76 Missed one fix for Mac OS. 2004-04-26 14:55:27 +00:00
curt
6f29d234eb Lower the verbosity in a couple other spots. 2004-04-25 02:30:52 +00:00
curt
6f5517f602 Lower verbosity. 2004-04-25 02:02:35 +00:00
curt
cc43c745b2 Add support for the MacOS variations of OpenAL. 2004-04-25 01:48:08 +00:00
curt
db8d961b27 Add correct openal libs for MacOS. 2004-04-25 01:41:24 +00:00
curt
a0bdec2846 Clamp pitch values rather than just dumping an error message. 2004-04-24 19:47:42 +00:00
curt
5bbcd386fa Rewrite the entire audio support library on top of OpenAL rather than plib's
sound manager.  The interface was simplified and cleaned up a bit, and I
haven't back ported these changes to the plib sound wrappers ... we could
I suppose if someone really had a problem, but I haven't seen anything so
far that would indicate the extra effort is worth it.
2004-04-24 19:02:29 +00:00
curt
7657632024 Bernie Bright:
gcc 3.4 has changed the rules for unqualified template name lookup.  This
affects SGQueue.hxx.  The changes I've made are backwards compatible with
earlier gcc versions.  Everything else compiles pretty much okay except for a
few warnings.  The resultant executable seems a bit faster too.
2004-04-22 12:39:16 +00:00
ehofman
ab29063a97 Frederic: The state selector was not referenced and got deleted as soon as the sky was rebuilt a second time with the metar code. 2004-04-04 15:35:28 +00:00
david
c06ef23eb1 Added more generated files. 2004-04-04 14:24:06 +00:00
ehofman
7b2f7aa827 Make sure GLuint is known. 2004-04-04 13:46:26 +00:00
ehofman
7113c10f4b Frederic Bouvier:
This is a new patch that allow to define a different
texture for top and bottom of clouds. It uses the
overcast_top.rgb you made for me last time.

What the patch do is to install a ssgStateSelector
instead of a ssgSimpleState for each layer.
The SGCloudLayer::draw method is modified to accept
a boolean that will select the proper state: 0/false
for bottom, 1/true for top.

Then, in SGSky::drawUpperClouds and SGSky::drawLowerClouds,
SGCloudLayer::draw is called with false and true because
we see the bottom of upper clouds and the top of
lower clouds.

Only overcast has 2 textures, the other types share the
same state for top and bottom, but that could be modified
in SGCloudLayer::rebuild.
2004-04-04 13:41:53 +00:00
ehofman
14033946e5 Plib is willing callbacks to return 0, 1 or 2 and not simply a boolean 2004-04-02 19:48:50 +00:00
ehofman
6e0e056ca7 Fix an NVidia problem by moving the hack to another location. 2004-04-02 19:44:04 +00:00
ehofman
7aa4f0ccdb Frederic Bouvier:
Move the rendering stage for upper clouds from preDraw
 to drawUpperClouds. Rename postDraw to drawLowerClouds.
2004-04-02 14:39:42 +00:00
ehofman
4b04450fa6 Frederic Bouvier:
put all leaf is a seperated branch so that it is
 possible to use a pretrav callback to cull out
 terrain without culling out light or dynamic
 objects. It appears that plib is not calling the
 pretrav callback for leaves.
2004-04-02 14:39:19 +00:00
ehofman
ad81560be5 Frederic Bouvier:
add an optional parameter that would be called to
 build the aircraft panel, so that flightgear's
 model_panel no longer duplicate code.

 add a pretrav callback to models so that we can
 filter out models when calling ssgCullAndDraw on
 the global scene.
 sgSetModelFilter( true ) means that we want to draw
 the models. Use false to cull them out.
2004-04-02 14:38:57 +00:00
curt
5c26faa20e Clean up several stray warnings that have accumulated. 2004-04-01 13:47:02 +00:00
curt
bd85fa2457 Final 0.3.5 tweaks. 2004-03-26 21:07:15 +00:00
curt
430136fdc9 0.3.5.pre2 tweaks. 2004-03-24 00:19:59 +00:00
david
a616aa8e55 Ignore generated files. 2004-03-23 19:03:40 +00:00
andy
05b9166c25 Fix GC interaction. The "me" reference to a method call was being
popped off the stack in a situation where it could be garbage
collected.  I believe this is the source of the spurious "non-object
have no members" bug that has been reported.
2004-03-23 00:42:56 +00:00
ehofman
71770eb92e Let the cloud layers follow the earth's surface. If you want the clouds to touch the horizon, just increase the spaen. 2004-03-22 21:31:24 +00:00
ehofman
2089a2a956 These test should not be needed when properly using OpnGL colors. 2004-03-22 20:03:53 +00:00
curt
488efa2316 Tweaks for 0.3.5.pre1 release. 2004-03-22 19:12:23 +00:00
curt
44551dad2d Better color component sanity checking. 2004-03-22 19:12:07 +00:00
ehofman
00e0e72bca Frederic Bouvier:
If the input string of sgSplitPath is empty, it returned a list with one empty string, not an empty list.
2004-03-21 21:54:51 +00:00
ehofman
a611b70087 Frederic Bouvier:
The message 'Alert: catching up on tile delete queue'
comes from the fact that 48 tiles are scheduled and
added to the cache at startup before the plane location
is initialized. My proposed patch is to initialize
SGLocation with an invalid position and detect this
fact before scheduling tiles. I prefer to do that
rather than testing for lon and lat being 0,0 because
it is a valid position and someone could want to fly
near Accra.
2004-03-20 22:41:40 +00:00
ehofman
757ed2dfe7 Frederic Bouvier:
This patch is for windows only. It hides the console window
until there is a message to print. It only support SG_LOG,
that I think is the right way to display something in FG.
2004-03-20 22:38:13 +00:00
ehofman
8971a67aca Another Cygwin fix. This seems to take care of things proeprly. 2004-03-18 09:25:28 +00:00
ehofman
5a343da5cc Disable deselecting the branch if it becomes translucent because it crashes the UFO. 2004-03-17 15:20:20 +00:00
ehofman
4c77c1691b Remove an unused library since FlightGear dropped support for WeatherCM. Users are highly encouraged to use environment/metar instead. 2004-03-17 10:45:32 +00:00
ehofman
aadff33011 Attempt to fix the Cygwin build problem for once and for all 2004-03-17 10:31:34 +00:00
curt
25d7705379 Various changes in preparation for the 0.3.5 release. 2004-03-17 04:22:09 +00:00
ehofman
867ba3c7da Hopefully the last Cygwin fix 2004-03-16 14:25:15 +00:00
ehofman
3f08d9604e Further refinement of the Cygwin problem as suggested by Frederic. 2004-03-16 09:39:22 +00:00
ehofman
5d813aa4d0 Attempt to fix a nasty Cygwin problem. 2004-03-16 09:24:14 +00:00
ehofman
ce3a1ddcb0 Limmit the change in sun color due to visibility to a saner range. 2004-03-12 18:55:22 +00:00
ehofman
e37752f957 Use a more clever way to deselect a fully translucent leaf. 2004-03-12 17:38:57 +00:00
ehofman
40d920ddc9 Unselect the branch if the object has become fully translucent. 2004-03-12 10:09:09 +00:00
ehofman
4362eb79e6 Update for non-conformal (older) compilers 2004-03-12 08:59:12 +00:00
ehofman
f6c9af488b MacOS X refinement 2004-03-08 08:59:58 +00:00
ehofman
a34ac6a596 Silently ignore texture files that are not present. 2004-03-07 18:47:37 +00:00
ehofman
3b3baa996b MSVC .NET 2003 fix 2004-03-07 09:36:31 +00:00
ehofman
d6b81a9721 MacOS X 10.3 fix 2004-03-07 09:28:48 +00:00
curt
a460c753e7 Work around a limitation of gc_calc_course_dist(). When the start and end
points are too close together, this routine can return a course of "nan"
but the distance is valid.  Someday someone who understands the math should
rewrite the gc_calc_course_dist() routine so it is more robust, but for now
it's easiest to simply check for a nan result and code around the limitation.
2004-03-03 21:37:41 +00:00
curt
9f59e956fa #define isnan _isnan for MSVC and Mingwin. 2004-03-03 21:35:38 +00:00
ehofman
bd02eb8e6b Remove a typo 2004-03-03 20:06:28 +00:00
ehofman
a266790a25 Put Curt's cloud movement fix back in 2004-03-03 20:05:18 +00:00
ehofman
3462e3b6c1 MSVC .NET 2003 fix. 2004-03-03 19:59:44 +00:00
ehofman
ed29944b91 Add const back in the function 2004-03-03 19:54:24 +00:00
ehofman
a0251b3256 Some small fixes 2004-03-03 19:48:28 +00:00
ehofman
557474095f A real MSVC fix this time 2004-03-02 15:18:18 +00:00
ehofman
b7dd267807 Revert the last change, MSVC still doesn't like it. 2004-03-02 14:58:58 +00:00
ehofman
58a0b1d2c3 MSVC fixes 2004-03-02 14:49:01 +00:00
ehofman
d8acc3a8f2 Use a round-robin scheme rather than returning a random textured state. 2004-03-02 13:28:12 +00:00
ehofman
5f21c75e02 Make it possible to define multiple texture for a material (multiple <texture> entries in the materials.xml file). The code can return a random texture, or a pre defined texture upon request (default is random) 2004-03-02 10:51:13 +00:00
curt
79d72b6292 Add front() methods SGQueue, SGLockedQueue, and SGBlockingQueue so that the
can be used more interchangably with a regular STL queue.
2004-02-28 18:51:20 +00:00
david
aa67c738a1 Load submodels before animations, so that we can animate submodels.
Allow submodels to be named when they are loaded.
2004-02-27 03:30:01 +00:00
ehofman
117628bf7e Melchior FRANZ:
Add proxy support to the metar class. Authorization is untested, but everything else works. Martin will have to tell us ...
2004-02-26 09:46:36 +00:00
ehofman
70dbbf52f0 Melchior FRANZ:
Here are some updates for the metar class:

- support for empty visibility group
- support for 4-alnum IACO ids (rather than only 4-alpha)
- better diagnosis in exception messages
- check for 404 http response
- replace last constant by constants.h definition
2004-02-23 20:07:20 +00:00
curt
99bf2c6f9e Comment out an improperly written constructor. 2004-02-23 01:34:31 +00:00
ehofman
3fdeea7f65 An ugly hack to get MipsPro 7.4.1 working on IRIX 6
.5.20 (Yuck)
2004-02-20 16:07:51 +00:00
andy
ea9d110036 Fix from Richard Harke for 64 bit systems. The reftag was left
uninitialized by naNum().  If it happened to be constructing it on the
stack in a location previously occupied by a real reference, it would
generate a corrupt naRef.
2004-02-20 15:10:49 +00:00
ehofman
16ad232e0d Changes to tke sky dome coloring 2004-02-18 14:33:16 +00:00
ehofman
5b8e5fce20 Remove an extra sgSetVec call 2004-02-17 14:40:05 +00:00
david
0633d703d0 Be a little quieter at the default debug level. 2004-02-07 21:36:20 +00:00
ehofman
ec6ce9fcd8 Move the new metar class from FlightGear to SimGear 2004-02-02 10:12:31 +00:00
andy
c9e53d5a30 Yank the MSVC special handling. It turns out it was becuase "strlen"
has special voodoo in the parser.  That's much more cleanly handled by
renaming the function than by #ifdef'ing.
2004-02-01 17:47:08 +00:00
curt
828e10773c Fix a slight ambiguity in variable names. 2004-01-31 19:50:35 +00:00
ehofman
34b5c1a1b9 Activate the driver fog workaround again. It doesn't seem to be solved yet. 2004-01-29 18:25:55 +00:00
curt
b2a7975493 Frederic BOUVIER:
Win32 serial port communication fixes.
2004-01-27 15:55:47 +00:00
ehofman
f0af686d17 Make sure all libraries are used to test for certain functions 2004-01-27 09:41:33 +00:00
ehofman
eda1121054 Fix a mistake 2004-01-26 19:59:36 +00:00
ehofman
d97eb240d9 Clean up the Pre-, and PostDraw functions a bit. Especially the glPushAttrib has had some attention. The NVidia hack is commented out for now. 2004-01-24 12:08:12 +00:00
ehofman
8c296d96c7 Fix an initialization problem 2004-01-19 13:37:26 +00:00
curt
65a49bb6e4 Oops, I originally had ramped the vasi/papi color transition the wrong way.
So as you passed through the target glide slope from low to high it would
be colored: red -> white -> small range of transition to red -> white.
Now it goes the right way so you get: red -> smooth transition to -> white.
You can tell you are getting high if you see the bottom vasi start to turn
pink ... etc. etc. hopefully just like in real life.
2004-01-16 17:37:05 +00:00
ehofman
cfedc90fdd Try to prevent a devide by zero situation 2004-01-15 14:23:06 +00:00
ehofman
5665a62938 Don't do any calculations when thay are not needed 2004-01-15 14:22:03 +00:00
ehofman
36521869ae Make sure MispPro compilers < 7.4 still work 2004-01-15 14:21:31 +00:00
curt
84fd7a49ad The emissive values just don't seem like the right thing to do. You suddenly
see the dark side of the moon quite clearly, which usually isn't the case.

The rest of the moon still seems a bit oversaturated right now ...
2004-01-14 18:02:58 +00:00
curt
24b5f05522 Make the vasi lights slightly larger/brighter. 2004-01-09 16:49:13 +00:00
ehofman
17415424bf Use the same coloring scheme for the moon and the sun, add a bit of light reflection to the moon 2004-01-09 10:19:00 +00:00
ehofman
920c0fdb62 Updates to the alpha-test animation class 2004-01-08 10:38:29 +00:00
ehofman
40414f2823 Updates to the alpha-test animation class 2004-01-08 10:25:23 +00:00
ehofman
3d43bc0480 Frederic Bouvier:
The attached patch adds a new animation class, called SGAlphaTestAnimation, to enable alpha test in 3D models.
This will remove many artefact caused by painting order of translucent models, and I need it for an upcoming model. In addition, I added a min-factor and a max-factor to the range animation to modulate min-m, min-property, max-m or max-property.
2004-01-07 09:07:57 +00:00
curt
7bee5f1ab6 Smarter vasi coloring. 2003-12-30 07:04:05 +00:00
curt
a43f5c8d21 Track some additional data required for computing vasi/papi colors. 2003-12-30 05:53:50 +00:00
curt
8361069344 Go with an all white texture for vasi/papi lights. We will vary the
background color externally to change from white to red.
2003-12-30 05:53:03 +00:00
ehofman
c9661e2732 Add a number of Metar related constants 2003-12-27 13:41:02 +00:00
ehofman
bd13cf84a1 Resolve some dependency problems 2003-12-27 09:31:02 +00:00
ehofman
e54cfc002b Updates to support sgi's MIPSpro compiler version 7.4 and newer. This also fixes a number of C++ issues where FlightGear didn't follow the standard. 2003-12-26 13:55:09 +00:00
andy
5aac63d9f5 Parse/GC interaction fixed.
Remove the OP_NEWARGS "optimization" (it wasn't).
2003-12-22 19:27:51 +00:00
ehofman
6a19bbee7d Melchior FRANZ:
There are constructors for sg_io_exception that don't initialize the
location. In this case getFormattedMessage does still output an extra
line with " at" followed by ... nothing. Looks silly.
2003-12-19 17:44:30 +00:00
andy
2e5c4b4515 Rewrite sg_geodesy. The new version is more accurate to the WGS84
standard and includes a sgCartToGeod() function which is 100%
symmetric (down to the precision of a double) with sgGeodToCart().
2003-12-19 02:40:33 +00:00
ehofman
79d1aaf7f5 Melchior FRANZ:
There's another problem with sg_socket.cxx: the timeout value is
hardcoded as 0. This is appropriate for servers as they continuously
poll the socket and never want to wait for clients. But clients
*do* want to wait a few seconds for a server response.
2003-12-14 14:45:29 +00:00
ehofman
a659969bcf Make sure both client and server situations are hendled properly 2003-12-14 10:07:51 +00:00
ehofman
53bdf9dac4 Revert to the previous version 2003-12-11 15:26:23 +00:00
ehofman
ad394fb090 fgrun fixes 2003-12-11 13:17:45 +00:00
andy
92a123a47d Extra i++ led to a "double skip" when parsing a \r\n pair. So a DOS
file would look like it was all on one line, and a comment would skip
to the end of the file.
2003-12-08 16:55:50 +00:00
andy
755173bd2e Bug fixes. The priority queue wasn't handling boundary conditions at
the edge of the table properly.  The new code is half the size -- it
*has* to be correct, right?
2003-12-07 19:53:34 +00:00
andy
27477402c9 Property interpolator subsystem. A utility, primarily for Nasal scripts 2003-12-05 01:49:44 +00:00
andy
dc9c41e119 Added setsize() and subvec() library functions 2003-12-05 01:49:02 +00:00
ehofman
3c7f9e7ba4 A first attempt on detecting endianness and number of bits 2003-12-01 18:57:32 +00:00
ehofman
fbf018598e Rename IRIX to irix_string in simgear/compatibility and assign "simgear/compatibility/irix_string" to STL_STRING for IRIX 2003-12-01 18:56:53 +00:00
ehofman
83b4dcb55c Add Nasal Vs. 1.5 2003-12-01 14:33:45 +00:00
curt
5812571df4 Attempt to fix a bug in SGSocket::read() affecting TCP style sockets. 2003-11-27 13:24:26 +00:00
ehofman
b1c688abe8 Revert an IRIX/O2 only setting again 2003-11-27 10:23:13 +00:00
ehofman
f4b30bbdd7 Portability fix 2003-11-27 10:22:29 +00:00
ehofman
e4008862ce Make sure autogenerated files don't show up 2003-11-26 14:42:05 +00:00
ehofman
2b7079eed2 Portability fixes 2003-11-26 14:39:46 +00:00
curt
983685fde3 rename libnasal.a to libsgnasal.a to match the existing SimGear library
naming convention.
2003-11-25 22:49:02 +00:00
ehofman
eef1cc716d MSVC > 6.0 fix 2003-11-25 21:45:56 +00:00
curt
34e2a9dc37 Nasal and event manager updates from Andy Ross. 2003-11-25 21:26:01 +00:00
curt
1786692406 Version 1.3 of Andy Ross's "NASAL" embedded scripting language. 2003-11-25 20:16:28 +00:00
david
c37afce303 Minor changes to logging messages (to STDOUT). 2003-11-24 17:41:43 +00:00
ehofman
1ea99cdd4d MacOS X fixes 2003-11-23 10:04:45 +00:00
ehofman
4c1d22b8a6 FIx a typo 2003-11-21 21:56:57 +00:00
ehofman
5f22c93db7 Frederic Bouvier wrote:
> When a c172 is on one machine, I only got segfault on an animation
> not found. This animation is named ControlsGroup and I guess
> that one object name referenced in this null animation no
> longer exist in the .ac model. I say that because the
> preceding one is analogous and works.
>
> So I would say the multiplayer works, except when there is a c172.

It seems that this animation refers to 'PanelInstruments' that is
a panel outside the model, so, when loaded with SGModelLib::load_model
the object is not found in the model and there is a non tested
read access through a null pointer in sgMakeAnimation.
2003-11-19 15:16:21 +00:00
ehofman
13a42f1d9e Change istringstream back to a typedef so there is no need to redefine every class memeber. 2003-11-09 08:56:09 +00:00
ehofman
c4d5d85c3e Save on a number of CPU costly strcmp calls when using the blend function 2003-11-04 13:25:23 +00:00
curt
d915ccec6e Updates for the official 0.3.4 version. 2003-10-22 19:21:24 +00:00
ehofman
ea1b70191c Shoot, I was trying to hunt down a bug that wasn't even caused by the sstream implementation! Back out some of the previous patches 2003-10-20 19:53:35 +00:00
ehofman
19815c3bce And don't forget to free up the used memory. 2003-10-20 19:38:27 +00:00
ehofman
66fb6b5a1c Make it easy on myself (and make it work as a bonus) 2003-10-20 19:32:50 +00:00
ehofman
94ac87f4f5 Last fixes 2003-10-20 12:14:10 +00:00
ehofman
79d5bf66a7 Safety updates 2003-10-20 09:41:26 +00:00
ehofman
a4535c92c3 fixes and updates for fgrun 2003-10-20 09:06:13 +00:00
ehofman
cecdb15692 Fix a problem which was introduced in the previous patch 2003-10-16 14:53:14 +00:00
ehofman
3c08eae85b Fix a problem where older IRIX compilers needed a typecast for certain opperations 2003-10-16 12:51:47 +00:00
curt
db928ea1ae Various updates for the upcoming 0.3.4 release. 2003-10-15 20:15:29 +00:00
curt
bb002356b4 Fix a stragling left over reference to metakit. 2003-10-15 20:01:41 +00:00
ehofman
431e78cf09 Add the ability to set three levels of detail for static scenery using the property tree 2003-09-28 08:38:48 +00:00
ehofman
81b9ec50b0 Fix a dependency problem 2003-09-25 08:22:40 +00:00
curt
e0ba803ca9 A couple changes to allow separate handling of VASI/PAPI lights which
generally are turned on all the time.
2003-09-24 19:56:51 +00:00
ehofman
7ae57483f3 Fix a problem where the compiler would mix up two function declarations because the one wich has SGSubsystem in it's options list expected a const SGSubsystem, but it was called with a plain SGSubsystem 2003-09-24 19:06:59 +00:00
ehofman
d22640ef4e Move FGEventMgr and FGSubsystemMgr over to SimGear, add SGEventMgr to FlightGear's globals structre and some small code cleanups 2003-09-24 17:19:22 +00:00
curt
f3eeeb760f Various tweaks to handling taxiway lighting. 2003-09-23 23:06:50 +00:00
ehofman
695e112039 Fix a problem where the upper cloud layers are drawn with the sun punch through value 2003-09-23 08:42:20 +00:00
ehofman
133e67adb8 Fix a problem where the cloud layers suddenly change color when looking towards the sun 2003-09-22 12:32:03 +00:00
ehofman
6079cd3df8 Initialize some variables before using them 2003-09-17 17:59:28 +00:00
ehofman
6f4fd2dc6e Frederic Bouvier:
This patch is there to correct a problem that prevent to load static objects when specifying a relative fg-root or a different, relative, fg-scenery. It appears that there is a mix between fg-root, fg-scenery and PLIB's model-dir.
It has been reported on the list that users are not able to see the buildings, especially those running the win32 builds because they run 'runfgfs.bat' that set FG_ROOT=./DATA.

I decided not to use model-dir because it just add confusion and to build a valid path earlier.
2003-09-13 11:45:47 +00:00
ehofman
b30eb9c00c Add support for win32-pthreads in MSVC.NET 2003-09-13 11:33:49 +00:00
ehofman
1236d8be19 Fix a problem for systems with older headers 2003-09-12 21:24:52 +00:00
ehofman
cb35ecb4b0 Use default OpenGL material colors 2003-09-09 14:33:29 +00:00
ehofman
54550aa002 Change the defaults color specifications 2003-09-08 13:11:19 +00:00
ehofman
d3db963dce Add a blend animation 2003-09-05 12:36:01 +00:00
ehofman
1dde23a0c9 Update some light parameters 2003-09-02 09:11:21 +00:00
ehofman
5feccc73c7 Fix the box like cloud layer appearance 2003-08-31 09:23:48 +00:00
curt
1cf13a7c1a Fix some lighting values. 2003-08-31 03:12:27 +00:00
ehofman
7289ac645a New automake, new problems. Use $base_LIBS where $LIBS was automatically added before 2003-08-29 07:35:55 +00:00
curt
699909f808 Remove metakit from src-libs, remove metakit check from configure script,
remove README.metakit.
2003-08-29 04:19:56 +00:00
ehofman
344610e24b Actually use the calculated position in the layer list. This prevents the use of glDepthMask(). Clean up the code some. 2003-08-22 16:58:01 +00:00
ehofman
092901b9ea Clouds3D crashes because there is no Light 2003-08-22 16:18:33 +00:00
ehofman
3ac6b34f4b Disable depth buffer writes while drawing the layers and some cosmetic updates 2003-08-22 09:48:49 +00:00
ehofman
d56b961c47 A patch from Frederic Bouvier which performs z-buffer ordering of the cloud layers to prevent transparency problems with other (se mi) transparent objects. Good work Frederic! 2003-08-22 08:07:21 +00:00
ehofman
858a73e187 Adjust the layer span and amount of curving based on the eleveation of the layer 2003-08-19 12:04:15 +00:00
ehofman
1623aee1e0 MacOS X fixes 2003-08-19 08:25:16 +00:00
curt
c0a633ea1d Give calc_tex_coords() a more conformant name: sgCalcTexCoords() 2003-08-19 02:08:16 +00:00
ehofman
5628c85b51 Frederic Bouvier:
This patch was inspired by Norman. Otherwise there is a segfault on Linux because the global variable tries to access OGL before a valid context is initialized.
2003-08-16 12:30:25 +00:00
ehofman
2e1accc0f3 Don't use glGet because of performance issues 2003-08-15 17:44:36 +00:00
ehofman
93b747f1ba Add support for NVidia cards with a broken OpenGL implementation 2003-08-15 17:19:22 +00:00
ehofman
21c16b4a51 A small update to the fog punch through code 2003-08-14 12:32:58 +00:00
ehofman
e5e1e165b9 Adjust the fog punch through effect for oursun 2003-08-14 09:58:48 +00:00
ehofman
8ae39ae8d4 MSVC fixes 2003-08-12 19:26:03 +00:00
curt
110e01a861 Remove extraneous/unneeded dependencies on glut. SimGear should no longer
have any glut dependies.
2003-08-11 21:16:53 +00:00
curt
578e774778 Remove "glut" dependency.
- SkyContext.[ch]pp needs to query the window size, but apparently doesn't
  do anything with it.  We can hard wire a size and the cloud code seems to
  behave fine.

- SkyLight.[ch]pp depends on glut_shapes so I copied over the code so it
  can access those routines locally.  (The routines that are used are
  simply combining calls to libGLU.a
2003-08-11 21:14:48 +00:00
curt
d7d13e458c Oops, it doesn't do much good to declare a function as "static" in the .hxx 2003-08-11 19:42:08 +00:00
curt
0bf579cf27 Only use the ";" delimiter under WIN32 2003-08-09 02:54:15 +00:00
curt
77cefa924c Add a routines that takes a search path (separated by sgSearchPathSep) and
seperates them into a vector of strings which it then returns.
2003-08-08 19:54:49 +00:00
ehofman
1fe26901af Go back to a function that actually does check wheter endian swapping needs to be done 2003-08-07 14:11:35 +00:00
ehofman
0dd50cf3d8 Add support for using textures as a basis for cloud fields. This is not yet completely finished. The orientation is not right. 2003-08-07 12:34:23 +00:00
ehofman
54b3c711c3 Add support for rgba textures 2003-08-07 12:31:16 +00:00
ehofman
f404161d23 Improve endian awareness somehwat. Still not therer though 2003-08-06 17:54:19 +00:00
ehofman
5a13068aaa Melchior FRANZ: Make the clouds3d code valgrind clean 2003-08-05 18:59:58 +00:00
curt
32067b9adf Changed "GL/glut.h" to <GL/glut.h> 2003-08-05 14:45:42 +00:00
ehofman
ea2f5f0035 Put clouds3d back in the build proces after (hopefully) fixing all the build problems 2003-08-04 17:29:30 +00:00
ehofman
ea6540ef90 Add dynamic glMultiTextureARB detection 2003-08-04 17:10:52 +00:00
ehofman
1d5c1de5d3 Add a safety precausion 2003-08-04 17:05:12 +00:00
ehofman
4b11d87a22 Add runtime detection of glActiveTextureARB 2003-08-04 12:54:57 +00:00
ehofman
c2149f9ea6 Pre-initialize the variables driving the external force 2003-08-04 12:07:04 +00:00
ehofman
73a4994cac Norman Vine:
Note that SSG and OpenGL use different representations
of Matrices.

1) SSG is row major and OpenGL is column major

2) SSG uses a Z is up whereas conventionally OpenGL uses
   Z is pointing into the screen
   ie this just requires swapping the Y and the Z axis < columns >
   and negating the new Y column

3) Now since SSG eventually calls OpenGL SSG must do this
   for us behind the scenes or else things just wouldn't work
   so inorder to get Clouds3D to render in the proper location
   we should just need to use the Matrix that SSG uses for a Camera
   Matrix and pass this directly to the Clouds3D Camers
2003-08-03 21:23:21 +00:00
ehofman
c9a4a6975c Hide an obvious mistake by defining our own ulEndianLittleDouble function for now 2003-08-03 08:25:26 +00:00
ehofman
1a1aa37a0e Adjust the fog according to visibillity 2003-08-01 14:20:20 +00:00
ehofman
7d3abdc512 Add cloud movement direction and speed 2003-07-31 14:46:24 +00:00
ehofman
db4c2243e3 Keep the stack clean 2003-07-31 09:04:32 +00:00
curt
6dc243e1af Actually commit the code changes which impliment a "scale" animation type. 2003-07-25 14:48:02 +00:00
ehofman
adb5fb3bee MSVC warning fixes 2003-07-23 09:59:39 +00:00
ehofman
7955319771 Jim Wilson:
Fixed texture translation so step and scroll values work with interpolation tables as well.  Moved step/scroll calculation to utility function to improve code readability.
2003-07-21 08:37:22 +00:00
ehofman
3da76522f8 Fix a typo 2003-07-16 11:32:08 +00:00
ehofman
c9ac1b5a06 Don't bother other develoers with problems caused by MipsPro (version < 7.3) compilers 2003-07-13 12:34:52 +00:00
ehofman
51dff6b537 Don't check for OpenGL libraries without at least including -lm 2003-07-12 09:18:54 +00:00
curt
1f4b55e98e Attempt to get these files back to a compilable state. 2003-07-11 17:50:32 +00:00
ehofman
229ea27050 Don't use floats where ints are more appropriate 2003-07-11 10:55:17 +00:00
ehofman
505b4c434d Allow removing of the texture data after it is sent to OpenGL 2003-07-11 09:57:28 +00:00
ehofman
12ab6872ec Sync he configure script with that one from FLightGear by splitting the LIBS cariable into a base_LIBS, opengl_LIBS, network_LIBS and thread_LIBS variable 2003-07-10 10:02:10 +00:00
ehofman
4c78e887e1 Jim Wilson:
This update adds the ability to do multiple texture transforms (Steve B. thinks supporting them at the plib level would be inefficient, which is probably true).

Removed units (e.g. "_m") from texture translation property and variable names since the texture translation values are dimensionless.

Added the ability to specify a scroll factor for stepped texture animation that needs to scroll smoothly when approaching the step interval (e.g. odometer movement).
2003-07-10 09:49:29 +00:00
ehofman
8871655a9b Don't delete the texture data after sending it to OpenGL. 2003-07-10 09:14:34 +00:00
curt
db1966c156 A couple more sanity checking tweaks for texture freeing. 2003-07-09 20:58:39 +00:00
ehofman
d4c0c8940b Prevent deleting the texture data for a second time in the destructor 2003-07-09 20:51:04 +00:00
ehofman
d4134195ea Fix a silly bug where is tested against the wrong variable 2003-07-09 19:46:04 +00:00
ehofman
a8fd1b4c16 Leave the clouds3d commented out for now 2003-07-09 14:46:30 +00:00
ehofman
086473c8eb A first attempt at making the clouds3d endian aware. Almost there. 2003-07-09 14:43:53 +00:00
ehofman
5642ef61ca Back out a patch that never went in CVS ... 2003-07-09 13:40:06 +00:00
ehofman
fec7c62b17 Don't link agains OpenGL libraries when it's not needed 2003-07-07 11:27:10 +00:00
ehofman
e046b1bfdb Clean up, and make more flexible and prevent unnessecary library includes 2003-07-06 17:13:25 +00:00
ehofman
01007986dc Solaris updates 2003-07-02 12:25:08 +00:00
ehofman
ad56ba1bfa Add a function which might return whether a texture is in video memory, delete the texture buffer after sending it to OpenGL and comment out the set/get_pixel functions 2003-07-01 09:49:45 +00:00
ehofman
54c2d5a6cc MSVC fixes 2003-06-28 21:43:41 +00:00
ehofman
25ad84e5cb Put the refference to fast_log() back in after checkit it actually works as expected 2003-06-28 13:43:09 +00:00
ehofman
dcdf8a4d5c Fix some problems 2003-06-28 12:58:59 +00:00
ehofman
5d24be8c51 Add some fast math functions 2003-06-28 12:06:09 +00:00
ehofman
fa42efcf91 Do some math omtimizations as pointed out by Norman 2003-06-27 21:36:05 +00:00
curt
7f4f778bb1 Explicitely initialize planets. 2003-06-26 17:13:27 +00:00
ehofman
8a2e5cace8 Use the dlsym based approach on all unices and depreciate the glXGetProcAddressARB function 2003-06-24 08:22:33 +00:00
ehofman
23c66b6cfe cygwin and mingw fixes 2003-06-22 11:49:19 +00:00
ehofman
b65fe814a0 Cross platform fixsimgear/screen/extensions.hxx 2003-06-20 20:05:52 +00:00
ehofman
e74c8587bd Increase the maximum number of simultanious audio streams to the maximum defined by plib 2003-06-20 19:44:41 +00:00
ehofman
ab34b86574 Mac OS X fix 2003-06-20 19:32:04 +00:00
ehofman
011ecd980d MSVC and Apple OS X fixes 2003-06-19 07:40:54 +00:00
ehofman
9ca1c6666e Add our own function to check whether a certain OpenGL extension is supported 2003-06-18 09:06:54 +00:00
ehofman
ba5316ca8e Add an OpenGL extension query function which should be cross platform 2003-06-17 16:55:21 +00:00
ehofman
f957227576 Don't make the sun imune for fog 2003-06-13 19:56:05 +00:00
curt
70f763dbe0 - Tweaks to doxygen main page.
- Added documentation for SGCloudLayer
- Updated the SGSky interface a bit to make it more sensible, flexible,
  and generic.  This requires a code tweak on the FlightGear side as well.
2003-06-11 18:55:36 +00:00
curt
f8201e6478 Make sky dome scaling values sensible (i.e. the sky dome will now fill up
the dimensions provided.)  We draw the sky dome before everything else
  and draw it with depth buffer off so it really doesn't matter, but it just
  makes a little more sense this way.
Updated a few doxygen comments.
2003-06-09 20:19:52 +00:00
ehofman
e053941467 Add the ability to include stepped texture translations for things like digital displays in 3D model animation. 2003-06-09 09:11:20 +00:00
ehofman
17e2478522 Jim Wilson:
1. Added support for defining arbitrary rotation axes using (x1,y1,z1), (x2,y2,z2).  The center is calculated automatically (midpoint on line) or you may specify an alternate "center" using the current scheme.  This makes it about  100 times easier to animate flaps, ailerons, etc.

2. Added support for plib's ssgTexTrans.  This will allow more sophisticated 3D instrument features by allowing the texture mapping itself to be animated. Included function for "texrotate" and "textranslate".  They configure the same as the geometry, except the arbitrary axis definition is not necessary (textures are flat).
2003-06-08 13:19:34 +00:00
ehofman
17df7141ae Remove some now depreciated lighting code 2003-06-07 10:35:20 +00:00
ehofman
5167dee0e3 Remove an unused variable 2003-06-03 19:37:21 +00:00
ehofman
a1a596b02a Add some more descriptive comments 2003-06-03 19:35:20 +00:00
curt
27f98d24eb Various 0.3.3 last minute tweaks. 2003-06-03 18:48:49 +00:00
curt
51ef4568dd Various documentation tweaks and additions. 2003-06-03 18:32:51 +00:00
curt
4c731de8b7 Tweaks to doxygen comments. 2003-06-03 18:22:10 +00:00
ehofman
fc692cb540 compiler fixes 2003-06-03 13:30:07 +00:00
curt
cedfade08d Updated dsp/dsw files for MSVC. 2003-06-02 20:11:43 +00:00
curt
eedbc7f436 Tweaks for the 0.3.2 release. 2003-06-02 19:58:49 +00:00
curt
b6a683eb6e Fix a bug in cloud texture state loading which caused the cloud textures to
be loaded 5 times! for a lot of wasted texture RAM.  Thanks to Erik H. for
noticing the problem.
2003-06-02 15:23:45 +00:00
curt
df677ff8aa Working on adding a top leve Doxygen docs introduction. 2003-05-30 16:41:36 +00:00
curt
1d8b352d2d Clean up a class renaming mistake. 2003-05-30 15:27:32 +00:00
curt
c8432e3763 Move simgear/sky/ -> simgear/scene/sky/ as part of the consolidation of
graphics code.
2003-05-30 15:16:25 +00:00
curt
b3f88735a8 Rename FGSerialPort to SGSerialPort. 2003-05-30 14:59:47 +00:00
curt
789b56872c Fix a very small oops. 2003-05-28 21:00:05 +00:00
curt
009ed26fd2 Moved low level "tg" format object loader code over to SimGear. 2003-05-28 20:59:11 +00:00
curt
5ed0ce79ab Moved random ground cover object management code over to simgear. 2003-05-28 20:25:37 +00:00
curt
8b8a82bb67 Make gen_surface_points accessible through the API. 2003-05-28 19:02:43 +00:00
ehofman
94c22fec46 Updates for a better sunrise/sunset effect 2003-05-21 17:17:47 +00:00
ehofman
8be760b594 Convert char* to string to prevent stdup/malloc/free 2003-05-19 15:40:11 +00:00
ehofman
42b4ec310f Add a gamma correction function 2003-05-17 12:43:47 +00:00
ehofman
4ea676b229 Adjust sunset/sun rise color scheme 2003-05-16 16:32:47 +00:00
curt
dda676b1b2 Forgot to #include <vector> 2003-05-16 13:22:03 +00:00
curt
f7a3dbc5ed I missed committing t hese changes yesterday. 2003-05-16 11:40:07 +00:00
ehofman
1f3947ea4c A patch from Frederic Bouvier to correct a naming problem caused bu Curts work. This gets FlightGear/SimGear compiling again 2003-05-16 08:51:24 +00:00
curt
cb7589cc95 Various code massaging. 2003-05-15 21:35:31 +00:00
curt
2ca4b30553 Rename matobj -> matmodel. 2003-05-15 16:19:56 +00:00
curt
bb238c4106 Separate out the SGMaterial::Object{,Group} code into it's own source file. 2003-05-15 15:08:39 +00:00
ehofman
4b0b49d1ed Add some missing requirements 2003-05-14 20:36:20 +00:00
curt
dd080de16c Just a bit of renaming. 2003-05-14 19:31:53 +00:00
curt
1ae257944b Moved some low level scene graph construction code over to simgear/scene/tgdb/ 2003-05-14 19:20:36 +00:00
curt
a2c8cfb84d Removed global instance of the material manager. Each application will
need to create it's own instance itself.
2003-05-14 18:27:25 +00:00
curt
c01740d516 Removed non-textured and flat shaded support because it really clutters up
the API and I don't believe we'd have any hope of running at any kind of
reasonable frame rates on a non-hardware-3d accelerated box these days anyway.
2003-05-13 19:05:09 +00:00
ehofman
1ce5cd154a Make the current color of the sun available 2003-05-13 19:00:49 +00:00
ehofman
1fce27f0c3 Improve speed and readabillity 2003-05-13 17:14:38 +00:00
ehofman
4fc985b518 Oops, make the cloud layer look more like an inverted bowl than like a sombrero 2003-05-13 12:11:48 +00:00
david
0e999f281b Added generated files. 2003-05-13 10:21:53 +00:00
david
aadc802fdd Added props_test program. 2003-05-13 10:21:36 +00:00
curt
d8a7589752 Cosmetic changes for new code moved into simgear to make the naming scheme
better follow simgear conventions.
2003-05-13 03:18:35 +00:00
curt
f1021ab820 Moved fgfs_src/Object/newmat.[ch]xx and fgfs_src/Object/matlib.[ch]xx into
simgear/scene/material/
2003-05-12 21:30:25 +00:00
ehofman
8bd3cccc08 simgear/sky/ 2003-05-11 22:29:52 +00:00
ehofman
78fbfa1dde Cygwin build fixes 2003-05-11 20:54:26 +00:00
curt
16dd841ce5 Moved loader.[ch]xx and model.[ch]xx from fgfs/src/Model/ to
simgear/scene/model.
2003-05-09 20:19:36 +00:00
curt
992de38184 Minor tweaks and clean ups. 2003-05-09 19:37:28 +00:00
curt
835e86ad19 Moved to SimGear from FlightGear/src/Model/ 2003-05-09 19:37:10 +00:00
curt
ef5fb7a98e Added "SG" prefixes to match other SimGear classes. 2003-05-09 19:36:41 +00:00
ehofman
e8cb3cbfa4 Move the FlightGear sound code over to SimGear 2003-05-09 17:29:06 +00:00
ehofman
68b2c9e7d3 ignore certain files for CVS commits 2003-05-08 21:42:59 +00:00
curt
e78427483c Split out animation code from fgfs-src/Model/model.[ch]xx and move it over
here.
2003-05-08 16:32:17 +00:00
curt
25364aa2a6 Removed some extraneous debugging output. Hey, this one was subtle. Due
to const/no-const variants of the prop->getNode() method, the 2nd bool
argument was getting promoted to an int so it would match a method with
a const SGPropertyNode * as the first argument.  But that made
it match the wrong version of prop->getNode() and things were failing.
Yikes!  This is one I could have stared at for days to figure out so I'm
glad I caught on to the problem. :-)
2003-05-07 01:59:03 +00:00
curt
525d2df3cc - Moved some property specific code into simgear/props/
- Split out the condition code from fgfs/src/Main/fg_props and put it
  in it's own source file in simgear/props/
- Created a scene subdirectory for scenery, model, and material property
  related code.
- Moved location.[ch]xx into simgear/scene/model/
- The location and condition code had dependencies on flightgear's global
  state (all the globals-> stuff, the flightgear property tree, etc.)  SimGear
  code can't depend on it so that data has to be passed as parameters to the
  functions/methods/constructors.
2003-05-06 23:40:43 +00:00
curt
701031a473 Also update the makefile.am 2003-05-05 15:54:00 +00:00
curt
1960e02ab7 Long on my todo list ...
Upgrade the distributed metakit to a newer version that hopefully fixes
some of the platform problems with the previous version.
2003-05-05 15:48:45 +00:00
curt
ca2ed1c941 Pass doubles as const ref's to save a couble bytes of stack space and
presumably a tiny bit of function call time.
2003-04-14 17:58:03 +00:00
ehofman
bde8528859 Fixup for windows machines 2003-04-13 21:16:52 +00:00
ehofman
86392857c5 Move the texture object to the screen directory for the sake of library dependencies 2003-04-12 09:42:45 +00:00
ehofman
95c6c16851 Move the texture object to the screen directory for the sake of library dependencies 2003-04-12 09:29:18 +00:00
ehofman
ce4f0c4fee remove a refference to a directory that doesn't exists yet 2003-04-11 12:51:36 +00:00
ehofman
2d081e6ce6 remove a depreciated file 2003-04-10 21:38:01 +00:00
ehofman
000106200f Remove a depreciated file 2003-04-10 21:37:11 +00:00
ehofman
2bb4274517 a small update 2003-04-10 09:31:12 +00:00
ehofman
5cd81b8c92 remove a depreciated file 2003-04-10 09:27:02 +00:00
ehofman
5712053ad8 get rid of malloc() 2003-04-10 09:26:03 +00:00
ehofman
192db1c343 Depreciate a wrapper header file 2003-04-10 08:01:18 +00:00
ehofman
a3bd57489a Update a SimGear/FlightGear inconsistancy 2003-04-09 20:59:21 +00:00
ehofman
d69e76959b Fix a booboo 2003-04-09 20:33:24 +00:00
ehofman
6d784a1a7e fix a booboo 2003-04-09 20:26:12 +00:00
ehofman
11d2bca8a7 Add out own texture object 2003-04-09 20:24:52 +00:00
david
f922e84eb6 Use "coverage" instead of "type".
Rename "mostly-cloudy" to "broken" and "mostly-sunny" to "scattered",
to follow standard weather terminology.

Add "few".
2003-04-05 03:32:18 +00:00
ehofman
e2bca737f0 Make debug levels an integer 2003-03-22 10:34:38 +00:00
ehofman
940ce98d2c add Air Traffic Controll to the list of possible debug sections 2003-03-20 12:14:11 +00:00
ehofman
72590e6b8f improved STL compatibility header files 2003-03-19 16:16:47 +00:00
curt
3e81ca7da5 Remove 3d clouds from the default build. These can still be built manually
if desired, no code is being removed.
2003-03-10 16:58:53 +00:00
david
c4fa7a965d Patch from Frederic Bouvier:
I am trying to compile tabbed_values.cxx and found that it requires
assert.h to compile with MSVC (on Linux, it must be included indirectly).
There is a patch below
2003-03-02 16:35:08 +00:00
david
1a6e14c3bb Added tabbed_test program. 2003-03-02 16:34:42 +00:00
david
7379d8a54d Patches from Erik Hofman (for Irix? I've lost the original message). 2003-03-02 14:52:05 +00:00
curt
b63464d239 Bernie Bright:
Could the file(), dir(), base() and extension() functions be made const member
functions.  As it stands they cannot be applied to const reference/pointer
values which limits their usefulness.

Curt:

Yes.
2003-02-28 01:02:26 +00:00
curt
1dac4b2dc1 Add some convenience functions to the SGPath function. 2003-02-26 19:50:14 +00:00
curt
44e7b36a8b Oops, missed this the first time. 2003-02-15 18:53:44 +00:00
curt
a26c677df4 James Turner:
- added a new class in simgear/misc, SGTabbedValues, which parses a
  null-terminated string of data separated by tabs into fields, and
  supports safe conversion into various other datatypes.
2003-02-15 18:43:59 +00:00
curt
5d10dda5a1 James Turner:
- added a 'filename' helper to SGPath, corresponding to the 'directory'
helper but returning just the filename portion of the name.
2003-02-15 18:43:06 +00:00
curt
0253a46dbb Fix a typo in the FreeBSD support section. 2003-02-07 17:35:37 +00:00
curt
9593059258 Misc. tweaks that have been laying around. 2003-01-23 21:59:07 +00:00
curt
3f0efc2a6f FreeBSD pthread and malloc fixes. 2003-01-23 15:16:51 +00:00
curt
b9593adc7c Some how the contents of this file got doubled up ... 2003-01-02 20:11:20 +00:00
david
6cf3b54b4b Patches from Erik Hofman for SGI compatibility:
Some more cmall changes to the SimGear header files and removed the
SG_HAVE_NATIVE_SGI_COMPILERS dependancies from FlightGear.

I've added a seperate JSBSim patch for the JSBSim source tree.
2002-12-31 18:03:26 +00:00
david
78411d29a7 Patch from Erik Hofman:
This patch adds some more functionality to the header files and removes
*all* dependencies on SG_HAVE_NATIVE_SGI_COMPILERS in the SimGear code!

[dpm: I had to add some additional SG_USING_STD declarations to make
it compile]
2002-12-31 14:47:34 +00:00
david
f8a49c41ef Added missing Makefile.am from Erik Hofman. 2002-12-30 22:33:34 +00:00
david
a0a0c8e308 IRIX/MipsPro patches from Erik Hofman:
This patch adds some missing default ISO C++ headers to SimGear,
especially usefull for Irix/MipsPro. To the best of my knowledge this
only affects the Irix/MipsPro compiler combination although it might be
usefull for others as well.

This patch does not yet remove any compiler specific code, but that
would be my next task. The powerfull macros as defined in the compiler.h
file allowed me to split it up into multiple patches.
2002-12-30 21:33:56 +00:00
david
e5814dad73 Some trivial typo corrections. 2002-12-21 13:40:50 +00:00
curt
f076594288 Mingwin fix from Norman Vine. 2002-12-18 21:54:04 +00:00
curt
7dfe0bf9b2 Remove -lmk4 from the LIBS after the version check is complete. 2002-12-11 19:57:00 +00:00
curt
d9ce8828c9 More tweaks to the configure script. 2002-12-10 20:54:08 +00:00
curt
cb2df234ae - Refactoring configure.ac a bit to use $host (please test on your platform)
- Use include GLUT_H instead of refering to the file directly since Mac
  unfortunately chose to put this in GLUT/glut.h :-(
2002-12-10 19:12:34 +00:00
curt
7d73dc6602 James Turner:
I've had to hack Simgear's configure.ac quite a bit [for Mac OS X],
using the Plib one as a reference.
The basic construct (a big switch statement based on the target
type) is nice, I think, since it moves lots of IRIX / cygwin / OS-X
specialties out of the way cleanly. Much more re-factoring of the
current tests in configure is possible if people are able to test.
2002-12-09 22:36:38 +00:00
curt
16bd8cef38 Updated for 0.3.1 2002-12-04 19:47:57 +00:00
curt
f2567f9af4 Fixes for 0.3.1 release. 2002-12-04 19:46:12 +00:00
curt
c363758449 Updated for 0.3.0 release. 2002-12-03 18:27:04 +00:00
curt
dfdeb8be9b Updated version number 2002-12-03 18:19:41 +00:00
curt
d1c8f60ca9 #include <simgear_config.h> as necessary. 2002-12-03 13:13:16 +00:00
curt
2fb961c922 NOMINMAX fix ... 2002-12-02 22:12:22 +00:00
david
2e17b28994 Includes patch from Erik Hofman. 2002-11-17 11:07:40 +00:00
david
c3f558b034 Cygwin patch from Patrick Staehlin:
To compile the development CVS version of FlightGear(0.9.0) i had to
apply some small changes to SimGear and FlightGear.

The changes need probably some additional ifdefs for other platforms but
since my linux-hd crashed i can't verify that.
2002-11-17 00:42:17 +00:00
david
65ce1a04b2 MS patch from Norm Vine to fix min/max macro defs. 2002-11-17 00:34:40 +00:00
david
3af4a19f76 Allow 'include' attribute on root PropertyList element. 2002-11-11 14:40:16 +00:00
david
5178f69f18 Simplified the command-manager interface. 2002-10-26 01:18:03 +00:00
curt
52e2005b3e Erik Hofman: fix an Irix build problem. 2002-10-24 13:59:33 +00:00
david
94fa51e3f7 Change int to GLenum for portability. 2002-10-18 20:25:21 +00:00
curt
590547e12d John W:
Attached is the new, improved SkyCloud.cpp. Tested on west coast @ KSFO and
east @ KJFK. Don't have any southern hemisphere or other airports to test
against, but you might give it a go and see what happens

Probably a good idea to add some user options to set cloud altitude, startup
position, etc, but for now this should suffice.
2002-10-04 16:44:23 +00:00
curt
c6832d2513 Fixes from Mark Harris. 2002-10-03 19:00:01 +00:00
curt
1fd63c30e9 Fix a texture state problem that caused clouds to occasionally flash all white. 2002-10-03 18:44:34 +00:00
curt
f08ae9f2ea John Wojnaroski:
Attached are the new files to transform the cloud field for local lat/lon.
2002-10-03 02:52:55 +00:00
curt
5c61e97358 ref() the cloud states before use so that if we are dyanmically creating and
deleting cloud layers we don't inadvertantly delete a cloud state.
2002-10-02 16:03:25 +00:00
curt
87e38e2617 Fix a tyop. 2002-09-22 03:42:26 +00:00
curt
92e1856caa Did I forget to commit John's loader patch?
Ran dos2unix on extgl.*
Include <simgear_config.h> from extgl.h so it properly picks up the WIN32
symbol.
2002-09-20 18:10:28 +00:00
curt
20c099b7ef Added extgl.c and extgl.h 2002-09-19 02:30:52 +00:00
curt
7eb74c7e2a Tweaks to build system following removal of interpreter subdir. 2002-09-18 20:38:40 +00:00
david
8d63c300e2 Removed simgear/interpreter directory; most likely we will use the new
PSL interpreted language in plib.
2002-09-18 20:27:17 +00:00
curt
01ccdd3ae1 Erik Hofman:
This patch fixes and STL problem, and adds (compile time) support for
architextures that don't support multitexturing.
2002-09-18 19:41:52 +00:00
curt
ab074726df Removed unnecessary files. 2002-09-18 18:47:47 +00:00
curt
ed26458a24 Norman's most recent 3d clouds code tweaks. 2002-09-18 14:24:19 +00:00
curt
fcf1d34e55 Latest changes from John. 2002-09-17 16:08:00 +00:00
curt
19f99ea273 Build with other simgear header files from source tree, not those that are
installed.
2002-09-17 01:16:18 +00:00
curt
fe5bb76def Latest changes from John Wojnaroski. 2002-09-16 14:55:31 +00:00
david
7ecf508453 Rolled Norm's change back out; update needs to be called earlier. 2002-09-16 13:13:49 +00:00
david
83e6e44eab Patches from Norm Vine to get clouds working (and add some debugging
information).
2002-09-16 02:26:20 +00:00
david
69a93342c0 Ignore generated files. 2002-09-15 10:42:54 +00:00
curt
e17338622a Change the header install directory.
Clean up a couple warnings.
2002-09-15 04:32:28 +00:00
david
a67fd7ea99 Added autom4te.cache. 2002-09-14 16:06:22 +00:00
david
cf2b8afbe9 Added stamp-h1. 2002-09-14 16:05:58 +00:00
david
a1e7761384 Removed /usr/local/include (as with plib). 2002-09-14 16:05:41 +00:00
david
d068915b42 Added newlines and did other clean-ups to eliminate errors and
minimize warnings compiling with g++ 3.2.
2002-09-14 16:03:39 +00:00
curt
adeb0d48fc Upgrade the version number. 2002-09-13 23:19:14 +00:00
curt
55c89ea865 Added simgear/sky/clouds3d to the build system. 2002-09-13 22:51:40 +00:00
curt
8bd07e358f Tweak lib name. 2002-09-13 20:36:19 +00:00
curt
01113e82f3 Initial revision. 2002-09-13 20:29:04 +00:00
curt
6d79582890 Initial revision 2002-09-07 02:58:19 +00:00
curt
2ae3c89406 For version 0.2.0 2002-09-07 01:45:46 +00:00
curt
1818102ffe Updated ... 2002-09-07 01:33:17 +00:00
curt
406d6dd6fc Getting ready for 0.2.0 stable release. 2002-09-07 01:25:02 +00:00
curt
c8ef854f01 Fixes to allow MingW compilation. 2002-09-06 20:05:40 +00:00
curt
87dcaf5a00 Fixes to better support the native irix compilers. 2002-09-06 15:30:11 +00:00
curt
c3bdd0e537 Automake version check is only done in autogen.sh and not in configure. 2002-09-03 21:44:44 +00:00
curt
c23fd6e66f Fix a typo in acinclude.m4 2002-09-03 02:52:39 +00:00
curt
e809eee896 Additional configure changes. 2002-09-02 22:18:31 +00:00
curt
c44ef2126c Tweaks for next prerelease. 2002-09-02 04:08:01 +00:00
curt
e2bfb5633b Minor tweaks. 2002-09-02 03:43:05 +00:00
curt
064ee8ba8f Make sure interpreters/ gets included with "make dist" 2002-09-02 03:41:39 +00:00
curt
a5c130446e Preparation for next pre-release. 2002-08-31 18:39:07 +00:00
curt
4162817c0b More clean ups. 2002-08-31 13:18:49 +00:00
curt
81cab6e089 Additional build system tweaks, regenerated the .dsp/.dsw's. 2002-08-30 15:03:30 +00:00
curt
d78204d147 Several fixes and tweaks. 2002-08-29 14:00:35 +00:00
curt
d8b523d067 Attempting more fixes to our autoconf/make scripts. 2002-08-28 14:08:12 +00:00
curt
c4cfad6069 Additional tweaks that got lost somehow. 2002-08-27 21:48:51 +00:00
curt
5bddb88ce2 Ooops, minor typo fixed. 2002-08-27 21:45:48 +00:00
curt
8c4ee69aeb Modernize the autoconf scripts a bit. 2002-08-27 21:44:39 +00:00
curt
b3a533f8ce Add #ifdef'd out support for plibs cheesy lens flare object. 2002-08-27 21:43:35 +00:00
curt
a885314a39 Tidy up the autoconf/automake configuration a bit.
- Removed some old cruft.

- Removed some support for older versions of automake which technically was
  correct, but caused the newer automakes to squawk warnings during an
  initial sanity check (which isn't done very intelligently.)

  NOTE: this fix is technically not correct for older version of automake.
  These older version use the variable "INCLUDES" internally and could have
  them already set to an important value.  That is why we were appending
  our values to them.  However, newer versions of automake don't set this
  value themselves so it is an error to append to a non-existant variable.
  We seem to "get away" with overwriting the value on older versions of
  automake, but if you have problems, consider upgrading to at least
  automake-1.5.
2002-08-25 17:31:47 +00:00
curt
0567a76445 It probably is better not to hide warning messages. Removed spaces from
AC_DEFINE( SYMBOL ) -> AC_DEFINE(SYMBOL)
2002-08-24 18:21:49 +00:00
curt
d6dc2d6eab Brandon Bergren:
2. I changed Simgear's autogen.sh so it is quieter, and errors out if
autoheader or autoconf fails.  It puts all error output in autogen.err, and
deletes it if nothing errored out.  The patch is in (sg.autogen.sh.patch.gz)
This patch applies to flightgear, too.  If someone doesn't like what I did
here, please speak up!  I really believe that this patch will help cause
less confusion among people new to compiling flightgear.
2002-08-24 03:54:45 +00:00
curt
b75a694682 Bernie Bright:
Here are some changes that gave me a significant frame rate increase of about 10 fps with random objects disabled.  The interesting thing is that these changes aren't in the main loop but are in tile loader.  My guess is that I've reduced the memory footprint just enough to reduce CPU cache misses, though I have no hard evidence of this.

Initially I modified all SGBinObject member functions to pass/return by reference instead of by-value.  This gives little or no speed up but allows for some optimizations in fgBinObjLoad().  It is these changes that reduce the number of memory allocations.  Needless copying of vectors, and vectors of vectors, can be very memory intensive, especially if they are large.

Anyway I would be interested to see if you get similar results.  I would emphasize that the frame rate increase only occurs with random objects disabled.  I lose about 10-15 fps on my GF2MX 32MB with random objects, probably a fill-rate limitation or texture memory thing.
2002-08-23 17:52:10 +00:00
david
2e7e9b73a0 Change from Norman Vine to add new random-number algorithm. 2002-08-05 18:43:28 +00:00
david
7a11523692 Random-number seed patch from Erik Hofman. 2002-07-31 17:14:29 +00:00
curt
f85a9866fe Remove efence support in favor of valgrind. 2002-07-30 14:10:08 +00:00
david
9b05c27938 Remove ECMAScript interpreter from the default build for now. It can
still be built from inside the directory.
2002-07-30 11:58:34 +00:00
david
fd96729362 Patch from Cameron Moore:
* Fixed (un)signed comparison
2002-07-18 20:30:18 +00:00
david
c57cc096f8 Patch from Cameron Moore:
* Rearranged member initializers to shut gcc -Wall up
2002-07-18 20:30:02 +00:00
david
c8efd0a465 Added JavaScript interpreter, repackaged by Tony Peden. It's not tied
into anything yet, but it builds OK inside SimGear.
2002-07-18 20:27:46 +00:00
david
db60139845 Downgrade cloud-base alert to a debug warning. 2002-07-18 20:23:30 +00:00
david
cadefd323a Quick fix for bug reported by Julian Foad, where the simplify flag was
not honoured after the first call.  This isn't all that efficient, and
the return type probably should change to string eventually, but this
fix avoids changing the headers for now.
2002-07-18 20:04:50 +00:00
david
baab88f42a Fix deletes in destructor. 2002-07-06 15:00:37 +00:00
david
767b74dd35 Added new getDisplayName method that gets the name with its index.
Suggested by Julian Foad.
2002-07-06 14:58:38 +00:00
david
90e8287f43 Made SGPropertyNode::getPath extremely efficient: it now caches its
result, so after the first call for any node, it simply tests and
returns a pointer.  This also fixes the problem of buffer conflicts
with make_string.

Added SGPropertyNode::hasChild(const char * name, int index = 0) to
provide a syntactically-cleaner way to test for the existence of a
child node, i.e.

  for (int i = 0; i < 9; i++) {
    if (node->hasChild("foo", i))
      foo[i] = node->getChild("foo", i)->getDoubleValue();
  }
2002-07-06 13:19:02 +00:00
david
d8b7e5b8fd Added simgear_config.h.in 2002-07-06 12:06:40 +00:00
curt
7769447283 Fixed a couple minor compiler warnings. 2002-07-03 17:35:49 +00:00
david
d6a790cf13 MSVC++ bug work-around from Frederic Bouvier. 2002-07-03 02:06:23 +00:00
curt
033c66363d Fixes for IA-64 with Intel compiler. 2002-07-02 18:44:20 +00:00
david
3ff1789963 Fixed an MSVC compilation problem reported by Frederic Bouvier. 2002-06-28 17:02:42 +00:00
david
9737c0c4dd Fixed bug reported by Julian Foad:
While investigating, I found that SGPropertyNode::getPath returns a
(char *) pointer to the character data of a string on its stack,
i.e. to undefined memory after it returns.  I remember someone was
changing strings to char* for efficiency.  Perhaps this bug was
introduced then.  I'll include a patch for it with my eventual patch
for the above, unless someone beats me to it.  I don't think it
affects any existing callers: they all want a string anyway.
2002-06-28 16:56:14 +00:00
david
b201383a80 Patch from Julian Foad:
Initialise a "possibly uninitialised" variable (which was already
functionally correct).

[Note from DPM: this patch will be blown away if we ever update to a
newer version of Expat.]
2002-06-28 15:55:11 +00:00
david
2253b82304 Patch from Julian Foad:
Remove a hack that originally worked around a buffer overflow
elsewhere in the file.  The buffer overflow was fixed long ago, but
the hack was not removed.
2002-06-28 15:54:34 +00:00
david
2581446d85 Patch from Julian Foad:
Remove trailing comma (unportable).
2002-06-28 15:54:15 +00:00
david
a6291b286c Patch from Julian Foad:
Remove unused static function (warning because it cannot possibly be used).
2002-06-28 15:53:58 +00:00
david
96a396bfcb Patch from Julian Foad:
This file should be removed from CVS because it is generated by
autogen.sh.
2002-06-28 15:53:31 +00:00
david
0833a11686 Significant improvements to the change-listener support. There are
now three different change events, and the listener base class removes
itself from the parent in the destructor.
2002-06-18 21:17:42 +00:00
david
9c7f7f3d32 Added a ptr() method to SGPropertyNode_ptr to get the raw pointer.
Added the SGPropertyChangeListener interface and addChangeListener and
firePropertyChange methods.
2002-06-18 01:26:09 +00:00
david
7847fe8074 Patch from Melchior Franz:
layer_span used uninitialized in SGCloudLayer::rebuild (line 162, 170, etc.)
2002-06-07 17:39:38 +00:00
david
c57d25ac51 Be more conservative and reuse SSG objects. 2002-06-05 19:12:50 +00:00
david
1341b5b9f8 Try to avoid some memory leaks. 2002-06-05 15:43:04 +00:00
curt
fb54e9e103 Include the autogen.sh script in the distribution. 2002-05-23 13:46:19 +00:00
david
3a835dde7d Skip drawing clear cloud layers. 2002-05-17 16:53:19 +00:00
curt
128a4a36ca Bernie Bright:
I've defined snprintf as _snprintf in compiler.h for MSVC and MINGW
targets and removed duplicate definitions from FG sources.
2002-05-17 14:38:03 +00:00
david
255bb6dd07 Preparation for making dynamic cloud layers -- moved cloud state out
of sky.[ch]xx and into cloud.[ch]xx, and added setters for modifying
the state of an existing layer.
2002-05-16 23:16:39 +00:00
curt
786b1e3a30 Removed SG_STATIC_CONST define. 2002-05-16 02:44:35 +00:00
curt
d5f38a558e Minor tweaks. 2002-05-16 02:30:06 +00:00
curt
ce5d4b7db8 Erik Hofman:
Some small patches to make the code Irix/Muli platform compatible and
one small fix to make it plib-1.4.2 compatible also.
2002-05-15 19:21:54 +00:00
curt
8c0b36fe9e Added SG_COMPILER macro. This is a string that identifies the build
compiler and version.  It might be useful to display it during program
startup.
2002-05-14 18:59:03 +00:00
david
c7e6459c64 Modified to work with the new SGPropertyNode_ptr class. 2002-05-10 22:58:03 +00:00
david
86e31e696d Patch from Frederic Bouvier:
I have modified the SGPropertyNode interface to support node removal
and address the issues you mention yesterday.

I added the SGPropertyNode_ptr class that is a smart pointer that
increment and decrement a counter in SGPropertyNode. The _children
vector is changed to a vector<SGPropertyNode_ptr> in order for the
node to hold a reference to its children. I also added a
_removedChildren vector of the same type. When removeChild is called
with the keep parameter set to true, the reference is removed from
_children and inserted in _removedChildren, and the attribute REMOVED
is set. When getChild is called with create set to true, the _children
vector is searched, then the _removedChildren and then a new node is
created. If a resurrected node is returned, the REMOVED bit is cleared.
The static const int LAST_USED_ATTRIBUTE is also added.

The footprint of this patch is light. SGPropertyNode is one int
longer in size, SGPropertyNode_ptr is one pointer large without
virtual functions. Some functions can be inlined if your current
policy change.

The FlightGear patch is to take account the change in the getChildren
function that now returns a vector<SGPropertyNode_ptr>. If the
removeChild functionnality is to be added in FlightGear, all those
SGPropertyNode * floating around should be changed to
SGPropertyNode_ptr.
2002-05-10 22:57:36 +00:00
david
be0b1bb994 Mac OS X fixes from Jonathan Polley. 2002-05-10 21:33:12 +00:00
david
03e74bfeb4 Ignore binaries. 2002-05-10 21:31:55 +00:00
david
972223cd50 Eliminate an unsigned-int comparison warning. 2002-05-10 21:31:15 +00:00
curt
761b7b9354 Bernie Bright:
Here's a first cut at SGSocket reimplemented using plib.net.  I've
maintained the same TCP server behaviour, that is only one client
connection at a time.  I don't think it is possible within the current
framework to handle simultaneous clients.

I've also added two simple test programs, tcp_client and tcp_server.
2002-05-10 13:53:22 +00:00
curt
6a3d1895d9 Bernie Bright:
Here is a total rewrite of the strutils package.  I've reimplemented the
trimleft(), trimright() and trim() functions as lstrip(), rstrip() and
strip() respectively.  Additionally I've added a split() function that
behaves like its perl/python equivalent.  Just the thing for splitting
comma separated option strings or space separated telnet commands and
arguments.  I've also enclosed the whole thing in a namespace
simgear::strutils.  Since I seem to be the only one who uses these
functions, SimGear and FlightGear compile without change.

PS It is no coincidence that the new function names bear an uncanny
resemblance to the python functions of the same name.
2002-05-10 13:32:44 +00:00
curt
d1178a26ce Updated MSVC project files. 2002-05-10 13:31:44 +00:00
curt
8ffdfa3cb1 Make the skydome interface a little more flexible so we can scale the dome
for other applications.
2002-04-27 03:19:45 +00:00
david
384e56b9b4 Patches from Erik Hoffman:
Tbis is a first patch in a series to clean up SimGear by removing
warning messages. Most of them are straight forwared, but in pops.hxx
the compile complaints about "type qualifier is meaningless on return
type". I think it's up to you to decide if you want that part applied.
2002-04-25 15:09:10 +00:00
david
d198e962b0 Patch from Melchior Franz:
From the cosmetics department ...
2002-04-25 14:56:03 +00:00
david
0136fdadbb Patch from Melchior Franz:
magvar and magdip are used before their initialization
2002-04-25 14:55:40 +00:00
curt
c616568830 Make sure README.MSVC goes in the distribution. 2002-04-23 01:56:51 +00:00
curt
995d2c1ede Make sure zlib.dsp goes in the distribution. 2002-04-23 01:55:48 +00:00
curt
051a5e9a38 Updated am2dsp.cfg file for creating MSVC project files.
New README.MSVC.
New src-libs/zlib.dsp for building zlib.
2002-04-22 20:37:31 +00:00
curt
60d89097de Bump up version number, remove boost from src-libs/Makefile.am 2002-04-20 22:03:35 +00:00
curt
6c35255549 Updated for 0.0.18. 2002-04-20 21:06:05 +00:00
curt
c985d8846d tweak. 2002-04-20 20:53:54 +00:00
curt
9a8ab26381 Removed boost dependency. Maybe we'll try again later. 2002-04-12 01:35:09 +00:00
david
711622fd5b Patch from Frederic Bouvier:
A const char * is not supposed to change and cannot be deleted. So
here is a patch that remove unnecessary const from props.hxx and
props.cxx. There also is the addition of a friend directive because
nested classes do not receive special privileges and cannot access
private members of the outer class.
2002-04-07 21:28:43 +00:00
david
96474823b5 Implemented a very simple hash-table cache for property lookup using
relative paths.
2002-04-06 21:47:22 +00:00
curt
bbf4b54613 Initial revision. 2002-04-03 21:22:52 +00:00
curt
9795c5dd6b Added src-libs subdirectory for keeping source code to extra libs. These
are things that are needed, but that many systems already have packages
available to install, and many users may have versions of these already
installed to support other projects.  So rather than build and install by
default with the main SimGear build/install, these are kept separate so that
those users that don't have them already installed can build and install
them separately.
2002-04-03 21:21:29 +00:00
curt
addcace80d Added a very crude/simple initial README.Install. 2002-04-03 21:18:13 +00:00
curt
77e43a5fa8 - Added src-libs/boost.tar.gz and README.boost. This is in anticipation
of actually using them in the flightgear event manager.
- Now that we have several add on libs we are bundling with simgear (but
  not automatically built as part of the simgear build) I have moved them
  to their own subdirectory (src-libs).
2002-04-03 21:05:51 +00:00
curt
b751188e56 string == "" -> string.empty() conversion. 2002-04-03 02:34:20 +00:00
curt
1ad9a15864 Updated to the latest metakit release. This fixes a few bugs that could
possibly affect some users.  For details, see the metakit changelog at
the metakit home page: ttp://www.equi4.com/metakit/
2002-03-28 02:21:00 +00:00
david
d0d7878e0a Patch from Melchior Franz:
This module works mostly with char* and allocates memory with
strdup ... delete doesn't go well with malloc(). The transition
to string only would be nice, but some class interfaces return
char*, so it was more natural to just drop the deletes.
2002-03-27 11:42:09 +00:00
david
be5d365348 Patch from Melchior Franz:
Here is a patch that fixes a little problem in dome.cxx: The fog_color
is created in a sgVec3 (227) but then handed over to ::repaint(), which
expects a sgVec4 (282). Then (343) center_color (although defined as
sgVec4) is only initialized with 3 values, but later (441) assigned to
'slot' via sgCopyVec4.
2002-03-25 19:56:48 +00:00
david
a8e0002a64 Patch from Melchior Franz:
at several places material was copied to "buffer" using strncpy
without adding a closing '\0'. This again lead to access to non
initialized memory and potentially (and actually at least in one
case) to feeding garbage to atof(). In case the following garbage
happened to start with digits, we would get funny time
values.  :-)
   I just added the obligatory "buffer[n] = 0", which doesn't
really look professional now. Maybe we should use the string
class or define a helper function that strncopies =and= adds
a trailing zero?
   The last hunk fixes another buglet, that wasn't dangerous
at all, but caused an error message. The loop that should cut
the string at hash marks ('#') did neither stop at such, nor at
string ends. It always scanned the whole 256 character long
buffer and accessed uninitialized memory. valgrind doesn't
like that. I dropped the 256 counter, because fgets =does=
add the closing zero. It is safe to scan until we either
get the zero or the hash mark.
2002-03-25 19:50:32 +00:00
david
bf75cf7225 Removed an unnecessary string allocation during copying. 2002-03-22 15:02:50 +00:00
david
c024b680bc Removed commented-out dead code. 2002-03-22 13:18:49 +00:00
david
c896475765 More rearrangement of headers. Replaced delete with delete[] where
appropriate.
2002-03-22 12:45:11 +00:00
david
101fdb3598 Moved up #include <algorithm> 2002-03-22 12:38:34 +00:00
david
b13505afdf Fix segfault when deleting a node with a string value. 2002-03-21 15:19:26 +00:00
david
9d96b171a0 Patch from Frederic Bouvier:
deletion of a const char * is not allowed with MSVC 6. I had to cast to char
*
to avoid compile errors.
2002-03-20 21:44:38 +00:00
david
8b5a0cde69 Patch from Tony Peden to remove unused variable and eliminate compiler
warning.
2002-03-20 21:31:53 +00:00
david
bed7593cdd Moved includes higher to make sure that std::sort is known. 2002-03-20 13:43:23 +00:00
david
9fed946567 Include <algorithm> and <stdio.hxx> to fix compilation errors on some
platforms (I should have done this anyway).
2002-03-19 18:17:36 +00:00
david
4d0bc0ae39 Major property-manager rewrite, using const char * throughout
interface instead of string.  This will result in a lot more
efficiency later, once I add in a simple hash table for caching
lookups, since it will avoid creating a lot of temporary string
objects.  The major considerations for users will be that they cannot
use

  node->getName() == "foo";

any more, and will have to use c_str() when setting a string value
from a C++ string.
2002-03-19 16:07:47 +00:00
david
f9824aa7de Removed SGRawValueInternal class (it's now handled directly by
SGPropertyNode) and updated some out-of-date documentation comments.
2002-03-18 14:55:59 +00:00
david
4d2522964a Some code fixes to keep untying clean with new optimizations. 2002-03-18 14:55:15 +00:00
david
dbe4a59b8e Code cleanup and minor speed improvements. For the record, accessing
an internally-managed property is nearly twice as fast as accessing
one tied to methods.
2002-03-18 03:21:18 +00:00
david
918f8a3ed4 Patches from Tony Peden to separate property XML I/O operations into a
separate header file.  This change will help integrate properties into
JSBSim.
2002-03-15 23:16:46 +00:00
curt
f645596606 Fixed an 'elstupido' bug.
Cleaned out some old #ifdef'd out code.
2002-03-13 05:01:51 +00:00
curt
d778dd081d Added some increased functionality in support of the binary file format
additions.
2002-03-13 05:00:55 +00:00
curt
f6ed02c3fb zlib-1.1.3 had a potential security flaw which is fixed by zlib-1.1.4:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Zlib Advisory 2002-03-11
zlib Compression Library Corrupts malloc Data Structures via Double Free

   Original release date: March 11, 2002
   Last revised: March 11, 2002
   Source: This advisory is based on a CERT advisory written
           by Jeffrey P. Lanza  http://www.kb.cert.org/vuls/id/368819

Systems Affected

     * Any software that is linked against zlib 1.1.3 or earlier
     * Any data compression library derived from zlib 1.1.3 or earlier

Overview

   There is a vulnerability in the zlib shared library that may introduce
   vulnerabilities   into   any   program   that   includes   zlib.  This
   vulnerability has been assigned a CVE name of CAN-2002-0059
   http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2002-0059

I. Description

   There  is  a  vulnerability in the decompression algorithm used by the
   popular  zlib  compression  library.  If an attacker is able to pass a
   specially-crafted  block of invalid compressed data to a program  that
   includes zlib,  the program's  attempt to decompress  the crafted data
   can cause the  zlib  routines to corrupt the internal data  structures
   maintained by malloc.

   The  vulnerability  results  from  a  programming  error  that  causes
   segments of dynamically allocated memory to be released more than once
   (aka.   "double-freed").  Specifically,  when  inftrees.c:huft_build()
   encounters  the  crafted data, it returns an unexpected Z_MEM_ERROR to
   inftrees.c:inflate_trees_dynamic().  When a subsequent call is made to
   infblock.c:inflate_blocks(), the inflate_blocks function tries to free
   an internal data structure a second time.

   Because  this  vulnerability interferes with the proper allocation and
   de-allocation of dynamic memory, it may be possible for an attacker to
   influence  the  operation  of  programs  that  include  zlib.  In most
   circumstances,  this influence will be limited to denial of service or
   information  leakage, but it is theoretically possible for an attacker
   to  insert  arbitrary  code into a running program. This code would be
   executed with the permissions of the vulnerable program.

II. Impact

   This vulnerability may introduce vulnerabilities into any program that
   includes  the  affected library. Depending upon how and where the zlib
   routines   are   called   from   the   given  program,  the  resulting
   vulnerability may have one or more of the following impacts: denial of
   service, information leakage, or execution of arbitrary code.

III. Solution

Upgrade your version of zlib

   The  maintainers  of  zlib have released version 1.1.4 to address this
   vulnerability.  Any software that is linked against or derived from an
   earlier  version  of  zlib  should be upgraded immediately. The latest
   version of zlib is available at http://www.zlib.org

   The md5 sums of the source archives are:
       abc405d0bdd3ee22782d7aa20e440f08  zlib-1.1.4.tar.gz
       ea16358be41384870acbdc372f9db152  zlib-1.1.4.tar.bz2

IV. Acknowledgments

Thanks to Owen Taylor and Mark Cox of Redhat, Inc. for the
reporting and research of this vulnerability.


This document is available from
http://www.gzip.org/zlib/advisory-2002-03-11.txt

The public PGP key of zlib author Jean-loup Gailly is available from
http://www.gzip.org/zlib/jloup.asc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8jSR02aJ9JQGWcacRAuDEAKCWdrRkWeJV9lYU5z8NN56s3m8eKACglR4m
42KDUGHuftBkwACTMCnZLEo=
=3yLS
-----END PGP SIGNATURE-----
2002-03-11 23:03:19 +00:00
curt
7fa5dd7a35 Added a warning message if the file is not found. 2002-03-11 21:47:09 +00:00
curt
a3186af099 Additions to the binary file format to make it *much* more flexible.
For each major primative type: points, triangles, fans, and strips, you
can specify an index list of vertices, normals, colors, and texture
coordinates.  You can skip any of these you like to save on space.

Note that the work for this has only been done in the file format reader
and writer.  The FlightGear loader for instance still needs to have
support for this built in.

This is is one more small step towards runway lighting.
2002-03-10 22:49:01 +00:00
david
a2d95ac742 Patch from Martin Dressler to ensure that values as well as children
get written with write-all.
2002-03-09 11:14:29 +00:00
david
10715bbea7 Modified to add an optional parameter to writeProperties to allow
*all* properties to be written, rather than just the ones flagged as
archivable.  Tony Peden requested this feature to make it easier for
people to document properties.
2002-03-03 21:22:24 +00:00
david
89fcb12556 Cleanups from Petru Paler:
It's basically a couple unused variables, an explicit cast, some unused
functions removed or commented out, and a whole bunch of pragmas
removed.
2002-03-02 23:37:04 +00:00
david
cc3d7ddee5 Minor changes to path caching. 2002-02-28 14:37:00 +00:00
curt
cc01f99acb Added support for points objects. 2002-02-27 23:08:45 +00:00
curt
62b75190bb Might as well bump up the version number. 2002-02-26 23:55:54 +00:00
curt
520124c1be Add initial support for per vertex or per object colors. 2002-02-26 20:05:20 +00:00
curt
e251bfcbaf Extended .btg format to support a 'points' primitive. 2002-02-26 19:47:06 +00:00
david
aef809348f IMPORTANT: backwards-incompatible change to properties.
The useDefault argument for the SGPropertyNode::tie(...) methods will
invoke the setter only when there is already a property value defined;
previously, the setter was always invoked, with a default value if
necessary.
2002-02-19 15:20:02 +00:00
curt
2d4a8774b8 Updated version number. 2002-02-15 17:27:50 +00:00
curt
b55c8fd828 Removed duplicate message. 2002-02-15 17:22:53 +00:00
curt
dfff091b5f Updated ... 2002-02-15 17:13:12 +00:00
curt
47eb7efafa Added README's to distribution. 2002-02-14 21:35:32 +00:00
curt
b2a7fff26e Explicitely reset the glBlendFunc() after drawing the moon for the Voodoo2
linux driver since it seems to have a bug in glPopAttrib().
2002-02-14 14:21:48 +00:00
curt
5f70123723 0.7.9pre2 changes. 2002-02-13 15:10:06 +00:00
david
dd629da8d3 Replaced some cout's with SG_LOG (fixes namespace problem with
ANSI-conformant compilers).
2002-02-13 12:14:01 +00:00
curt
74f7d52d95 Fixed a problem that could lead to a 'near infinite' loop if bogus input
values are provided.
2002-02-12 15:21:14 +00:00
curt
7a65a990ba Decouple sg_time code from the current time(NULL), i.e. you can run the
time calculations for an alternate calendar time (i.e. if the application
is being driven from an external source of data.)

Fix a bug in sg_binobj.cxx which disrupted the 'broken down time' globally
for the entire application.
2002-02-11 22:27:27 +00:00
curt
fe0076e291 Updated with 0.0.17 changes. 2002-02-10 04:10:00 +00:00
curt
1a8bc06cc6 FreeBSD fix: strnstr() is already defined. 2002-02-10 03:28:57 +00:00
curt
8c41081a5c This code had been written to assume current clock time. Added options
to allow specifying an alternate clock time.
2002-02-10 03:16:03 +00:00
curt
5b40eed554 Fixes a config problem that could lead to a bogus build for people with
voodoo cards.
2002-02-07 22:37:09 +00:00
curt
b1c4d34eef Fix for FreeBSD. 2002-02-06 01:04:38 +00:00
curt
0152b607f8 Tweaks ... 2002-02-05 21:36:09 +00:00
curt
ab6e72047b oops, minor tweaks. 2002-02-04 22:48:30 +00:00
curt
15399bfe95 Various mingwin patches contributed by Norman Vine. 2002-02-04 22:38:23 +00:00
curt
0ff748987b Pass strings by const reference instead of by value,
Made fix_path() a private member function, SGPath::fix(),
Added bool SGPath::exists(),
Added an assignment operator that acts like SGPath::append().
2002-02-04 20:23:41 +00:00
curt
58e0e7736b Removed some depricated irix support that is now handled elsewhere. 2002-02-01 20:18:47 +00:00
david
2d1b2ca938 Minor fixes from Cameron Moore. 2002-01-30 15:09:56 +00:00
curt
9a4152eb2d Fixes to make telnet interface work more than 1x. 2002-01-28 21:48:00 +00:00
curt
6ab443545f Further autogen.sh fixes to handle more cases. 2002-01-19 13:45:06 +00:00
curt
98a9b4a10c Minor clean ups. 2002-01-19 13:37:22 +00:00
david
a6251606dd Added some new functionality to the property manager:
1. Nodes cache previous relative paths so that they do not have to
parse the paths each time.

2. There are new getNode() methods that include indices, so that users
do not have to sprintf to a buffer to iterate through indexed nodes.
2002-01-19 03:06:22 +00:00
curt
c3b21e143c Fixed typos ... 2002-01-17 16:58:18 +00:00
curt
b496593883 Updated to automatically handle newer versions of automake.
Does some IRIX specific fixups.
2002-01-17 15:21:49 +00:00
curt
4ef4b019ca Added conditional support for Norman's jpegfactory code (requires libjpeg
to be already installed.)
2002-01-16 21:13:27 +00:00
curt
a8021531ab Initial revision of jpegfactory code for generating jpeg format screen dumps. 2002-01-16 21:11:00 +00:00
david
93fd948978 Added aclocal.m4 2002-01-16 00:04:16 +00:00
curt
a1b3740dc6 A few changes from Norman Vine to support mingwin. 2002-01-15 22:28:21 +00:00
curt
40920457cb Initial revision. 2001-12-29 03:35:31 +00:00
curt
5039c84fd0 Removed metakit and zlib from the configure/build process. The
developer will need to build and install these separately if they
don't have packages already installed by their system.  See
README.metakit and README.zlib for more details.

As a convenience, pristine tarballs of the metakit and zlib source
code trees are included with the simgear distribution (and cvs.)
2001-12-29 00:38:04 +00:00
curt
220a43bf46 Removed metakit and zlib from the configure/build process. The
developer will need to build and install these separately if they don't
have packages already installed by their system.  See README.metakit and
README.zlib for more details.

As a convenience, pristine tarballs of the metakit and zlib source code
trees are included with the simgear distribution (and cvs.)
2001-12-29 00:35:34 +00:00
curt
45d3e19c38 Small tweaks to class initialization. 2001-12-28 23:37:34 +00:00
curt
5bab565cfe Updates to build system to better support automake-1.5
- automake-1.4 sets default values for INCLUDES which we can't
  overwrite.
- automake-1.5 renames this to DEFAULT_INCLUDES and leaves INCLUDES
  open for the developer to use.

Thus for automake-1.4 we are forced to 'append' to INCLUDES and in
automake-1.5 we can just set the value to whatever we like.
Unfortunately, the behaviors of the two versions are mutually
incompatible.

The solution I am committing now works for both versions but
automake-1.5 generates a lot of spurious warning messages that are
annoying, but not fatal.
2001-12-28 21:27:19 +00:00
curt
319a4282c8 Test commit. 2001-12-17 16:52:20 +00:00
david
c6aa8bc8e9 Fixed Makefile.am to install easyxml.hxx in the simgear/xml rather
than simgear/.
2001-12-16 20:59:16 +00:00
david
6f1bfa202e -Added .cvsignore files to clean up CVS messages 2001-12-12 02:44:37 +00:00
david
6fa9f86d1c Added trace attributes to properties:
TRACE_READ - log a message whenever the property is read.

TRACE_WRITE - log a message whenever the property is written.

The second one works only when the property value is changed through
the property manager; tied variables and accessors are not polled for
value changes because of the performance hit.

These methods end up invoking private methods
SGPropertyNode::trace_read and SGPropertyNode::trace_write.  By
setting breakpoints on these methods inside a debugger, it is possible
to debug property access and find what parts of a program are reading
or writing specific property values by doing a backtrace.

In the XML property files, users can use the attributes 'trace-read'
and 'trace-write' to control tracing; the value should be 'y' to
enable tracing or 'n' to disable it (the default).
2001-12-12 02:28:28 +00:00
david
019a9527d2 Added Curt to empty Authors file as CVS test. 2001-12-11 22:23:25 +00:00
curt
d100ca485f Doh! fixed a typo ... 2001-12-10 00:24:51 +00:00
curt
35ab6900ee [Hopefully] fix a line ending problem that surfaces in MSVC. 2001-12-09 03:54:46 +00:00
curt
c8570302f5 Removed this autogenerated file from CVS. 2001-12-06 22:53:29 +00:00
curt
74f10486bc In certain degenerate situations on the FlightGear side when the flight
model math blows up, the lat/lon could be nan.  Thus updateLocal() could
potentially called with nan arguments if FlightGear is reiniting from a
blown up state.  This is a bug in FlightGear, but I've added a simple
check to catch this so updateLocal() is robust if called under these
circumstances.
2001-12-05 22:31:03 +00:00
curt
2b12425a62 Christian M. says it's bad to chain one constructor call from another.
I can't find anything that addresses this in Stroustrup, but I also don't
see them doing this in any of their examples.  So I have rewritten this
instance to use default arguments to accomplish the same thing.  I imagine
there are other instances of this same sort of thing in other classes to
be fixed at a later date.
2001-11-27 03:17:43 +00:00
curt
c600aad7a7 Bernie Bright: support for Intel C++ under Linux. 2001-11-21 21:31:40 +00:00
curt
67b2f0a977 - changed getAttribute to avoid MSVC compiler warning 2001-11-20 20:57:07 +00:00
curt
70c6b48a07 - implemented set/get_log_classes and set/get_log_priority 2001-11-20 20:56:53 +00:00
curt
76084f8538 Oops, typo ... 2001-11-12 18:20:32 +00:00
curt
64c408d2b7 Updated RPM make rule as per Ross Golder. 2001-11-12 17:37:24 +00:00
curt
73b050ae34 Mixed a makefile typo. 2001-11-12 15:27:32 +00:00
curt
59991393ca plib/net based udp client/server sockets. 2001-11-12 04:47:58 +00:00
curt
69b2717b62 One more tiny Irix tweak. 2001-10-24 20:01:15 +00:00
curt
f2a323e048 Misc Irix tweaks. 2001-10-24 19:59:05 +00:00
curt
7d07e6ea51 Misc MSVC tweaks. 2001-10-24 19:05:16 +00:00
curt
7c846972bf Macintosh OSX changes. 2001-10-23 20:22:12 +00:00
curt
4f76c258af MSVC tweaks. 2001-08-13 17:14:21 +00:00
curt
eca2afb982 Various changes for MingWin32 support. 2001-08-02 22:56:33 +00:00
curt
9ff6934c83 Various MSVC fixes. 2001-07-30 20:34:20 +00:00
curt
e04839765d Updates for irix to disable various warnings and define
__STL_FUNCTION_TMPL_PARTIAL_ORDER
2001-07-30 20:05:27 +00:00
curt
d0c655109f Oops, missing a trainling backslash after exception.hxx 2001-07-28 04:00:10 +00:00
curt
b28b55abb1 - removed declaration of sg_xml_exception (use sg_io_exception) 2001-07-24 21:41:33 +00:00
curt
c3a0db1aba - make sure file is closed when an exception passes through 2001-07-24 21:41:19 +00:00
curt
5e929d7d01 - remove dependencies on sg_throwable::clone 2001-07-24 21:41:06 +00:00
curt
17f113f8cd - remove clone methods for exceptions (SGI/Irix compiler bugs)
- added declaration for sg_throwable::getFormattedMessage
- added declaration for sg_io_exception::getFormattedMessage
- added #ifdef wrapper
2001-07-24 21:40:57 +00:00
curt
445cd4ccda - remove clone method declarations (SGI/Irix compiler bugs)
- added default implementation for sg_throwable::getFormattedMessage
  (returns sg_throwable::getMessage by default)
- removed unneeded newline in sg_location::asString
2001-07-24 21:40:46 +00:00
curt
55845bbbb9 Added exceptions.[ch]xx 2001-07-19 02:34:43 +00:00
curt
1976481ba2 - added sg_xml_exception class
- changed return type of readXML from bool to void (uses an exception
  to report problems now)
- removed XMLVisitor::error callback
- declared new readXML function that uses a path rather than a stream
- modified existing readXML function to take an optional path parameter
2001-07-19 02:34:18 +00:00
curt
5f17edbc72 - implemented sg_xml_exception class
- implemented new readXML function with path instead of stream
- modified existing readXML function to use optional path parameter
- modified readXML to throw exceptions rather than returning a bool
  value on error
2001-07-19 02:33:58 +00:00
curt
6f7fe4b481 - modified both readProperties functions to return void, and modified
file-name variant to invoke new readXML function
- readProperties and writeProperties will now throw exceptions if there
  are file I/O problems
- replace error messages with exceptions
- tunnel sg_io_exception through from nested property read, since
  the C-based Expat code cannot handle exceptions
2001-07-19 02:33:38 +00:00
curt
66ebe6e690 - changed return type of both readProperties functions to void
- changed return type of both writeProperties functions to void
2001-07-19 02:33:18 +00:00
curt
a9cd67e0ce - new file: implementation of SimGear general exception classes 2001-07-19 02:33:00 +00:00
curt
994a470fbf Prepairing for 0.0.17 2001-07-13 14:58:14 +00:00
curt
0ce0684dae Added a missing include for memcpy() 2001-07-13 03:36:50 +00:00
curt
377eb4782a Updated for 0.0.16 2001-07-13 03:36:29 +00:00
curt
f1a79e6b9f - changed default value of "archive" attribute from "y" to "n"
- modified to write out non-archivable parents if they have an
  archivable descendant (i.e. archive="n" no longer kills a whole
  subbranch); this makes sense now that archive defaults to "n".
- don't save the flags -- let the program handle them itself
- produce slightly less verbose output; omit n="0" in elements
2001-07-12 21:09:12 +00:00
curt
007a1e4659 - changed the default value of the archive flag to false; it must now
be set explicitly for a value to be saved
2001-07-12 21:08:58 +00:00
curt
fcb873b6dd - added virtual destructor to XMLVisitor to make sure derived classes
get a virtual destructor automatically.
2001-07-11 16:02:26 +00:00
curt
a66d1ad855 Check for valid hostname lookup in sg_socket.cxx. 2001-07-10 14:13:51 +00:00
curt
76a5950f19 Add a separate function to just return modified julian date. 2001-07-03 14:39:05 +00:00
curt
b7a91bdb03 Various tweaks for Irix. 2001-07-02 20:51:32 +00:00
curt
e4bbc5c50b Fix a potential array under/over run bug. 2001-06-30 02:01:22 +00:00
curt
b481ccd749 Tweaks to track changes in property manager. 2001-06-28 21:54:02 +00:00
curt
e7b9e55599 - removed all reference to SGValue
- renamed UNKNOWN to UNSPECIED and setUnknownValue to
  setUnspecifiedValue
- modified routines to use 'read', 'write', and 'archive' attribute
  for access-mode attributes (only if non-default; they all default to
  'y')
- modified write routine to honour ARCHIVE attribute (won't write
  subtree if ARCHIVE is not set)
2001-06-28 21:53:46 +00:00
curt
05eaa7135f - made getValue methods protected, so that they won't be invoked outside
the class
- renamed UNKNOWN to UNSPECIED and setUnknownValue to
  setUnspecifiedValue
- added access-mode attributes
- added methods for setting and querying access-mode attributes
2001-06-28 21:53:34 +00:00
curt
d063b319e8 - attempting to tie an aliased node now fails; the node must be
unaliased first
- renamed UNKNOWN to UNSPECIED and setUnknownValue to
  setUnspecifiedValue
- modified get*Value and set*Value methods to respect READ and WRITE
  attributes
2001-06-28 21:53:24 +00:00
curt
be4fd56660 - added SGCommandState class so that commands can compile and save
copies of their arguments
- modified prototype for command functions -- they now take a pointer
  to a pointer of an SGCommandState object (which they will normally
  subclass) so that they can cache state between invocations
- commented out convenience execute methods until they're actually
  needed
2001-06-28 21:53:10 +00:00
curt
a406a3c00b - added implementation of SGCommandState
- removed commented-out convenience execute methods
2001-06-28 21:53:01 +00:00
curt
c7295da5eb Fixed a type conversion bug that could trip up some of the pickier compilers
out there.
2001-06-27 02:48:01 +00:00
curt
505f561e1c Added tr.cxx / tr.h, Brian Paul's LGPL'd tiled rendering support libs for
rendering ultra high res "tiled" screen shots.
2001-06-26 15:19:39 +00:00
curt
7bd8477fa1 Tweaks. 2001-06-20 18:35:42 +00:00
curt
36ef15940e Changes for 0.7.8 2001-06-20 18:12:18 +00:00
curt
f2ba7aefa6 Need to include <simgear_config.h> to pick up the WIN32 definition. 2001-06-19 14:24:16 +00:00
curt
73b58b0e87 Updated for the 0.0.15 release. 2001-06-19 00:50:33 +00:00
curt
6ce4f096b2 #endif // __COMMANDS_HXX 2001-06-13 18:59:07 +00:00
curt
3e7ece7f5f #include <simgear/compiler.h> and adjust to fit the standard coding conventions
of this project.
2001-06-13 18:10:16 +00:00
curt
48a219473e Norman Vine optimizations. 2001-06-12 21:44:03 +00:00
curt
887ffd102f David patches. 2001-06-12 02:52:07 +00:00
curt
b1a719dd4c - added SGPropertyNode::Type
- changed return type of SGPropertyNode::getType methods from
  SGValue::Type to SGPropertyNode::Type
- made SGPropertyNode::getValue and SGPropertyNode::hasValue private
  so that applications cannot get at SGValue instances (SGValue is
  slated for removal)
2001-06-12 02:49:32 +00:00
curt
b4efe8f374 - added missing return statement for getAliasTarget
- changed SGValue::Type to SGPropertyNode::Type for all of
  SGPropertyNode
2001-06-12 02:48:24 +00:00
curt
03f844d4be - added missing return statements for execute methods 2001-06-12 02:44:40 +00:00
curt
a212589865 Fixed a problem that could cause a divide by zero error during initialization.
Contributed by Durk Talsma.
2001-06-10 15:12:09 +00:00
curt
29dfc5bd3c Resolve a #define clash with the template argument LOCK. 2001-06-06 23:12:03 +00:00
curt
a6ac06c47a Display a warning message for Irix users. 2001-06-06 21:27:38 +00:00
curt
4d914db1db - fixed XML syntax error with missing '"' for some attribute values
that was preventing fgfs save/restore from working
- ensured that aliases always appear standalone
2001-06-06 14:57:58 +00:00
curt
68572f106d Added support for #include STL_ITERATOR 2001-06-05 17:47:02 +00:00
curt
c5ca4db94e Fixed a bug in star repainting optimization. 2001-06-02 04:21:04 +00:00
curt
3980f08cc5 Initial revsion of new command manager (contributed by David Megginson)
Fix to configure.in.
2001-06-01 15:28:49 +00:00
curt
f93fa4b613 Detect Irix/CC compiler and substitute AR="CC -ar". 2001-06-01 15:13:04 +00:00
curt
06f2dba92c Norman Vine contributed an optimization to eliminate unnecessary color
recalculations.
2001-05-29 13:45:06 +00:00
curt
30a14741c9 gcc-3.0.x fixes. 2001-05-23 19:25:27 +00:00
curt
2f39b688f4 Added #include <config.h> 2001-05-18 19:06:26 +00:00
curt
724a2ef83b MSVC changes contributed by Geoff McLane. 2001-05-17 19:54:18 +00:00
curt
f7e0e46143 Tweak link libs for decode_binobj. 2001-05-17 16:19:29 +00:00
curt
83acb47295 renamed config.h to simgear_config.h 2001-05-16 00:19:24 +00:00
curt
e5282caea5 MSVC++ tweaks. 2001-05-15 22:17:58 +00:00
curt
6a481eed36 We have to add a few more libs to a couple link lines in order to make
irix happy because it tries to resolve dependencies even if they are
eventually never used.
2001-05-15 21:31:35 +00:00
curt
e145f903de STL-ified the interpolation table so it is not size limited. 2001-05-15 21:07:41 +00:00
curt
2afd1c8663 Updates ... 2001-05-15 20:34:20 +00:00
curt
948d02055d Tweaks. 2001-05-15 20:26:47 +00:00
curt
e2b4c0787a Attempt to resolve ambiguity between #include <config.h> for simgear vs.
flightgear, especially when this occurs in a simgear .hxx file.  This is
now expressly forbidden, and will cause problems anyways because we now
changed the name to <simgear_config.h> which isn't installed, so you can't
include it in an installed header file.
2001-05-15 19:26:22 +00:00
curt
2d21e59b54 MSVC++ doesn't have long long, but does have __int64. 2001-05-15 15:52:10 +00:00
curt
00ccafb90d Update build order to work around dependencies. 2001-05-04 02:10:46 +00:00
curt
b82e02b5ed Tweaks. 2001-05-03 01:58:50 +00:00
curt
096550f163 Initial revision. 2001-05-03 01:58:12 +00:00
curt
81e5963a5d Timezone fixes for cygwin. 2001-04-26 16:15:01 +00:00
curt
14569e4fae Tweaked efence configure. 2001-04-24 21:34:07 +00:00
curt
6cc32a56b9 Added some convenience functions to point3d. 2001-04-24 20:01:52 +00:00
curt
ebdb86c460 Screen shot tweaks from Cameron Moore. 2001-04-22 20:02:49 +00:00
curt
400c9d6a2d Fix various compiler warnings contributed by Norman Princeton. 2001-04-22 14:57:08 +00:00
curt
e9a1b06746 Updated for cygwin build note. 2001-04-18 11:59:47 +00:00
curt
4f3aaa1ede iAdded new classes to simgear/threads. SGGuard is a wrapper around a
mutex that unlocks the mutex when the SGGuard object goes out of scope.
The SGxxxQueue<T> template family factor out the common behaviour we
need for passing data between threads.
2001-04-16 17:26:13 +00:00
curt
187258cc3a -a needed instead of -o 2001-04-13 13:45:15 +00:00
curt
dfbcb1566b Irix tweaks. 2001-04-11 21:14:24 +00:00
curt
e3b0a70eb9 Fixed a typo. 2001-04-11 18:03:30 +00:00
curt
790a40ec99 Tweak... 2001-04-09 18:02:22 +00:00
curt
a824bec9e1 Configure check for pthreads. 2001-04-09 17:58:20 +00:00
curt
10db0c3c66 Swab after sgReadBytes() if necessary. 2001-04-07 23:07:44 +00:00
curt
12620b6152 Tweaks to endianess support. 2001-04-06 21:26:34 +00:00
curt
2294283506 Tweaks to lowlevel.[ch]xx from Norman. 2001-04-06 18:08:07 +00:00
curt
cebcf6a4fc Expanded doxygen comments and added the SGThread::set_cancel() function. 2001-04-06 14:30:42 +00:00
curt
a79a78b6e6 Ooops, commit Makefile.am not .in. 2001-04-05 23:01:04 +00:00
curt
c6ad744ce2 Added support for byte swapping based on endianess. Note the assumption is
that files are stored in little endian order so if reads or writes are done
from a big endian machine, the contents must be byte swapped.
2001-04-05 21:51:32 +00:00
curt
b430b3c8df Added simgear/threads contributed by Bernie Bright. 2001-04-05 15:58:41 +00:00
curt
0b316a8c5e Initial revision. 2001-04-05 15:58:22 +00:00
curt
b8e93e6099 Fixes for native Irix compilers. 2001-04-02 00:23:46 +00:00
curt
a84a88bf09 - started adding doc comments to simgear/misc/props.hxx
- fixed some minor bugs in simgear/misc/props-io.cxx relating to the
new LONG type
2001-03-29 01:35:00 +00:00
curt
02d54dd187 Doxygen. 2001-03-26 19:04:52 +00:00
curt
fb054c7f8d Doxygen ... 2001-03-26 02:41:40 +00:00
curt
77da29b4f7 Doxygen ... 2001-03-25 21:39:03 +00:00
curt
828a9a8c51 Doxygen ... 2001-03-25 13:27:50 +00:00
curt
c680947db5 Doxygen. 2001-03-25 13:16:05 +00:00
curt
5348f4eafe Doxygen. 2001-03-25 12:45:13 +00:00
curt
7781498181 renamed to sgstream.[ch]xx 2001-03-25 12:07:55 +00:00
curt
b8ce139b8a FG_ to SG_ namespace changes.
Doxygenifing.
2001-03-25 12:06:09 +00:00
curt
75911b6c64 doxygen ... 2001-03-25 01:42:40 +00:00
curt
bf0d95145d Doxygen ... 2001-03-24 14:21:06 +00:00
curt
4326d560e9 name space tweaks.
dogygen.
2001-03-24 13:56:53 +00:00
curt
65fa6f2f00 fg_traits.hxx -> sg_traits.hxx
fg_zlib.hxx -> sg_zlib.hxx
2001-03-24 13:12:26 +00:00
curt
124629e1d9 Added some doxygen comments. 2001-03-24 05:27:23 +00:00
curt
557fade4a7 SG-ified logstream. 2001-03-24 05:02:14 +00:00
curt
98a65b5d1d Doxygen ... 2001-03-24 04:21:37 +00:00
curt
caaa35e5a7 SG_ namespace. 2001-03-24 03:55:18 +00:00
curt
a7459489ff Use plib rad/degrees conversion constants. 2001-03-24 03:20:47 +00:00
curt
87e59ff876 SG_ namespace fixes. 2001-03-24 03:02:31 +00:00
curt
9d87c913e7 Initial revision. 2001-03-24 02:43:29 +00:00
curt
0e8c010645 Trying to sort out name space confusing with SG_PI and SGD_PI and varients. 2001-03-23 23:39:25 +00:00
curt
470d01a508 FG_ to SG_ namespace changes. 2001-03-23 23:18:08 +00:00
curt
c16b9ed25b FG_ to SG_ namespace changes. 2001-03-23 21:59:44 +00:00
curt
d498199e8a FG_ to SG_ name changes. 2001-03-23 21:42:18 +00:00
curt
013687dccd Name space changes. 2001-03-23 21:09:56 +00:00
curt
baf25ca7a7 Name space tweaks. 2001-03-23 20:59:25 +00:00
curt
6c28bd884b Added doxygen comments. 2001-03-23 20:50:10 +00:00
curt
510091f082 From David Megginson:
1. Fixed a bug reported by Curt for one of the getChild methods.

2. Cleaned up some of the error reporting, and require PropertyList as
the root element name.  Also uncluttered the XML output a little
(removed type="unknown").

3. Added a new Long type (i.e. setLongValue, getLongValue, etc.), as
requested by Curt aeons ago.

4. Added aliases, so that a property's value can directly reflect the
value of another property.

5. Added a generalized inclusion facility, with parameters (panel
writers should love this one).
2001-03-21 04:57:13 +00:00
curt
7db44c113c Patch to property tree to allow repeating tag names. The property manager
simply assigns ordinality as it finds multiple instances.
2001-03-18 21:22:28 +00:00
curt
6cbf4306e7 Here are four small changes to simgear/misc/props.hxx for Red Hat 6.2.
I've also compiled with Mandrake 7.2 and MSVC with no problems.
2001-03-18 20:52:27 +00:00
curt
777386ea67 Tweaks to interpolator code. 2001-03-14 06:24:52 +00:00
curt
95e5e90791 More Irix Mips tweaks. 2001-03-07 23:56:11 +00:00
curt
a86868526e Patch to tweak traits so they work on Irix too. 2001-03-06 21:14:32 +00:00
curt
f1ab6e2533 Tweaks to follow flightgear STL standard coding procedure. 2001-03-06 19:57:56 +00:00
curt
9f516a8ccc Patches from Norman Vine <nhv@cape.com> to catch and properly report "errno"
conditions.
2001-03-06 16:33:39 +00:00
curt
e07af68018 Changes for the native Irix CC compiler contributed by Erik Hofman. 2001-03-02 22:52:04 +00:00
curt
a37d9a2d8e Reduced the verbocity level of the property loader. 2001-01-31 15:35:43 +00:00
curt
57811b5371 Tweaks to errno checking and perror. 2001-01-27 01:53:11 +00:00
curt
7ff9ba4fe6 Close a binary file before we return (if it turns out not to be a binary file) 2001-01-24 20:07:13 +00:00
curt
fad34bdbc3 Attempt to further isolate domain error problem. 2001-01-24 04:11:36 +00:00
curt
22b41d892a Tweaks from David Megginson. 2001-01-19 21:56:02 +00:00
curt
7a97c7575d Fixed a bug in how zlib.h was included. 2001-01-19 21:55:49 +00:00
curt
b0e175ad3d Tweaks to get us back within the ANSI C++ spec.
Cleaned up some debugging output.
2001-01-12 21:55:44 +00:00
curt
0de60aa6aa Minor MSVC tweaks by Christian Mayer. 2001-01-11 03:33:09 +00:00
curt
933e10d8a0 Initial revision. 2001-01-09 15:46:32 +00:00
curt
2efac3d949 made read/write functions into members of SGBinObject. 2001-01-06 04:31:11 +00:00
curt
c33841329d Simplified calling interface to read/write obj functions. 2001-01-06 04:07:45 +00:00
curt
f37800560f Need to properly interpret gzread() and gzwrite() return result for error
detection.
2001-01-05 21:26:59 +00:00
curt
60e61a0627 1. Patched simgear/magvar/magvar.[ch]xx to allow retrieval of the
magnetic variation for a specific location and date without running an
update cycle (I use this for setting up VOR default offsets in some
FlightGear patches).

2. [CRITICAL] Fixed some null-pointer bugs in simgear/misc/props.cxx.
2001-01-05 16:04:21 +00:00
curt
260dbeb3d2 Additional bug fixes after testing. 2001-01-05 00:04:20 +00:00
curt
70f495b4e1 Move binary file reading and writing to simgear. 2001-01-04 20:16:11 +00:00
curt
663db8f978 Fix a build order problem. 2000-12-20 15:06:04 +00:00
curt
c412739040 Updates for 0.0.15 2000-12-20 04:57:54 +00:00
curt
8b13d71fcf Rewrite of the property manager my David Megginson. 2000-12-19 21:53:37 +00:00
curt
1b129b289c Ready for 0.0.14 release. 2000-12-14 21:21:13 +00:00
curt
a89ceb96b9 Tweak ... 2000-12-14 15:10:56 +00:00
curt
9af5f9f094 MacOS tweaks contributed by Darrell Walisser. 2000-12-13 21:12:15 +00:00
curt
6776c2e536 oops again, fixed. 2000-12-13 19:35:32 +00:00
curt
4c3b4219fe Oops, fixed ... :-) 2000-12-13 19:30:57 +00:00
curt
a09806bb98 Tweaks to newbucket organization. 2000-12-13 19:18:29 +00:00
curt
e175c8cc4d Tweaks to property manager write routine to return true as it should when
the write succeeds.
2000-12-08 15:22:09 +00:00
curt
a53faf4565 Updated random interface so we can optionally specify our own seed value. 2000-12-06 19:01:57 +00:00
curt
dc653ac46c Removed some previously added debugging output. 2000-12-04 22:24:08 +00:00
curt
c544777d37 Minor fix to make the dome always match the fog / horizon color at the
horizon, so we don't see the extreme far tile edges when it is really dark.
2000-12-04 21:31:58 +00:00
curt
93a37df90a Renamed fg_random -> sg_random. 2000-12-04 04:12:33 +00:00
curt
1da02cca4c Added methods to return tile dimension in meters. 2000-12-04 04:11:03 +00:00
curt
4b1d777ad4 Updated some "const" stuff. 2000-12-03 19:32:42 +00:00
curt
fb0916be0f Added an explanation of what this code does. 2000-12-01 22:13:41 +00:00
curt
806083cb25 Initial revision. 2000-11-30 17:38:23 +00:00
curt
5ba74e30b8 Reduced debugging output. 2000-10-23 15:10:45 +00:00
curt
c39e08cb2a Added a distance off route routine (works best with 2d cartesian coordinates.) 2000-10-23 14:57:29 +00:00
curt
e4653be9a1 MSVC++ fixes. 2000-10-19 22:27:27 +00:00
curt
cd5765be1e Tweaks to waypoints and routing. Added distance_to field for each waypoint. 2000-10-13 21:32:51 +00:00
curt
c481b06451 Added route.[ch]xx which maintains a list of waypoints (i.e. a route)
Added an elevation field to each waypoint.  This can be used by the calling
program however it wishes.
2000-10-11 23:04:09 +00:00
curt
91ba4618e7 Initial revision. 2000-10-10 23:41:25 +00:00
curt
fdc5521389 First working revision. 2000-10-10 22:15:11 +00:00
curt
e88c915206 A bit of file renaming to avoid problems with MSVC++ 2000-10-10 17:19:17 +00:00
curt
1e60698053 Initial revision. 2000-10-04 21:55:11 +00:00
curt
5702bd7ee8 io changes and tweaks. Working on adding SOCK_STREAM (tcp) support. Still
needs some work, but is basically there.
2000-10-04 20:14:26 +00:00
curt
8eef3eb582 MSVC++ tweaks. 2000-10-02 18:55:26 +00:00
curt
31db353173 Changes from Bernie Bright:
Added '--with-cxx=COMPILER[:flags]' to ./configure in order to set the
compiler and flags.  If this option is omitted then the default compiler
is assumed (ie the current behaviour).  This duplicates the effect of
passing CC, CFLAGS, CXX and CXXFLAGS on the command line to configure
and make.

SimGear/simgear/compiler.h
Initial support for KAI C++ on linux.

SimGear/simgear/ephemeris/celestialBody.[ch]xx
Removed extraneous semicolons.

SimGear/simgear/io/sg_file.cxx
MSVC tidy up.
2000-10-02 18:52:32 +00:00
curt
2c4a0dd998 Updates from David Megginson:
These patches also eliminate the spurious warning messages about not being
able to set values for joystick buttons.
2000-09-30 01:34:46 +00:00
curt
7d7e41dacc Cleaned up a few poluting #defines.
Did some fg -> sg name space updating (lots more to do but we'll get there
  eventually)
2000-09-27 18:00:04 +00:00
curt
453a53b372 Oops! fixed a typo ... 2000-09-26 21:28:46 +00:00
curt
ef68d18f64 Renames fg_types.hxx -> sg_types.hxx 2000-09-26 21:03:31 +00:00
curt
ded1d2343f Renamed fg_types.hxx -> sg_types.hxx 2000-09-26 21:01:46 +00:00
curt
e6241a2f73 Renamed fg_types.hxx -> sg_types.hxx 2000-09-26 20:52:01 +00:00
curt
467254ec66 MSVC socket support added by Bernie Bright. 2000-09-25 17:32:44 +00:00
curt
135e137921 Initial revision. 2000-09-22 19:24:41 +00:00
curt
e13a5b57d4 Oops, references to built libs need to be relative to $(top_builddir) 2000-09-20 21:21:13 +00:00
curt
f1c00cdd18 #includes based off of srcdir rather than builddir. 2000-09-20 21:14:42 +00:00
curt
8c3de351b0 Use time_t rather than long int as return type for mktime(). 2000-09-18 17:00:16 +00:00
curt
0bcdb7eb70 Ready for 0.0.13 release. 2000-09-14 16:56:13 +00:00
curt
a92b71fffc MSVC changes ... 2000-09-13 20:21:39 +00:00
curt
89960ab715 MacOS portability tweaks from Darrell Walisser. 2000-09-13 19:29:01 +00:00
curt
2a369803ae MACOS -> macintosh 2000-09-09 20:53:44 +00:00
curt
b0134a377e Added a touch of error checking to the screen dump routine, i.e. don't
die if you can't open the output file.
2000-09-09 13:31:45 +00:00
curt
502c650cd9 Sep. 8, 2000 updates from David Megginson. 2000-09-08 18:34:45 +00:00
curt
a1bf8d2229 9/05/2000 updates from David Megginson relating to the property manager and
easyxml support.  This is a bit of simgear side support to facilitate a
configurable instrument panel in flightgear.
2000-09-05 21:38:00 +00:00
curt
25b743bdec Preserve initial "state" by careful use of glPushAttrib() and glPopAttrib()
being careful to manually call getState()->apply() before the glPushAttrib()
so that the ssg state handling mechanism doesn't get derailed accidentally.
2000-08-22 02:40:13 +00:00
curt
dbf7db02a2 Tiny bug fix/tweak. 2000-08-08 14:54:09 +00:00
curt
8c998659c6 Missed some files needed in make dist. 2000-08-08 03:21:26 +00:00
curt
4e23b3dff5 Clean up constructor a bit. 2000-08-08 03:20:02 +00:00
curt
159d3c4c6c Restructured the magvar code a bit to make it more usable. 2000-08-07 18:26:35 +00:00
curt
612b5ae0bc Added simgear/xml. 2000-07-27 02:55:47 +00:00
curt
60cbe9c1d4 Initial revision. 2000-07-26 19:17:43 +00:00
curt
4dadd29727 Updates for 0.0.13 2000-07-22 21:34:58 +00:00
curt
e4610b9baa Ready for 0.0.12 release. 2000-07-20 02:04:47 +00:00
curt
926a0f2437 Renamed FG* to SG* to conform with SimGear naming prefix scheme. 2000-07-14 21:26:45 +00:00
curt
9325ec681e Tweaking api. 2000-07-14 19:15:41 +00:00
curt
af383e6c39 Tweaks to SGSocket. 2000-07-13 22:51:16 +00:00
curt
b000691ab9 Added iochannel stuff to simgear. 2000-07-11 18:38:10 +00:00
curt
22812a0aae Moved to SimGear. 2000-07-11 18:37:49 +00:00
curt
dda7ebfe0d Minor spelling changes in comments. 2000-07-10 13:18:10 +00:00
curt
9a211af659 Sg-ifying names. 2000-07-08 21:30:23 +00:00
curt
82459a2802 Converted to the LGPL licencing terms. 2000-07-08 19:16:10 +00:00
curt
1774fb2d02 Starting conversion to LGPL (from GPL). 2000-07-08 18:44:26 +00:00
curt
f0081c7697 Collapsed the init() method into the constructor. 2000-07-08 13:54:06 +00:00
curt
1e53bedca5 Minor tidying up of interface. 2000-07-08 03:06:45 +00:00
curt
cf1c7e7378 Updated Durk's entry. 2000-07-07 22:03:45 +00:00
curt
5c3b569e97 What do you know, more tidying. 2000-07-07 21:56:25 +00:00
curt
cb29dcc238 clean ups ... 2000-07-07 19:51:42 +00:00
curt
d48b3f1e9a More SGTime tidying. 2000-07-07 18:28:36 +00:00
curt
a4d60e7bd6 Still tweaking output messages. 2000-07-07 15:26:54 +00:00
curt
1a6e2509c7 More SGTime clean ups. 2000-07-07 14:59:04 +00:00
curt
8159b749f4 fg_time.* becomes sg_time.*, FGTime becomes SGTime ... 2000-07-06 20:10:41 +00:00
curt
bec11c2939 ... 2000-07-06 12:46:18 +00:00
curt
8a189b6778 ... 2000-07-06 12:31:18 +00:00
curt
93c6845a6d David Megginson: Added an interface for tree-based navigation (like
navigating a file system.)
2000-07-05 18:50:34 +00:00
curt
b659c805fc Initial revision. 2000-07-05 18:43:44 +00:00
curt
15eaf8dc84 Updates from David Megginson. 2000-07-05 18:36:52 +00:00
curt
cafe89047c Additional updates. 2000-07-05 14:42:58 +00:00
curt
b5705ff47a Pulling in code from the flight gear project relating to timing and ephemeral
calculations.
2000-07-05 00:26:03 +00:00
curt
1b07b25ad2 Migrating timing support routines over to SimGear. 2000-07-05 00:25:30 +00:00
curt
a46163bcd7 Migrated this source over to SimGear. 2000-07-05 00:20:08 +00:00
curt
6531b1ebbc More tweaks ... 2000-07-04 15:44:49 +00:00
curt
dc7bbdce11 Updates to control span (or lateral size of cloud layer square) 2000-07-04 03:32:02 +00:00
curt
a29cbc1112 Updates ... 2000-07-03 21:42:56 +00:00
curt
afc2099865 Updated news. 2000-07-03 17:50:03 +00:00
curt
7d251444e6 Tweaks for 0.0.11 release. 2000-07-03 17:45:30 +00:00
curt
1c2289dacd Initial revision. 2000-07-03 15:07:33 +00:00
curt
044ac5d5d3 Just a few more visibility tweaks and clean ups. 2000-06-30 22:16:41 +00:00
curt
38167ed273 Oops, a couple more sky tweaks. 2000-06-30 21:51:12 +00:00
curt
e15ffbc856 Updates to remove unneeded dependencies on FlightGear and SimGear. 2000-06-30 19:45:24 +00:00
curt
6cf2716615 Updates to cloud code to add different basic cloud types. This isn't the
final list of cloud types, but servers as an example / template for someone
who wants to tweak this out and do it right.
2000-06-23 02:55:57 +00:00
curt
0468b315d4 A couple more cloud tweaks. 2000-06-20 21:44:04 +00:00
curt
de66c74a91 Updating cloud code. 2000-06-20 20:31:48 +00:00
curt
7db73cd215 Cloud texcoord fixes to tie apparent cloud position to earth even though
the whole cloud structure is actual tied to ownship movement.
2000-06-20 02:49:03 +00:00
curt
242eceb1c6 Added a spherical course & dist given two points routine. 2000-06-20 02:46:42 +00:00
curt
c2b84db5a2 Moving cloud functionality to sky section. 2000-06-20 00:30:30 +00:00
curt
487bee35ab Initial revision. 2000-06-20 00:27:53 +00:00
curt
9fabeb77bc Metakit seems to really want to #define bool int, #define true 1,
#define false 0, so I massaged the header files to make this impossible.
2000-06-19 17:06:35 +00:00
curt
bfea2dec4d Initial revision. 2000-06-19 17:05:41 +00:00
curt
2ed07850c6 Math/bucket/tiling updates contributed by Norman Vine.
Texture coordinate calculation updates by Curt.
2000-06-16 00:28:19 +00:00
curt
b72d36d96f Minor fiddling with material properties *trying* to chase down a visual bug
where the scene get's brighter or dimmer depending on whether or not the sun
or moon is in the field of view.
2000-06-01 19:14:06 +00:00
curt
e3ff048ff6 First quick hack at panel shading. 2000-05-27 04:40:55 +00:00
curt
ceef43681d First stab at replacing gdbm with metakit. 2000-05-27 03:43:44 +00:00
curt
3ec00676e4 Initial revision. 2000-05-25 16:45:19 +00:00
curt
e6575fb1db MSVC5 portability changes contributed by Bruce Finney. 2000-05-24 04:10:01 +00:00
curt
fa98d733d6 Updated for version 0.0.9 2000-05-24 01:30:42 +00:00
curt
2981a10e62 Updated for MSVC5. 2000-05-24 01:30:18 +00:00
curt
551c06f885 Updates for MSVC5 2000-05-24 01:29:13 +00:00
curt
a1c59071a1 Changes by David Megginson. 2000-05-16 16:21:08 +00:00
curt
13af443057 cygwin32 fix for gdbm 2000-04-27 01:28:22 +00:00
curt
b8e2b0d0f9 Fixes for cygwin32 builds. 2000-04-27 01:26:36 +00:00
curt
53cd776bf6 Tweaks. 2000-03-30 00:48:38 +00:00
curt
180bba8767 Updated. 2000-03-29 21:28:14 +00:00
curt
377cf1662e For building redhat packages. 2000-03-29 00:00:46 +00:00
curt
420c747551 Ed Williams: Added some bulletproofing at the poles. 2000-03-28 22:08:31 +00:00
curt
7c5b4a87f2 Added gdbm 2000-03-28 22:06:34 +00:00
curt
7ea241b412 Added gdbm to SimGear. Many systems will already have gdbm installed so
it is only built if it doesn't already exist on the user's platform.
gdbm is a set of database routines that use extendible hashing and works
similar to the standard UNIX dbm routines.  This guarantees the availability
of gdbm to any application that uses SimGear.
2000-03-28 21:37:36 +00:00
curt
1547d4ee2f RedHat package building changes contributed by Habibie <habibie@MailandNews.com> 2000-03-28 19:49:07 +00:00
curt
3dde4113e7 Optimizations by Norman Vine:
Classic space vs time seemed worth it in that we get a ~3 fold speedup
  for ~5% space increase here.  Also pow() is an expensive Fortran to C
  translation in just about all the old government code I see :))
2000-03-28 15:20:20 +00:00
curt
205e6ef18f Bump up version # 2000-03-28 15:19:28 +00:00
curt
d53830076b Ready for 0.0.6 release. 2000-03-27 22:34:59 +00:00
curt
296a01b7bd Removed autogen file. 2000-03-27 22:30:32 +00:00
curt
f47fdd63f7 Return result in radians. 2000-03-27 22:30:11 +00:00
curt
b0b5f5035a Updated ... 2000-03-27 22:29:59 +00:00
curt
629ece6e41 Added. 2000-03-27 20:39:10 +00:00
curt
4c79263dcf Added simgear/magvar which impliments WMM 2000 world magnetic variance model.
contributed by Ed Williams.
Some additional internal rearrangement of code.
2000-03-27 20:36:26 +00:00
curt
856b6201dc #include "config.h" 2000-03-26 14:04:03 +00:00
curt
f2160b1479 MSVC++ tweaks contributed by Christian Mayer. 2000-03-21 21:06:07 +00:00
curt
535f6a13b3 Fixes for MSVC++. 2000-03-21 20:38:52 +00:00
curt
2ab760e456 Updates for next version. 2000-03-21 20:38:44 +00:00
curt
8b75fbc1e6 Update for next (0.0.6) release. 2000-03-17 22:20:32 +00:00
curt
82f410e955 Changed directory structure a bit to facilitate building for windows. 2000-03-17 22:12:16 +00:00
curt
68a19bd39f Rendering tweaks. 2000-03-17 05:16:15 +00:00
curt
48689622b4 Updated. 2000-03-16 22:44:50 +00:00
curt
acc2075986 Update star repainting to fade as the day get's brighter, also reworked
coloring just a bit.
2000-03-16 22:02:47 +00:00
curt
1984ae1583 Removed solarsystem.* replaced mostly with ephemeris.* which is similar
but not rendering oriented.
Added star database management class.
2000-03-16 22:00:53 +00:00
curt
427f309aea Complete overhaul of the sky/sun/moon/stars/planets. It is now an ssg
model that get's inserted into the scene graph.
2000-03-16 03:17:04 +00:00
curt
84482ad30d Pass current latitude to moon position calculations to compenstate for it's
parallax.
2000-03-16 03:14:23 +00:00
curt
09b67e9440 Updated to eliminate rendering component and allow initialization without a
known time.
2000-03-16 03:00:58 +00:00
curt
80cf74d85f Initial revision. 2000-03-07 00:47:37 +00:00
curt
17e055a00e Working on ssg-ifying sky. 2000-03-06 22:29:21 +00:00
curt
a8d8c9d24e Working on ssg-ifying the sky dome. Added the moon and other various tweaks. 2000-03-06 22:27:52 +00:00
curt
99a59763f1 Working on drawing sun and sun halo. 2000-03-02 23:07:25 +00:00
curt
0fa3a329e8 Fixed a typo in the sky dome painting code. 2000-03-02 19:06:28 +00:00
curt
5fbe532ec5 Sun now correctly placed in sky and correctly colored. 2000-03-02 18:20:52 +00:00
curt
5f3de889d7 Added top level ephemeris class. 2000-03-02 15:06:14 +00:00
curt
a8db14196a Working on separating out ephemeris code from the actual rendering code
which I am trying to ssg-ify at the same time.
2000-03-02 12:51:30 +00:00
curt
03b10d64a8 Separating out the Sky rendering as a separate unit and ssg-ifying it. 2000-03-02 02:03:18 +00:00
curt
86892d87e9 Starting to work on an independent sky implimentation that can be used by
any ssg application and can have it's components driven realistically based
on time.
2000-03-02 00:56:35 +00:00
curt
41218272c4 Working on skydome ... some actual progress has been made. :-) Still
something goofy with sunrise, sunset effects.
2000-02-29 23:31:32 +00:00
curt
8b5514fa9f Continuing work on ssg-ifying the sky dome. 2000-02-29 16:13:02 +00:00
curt
f14de56712 Further work on ssg-ifying the sky dome. (not tested) but I can build the
structures and update the colors.  I still need to set up the transforms
properly and connect it into the scene graph.
2000-02-28 23:04:07 +00:00
curt
ecc5c9865b Beginning work on a restructure of the sky code. 2000-02-28 12:58:41 +00:00
curt
929a56a6e8 Updated to 0.0.4 2000-02-22 16:21:15 +00:00
curt
4416df8c39 Added an include file that reports the current SimGear version. 2000-02-22 04:32:16 +00:00
curt
fc80610663 Removed mat3.h et. al. plib/sg.h provides a superset of mat3.h, has a
cleaner design, and is something that we are already linking in.
2000-02-19 20:58:58 +00:00
curt
cb03bfcb80 Fixed a warning message. 2000-02-19 02:28:58 +00:00
curt
35ed10e252 Updates. 2000-02-19 02:22:47 +00:00
curt
41fc1621b1 Updates .. 2000-02-17 16:04:35 +00:00
622 changed files with 117478 additions and 25227 deletions

19
.cvsignore Normal file
View File

@@ -0,0 +1,19 @@
Makefile
Makefile.in
SimGear.spec
aclocal.m4
autom4te.cache
config.cache
config.log
config.status
configure
do-config.sh
.cdtproject
.project
config.guess
config.sub
depcomp
INSTALL
install-sh
missing
mkinstalldirs

View File

@@ -0,0 +1 @@
Curtis Olsen and others.

481
COPYING Normal file
View File

@@ -0,0 +1,481 @@
GNU LIBRARY GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the library GPL. It is
numbered 2 because it goes with version 2 of the ordinary GPL.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Library General Public License, applies to some
specially designated Free Software Foundation software, and to any
other libraries whose authors decide to use it. You can use it for
your libraries, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if
you distribute copies of the library, or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link a program with the library, you must provide
complete object files to the recipients so that they can relink them
with the library, after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
Our method of protecting your rights has two steps: (1) copyright
the library, and (2) offer you this license which gives you legal
permission to copy, distribute and/or modify the library.
Also, for each distributor's protection, we want to make certain
that everyone understands that there is no warranty for this free
library. If the library is modified by someone else and passed on, we
want its recipients to know that what they have is not the original
version, so that any problems introduced by others will not reflect on
the original authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that companies distributing free
software will individually obtain patent licenses, thus in effect
transforming the program into proprietary software. To prevent this,
we have made it clear that any patent must be licensed for everyone's
free use or not licensed at all.
Most GNU software, including some libraries, is covered by the ordinary
GNU General Public License, which was designed for utility programs. This
license, the GNU Library General Public License, applies to certain
designated libraries. This license is quite different from the ordinary
one; be sure to read it in full, and don't assume that anything in it is
the same as in the ordinary license.
The reason we have a separate public license for some libraries is that
they blur the distinction we usually make between modifying or adding to a
program and simply using it. Linking a program with a library, without
changing the library, is in some sense simply using the library, and is
analogous to running a utility program or application program. However, in
a textual and legal sense, the linked executable is a combined work, a
derivative of the original library, and the ordinary General Public License
treats it as such.
Because of this blurred distinction, using the ordinary General
Public License for libraries did not effectively promote software
sharing, because most developers did not use the libraries. We
concluded that weaker conditions might promote sharing better.
However, unrestricted linking of non-free programs would deprive the
users of those programs of all benefit from the free status of the
libraries themselves. This Library General Public License is intended to
permit developers of non-free programs to use free libraries, while
preserving your freedom as a user of such programs to change the free
libraries that are incorporated in them. (We have not seen how to achieve
this as regards changes in header files, but we have achieved it as regards
changes in the actual functions of the Library.) The hope is that this
will lead to faster development of free libraries.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, while the latter only
works together with the library.
Note that it is possible for a library to be covered by the ordinary
General Public License rather than by this special one.
GNU LIBRARY GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library which
contains a notice placed by the copyright holder or other authorized
party saying it may be distributed under the terms of this Library
General Public License (also called "this License"). Each licensee is
addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also compile or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
c) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
d) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the source code distributed need not include anything that is normally
distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Library General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

12243
ChangeLog

File diff suppressed because it is too large Load Diff

811
Doxyfile Normal file
View File

@@ -0,0 +1,811 @@
# Doxyfile 1.2.6
# This file describes the settings to be used by doxygen for a project
#
# All text after a hash (#) is considered a comment and will be ignored
# The format is:
# TAG = value [value, ...]
# For lists items can also be appended using:
# TAG += value [value, ...]
# Values that contain spaces should be placed between quotes (" ")
#---------------------------------------------------------------------------
# General configuration options
#---------------------------------------------------------------------------
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project.
PROJECT_NAME = SimGear
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = 1.9.0
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
# If a relative path is entered, it will be relative to the location
# where doxygen was started. If left blank the current directory will be used.
OUTPUT_DIRECTORY = ../doxy
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
# documentation generated by doxygen is written. Doxygen will use this
# information to generate all constant output in the proper language.
# The default language is English, other supported languages are:
# Dutch, French, Italian, Czech, Swedish, German, Finnish, Japanese,
# Korean, Hungarian, Norwegian, Spanish, Romanian, Russian, Croatian,
# Polish, Portuguese and Slovene.
OUTPUT_LANGUAGE = English
# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
# documentation are documented, even if no documentation was available.
# Private class members and static file members will be hidden unless
# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
EXTRACT_ALL = NO
# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
# will be included in the documentation.
EXTRACT_PRIVATE = NO
# If the EXTRACT_STATIC tag is set to YES all static members of a file
# will be included in the documentation.
EXTRACT_STATIC = NO
# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
# undocumented members of documented classes, files or namespaces.
# If set to NO (the default) these members will be included in the
# various overviews, but no documentation section is generated.
# This option has no effect if EXTRACT_ALL is enabled.
HIDE_UNDOC_MEMBERS = YES
# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
# undocumented classes that are normally visible in the class hierarchy.
# If set to NO (the default) these class will be included in the various
# overviews. This option has no effect if EXTRACT_ALL is enabled.
HIDE_UNDOC_CLASSES = YES
# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
# include brief member descriptions after the members that are listed in
# the file and class documentation (similar to JavaDoc).
# Set to NO to disable this.
BRIEF_MEMBER_DESC = YES
# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
# the brief description of a member or function before the detailed description.
# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
# brief descriptions will be completely suppressed.
REPEAT_BRIEF = YES
# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
# Doxygen will generate a detailed section even if there is only a brief
# description.
ALWAYS_DETAILED_SEC = NO
# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
# path before files name in the file list and in the header files. If set
# to NO the shortest path that makes the file name unique will be used.
FULL_PATH_NAMES = NO
# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
# can be used to strip a user defined part of the path. Stripping is
# only done if one of the specified strings matches the left-hand part of
# the path. It is allowed to use relative paths in the argument list.
STRIP_FROM_PATH =
# The INTERNAL_DOCS tag determines if documentation
# that is typed after a \internal command is included. If the tag is set
# to NO (the default) then the documentation will be excluded.
# Set it to YES to include the internal documentation.
INTERNAL_DOCS = NO
# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
# generate a class diagram (in Html and LaTeX) for classes with base or
# super classes. Setting the tag to NO turns the diagrams off.
CLASS_DIAGRAMS = YES
# If the SOURCE_BROWSER tag is set to YES then a list of source files will
# be generated. Documented entities will be cross-referenced with these sources.
SOURCE_BROWSER = YES
# Setting the INLINE_SOURCES tag to YES will include the body
# of functions and classes directly in the documentation.
INLINE_SOURCES = NO
# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
# doxygen to hide any special comment blocks from generated source code
# fragments. Normal C and C++ comments will always remain visible.
STRIP_CODE_COMMENTS = YES
# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
# file names in lower case letters. If set to YES upper case letters are also
# allowed. This is useful if you have classes or files whose names only differ
# in case and if your file system supports case sensitive file names. Windows
# users are adviced to set this option to NO.
CASE_SENSE_NAMES = YES
# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
# will show members with their full class and namespace scopes in the
# documentation. If set to YES the scope will be hidden.
HIDE_SCOPE_NAMES = NO
# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
# will generate a verbatim copy of the header file for each class for
# which an include is specified. Set to NO to disable this.
VERBATIM_HEADERS = YES
# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
# will put list of the files that are included by a file in the documentation
# of that file.
SHOW_INCLUDE_FILES = YES
# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
# will interpret the first line (until the first dot) of a JavaDoc-style
# comment as the brief description. If set to NO, the JavaDoc
# comments will behave just like the Qt-style comments (thus requiring an
# explict @brief command for a brief description.
JAVADOC_AUTOBRIEF = YES
# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
# member inherits the documentation from any documented member that it
# reimplements.
INHERIT_DOCS = YES
# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
# is inserted in the documentation for inline members.
INLINE_INFO = YES
# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
# will sort the (detailed) documentation of file and class members
# alphabetically by member name. If set to NO the members will appear in
# declaration order.
SORT_MEMBER_DOCS = YES
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
# tag is set to YES, then doxygen will reuse the documentation of the first
# member in the group (if any) for the other members of the group. By default
# all members of a group must be documented explicitly.
DISTRIBUTE_GROUP_DOC = NO
# The TAB_SIZE tag can be used to set the number of spaces in a tab.
# Doxygen uses this value to replace tabs by spaces in code fragments.
TAB_SIZE = 8
# The ENABLE_SECTIONS tag can be used to enable conditional
# documentation sections, marked by \if sectionname ... \endif.
ENABLED_SECTIONS =
# The GENERATE_TODOLIST tag can be used to enable (YES) or
# disable (NO) the todo list. This list is created by putting \todo
# commands in the documentation.
GENERATE_TODOLIST = YES
# The GENERATE_TESTLIST tag can be used to enable (YES) or
# disable (NO) the test list. This list is created by putting \test
# commands in the documentation.
GENERATE_TESTLIST = YES
# The GENERATE_BUGLIST tag can be used to enable (YES) or
# disable (NO) the bug list. This list is created by putting \bug
# commands in the documentation.
GENERATE_BUGLIST = YES
# This tag can be used to specify a number of aliases that acts
# as commands in the documentation. An alias has the form "name=value".
# For example adding "sideeffect=\par Side Effects:\n" will allow you to
# put the command \sideeffect (or @sideeffect) in the documentation, which
# will result in a user defined paragraph with heading "Side Effects:".
# You can put \n's in the value part of an alias to insert newlines.
ALIASES =
# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
# the initial value of a variable or define consist of for it to appear in
# the documentation. If the initializer consists of more lines than specified
# here it will be hidden. Use a value of 0 to hide initializers completely.
# The appearance of the initializer of individual variables and defines in the
# documentation can be controlled using \showinitializer or \hideinitializer
# command in the documentation regardless of this setting.
MAX_INITIALIZER_LINES = 30
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
# only. Doxygen will then generate output that is more tailored for C.
# For instance some of the names that are used will be different. The list
# of all members will be omitted, etc.
OPTIMIZE_OUTPUT_FOR_C = NO
# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
# at the bottom of the documentation of classes and structs. If set to YES the
# list will mention the files that were used to generate the documentation.
SHOW_USED_FILES = YES
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
# The QUIET tag can be used to turn on/off the messages that are generated
# by doxygen. Possible values are YES and NO. If left blank NO is used.
QUIET = NO
# The WARNINGS tag can be used to turn on/off the warning messages that are
# generated by doxygen. Possible values are YES and NO. If left blank
# NO is used.
WARNINGS = YES
# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
# automatically be disabled.
WARN_IF_UNDOCUMENTED = YES
# The WARN_FORMAT tag determines the format of the warning messages that
# doxygen can produce. The string should contain the $file, $line, and $text
# tags, which will be replaced by the file and line number from which the
# warning originated and the warning text.
WARN_FORMAT = "$file:$line: $text"
# The WARN_LOGFILE tag can be used to specify a file to which warning
# and error messages should be written. If left blank the output is written
# to stderr.
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
# The INPUT tag can be used to specify the files and/or directories that contain
# documented source files. You may enter file names like "myfile.cpp" or
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = \
DoxygenMain.cxx \
simgear/bucket \
simgear/compiler.h \
simgear/constants.h \
simgear/debug \
simgear/environment \
simgear/ephemeris \
simgear/io \
simgear/magvar \
simgear/math \
simgear/misc \
simgear/nasal \
simgear/props \
simgear/route \
simgear/scene \
simgear/screen \
simgear/serial \
simgear/structure \
simgear/sg_inlines.h \
simgear/sg_traits.hxx \
simgear/sound \
simgear/threads \
simgear/timing \
simgear/xml
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
# and *.h) to filter out the source-files in the directories. If left
# blank all files are included.
FILE_PATTERNS = *.h *.hxx *.c *.cxx *.cpp
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
# should be searched for input files as well. Possible values are YES and NO.
# If left blank NO is used.
RECURSIVE = YES
# The EXCLUDE tag can be used to specify files and/or directories that should
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
EXCLUDE = simgear/scene/sky/clouds3d
# If the value of the INPUT tag contains directories, you can use the
# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
# certain files from those directories.
EXCLUDE_PATTERNS =
# The EXAMPLE_PATH tag can be used to specify one or more files or
# directories that contain example code fragments that are included (see
# the \include command).
EXAMPLE_PATH =
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
# and *.h) to filter out the source-files in the directories. If left
# blank all files are included.
EXAMPLE_PATTERNS =
# The IMAGE_PATH tag can be used to specify one or more files or
# directories that contain image that are included in the documentation (see
# the \image command).
IMAGE_PATH =
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
# by executing (via popen()) the command <filter> <input-file>, where <filter>
# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
# input file. Doxygen will then use the output that the filter program writes
# to standard output.
INPUT_FILTER =
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
# INPUT_FILTER) will be used to filter the input files when producing source
# files to browse.
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
# of all compounds will be generated. Enable this if the project
# contains a lot of classes, structs, unions or interfaces.
ALPHABETICAL_INDEX = YES
# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
# in which this list will be split (can be a number in the range [1..20])
COLS_IN_ALPHA_INDEX = 5
# In case all classes in a project start with a common prefix, all
# classes will be put under the same header in the alphabetical index.
# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
# should be ignored while generating the index headers.
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
# generate HTML output.
GENERATE_HTML = YES
# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `html' will be used as the default path.
HTML_OUTPUT = html
# The HTML_HEADER tag can be used to specify a personal HTML header for
# each generated HTML page. If it is left blank doxygen will generate a
# standard header.
HTML_HEADER =
# The HTML_FOOTER tag can be used to specify a personal HTML footer for
# each generated HTML page. If it is left blank doxygen will generate a
# standard footer.
HTML_FOOTER =
# The HTML_STYLESHEET tag can be used to specify a user defined cascading
# style sheet that is used by each HTML page. It can be used to
# fine-tune the look of the HTML output. If the tag is left blank doxygen
# will generate a default style sheet
HTML_STYLESHEET =
# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
# files or namespaces will be aligned in HTML using tables. If set to
# NO a bullet list will be used.
HTML_ALIGN_MEMBERS = YES
# If the GENERATE_HTMLHELP tag is set to YES, additional index files
# will be generated that can be used as input for tools like the
# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
# of the generated HTML documentation.
GENERATE_HTMLHELP = NO
# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
# controls if a separate .chi index file is generated (YES) or that
# it should be included in the master .chm file (NO).
GENERATE_CHI = NO
# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
# controls whether a binary table of contents is generated (YES) or a
# normal table of contents (NO) in the .chm file.
BINARY_TOC = NO
# The TOC_EXPAND flag can be set YES to add extra items for group members
# to the contents of the Html help documentation and to the tree view.
TOC_EXPAND = NO
# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
# top of each HTML page. The value NO (the default) enables the index and
# the value YES disables it.
DISABLE_INDEX = NO
# This tag can be used to set the number of enum values (range [1..20])
# that doxygen will group on one line in the generated HTML documentation.
ENUM_VALUES_PER_LINE = 4
# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
# generated containing a tree-like index structure (just like the one that
# is generated for HTML Help). For this to work a browser that supports
# JavaScript and frames is required (for instance Netscape 4.0+
# or Internet explorer 4.0+).
GENERATE_TREEVIEW = NO
# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
# used to set the initial width (in pixels) of the frame in which the tree
# is shown.
TREEVIEW_WIDTH = 250
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
# generate Latex output.
GENERATE_LATEX = YES
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `latex' will be used as the default path.
LATEX_OUTPUT = latex
# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
# LaTeX documents. This may be useful for small projects and may help to
# save some trees in general.
COMPACT_LATEX = NO
# The PAPER_TYPE tag can be used to set the paper type that is used
# by the printer. Possible values are: a4, a4wide, letter, legal and
# executive. If left blank a4wide will be used.
PAPER_TYPE = letter
# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
# packages that should be included in the LaTeX output.
EXTRA_PACKAGES =
# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
# the generated latex document. The header should contain everything until
# the first chapter. If it is left blank doxygen will generate a
# standard header. Notice: only use this tag if you know what you are doing!
LATEX_HEADER =
# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
# is prepared for conversion to pdf (using ps2pdf). The pdf file will
# contain links (just like the HTML output) instead of page references
# This makes the output suitable for online browsing using a pdf viewer.
PDF_HYPERLINKS = NO
# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
# plain latex in the generated Makefile. Set this option to YES to get a
# higher quality PDF documentation.
USE_PDFLATEX = NO
# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
# command to the generated LaTeX files. This will instruct LaTeX to keep
# running if errors occur, instead of asking the user for help.
# This option is also used when generating formulas in HTML.
LATEX_BATCHMODE = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
# The RTF output is optimised for Word 97 and may not look very pretty with
# other RTF readers or editors.
GENERATE_RTF = YES
# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `rtf' will be used as the default path.
RTF_OUTPUT = rtf
# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
# RTF documents. This may be useful for small projects and may help to
# save some trees in general.
COMPACT_RTF = NO
# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
# will contain hyperlink fields. The RTF file will
# contain links (just like the HTML output) instead of page references.
# This makes the output suitable for online browsing using a WORD or other.
# programs which support those fields.
# Note: wordpad (write) and others do not support links.
RTF_HYPERLINKS = NO
# Load stylesheet definitions from file. Syntax is similar to doxygen's
# config file, i.e. a series of assigments. You only have to provide
# replacements, missing definitions are set to their default value.
RTF_STYLESHEET_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
# generate man pages
GENERATE_MAN = YES
# The MAN_OUTPUT tag is used to specify where the man pages will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `man' will be used as the default path.
MAN_OUTPUT = man
# The MAN_EXTENSION tag determines the extension that is added to
# the generated man pages (default is the subroutine's section .3)
MAN_EXTENSION = .3
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
# evaluate all C-preprocessor directives found in the sources and include
# files.
ENABLE_PREPROCESSING = YES
# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
# names in the source code. If set to NO (the default) only conditional
# compilation will be performed. Macro expansion can be done in a controlled
# way by setting EXPAND_ONLY_PREDEF to YES.
MACRO_EXPANSION = NO
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
# then the macro expansion is limited to the macros specified with the
# PREDEFINED and EXPAND_AS_PREDEFINED tags.
EXPAND_ONLY_PREDEF = NO
# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
# in the INCLUDE_PATH (see below) will be search if a #include is found.
SEARCH_INCLUDES = YES
# The INCLUDE_PATH tag can be used to specify one or more directories that
# contain include files that are not input files but should be processed by
# the preprocessor.
INCLUDE_PATH =
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
# directories. If left blank, the patterns specified with FILE_PATTERNS will
# be used.
INCLUDE_FILE_PATTERNS =
# The PREDEFINED tag can be used to specify one or more macro names that
# are defined before the preprocessor is started (similar to the -D option of
# gcc). The argument of the tag is a list of macros of the form: name
# or name=definition (no spaces). If the definition and the = are
# omitted =1 is assumed.
PREDEFINED =
# If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.
# The macro definition that is found in the sources will be used.
# Use the PREDEFINED tag if you want to use a different macro definition.
EXPAND_AS_DEFINED =
#---------------------------------------------------------------------------
# Configuration::addtions related to external references
#---------------------------------------------------------------------------
# The TAGFILES tag can be used to specify one or more tagfiles.
TAGFILES =
# When a file name is specified after GENERATE_TAGFILE, doxygen will create
# a tag file that is based on the input files it reads.
GENERATE_TAGFILE =
# If the ALLEXTERNALS tag is set to YES all external classes will be listed
# in the class index. If set to NO only the inherited external classes
# will be listed.
ALLEXTERNALS = NO
# The PERL_PATH should be the absolute path and name of the perl script
# interpreter (i.e. the result of `which perl').
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
# available from the path. This tool is part of Graphviz, a graph visualization
# toolkit from AT&T and Lucent Bell Labs. The other options in this section
# have no effect if this option is set to NO (the default)
HAVE_DOT = NO
# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for each documented class showing the direct and
# indirect inheritance relations. Setting this tag to YES will force the
# the CLASS_DIAGRAMS tag to NO.
CLASS_GRAPH = YES
# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for each documented class showing the direct and
# indirect implementation dependencies (inheritance, containment, and
# class references variables) of the class with other documented classes.
COLLABORATION_GRAPH = YES
# If the ENABLE_PREPROCESSING, INCLUDE_GRAPH, and HAVE_DOT tags are set to
# YES then doxygen will generate a graph for each documented file showing
# the direct and indirect include dependencies of the file with other
# documented files.
INCLUDE_GRAPH = YES
# If the ENABLE_PREPROCESSING, INCLUDED_BY_GRAPH, and HAVE_DOT tags are set to
# YES then doxygen will generate a graph for each documented header file showing
# the documented files that directly or indirectly include this file
INCLUDED_BY_GRAPH = YES
# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
# will graphical hierarchy of all classes instead of a textual one.
GRAPHICAL_HIERARCHY = YES
# The tag DOT_PATH can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found on the path.
DOT_PATH =
# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
# (in pixels) of the graphs generated by dot. If a graph becomes larger than
# this value, doxygen will try to truncate the graph, so that it fits within
# the specified constraint. Beware that most browsers cannot cope with very
# large images.
MAX_DOT_GRAPH_WIDTH = 1024
# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
# (in pixels) of the graphs generated by dot. If a graph becomes larger than
# this value, doxygen will try to truncate the graph, so that it fits within
# the specified constraint. Beware that most browsers cannot cope with very
# large images.
MAX_DOT_GRAPH_HEIGHT = 1024
# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
# generate a legend page explaining the meaning of the various boxes and
# arrows in the dot generated graphs.
GENERATE_LEGEND = YES
# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
# remove the intermedate dot files that are used to generate
# the various graphs.
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::addtions related to the search engine
#---------------------------------------------------------------------------
# The SEARCHENGINE tag specifies whether or not a search engine should be
# used. If set to NO the values of all tags below this one will be ignored.
SEARCHENGINE = NO
# The CGI_NAME tag should be the name of the CGI script that
# starts the search engine (doxysearch) with the correct parameters.
# A script with this name will be generated by doxygen.
CGI_NAME = search.cgi
# The CGI_URL tag should be the absolute URL to the directory where the
# cgi binaries are located. See the documentation of your http daemon for
# details.
CGI_URL =
# The DOC_URL tag should be the absolute URL to the directory where the
# documentation is located. If left blank the absolute path to the
# documentation, with file:// prepended to it, will be used.
DOC_URL =
# The DOC_ABSPATH tag should be the absolute path to the directory where the
# documentation is located. If left blank the directory on the local machine
# will be used.
DOC_ABSPATH =
# The BIN_ABSPATH tag must point to the directory where the doxysearch binary
# is installed.
BIN_ABSPATH = /usr/local/bin/
# The EXT_DOC_PATHS tag can be used to specify one or more paths to
# documentation generated for other projects. This allows doxysearch to search
# the documentation for these projects as well.
EXT_DOC_PATHS =

108
DoxygenMain.cxx Normal file
View File

@@ -0,0 +1,108 @@
/* This is a dummy code file that only contains doxygen main page
documentation. It has a .cxx extension so that emacs will happily
autoindent correctly. */
/** \mainpage SimGear
* Simulation, Visualization, and Game development libraries.
* \section intro Introduction
*
* SimGear is a collection of libraries which provide a variety of
* functionality useful for building simulations, visualizations, and
* even games. All the SimGear code is designed to be portable across
* a wide variety of platforms and compilers. It has primarily been
* developed in support of the FlightGear project, but as development
* moves forward, we are generalizing the code to make more of it
* useful for other types of applications.
*
* Some of the functionality provide includes
*
* - Compiler and platform abstractions for many tricky differences.
* (compiler.h)
*
* - A whole earth tiling/indexing scheme. (SGBucket)
*
* - A console debugging output scheme that tracks severity and
* category that can be completely compiled out for a final build release.
* (logstream.hxx)
*
* - Code to manage "real" time (SGTime), time zones (SGTimeZone), and
* millesecond time differences (SGTimeStamp).
*
* - Code to calculate accurate positions of sun, moon, stars, and
* planets for a given time, date, season, earth location, etc.
* (SGEphemeris)
*
* - Code to render a realistic sky dome, cloud layers, sun, moon,
* stars, and planets all with realistic day/night/sunset/sunrise
* effects. Includes things like correct moon phase, textured moon,
* sun halo, etc. (SGSky is built on top of SGCloudLayer ...)
*
* - Simple serial (SGSerial), file (SGFile), socket (SGSocket), and
* UDP socket (SGSocketUDP) I/O abstractions.
*
* - Code to calculate magnetic variation. (SGMagVar)
*
* - A variety of classes and functions for interpolation tables
* (SGInterpTable), least squares computation (leastsqs.hxx), 3D
* point/vectors (Point3D), 3D polar math and conversions (polar3d.hxx),
* WGS-84 math and conversions (sg_geodesy.hxx), random number abstraction
* (sg_random.h), STL conglomerates for common list types (sg_types.hxx),
* and other vector and linear algebra routines (vector.hxx)
*
* - An abstraction to hide platform dependent path naming schemes. (SGPath)
*
* - A C++ streams wrapper to handle compress input/output streams.
* (sg_gzifstream)
*
* - An optimized "property manager" which associates ascii property
* names with their corresponding value. This can be a great way to build
* loose linkages between modules, or build linkages/connections that can
* be determined from config files or at runtime. (SGPropertyNode)
* Also included is a set of functions to dump the property tree into a
* standard xml file and subsequently read/parse a standard xml file and
* rebuild the associated property tree. (props_io.hxx)
*
* - Scene management and drawing routines:
* - material property management
* - object management
* - terrain tile management and paging
* - sky dome rendering (with ephemeral objects)
*
* - Code to handle screen dumps (screen-dump.hxx) and ultra-hires
* tile rendered screen dumps (tr.h)
*
* - A sound effects manager. (SGSoundMgr, SGSimpleSound, SGSound)
*
* - A threading abstraction. (SGThread)
*
* - A simple but highly functional XML parser that interfaces nicely
* with the property manager. (easyxml.hxx)
* \section supports Supported Platforms
* SimGear has been built on the following platforms:
*
* - Linux (x86)
* - Windows (MSVC, Cygwin, Mingwin)
* - SGI (native compilers)
* - Mac OS X
* - FreeBSD
* \section depends Dependencies
*
* SimGear depends on several other open source packages. These must
* be installed before SimGear can be installed:
*
* - glut and opengl
* - plib (http://plib.sf.net)
* - metakit
* - zlib
* - libjpeg (optional)
* - pthread (optional)
* \section license Licensing
*
* SimGear is licensed under the terms of the LGPL
*/

View File

@@ -1,6 +1,22 @@
EXTRA_DIST = mksymlinks.sh
EXTRA_DIST = \
acinclude.m4 \
autogen.sh \
DoxygenMain.cxx \
README.zlib \
README.plib \
README.OpenAL \
README.OSG \
projects
SUBDIRS = simgear
dist-hook:
tar cf - src/metar | (cd $(distdir); tar xvf -)
(cd $(top_srcdir); $(HOME)/Projects/FlightGear/admin/am2dsp.pl)
rm -rf `find $(distdir)/projects -name CVS`
#
# Rule to build RPM distribution package
#
rpm: dist
rpm -ta $(PACKAGE)-$(VERSION).tar.gz
SUBDIRS = src

439
NEWS
View File

@@ -0,0 +1,439 @@
Version 1.9.0
* Thu Dec 18 15:12:15 CST 2008
Version 1.8.6
* Mon Dec 1 14:02:47 CST 2008
Version 1.8.5
* October 30, 2008 (source code snapshot release)
New in 0.3.10
* April 5, 2006
* Add a small accessor function to expose local timezone offset.
* Improved exception handling and made output more helpful in various places.
* Better pbuffer runtime detection.
* Add directory creation capability to file/path library.
* Added a basic reference counting class to improve robustness of
memory management in places. Use this for all scenegraph
references, sgmaterial references, sgmatmodel references, and
sgsoundsample references.
* Add support for point sprites.
* Updates to rain cone rendering.
* Add a new vector library and integrate that with improved coordinate
system conversion code.
* Mutex locking and cleanup improvements in the threading abstraction
library.
* Add MacOS RenderTexture support.
* Add a Nasal based io libarary that is not activated by default.
* Added a set of MS-VC8 project files.
* Various platform related bug fixes.
* Various compiler related bug/warning fixes.
* Clean up some things that triggered valgrind warnings.
* Fix a Nasal cmp() bug.
* Removed ancient version of zlib from distribution.
New in 0.3.9
* November 17, 2005
* Add support for OpenAL 1.1 (with a separate alut library.)
* Add support for volumetric shadows. Aircraft can cast shadows on themselves
as well as onto the ground (by Harald Johnsen.)
* New 3d volumetric clouds by Harald Johnsen (along with several rounds of
followup fixes and improvements.)
* Remove Mark Harris's old 3d clouds because they were never properly
integrated. And we now have new 3d clouds.
* Add support for seasonal textures (with a set of winter textures added
to FlightGear.)
* Updated Nasal scripting system. Adds several new syntax convenience
features, fixes parser bugs, fixes several internal bugs.
* Our 3d cockpit jitter problem is fixed (woohoo!)
* Add code to support rendering to a texture.
* Allow "tip" popups to pop themselves down after the appropriate
timeout, even if the sim time is paused.
* Various low model level animation fixes and additions ... color,
transparency, 'chrome' effects, randomized spin, etc.
* Create our own portable stdint.h implementation.
* Fixed several memory leaks.
* removeChildren() added to the property system.
* Fix many cases of 'const'.
* Fixes for cygwin, solaris/sun, Mac OS X, MSVC, gcc-3.4.x.
New in 0.3.8
* January 18, 2005
* Configure script does a sanity check for the existence of openal.
* Better pthreads detection for FreeBSD.
* Abstract out the location of gl.h, glu.h, and glut.h so we can more
easily support MacOS which puts these in an oddball location.
* Added two new debug output types for instrumentation and systems.
* Add a name parameter to the waypoint class for supporting a route
manager in the flightgear gps module.
* Make display list usage optional.
* Event manager: specifying a zero delay will force event execution in
the next frame rather than entering an infinite loop.
* gcc-4.0 fix.
* Fixes to property tree loading and saving.
* Make volume inaudible at startup.
* Solaris fixes.
* For low density cloud coverage, blend the layer to nothing as we pass
through instead of fully engulfing the aircraft in the cloud.
* Add several new capabilities to the texture management code for building
normal maps and doing some simple on-the-fly effects on textures.
* Better error message for sound problems.
* Add support for binding a thread to a specific CPU.
New in 0.3.7
* October 12, 2004
* Add support for parsing xml from an in memory buffer, not just a file.
* Don't reduce visibility for a "clear" cloud layer.
* Add support for audio orientation (direction and cone) for internal
view and tower view.
* Add support for drawing from display lists rather than in immediate mode.
This provides a big performance improvement on many systems.
New in 0.3.6
* July 29, 2004
* Better MinGW support
* A bit better handling of OpenAL under Cygwin
* Switched audio system from plib's "sl/sm" to OpenAL.
* Add support for scaling an object based on distance. The scaling
factor is determined by a lookup table based on distance.
* Add a "flash" animation type.
* Fix cloud positioning/animation bugs.
* Fix an off-by-one error in props_io.cxx
* Clip audio gain (volume) to 1.0
New in 0.3.5
* March 26, 2004
* Added Andy's nasal interpreter for small built in scripting tasks.
Nasal integrates nicely with FlightGear's property system.
* Added new (much simpler) metar parsing code (removed older more
complex code.)
* Support VASI/PAPI lights correctly.
* Fixes to cloud animation.
* Updates to sky dome coloring as well as sun/moon coloring.
* Vary environment lighting with visibility (subtlety.)
* Support control of alpha test in model animation.
* Complete rewrite of the event manager.
* Updates to low level socket code to make it more flexible.
* Win32 serial port communication fixes.
* sg_geodesy rewritten to be more accurate and robust and symmetric.
New in 0.3.4
* October 22, 2003
* Removed Metakit, FlightGear no longer uses it.
* Removed all glut dependencies from SimGear.
* Moved FGEventMgr and FGSubsystemMgr over to SimGear.
* Some more incremental work on 3D clouds.
* Added some "fastmath" functions.
* Some lighting tweaks and fixes (especially for taxiways.)
* Added support for "blend" and "scale" and "texture" animations.
* Added support for animating rotations around an arbitrary axis (so the
aircraft designer isn't forced to figure out animations as a combination
of rotations around X, Y, and X axes.
* Updates to sky dome modeling and make cloud layers follow the curve
of the earth (sort of.)
* Updates to sky dome, cloud, and sunrise/sunset color and lighting
effects to make them more realistic and lifelike.
* Better support for detecting and using OpenGL extensions at run time.
* Add support for win32-pthreads in MSVC.NET
* Various MSVC fixes.
* Various Solaris fixes.
* Various cygwin/mingwin fixes.
* Various Mac OS X fixes.
* Various Irix fixes.
New in 0.3.3
* June 3, 2003
* Fix a compile problem for cygwin
* Updated/tweaked doxygen documentation in several areas
New in 0.3.2
* June 2, 2003
* Moved quite a bit of low level model management and "state"
management code from FlightGear into SimGear and did a substantial
amount of restructuring and dependency clean up in the process.
Created a "scene" subdirectory with sub-subdirectories for material
management, basic model and model animation management, sky
rendering, and low level loaders for the "TerraGear" tile object format.
* Removed support of the flat shaded and non-textured material
property variants. You can still do these things, but extra states
are no longer set up automatically.
* Removed 3d clouds from the default build ... these need a maintainer
or better yet, a complete plib-based rewrite.
* Moved the FlightGear sound effect manager code over to SimGear.
* Updated the cloud layer surface to better follow the inverted bowl
shape.
* Much work on cloud/sky coloring, and also much work on
sunset/sunrise coloring.
* Fixed an obscure bug in cloud texture loading which caused each
cloud texture to be loaded 5 times. Ouch!
* Various class and function renaming to make them better fit into the
standard SimGear naming scheme.
* Added some additional convenience functions to the SGPath class.
* Upgraded the distributed version of metakit.
* FreeBSD fixes.
* Irix fixes (better STL/ISO C++ header support.)
* Mingwin fixes.
* Better MacOS support
* MSVC fixes.
New in 0.3.1
* December 4, 2002
* Fix a major packaging blunder with several missing files.
New in 0.3.0
* December 3, 2002
* removed interpreter subdir
* NOMINAX fix for Cygwin/gcc-3.2
* Added some prototype 3d clouds based on Mark Harris's demos.
* Simplified the command manager interface
* Allow an "include" attribute on root PropertyList element.
New in 0.2.0
* September 6, 2002
* Modernized the autoconf/make scripts, plus lots of tweaks and enhancements.
* Removed efence support (in favor of valgrind.)
* Added a javascript interpreter.
* SGSocket reimplemented on top of plib/net libs.
* Added a new random number generation algorithm.
* Total rewrite of the strutils package.
* Patch for the random number seed.
* IA-64 w/ Intel compiler fixes.
* MSVC/MINGW fixes.
* Mac OS X fixes.
* Irix fixes.
* Code clean ups to remove warning messages.
* Optimizations in sg_binobj to reduce the amount of memory copying
needed when loading a binobj format file.
* Fixed a couple places where variables could be used before they were
initialized.
* Various property manager fixes and improvements.
* Fixes to cloud layer management code.
* Made the sky dome more flexible to facilitate use in other applications.
New in 0.0.18
* April 20, 2002
* Created a src/libs subdirectory for several packages that need to be
installed by the user but are used by many other packages and may already
be installed. So we just bundle the source separately as a convenience
if the user needs to build and install these.
* Upgrade to zlib-1.1.4 (security fix)
* Upgrade to metakit-2.4.2-32.tar.gz (latest upstream release)
* Added support for point objects in the scenery file format.
* Additions to the binary file format to make it *much* more flexible.
For each major primitive type: points, triangles, fans, and strips, you
can specify an index list of vertices, normals, colors, and texture
coordinates. You can skip any of these you like to save on space.
* Added support for new file features in the binary -> ascii scenery file
decoder.
* Various code clean ups.
* Separate XML I/O operations into a separate header file.
* Major property manager rewrite, then lots of followup cleaning and
improvements.
New in 0.0.17 (final)
* February 16, 2002
* Explicitely reset the glBlendFunc() after drawing the moon for the
Voodoo2 linux driver since it seems to have a bug in glPopAttrib().
New in 0.0.17pre2
* February 13, 2002
* Replaced some cout's with SG_LOG's
New in 0.0.17pre1
* February 12, 2002
* Removed metakit and zlib from build process. Tarballs are still included
for those who's systems don't provide these packages.
* MSVC fixes.
* IRIX fixes.
* Mingwin fixes.
* Mac OS X fixes.
* FreeBSD fixes.
* Added support for Intel's C++ compiler under Linux.
* Attempt to build in support for various non-compatible automake/autoconf
versions.
* Fix for a problem that could lead to a bogus build for people with voodoo
cards.
* Added Norman's jpegfactory code which can create jpeg format screen shots
of a live running application.
* implemented set/get_log_classes and set/get_log_priority.
* Socket library improvements.
* Added a C++ exception abstraction.
* Property manager fixes and improvements including node path caching
and debug tracing of property reads/writes.
* Updates/fixes to xml handling.
New in 0.0.16
* July 12, 2001
* Various changes to the property manager implementation to better support
dumping out the desired portions of the property tree to file.
* Don't compile the metakit demos by default (causes problems for Irix)'
* Other various tweaks for Irix.
* Added a virtual destructor to XMLVisitor to fix a warning message.
* Check for valid hostname lookup in sg_socket.cxx
* Add a function to return modified julian date without creating an
entire SGTime class. This avoids an extraneous warning about not
being able to find a timezone.
* Created a mailing list for cvs commit messages.
* Fixed a potential array under/over run bug in interpolator.cxx
* Removed all references to SGValue from the property manager. Added
support for an "archive" bit in the property manager to control
which values get written out.
* Added SGCommandState class so that commands can compile and save
copies of their arguments for efficiency if they are called multiple
times.
* Added Brian Baul's "tr" tiled rendering low level support library.
This along with some higher level code in flightgear allows us to do
ultra-hires tiled screen dumps suitable for large format printers.
(Norman Vine)
New in 0.0.15
* June 20, 2001
* Various bug fixes, tweaks, and optimizations.
* Added a command manager (analogous to the property manager)
* Better Irix Mips support.
* Various gcc-3.0 fixes.
* Various MSVC fixes.
* Added MSVC project files (automatically generated from the unix
automake configuration files.)
* Removed total size limitation on interpolation table module.
* Various Cygwin fixes.
* Added some convenience functions to point3d.
* Various compiler warning fixes.
* Added a thread wrapper class (currently only supports pthreads)
* Added IO routines for a lowlevel, native simgear binary 3d file
format optimized for TerraGear terrain.
* Better endianness checking and support for the binary file
read/write routines.
* Added doxygen comments for all public interface code. Documentation
can be accessed via the SimGear web page.
* Many FG -> SG name space changes for better consistency throughout
this package.
* Added property aliases, repeated name tags, and a general xml
inclusion facilities. Many other property manager clean ups
following a complete rewrite.
* Fixed some critical null pointer bugs in property manager.
* Magnetic variation can now be fetched for any arbitrary location.
New in 0.0.14
* December 14, 2000
* Added a module to manage waypoints and routes, calculate bearing and
distance to next waypoint, lateral distance off route, etc.
* Moved some of the basic time management code over from flightgear.
* Bucket dimensions can be returned in meters
* Added SOCK_STREAM (TCP) socket support to the networking code.
* Updated random number generator interface so application can provide
it's own seed value as well as use the default time seed.
* Added a routine to calculate the distance between a point and a line segment.
* Updates to the property manager and the property list loader/saver.
* Added an explanation of the rational behind our terrain texture coordinate
generation code.
* Fixed sky dome so that the color at the horizon will always match
the specified fog color.
* Did a fair amount of fg -> sg name space updating (lots left to do.)
* Added support for KAI C++ on linux.
* MSVC tweaks.
* MacOS tweaks.
* FreeBSD tweaks.
New in 0.0.13
* September 14, 2000
* Added support for reading and writing xml files (easyxml)
* Then updates to property manager and xml code.
* Update magnetic variation code.
* Sky code now uses glPushAttrib and glPopAttrib so it plays better with
other ssg based apps.
* MacOS tweaks.
* MSVC tweaks.
New in 0.0.12
* July 19, 2000
* Converted project license from GPL to LGPL.
* Moved low level IO (socket, file, serial) code over to SimGear.
* Moved ephemeral code into simgear
* Moved basic world time code into simgear
* Added a property manager (registry)
* Some documentation added.
New in 0.0.11
* July 3, 2000
* Replaced gdbm with metakit
* Added drop in sky (depends on plib)
* Added spherical course and dist given two points calculations
* MSVC5 fixes
* Math/bucket/tiling tweaks from Norman Vine
New in 0.0.7
* March 29, 2000
* Added support for RedHat package building contributed by Habibie
<habibie@MailandNews.com>
* Added gdbm to SimGear. Many systems will already have gdbm installed so
it is only built if it doesn't already exist on the user's platform.
gdbm is a set of database routines that use extendible hashing and works
similar to the standard UNIX dbm routines. This guarantees the availability
of gdbm to any application that uses SimGear.
* Optimizations and bullet proofing of magnetic variation code by Norman
Vine and Ed Williams
New in 0.0.6
* March 27, 2000
* Added Nima World Magnetic Model 2000 contributed by Ed Williams
* Fixes for MSVC++
New in 0.0.5
* March 17, 2000
* Restructured directory layout to facilitate windows/mac IDE builds.
New in 0.0.4
* Removed mat3.h and friends (we now use plib's sg lib for these sorts of
things.)
New in 0.0.3
* Release that coincides with FlightGear-0.7.2

1
README
View File

@@ -0,0 +1 @@
[ Nothing here at this time. ]

27
README.OSG Normal file
View File

@@ -0,0 +1,27 @@
[This file is mirrored in both the FlightGear and SimGear packages.]
You *must* have OpenSceneGraph (OSG) installed to build this version of
FlightGear.
Notice that FlightGear 1.9.0 requires at least version 2.7.8. Using earlier
versions of OSG will yield serious rendering bugs.
You can get the latest version of OSG from:
http://www.openscenegraph.org/
Build notes:
Unzip the file OpenSceneGraph-x.x.zip and install using the following
commands:
unzip OpenSceneGraph-x.x
cd OpenSceneGraph
ccmake .
[ While running ccmake: press 'c' to configure, press 'c' once more, and
then press 'g' to generate and exit ]
make
sudo make install

29
README.OpenAL Normal file
View File

@@ -0,0 +1,29 @@
[This file is mirrored in both the FlightGear and SimGear packages.]
You *must* have the development components of OpenAL installed on your system
to build FlightGear!" You can get a copy here:
http://connect.creativelabs.com/openal/default.aspx
Build notes:
You can download a versioned release of the openal library from
http://www.openal.org/downloads.html. Download the openal source,
release 0.0.8 (dated February 11, 2006) and run:
tar xjvf openal-soft-1.5.304.tar.bz2
cd openal-soft-1.5.304/
ccmake .
[ While running ccmake: press 'c' to configure, press 'c' once more, and
then press 'g' to generate and exit ]
The alut library is also required, but comes separately in the package
freelut-1.1.0.tar.gz. This package can be downloaded from the same page
(http://connect.creativelabs.com/openal/default.aspx). Download and run:
tar xzvf freelut-1.1.0.tar.gz
cd freealut-1.1.0
./configure
make
sudo make install

32
README.plib Normal file
View File

@@ -0,0 +1,32 @@
[This file is mirrored in both the FlightGear and SimGear packages.]
You *must* have plib version 1.8.5 or later installed on your system
to build FlightGear!" Flight Gear is no longer compatible with the
earlier versions of the library.
You can get the latest version of plib from:
http://plib.sourceforge.net
Build notes:
You should be able to just run "./configure" to configure the package
and use all of plib's defaults. Then run "make" followed by "make
install". By default, plib installs itself into /usr so if you don't
like this, be sure to specify an alternate prefix such as --prefix=/usr/local
As of this writing (2007-11-18), many linux distributions are shipped with a
working version of plib, so chances are that this library is already
installed. It should be noted, that currently plib version no longer compiles
using recent versions of gcc (confirmed on version gcc 4.1.2, as shipped with
SuSe 10.2). As a workaround, it is possible to either use plib SVN. Run the
following commands:
svn co https://plib.svn.sourceforge.net/svnroot/plib/trunk plib
cd plib
./autogen.sh
./configure
make
make install

8
README.zlib Normal file
View File

@@ -0,0 +1,8 @@
zlib is prerequisite for compiling SimGear and FlightGear. You can fetch
the latest version of zlib from:
http://www.zlib.net
Most modern unix distributions (and cygwin) come with a version of zlib
already installed or available to install as a package.

76
SimGear.spec.in Normal file
View File

@@ -0,0 +1,76 @@
%define ver @VERSION@
%define rel 1
%define prefix /usr
Summary: Simulator Construction Gear.
Name: @PACKAGE@
Version: %ver
Release: %rel
Copyright: LGPL
Group: Libraries/Graphics
Source: %{name}-%{version}.tar.gz
#URL:
BuildRoot: /tmp/%{name}-%{version}-%{rel}-root
Packager: Fill In As You Wish
Docdir: %{prefix}/doc
%description
This package contains a tools and libraries useful for constructing
simulation and visualization applications such as FlightGear or TerraGear.
Authors:
N/A
%prep
%setup -n %{name}-%{version}
%build
# Needed for snapshot releases.
if [ ! -f configure ]; then
CFLAGS="$RPM_OPT_FLAGS" ./autogen.sh --prefix=%prefix
else
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%prefix
fi
if [ "$SMP" != "" ]; then
JSMP = '"MAKE=make -k -j $SMP"'
fi
make ${JSMP};
%install
[ -d ${RPM_BUILD_ROOT} ] && rm -rf ${RPM_BUILD_ROOT}
make prefix=${RPM_BUILD_ROOT}%{prefix} install
#
# Generating file lists and store them in file-lists
# Starting with the directory listings
#
find ${RPM_BUILD_ROOT}%{prefix}/{bin,include,lib} -type d | sed "s#^${RPM_BUILD_ROOT}#\%attr (-\,root\,root) \%dir #" > file-lists
%{?ETCDR:find ${RPM_BUILD_ROOT}%{!?SYSCF:%{prefix}}/etc -type d | sed "s#^${RPM_BUILD_ROOT}#\%attr (-\,root\,root) \%dir #" >> file-lists}
#
# Then, the file listings
#
echo "%defattr (-, root, root)" >> file-lists
%{?ETCDR:find ${RPM_BUILD_ROOT}%{!?SYSCF:%{prefix}}/etc/%{name}.conf -type f | sed -e "s#^${RPM_BUILD_ROOT}#%config #g" >> file-lists}
find ${RPM_BUILD_ROOT}%{prefix} -type f | sed -e "s#^${RPM_BUILD_ROOT}##g" >> file-lists
%clean
(cd ..; rm -rf %{name}-%{version} ${RPM_BUILD_ROOT})
%files -f file-lists
%defattr (-, root, root)
%doc AUTHORS
%doc COPYING
%doc ChangeLog
%doc INSTALL
%doc NEWS
%doc README
%doc %{name}.spec.in

1
TODO Normal file
View File

@@ -0,0 +1 @@
03/25/2001 - Resolve location of Sky dome implimentation documentation.

205
Thanks Normal file
View File

@@ -0,0 +1,205 @@
A very special thanks is due to the following people and groups.
Note: as hard as we've tried, it is impossible to perfectly maintain
this file. If you are aware of someone who you think should be
included here, PLEASE let me know. Projects like this are made
possible only by the help and hard work of others. I want to properly
credit everyone who has contributed to this project.
Raul Alonzo <amil@las.es>
Mr. Alonzo is the author of Ssystem and provided his kind permission
for using the moon texture. I also used parts of his code as a template
when adding the texture. Ssystem Homepage can be found at:
http://www1.las.es/~amil/ssystem
Paul Bleisch <pbleisch@acm.org>
Paul redid the "debug" system so that it would be much more flexible,
so it could be easily disabled for production system, and so that
messages for certain subsystems could be selectively enabled.
Also contributed a first stab at a config file/command line parsing
system.
Bernie Bright <bbright@c031.aone.net.au>
Many C++ style, usage, and implementation improvements.
STL portability, tons o' stuff. :-)
Currently trying to get a BeOS port together but life keeps getting
in the way!
Gene Buckle <geneb@deltasoft.com>
Gene has done a lot of work getting FG to compile with the MSVC++
compiler. Also, he has pushed, proded, and bugged me endlessly to
do my stuff right. (I mean that in a good way, because sometimes
when the little nudge in the right direction isn't working, I need
a good hard shove.) :-)
John Check <j4strngs@rockfish.net>
Cloud textures
Jean-Francois Doue
Vector 2D, 3D, 4D and Matrix 3D and 4D inlined C++ classes. (Based on
Graphics Gems IV ed. Paul S. Heckbert)
http://www.animats.com/simpleppp/ftp/public_html/topics/developers.html
Melchior Franz
METAR parser and fetcher. "material" animation (based on Jim Wilsons's
"emission" animation). Debugging and extension of property listener
features. Addition of removeChildren.
Mathias Froehlich
Reworked and cleaned up large parts of the infrastructure, of math
files, animations and rendering in preparation of a transition to
the OSG library. Added new handlers for shared and referenced objects.
Bruce Finney <bfinney@gte.net>
MSVC5 compatibility.
Jean-loup Gailly and Mark Adler <zlib@gzip.org>
Authors of the zlib library. Used for on-the-fly compression and
decompression routines.
http://www.cdrom.com/pub/infozip/zlib/
Thomas Gellekum <tg@ihf.rwth-aachen.de>
Changes and updates for compiling on FreeBSD
Habibie <habibie@MailandNews.com>
RedHat package building changes for SimGear.
Bruce Jackson of NASA <e.b.jackson@larc.nasa.gov>
Developed the LaRCsim code under funding by NASA which we use to provide
the flight model. Bruce has patiently answered my many, many questions.
http://dcb.larc.nasa.gov/www/DCBStaff/ebj/ebj.html
Maik Justus
Fixed an old bug in the SGPropertyNode class.
Richard Kaszeta <bofh@me.umn.edu>
Contributed screen buffer to ppm screen shot routine.
Rich has also helped in the early development of the Flight Gear "altitude
hold autopilot module" by teaching Curt Olson the basics of Control Theory
and helping him code and debug early versions. Curt's "Boss" Bob Hain
also contributed <bob@me.umn.edu>. Further details available at:
http://www.menet.umn.edu/~curt/fgfs/Docs/Autopilot/AltitudeHold/AltitudeHold.html
Rich's Homepage: http://www.menet.umn.edu/~kaszeta
Tom Knienieder <tom@knienieder.com>
Ported Steve's Audio library first to OpenBSD and IRIX and
after that also to Win32
David Megginson <david@megginson.com>
SimGear property manager/registry
Tim Moore
Ported the (chrome) "shader" animation to OSG, and helped with porting
the "material" animation.
Curt Olson http://www.flightgear.org/~curt/
Curt is responsible for overall project and source code management.
He has his hands in many of the areas.
Petter Reinholdtsen <pere@games.no>
Incorporated the Gnu automake/autoconf system (with libtool).
This should streamline and standardize the build process for all
Unix-like platforms. It should have little effect on IDE type
environments since these don't use the Unix make system.
Paul Schlyter <pausch@saaf.se>
Mr. Schlyter provided Durk Talsma with all the information
he needed to write the astro code. Mr. S. is also willing
to answer astro-related questions whenever one needs to.
http://welcome.to/pausch
Durk Talsma <d.talsma@chello.nl>
Accurate Sun, Moon, and Planets.
Sun changes color based on position in sky.
Moon has correct phase and blends well into the sky.
Planets are correctly positioned and have proper magnitude.
Added time zone support in the SGTime class.
Help with time functions, gui, and other misc stuff.
http://people.a2000.nl/dtals
Mark Vallevand <Mark.Vallevand@UNISYS.com>
Contributed some METAR parsing code.
Contributed some win32 screen printing routines.
Gary R. Van Sickle <tiberius@braemarinc.com>
Contributed some initial GameGLUT support and other fixes.
Has done some interesting preliminary work on a binary file format
http://www.woodsoup.org/projs/ORKiD/fgfs.htm
Has set up a 'Cygwin Tips' site that has been very helpful to many
people in getting a Cygwin Unix-on-Windows build environment set up
so they can build FG effectively.
http://www.woodsoup.org/projs/ORKiD/cygwin.htm
Norman Vine <nhv@yahoo.com>
Provided more than uncountable URL's to the "FlightGear Community".
Many performance optimizations throughout the code.
Lots of windoze related contributions.
Contributed wgs84 distance and course routines.
Contributed a great circle route autopilot mode based on wgs84 routines.
Ed Williams <Ed_Williams@compuserve.com>
Contributed magnetic variation code (impliments Nima WMM 2000)
We've also borrowed from Ed's wonderful aviation formulary at various
times as well.
http://www.best.com/~williams/index.html
Jean-Claude Wippler <jcw@equi4.com>
Author of MetaKit - a portable, embeddible database with a portable
data file format. This software is not GPL'd but the author is kindly
allowing us to bundle MetaKit with our code. MetaKit has a liberal
X/MIT-style license. Please see the following URL for more info:
http://www.equi4.com/metakit
WoodSoup Project http://www.woodsoup.org
Provided computing resources and services so that the Flight Gear
project could have real home. This includes, web services,
ftp services, shell accounts, email lists, dns services, etc.
Robert Allan Zeh <raz@cmg.FCNBD.COM>
Helped me tremendously in figuring out the Cygnus win32 compiler and
how to link with .dll's. With out him the first runable win32
version of FG would have been impossible.
NOTE:
----
THIS DOCUMENT WAS INITIALLY WRITTEN BY
Curt L. Olson <http://www.flightgear.org/~curt>
05 Jul 2000 Removed non-SimGear entries (CLO)
08 Mar 2000 CONTENTS RESEARCHED AND UPDATED by
Oliver Delise <delise@mail.isis.de>

View File

@@ -1 +0,0 @@
@VERSION@

View File

@@ -1,324 +0,0 @@
/* acconfig.h
This file is in the public domain.
Descriptive text for the C preprocessor macros that
the distributed Autoconf macros can define.
No software package will use all of them; autoheader copies the ones
your configure.in uses into your configuration header file templates.
The entries are in sort -df order: alphabetical, case insensitive,
ignoring punctuation (such as underscores). Although this order
can split up related entries, it makes it easier to check whether
a given entry is in the file.
Leave the following blank line there!! Autoheader needs it. */
/* Define if on AIX 3.
System headers sometimes define this.
We just want to avoid a redefinition error message. */
#ifndef _ALL_SOURCE
#undef _ALL_SOURCE
#endif
/* Define if using alloca.c. */
#undef C_ALLOCA
/* Define if type char is unsigned and you are not using gcc. */
#ifndef __CHAR_UNSIGNED__
#undef __CHAR_UNSIGNED__
#endif
/* Define if the closedir function returns void instead of int. */
#undef CLOSEDIR_VOID
/* Define to empty if the keyword does not work. */
#undef const
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
This function is required for alloca.c support on those systems. */
#undef CRAY_STACKSEG_END
/* Define for DGUX with <sys/dg_sys_info.h>. */
#undef DGUX
/* Define if you have <dirent.h>. */
#undef DIRENT
/* Define to enable audio support */
#undef ENABLE_AUDIO_SUPPORT
/* Define to enable GLUT joystick support (limited to 3 axes) */
#undef ENABLE_GLUT_JOYSTICK
/* Define to enable plib joystick support (recommended) */
#undef ENABLE_PLIB_JOYSTICK
/* Define to eliminate all trace of debugging messages such as for a
release build */
#undef FG_NDEBUG
/* Define to include Oliver's networking support */
#undef FG_NETWORK_OLK
/* Define to avoid Christian's new weather code */
#undef FG_OLD_WEATHER
/* Define if we are building FGFS (should always be defined) */
#undef FGFS
/* Define to enable 3dfx/glide render in a window hack under unix.
This probably won't work under windows. */
#undef XMESA
#undef FX
/* Define to the type of elements in the array set by `getgroups'.
Usually this is either `int' or `gid_t'. */
#undef GETGROUPS_T
/* Define if the `getloadavg' function needs to be run setuid or setgid. */
#undef GETLOADAVG_PRIVILEGED
/* Define if the `getpgrp' function takes no argument. */
#undef GETPGRP_VOID
/* Define to `int' if <sys/types.h> doesn't define. */
#undef gid_t
/* Define if you have alloca, as a function or macro. */
#undef HAVE_ALLOCA
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
#undef HAVE_ALLOCA_H
/* Define if you external variables daylight. */
#undef HAVE_DAYLIGHT
/* Define if you don't have vprintf but do have _doprnt. */
#undef HAVE_DOPRNT
/* Define if your system has a working fnmatch function. */
#undef HAVE_FNMATCH
/* Define if your system has its own `getloadavg' function. */
#undef HAVE_GETLOADAVG
/* Define if you have getrusage() */
#undef HAVE_GETRUSAGE
/* Define if you have the getmntent function. */
#undef HAVE_GETMNTENT
/* Define if you have the gpc library and headers installed. */
#undef HAVE_GPC_H
/* Define if the `long double' type works. */
#undef HAVE_LONG_DOUBLE
/* Define if you support file names longer than 14 characters. */
#undef HAVE_LONG_FILE_NAMES
/* Define if you have a working `mmap' system call. */
#undef HAVE_MMAP
/* Define if system calls automatically restart after interruption
by a signal. */
#undef HAVE_RESTARTABLE_SYSCALLS
/* Define if you have rint() which rounds to closest int but returns
result as a double data type. */
#undef HAVE_RINT
/* Define if your struct stat has st_blksize. */
#undef HAVE_ST_BLKSIZE
/* Define if your struct stat has st_blocks. */
#undef HAVE_ST_BLOCKS
/* Define if you have the strcoll function and it is properly defined. */
#undef HAVE_STRCOLL
/* Define if your struct stat has st_rdev. */
#undef HAVE_ST_RDEV
/* Define if you have the strftime function. */
#undef HAVE_STRFTIME
/* Define if you have <sys/param.h> */
#undef HAVE_SYS_PARAM_H
/* Define if you have <sys/stat.h> that is POSIX.1 compatible. */
#undef HAVE_SYS_STAT_H
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
#undef HAVE_SYS_WAIT_H
/* Define if you have timegm() */
#undef HAVE_TIMEGM
/* Define if you external variables timezone. */
#undef HAVE_TIMEZONE
/* Define if your struct tm has tm_zone. */
#undef HAVE_TM_ZONE
/* Define if you don't have tm_zone but do have the external array
tzname. */
#undef HAVE_TZNAME
/* Define if you have <unistd.h>. */
#undef HAVE_UNISTD_H
/* Define if utime(file, NULL) sets file's timestamp to the present. */
#undef HAVE_UTIME_NULL
/* Define if you have <vfork.h>. */
#undef HAVE_VFORK_H
/* Define if you have the vprintf function. */
#undef HAVE_VPRINTF
/* Define if you have the wait3 system call. */
#undef HAVE_WAIT3
/* Define as __inline if that's what the C compiler calls it. */
#undef inline
/* Define if int is 16 bits instead of 32. */
#undef INT_16_BITS
/* Define if long int is 64 bits. */
#undef LONG_64_BITS
/* Define if major, minor, and makedev are declared in <mkdev.h>. */
#undef MAJOR_IN_MKDEV
/* Define if major, minor, and makedev are declared in <sysmacros.h>. */
#undef MAJOR_IN_SYSMACROS
/* Define if on MINIX. */
#undef _MINIX
/* Define to `int' if <sys/types.h> doesn't define. */
#undef mode_t
/* Define if you don't have <dirent.h>, but have <ndir.h>. */
#undef NDIR
/* Define if you have <memory.h>, and <string.h> doesn't declare the
mem* functions. */
#undef NEED_MEMORY_H
/* Define if your struct nlist has an n_un member. */
#undef NLIST_NAME_UNION
/* Define if you have <nlist.h>. */
#undef NLIST_STRUCT
/* Define if your C compiler doesn't accept -c and -o together. */
#undef NO_MINUS_C_MINUS_O
/* Define to `long' if <sys/types.h> doesn't define. */
#undef off_t
/* Define to package name */
#undef PACKAGE
/* Define to `int' if <sys/types.h> doesn't define. */
#undef pid_t
/* Define if the system does not provide POSIX.1 features except
with this defined. */
#undef _POSIX_1_SOURCE
/* Define if you need to in order for stat and other things to work. */
#undef _POSIX_SOURCE
/* Define as the return type of signal handlers (int or void). */
#undef RETSIGTYPE
/* Define if the `setpgrp' function takes no argument. */
#undef SETPGRP_VOID
/* Define if the setvbuf function takes the buffering type as its second
argument and the buffer pointer as the third, as on System V
before release 3. */
#undef SETVBUF_REVERSED
/* Define to `unsigned' if <sys/types.h> doesn't define. */
#undef size_t
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown
*/
#undef STACK_DIRECTION
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
#undef STAT_MACROS_BROKEN
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define on System V Release 4. */
#undef SVR4
/* Define if you don't have <dirent.h>, but have <sys/dir.h>. */
#undef SYSDIR
/* Define if you don't have <dirent.h>, but have <sys/ndir.h>. */
#undef SYSNDIR
/* Define if `sys_siglist' is declared by <signal.h>. */
#undef SYS_SIGLIST_DECLARED
/* Define if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
/* Define if your <sys/time.h> declares struct tm. */
#undef TM_IN_SYS_TIME
/* Define to `int' if <sys/types.h> doesn't define. */
#undef uid_t
/* Define for Encore UMAX. */
#undef UMAX
/* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
instead of <sys/cpustats.h>. */
#undef UMAX4_3
/* Define if you do not have <strings.h>, index, bzero, etc.. */
#undef USG
/* Define to version number */
#undef VERSION
/* Define vfork as fork if vfork does not work. */
#undef vfork
/* Define if the closedir function returns void instead of int. */
#undef VOID_CLOSEDIR
/* Define if compiling on a Winbloze (95, NT, etc.) platform */
#undef WIN32
/* Define if your processor stores words with the most significant
byte first (like Motorola and SPARC, unlike Intel and VAX). */
#undef WORDS_BIGENDIAN
/* Define if the X Window System is missing or not being used. */
#undef X_DISPLAY_MISSING
/* Define if lex declares yytext as a char * by default, not a char[]. */
#undef YYTEXT_POINTER
/* Leave that blank line there!! Autoheader needs it.
If you're adding to this file, keep in mind:
The entries are in sort -df order: alphabetical, case insensitive,
ignoring punctuation (such as underscores). */

706
acinclude.m4 Normal file
View File

@@ -0,0 +1,706 @@
dnl
dnl originally from ncftp 2.3.0
dnl added wi_EXTRA_PDIR and wi_ANSI_C
dnl $Id$
dnl
AC_DEFUN([wi_EXTRA_IDIR], [
incdir="$1"
if test -r $incdir ; then
already=""
for CPPflag in $CPPFLAGS ; do
if test "_$CPPflag" = "_-I${incdir}" ; then
already=yes
break
fi
done
if test -n "$already" ; then
echo " + already had -I$incdir" 1>&AS_MESSAGE_LOG_FD
else
if test "$CPPFLAGS" = "" ; then
CPPFLAGS="-I$incdir"
else
CPPFLAGS="$CPPFLAGS -I$incdir"
fi
echo " + added -I$incdir" 1>&AS_MESSAGE_LOG_FD
fi
else
echo " + IDIR is not accessible: '$myincdir'" 1>&AS_MESSAGE_LOG_FD
fi
])
dnl
dnl
dnl
dnl
AC_DEFUN([wi_EXTRA_LDIR], [
mylibdir="$1"
if test -r $mylibdir ; then
already=""
for LDflag in $LDFLAGS ; do
if test "_$LDflag" = "_-L${mylibdir}" ; then
already=yes
break
fi
done
if test -n "$already" ; then
echo " + already had -L$mylibdir" 1>&AS_MESSAGE_LOG_FD
else
if test "$LDFLAGS" = "" ; then
LDFLAGS="-L$mylibdir"
else
LDFLAGS="$LDFLAGS -L$mylibdir"
fi
echo " + added -L$mylibdir" 1>&AS_MESSAGE_LOG_FD
fi
else
echo " + LDIR is not accessible: '$mylibdir'" 1>&AS_MESSAGE_LOG_FD
fi
])
dnl
dnl __FP__
dnl
dnl
AC_DEFUN([wi_EXTRA_PDIR], [
progdir="$1"
if test -r $progdir ; then
case ":$PATH:" in
*:${progdir}:*)
echo " + already had $progdir in \$PATH" 1>&AS_MESSAGE_LOG_FD
;;
*)
if test "$PATH" = "" ; then
PATH="$progdir"
else
PATH="$PATH:$progdir"
fi
echo " + appended $progdir to \$PATH" 1>&AS_MESSAGE_LOG_FD
;;
esac
else
echo " + PDIR is not accessible: '$progdir'" 1>&AS_MESSAGE_LOG_FD
fi
])
dnl
dnl
dnl If you want to also look for include and lib subdirectories in the
dnl $HOME tree, you supply "yes" as the first argument to this macro.
dnl
dnl If you want to look for subdirectories in include/lib directories,
dnl you pass the names in argument 3, otherwise pass a dash.
dnl
AC_DEFUN([wi_EXTRA_DIRS], [echo "checking for extra include and lib directories..." 1>&6
ifelse([$1], yes, [dnl
b1=`cd .. ; pwd`
b2=`cd ../.. ; pwd`
exdirs="$HOME $j $b1 $b2 $prefix $2"
],[dnl
exdirs="$prefix $2"
])
subexdirs="$3"
if test "$subexdirs" = "" ; then
subexdirs="-"
fi
for subexdir in $subexdirs ; do
if test "$subexdir" = "-" ; then
subexdir=""
else
subexdir="/$subexdir"
fi
for exdir in $exdirs ; do
if test "$exdir" != "/usr" || test "$subexdir" != ""; then
incdir="${exdir}/include${subexdir}"
wi_EXTRA_IDIR($incdir)
dnl On 64-bit machines, if lib64/ exists and is not identical to lib/
dnl then it should be listed here, listed ahead of lib/.
mylibdir64="${exdir}/lib64${subexdir}"
mylibdir32="${exdir}/lib${subexdir}"
if test "x86_64" = $(uname -m) \
-a ! ${mylibdir64} -ef ${mylibdir32} ; then
wi_EXTRA_LDIR($mylibdir64)
fi
wi_EXTRA_LDIR($mylibdir32)
progdir="${exdir}/bin${subexdir}"
wi_EXTRA_PDIR($progdir)
fi
done
done
])
dnl
dnl
dnl
AC_DEFUN([wi_HPUX_CFLAGS],
[AC_MSG_CHECKING(if HP-UX ansi C compiler flags are needed)
AC_REQUIRE([AC_PROG_CC])
os=`uname -s | tr '[A-Z]' '[a-z]'`
ac_cv_hpux_flags=no
if test "$os" = hp-ux ; then
if test "$ac_cv_prog_gcc" = yes ; then
if test "$CFLAGS" != "" ; then
# Shouldn't be in there.
CFLAGS=`echo "$CFLAGS" | sed 's/-Aa//g'`
fi
else
# If you're not using gcc, then you better have a cc/c89
# that is usable. If you have the barebones compiler, it
# won't work. The good compiler uses -Aa for the ANSI
# compatible stuff.
x=`echo $CFLAGS | grep 'Aa' 2>/dev/null`
if test "$x" = "" ; then
CFLAGS="$CFLAGS -Aa"
fi
ac_cv_hpux_flags=yes
fi
# Also add _HPUX_SOURCE to get the extended namespace.
x=`echo $CFLAGS | grep '_HPUX_SOURCE' 2>/dev/null`
if test "$x" = "" ; then
CFLAGS="$CFLAGS -D_HPUX_SOURCE"
fi
fi
AC_MSG_RESULT($ac_cv_hpux_flags)
])
dnl
dnl
dnl
AC_DEFUN([wi_CFLAGS], [AC_REQUIRE([AC_PROG_CC])
wi_HPUX_CFLAGS
if test "$CFLAGS" = "" ; then
CFLAGS="-O"
elif test "$ac_cv_prog_gcc" = "yes" ; then
case "$CFLAGS" in
*"-g -O"*)
#echo "using -g as default gcc CFLAGS" 1>&6
CFLAGS=`echo $CFLAGS | sed 's/-g\ -O/-O/'`
;;
*"-O -g"*)
# Leave the -g, but remove all -O options.
#echo "using -g as default gcc CFLAGS" 1>&6
CFLAGS=`echo $CFLAGS | sed 's/-O\ -g/-O/'`
;;
esac
fi
])
dnl
dnl
dnl
AC_DEFUN([wi_PROTOTYPES], [
AC_MSG_CHECKING(if the compiler supports function prototypes)
AC_TRY_COMPILE(,[extern void exit(int status);],[wi_cv_prototypes=yes
AC_DEFINE(PROTOTYPES)],wi_cv_prototypes=no)
AC_MSG_RESULT($wi_cv_prototypes)
])
dnl
dnl
dnl
AC_DEFUN([wi_ANSI_C], [
AC_MSG_CHECKING(ANSI-style function definitions)
AC_TRY_COMPILE(,[int blubb(int x) { return 0; }],[wi_cv_ansi_funcs=yes
AC_DEFINE(ANSI_FUNCS)],wi_cv_ansi_funcs=no)
AC_MSG_RESULT($wi_cv_ansi_funcs)
])
dnl
dnl
dnl
AC_DEFUN([wi_HEADER_SYS_SELECT_H], [
# See if <sys/select.h> is includable after <sys/time.h>
if test "$ac_cv_header_sys_time_h" = no ; then
AC_CHECK_HEADERS(sys/time.h sys/select.h)
else
AC_CHECK_HEADERS(sys/select.h)
fi
if test "$ac_cv_header_sys_select_h" = yes ; then
AC_MSG_CHECKING([if <sys/select.h> is compatible with <sys/time.h>])
selecth=yes
if test "$ac_cv_header_sys_time_h" = yes ; then
AC_TRY_COMPILE([#include <sys/time.h>
#include <sys/select.h>],[
fd_set a;
struct timeval tmval;
tmval.tv_sec = 0;],selecth=yes,selecth=no)
if test "$selecth" = yes ; then
AC_DEFINE(CAN_USE_SYS_SELECT_H)
fi
fi
AC_MSG_RESULT($selecth)
fi
])
dnl
dnl
dnl
AC_DEFUN([wi_LIB_RESOLV], [
# See if we could access two well-known sites without help of any special
# libraries, like resolv.
AC_TRY_RUN([
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
main()
{
struct hostent *hp1, *hp2;
int result;
hp1 = gethostbyname("gatekeeper.dec.com");
hp2 = gethostbyname("ftp.ncsa.uiuc.edu");
result = ((hp1 != (struct hostent *) 0) && (hp2 != (struct hostent *) 0));
exit(! result);
}],look_for_resolv=no,look_for_resolv=yes,look_for_resolv=yes)
AC_MSG_CHECKING([if we need to look for -lresolv])
AC_MSG_RESULT($look_for_resolv)
if test "$look_for_resolv" = yes ; then
AC_CHECK_LIB(resolv,main)
else
ac_cv_lib_resolv=no
fi
])
dnl
dnl
dnl
AC_DEFUN([wi_LIB_NSL], [
AC_MSG_CHECKING(if we can use -lnsl)
ac_save_LIBS="$LIBS";
LIBS="$LIBS -lnsl";
AC_CACHE_VAL(r_cv_use_libnsl, [
AC_TRY_RUN(
main() { if (getpwuid(getuid())) exit(0); exit(-1); },
nc_cv_use_libnsl=yes, nc_cv_use_libnsl=no, nc_cv_use_libnsl=no)
])
if test "$nc_cv_use_libnsl" = "no"; then LIBS="$ac_save_LIBS"; fi
AC_MSG_RESULT($nc_cv_use_libnsl)
])dnl
dnl
dnl
dnl
AC_DEFUN([nc_PATH_PROG_ZCAT], [
AC_PATH_PROG(GZCAT,gzcat)
AC_PATH_PROG(ZCAT,zcat)
if test "x$GZCAT" = x ; then
if test "x$ZCAT" != x ; then
# See if zcat is really gzcat. gzcat has a --version option, regular
# zcat does not.
AC_MSG_CHECKING(if zcat is really gzcat in disguise)
if $ZCAT --version 2> /dev/null ; then
AC_DEFINE_UNQUOTED(GZCAT, "$ZCAT")
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
fi
else
AC_DEFINE_UNQUOTED(GZCAT, "$GZCAT")
fi
if test "x$ZCAT" != x ; then
AC_DEFINE_UNQUOTED(ZCAT, "$ZCAT")
fi
])
dnl
dnl
dnl
AC_DEFUN([wi_SYSV_EXTRA_DIRS], [
# Use System V because their curses extensions are required. This must
# be done early so we use the -I and -L in the library checks also.
# This is mostly a Solaris/SunOS hack. Note that doing this will also
# use all of the other System V libraries and headers.
AC_MSG_CHECKING(for alternative System V libraries)
if test -f /usr/5include/curses.h ; then
CPPFLAGS="$CPPFLAGS -I/usr/5include"
LDFLAGS="$LDFLAGS -L/usr/5lib"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
])
dnl
dnl
dnl
AC_DEFUN([wi_DEFINE_UNAME], [
# Get first 127 chars of all uname information. Some folks have
# way too much stuff there, so grab only the first 127.
unam=`uname -a 2>/dev/null | cut -c1-127`
if test "$unam" != "" ; then
AC_DEFINE_UNQUOTED(UNAME, "$unam")
fi
])
dnl
dnl
dnl
AC_DEFUN([wi_READLINE_WITH_NCURSES], [
# Readline and Ncurses could both define "backspace".
# Warn about this if we have both things in our definitions list.
if test "$ac_cv_lib_readline" = yes && test "$ac_cv_lib_ncurses" = yes ; then
AC_MSG_CHECKING(if readline and ncurses will link together)
j="$LIBS"
LIBS="-lreadline -lncurses"
AC_TRY_LINK(,[
readline("prompt");
endwin();
],k=yes,k=no)
if test "$k" = no ; then
AC_MSG_RESULT(no)
# Remove '-lreadline' from LIBS.
LIBS=`echo $j | sed s/-lreadline//g`
ac_cv_lib_readline=no
AC_WARN([The versions of GNU readline and ncurses you have installed on this system
can't be used together, because they use the same symbol, backspace. If
possible, recompile one of the libraries with -Dbackspace=back_space, then
re-run configure.])
else
AC_MSG_RESULT(yes)
LIBS="$j"
fi
fi
])
dnl
dnl
dnl
dnl AC_EXT_DAYLIGHT
dnl Check for an external variable daylight. Stolen from w3c-libwww.
AC_DEFUN([AC_EXT_DAYLIGHT],
[ AC_MSG_CHECKING(int daylight variable)
AC_TRY_COMPILE([#include <time.h>], [return daylight;],
have_daylight=yes,
have_daylight=no)
AC_MSG_RESULT($have_daylight)
])dnl
dnl AC_EXT_TIMEZONE
dnl Check for an external variable timezone. Stolen from tcl-8.0.
AC_DEFUN([AC_EXT_TIMEZONE],
[
#
# Its important to include time.h in this check, as some systems (like convex)
# have timezone functions, etc.
#
have_timezone=no
AC_MSG_CHECKING([long timezone variable])
AC_TRY_COMPILE([#include <time.h>],
[extern long timezone;
timezone += 1;
exit (0);],
[have_timezone=yes
AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no))
#
# On some systems (eg IRIX 6.2), timezone is a time_t and not a long.
#
if test "$have_timezone" = no; then
AC_MSG_CHECKING([time_t timezone variable])
AC_TRY_COMPILE([#include <time.h>],
[extern time_t timezone;
timezone += 1;
exit (0);],
[have_timezone=yes
AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no))
fi
])dnl
## AC_BZ_SET_COMPILER: Addition by Theodore Papadopoulo
## Patch by Jim McKelvey: change sed -e 's/ /@/g' to sed -e 's/ /@/'
AC_DEFUN([AC_SG_SET_COMPILER],
[cxxwith=`echo $1 | sed -e 's/ /@/'`
case "$cxxwith" in
*:*@*) # Full initialization syntax
CXX=`echo "$cxxwith" | sed -n -e 's/.*:\(.*\)@.*/\1/p'`
CXXFLAGS=`echo "$cxxwith" | sed -n -e 's/.*:.*@\(.*\)/\1/p'`
;;
*:*) # Simple initialization syntax
CXX=`echo "$cxxwith" | sed -n -e 's/.*:\(.*\)/\1/p'`
CXXFLAGS=$3
;;
*) # Default values
CXX=$2
CXXFLAGS=$3
CC="$2 --c"
## CFLAGS=
;;
esac])
pushdef([AC_PROG_INSTALL],
[
dnl our own version, testing for a -p flag
popdef([AC_PROG_INSTALL])
dnl as AC_PROG_INSTALL works as it works we first have
dnl to save if the user didn't specify INSTALL, as the
dnl autoconf one overwrites INSTALL and we have no chance to find
dnl out afterwards
AC_PROG_INSTALL
# OK, user hasn't given any INSTALL, autoconf found one for us
# now we test, if it supports the -p flag
AC_MSG_CHECKING(for -p flag to install)
rm -f confinst.$$.* > /dev/null 2>&1
echo "Testtest" > confinst.$$.orig
ac_res=no
if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
if test -f confinst.$$.new ; then
# OK, -p seems to do no harm to install
INSTALL="${INSTALL} -p"
ac_res=yes
fi
fi
rm -f confinst.$$.*
AC_MSG_RESULT($ac_res)
dnl the following tries to resolve some signs and wonders coming up
dnl with different autoconf/automake versions
dnl e.g.:
dnl *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s
dnl and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS)
dnl it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s
dnl *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has
dnl INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the
dnl install-@DIR@PROGRAMS targets to explicitly use that flag
dnl *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as
dnl INSTALL_SCRIPT, which breaks with automake <= 1.4
dnl *autoconf >2.13 (since 10.Apr 1999) has not that failure
dnl to clean up that mess we:
dnl +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG
dnl which cleans KDE's program with automake > 1.4;
dnl +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems
dnl with automake<=1.4
dnl note that dues to this sometimes two '-s' flags are used
INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
INSTALL_SCRIPT='${INSTALL}'
])dnl
# ===========================================================================
# http://autoconf-archive.cryp.to/ax_boost_base.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_BOOST_BASE([MINIMUM-VERSION])
#
# DESCRIPTION
#
# Test for the Boost C++ libraries of a particular version (or newer)
#
# If no path to the installed boost library is given the macro searchs
# under /usr, /usr/local, /opt and /opt/local and evaluates the
# $BOOST_ROOT environment variable. Further documentation is available at
# <http://randspringer.de/boost/index.html>.
#
# This macro calls:
#
# AC_SUBST(BOOST_CPPFLAGS) / AC_SUBST(BOOST_LDFLAGS)
#
# And sets:
#
# HAVE_BOOST
#
# LAST MODIFICATION
#
# 2008-04-12
#
# COPYLEFT
#
# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved.
AC_DEFUN([AX_BOOST_BASE],
[
AC_ARG_WITH([boost],
AS_HELP_STRING([--with-boost@<:@=DIR@:>@], [use boost (default is yes) - it is possible to specify the root directory for boost (optional)]),
[
if test "$withval" = "no"; then
want_boost="no"
elif test "$withval" = "yes"; then
want_boost="yes"
ac_boost_path=""
else
want_boost="yes"
ac_boost_path="$withval"
fi
],
[want_boost="yes"])
AC_ARG_WITH([boost-libdir],
AS_HELP_STRING([--with-boost-libdir=LIB_DIR],
[Force given directory for boost libraries. Note that this will overwrite library path detection, so use this parameter only if default library detection fails and you know exactly where your boost libraries are located.]),
[
if test -d $withval
then
ac_boost_lib_path="$withval"
else
AC_MSG_ERROR(--with-boost-libdir expected directory name)
fi
],
[ac_boost_lib_path=""]
)
if test "x$want_boost" = "xyes"; then
boost_lib_version_req=ifelse([$1], ,1.20.0,$1)
boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'`
boost_lib_version_req_major=`expr $boost_lib_version_req : '\([[0-9]]*\)'`
boost_lib_version_req_minor=`expr $boost_lib_version_req : '[[0-9]]*\.\([[0-9]]*\)'`
boost_lib_version_req_sub_minor=`expr $boost_lib_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
if test "x$boost_lib_version_req_sub_minor" = "x" ; then
boost_lib_version_req_sub_minor="0"
fi
WANT_BOOST_VERSION=`expr $boost_lib_version_req_major \* 100000 \+ $boost_lib_version_req_minor \* 100 \+ $boost_lib_version_req_sub_minor`
AC_MSG_CHECKING(for boostlib >= $boost_lib_version_req)
succeeded=no
dnl first we check the system location for boost libraries
dnl this location ist chosen if boost libraries are installed with the --layout=system option
dnl or if you install boost with RPM
if test "$ac_boost_path" != ""; then
BOOST_LDFLAGS="-L$ac_boost_path/lib"
BOOST_CPPFLAGS="-I$ac_boost_path/include"
else
for ac_boost_path_tmp in /usr /usr/local /opt /opt/local ; do
if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then
BOOST_LDFLAGS="-L$ac_boost_path_tmp/lib"
BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include"
break;
fi
done
fi
dnl overwrite ld flags if we have required special directory with
dnl --with-boost-libdir parameter
if test "$ac_boost_lib_path" != ""; then
BOOST_LDFLAGS="-L$ac_boost_lib_path"
fi
CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
export CPPFLAGS
LDFLAGS_SAVED="$LDFLAGS"
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
export LDFLAGS
AC_LANG_PUSH(C++)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
@%:@include <boost/version.hpp>
]], [[
#if BOOST_VERSION >= $WANT_BOOST_VERSION
// Everything is okay
#else
# error Boost version is too old
#endif
]])],[
AC_MSG_RESULT(yes)
succeeded=yes
found_system=yes
],[
])
AC_LANG_POP([C++])
dnl if we found no boost with system layout we search for boost libraries
dnl built and installed without the --layout=system option or for a staged(not installed) version
if test "x$succeeded" != "xyes"; then
_version=0
if test "$ac_boost_path" != ""; then
if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
_version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
V_CHECK=`expr $_version_tmp \> $_version`
if test "$V_CHECK" = "1" ; then
_version=$_version_tmp
fi
VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
BOOST_CPPFLAGS="-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE"
done
fi
else
for ac_boost_path in /usr /usr/local /opt /opt/local ; do
if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
_version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
V_CHECK=`expr $_version_tmp \> $_version`
if test "$V_CHECK" = "1" ; then
_version=$_version_tmp
best_path=$ac_boost_path
fi
done
fi
done
VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE"
if test "$ac_boost_lib_path" = ""
then
BOOST_LDFLAGS="-L$best_path/lib"
fi
if test "x$BOOST_ROOT" != "x"; then
if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/lib" && test -r "$BOOST_ROOT/stage/lib"; then
version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'`
stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'`
stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'`
V_CHECK=`expr $stage_version_shorten \>\= $_version`
if test "$V_CHECK" = "1" -a "$ac_boost_lib_path" = "" ; then
AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT)
BOOST_CPPFLAGS="-I$BOOST_ROOT"
BOOST_LDFLAGS="-L$BOOST_ROOT/stage/lib"
fi
fi
fi
fi
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
export CPPFLAGS
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
export LDFLAGS
AC_LANG_PUSH(C++)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
@%:@include <boost/version.hpp>
]], [[
#if BOOST_VERSION >= $WANT_BOOST_VERSION
// Everything is okay
#else
# error Boost version is too old
#endif
]])],[
AC_MSG_RESULT(yes)
succeeded=yes
found_system=yes
],[
])
AC_LANG_POP([C++])
fi
if test "$succeeded" != "yes" ; then
if test "$_version" = "0" ; then
AC_MSG_ERROR([[We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.]])
else
AC_MSG_ERROR([Your boost libraries seems to old (version $_version).])
fi
else
AC_SUBST(BOOST_CPPFLAGS)
AC_SUBST(BOOST_LDFLAGS)
AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available])
fi
CPPFLAGS="$CPPFLAGS_SAVED"
LDFLAGS="$LDFLAGS_SAVED"
fi
])

149
aclocal.m4 vendored
View File

@@ -1,149 +0,0 @@
dnl aclocal.m4 generated automatically by aclocal 1.3
dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
dnl This Makefile.in is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
dnl PARTICULAR PURPOSE.
# Do all the work for Automake. This macro actually does too much --
# some checks are only needed if your package does certain things.
# But this isn't really a big deal.
# serial 1
dnl Usage:
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
AC_DEFUN(AM_INIT_AUTOMAKE,
[AC_REQUIRE([AM_PROG_INSTALL])
PACKAGE=[$1]
AC_SUBST(PACKAGE)
VERSION=[$2]
AC_SUBST(VERSION)
dnl test to see if srcdir already configured
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
ifelse([$3],,
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
AC_REQUIRE([AM_SANITY_CHECK])
AC_REQUIRE([AC_ARG_PROGRAM])
dnl FIXME This is truly gross.
missing_dir=`cd $ac_aux_dir && pwd`
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
AC_REQUIRE([AC_PROG_MAKE_SET])])
# serial 1
AC_DEFUN(AM_PROG_INSTALL,
[AC_REQUIRE([AC_PROG_INSTALL])
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
AC_SUBST(INSTALL_SCRIPT)dnl
])
#
# Check to make sure that the build environment is sane.
#
AC_DEFUN(AM_SANITY_CHECK,
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
echo timestamp > conftestfile
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
if test "[$]*" = "X"; then
# -L didn't work.
set X `ls -t $srcdir/configure conftestfile`
fi
if test "[$]*" != "X $srcdir/configure conftestfile" \
&& test "[$]*" != "X conftestfile $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
alias in your environment])
fi
test "[$]2" = conftestfile
)
then
# Ok.
:
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
rm -f conftest*
AC_MSG_RESULT(yes)])
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
dnl The program must properly implement --version.
AC_DEFUN(AM_MISSING_PROG,
[AC_MSG_CHECKING(for working $2)
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
if ($2 --version) < /dev/null > /dev/null 2>&1; then
$1=$2
AC_MSG_RESULT(found)
else
$1="$3/missing $2"
AC_MSG_RESULT(missing)
fi
AC_SUBST($1)])
# Define a conditional.
AC_DEFUN(AM_CONDITIONAL,
[AC_SUBST($1_TRUE)
AC_SUBST($1_FALSE)
if $2; then
$1_TRUE=
$1_FALSE='#'
else
$1_TRUE='#'
$1_FALSE=
fi])
# Like AC_CONFIG_HEADER, but automatically create stamp file.
AC_DEFUN(AM_CONFIG_HEADER,
[AC_PREREQ([2.12])
AC_CONFIG_HEADER([$1])
dnl When config.status generates a header, we must update the stamp-h file.
dnl This file resides in the same directory as the config header
dnl that is generated. We must strip everything past the first ":",
dnl and everything past the last "/".
AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
<<am_indx=1
for am_file in <<$1>>; do
case " <<$>>CONFIG_HEADERS " in
*" <<$>>am_file "*<<)>>
echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
;;
esac
am_indx=`expr "<<$>>am_indx" + 1`
done<<>>dnl>>)
changequote([,]))])

394
acsite.m4
View File

@@ -1,394 +0,0 @@
dnl
dnl originally from ncftp 2.3.0
dnl added wi_EXTRA_PDIR and wi_ANSI_C
dnl $Id$
dnl
AC_DEFUN(wi_EXTRA_IDIR, [
incdir="$1"
if test -r $incdir ; then
case "$CPPFLAGS" in
*-I${incdir}*)
# echo " + already had $incdir" 1>&6
;;
*)
if test "$CPPFLAGS" = "" ; then
CPPFLAGS="-I$incdir"
else
CPPFLAGS="$CPPFLAGS -I$incdir"
fi
echo " + found $incdir" 1>&6
;;
esac
fi
])
dnl
dnl
dnl
dnl
AC_DEFUN(wi_EXTRA_LDIR, [
mylibdir="$1"
if test -r $mylibdir ; then
case "$LDFLAGS" in
*-L${mylibdir}*)
# echo " + already had $mylibdir" 1>&6
;;
*)
if test "$LDFLAGS" = "" ; then
LDFLAGS="-L$mylibdir"
else
LDFLAGS="$LDFLAGS -L$mylibdir"
fi
echo " + found $mylibdir" 1>&6
;;
esac
fi
])
dnl
dnl __FP__
dnl
dnl
AC_DEFUN(wi_EXTRA_PDIR, [
progdir="$1"
if test -r $progdir ; then
case "$PATH" in
*:${progdir}*)
# echo " + already had $progdir" 1>&6
;;
*${progdir}:*)
# echo " + already had $progdir" 1>&6
;;
*)
if test "$PATH" = "" ; then
PATH="$progdir"
else
PATH="$PATH:$progdir"
fi
echo " + found $progdir" 1>&6
;;
esac
fi
])
dnl
dnl
dnl If you want to also look for include and lib subdirectories in the
dnl $HOME tree, you supply "yes" as the first argument to this macro.
dnl
dnl If you want to look for subdirectories in include/lib directories,
dnl you pass the names in argument 3, otherwise pass a dash.
dnl
AC_DEFUN(wi_EXTRA_DIRS, [echo "checking for extra include and lib directories..." 1>&6
ifelse([$1], yes, [dnl
b1=`cd .. ; pwd`
b2=`cd ../.. ; pwd`
exdirs="$HOME $j $b1 $b2 $prefix $2"
],[dnl
exdirs="$prefix $2"
])
subexdirs="$3"
if test "$subexdirs" = "" ; then
subexdirs="-"
fi
for subexdir in $subexdirs ; do
if test "$subexdir" = "-" ; then
subexdir=""
else
subexdir="/$subexdir"
fi
for exdir in $exdirs ; do
if test "$exdir" != "/usr" || test "$subexdir" != ""; then
incdir="${exdir}/include${subexdir}"
wi_EXTRA_IDIR($incdir)
mylibdir="${exdir}/lib${subexdir}"
wi_EXTRA_LDIR($mylibdir)
progdir="${exdir}/bin${subexdirr}"
wi_EXTRA_PDIR($progdir)
fi
done
done
])
dnl
dnl
dnl
AC_DEFUN(wi_HPUX_CFLAGS,
[AC_MSG_CHECKING(if HP-UX ansi C compiler flags are needed)
AC_REQUIRE([AC_PROG_CC])
os=`uname -s | tr '[A-Z]' '[a-z]'`
ac_cv_hpux_flags=no
if test "$os" = hp-ux ; then
if test "$ac_cv_prog_gcc" = yes ; then
if test "$CFLAGS" != "" ; then
# Shouldn't be in there.
CFLAGS=`echo "$CFLAGS" | sed 's/-Aa//g'`
fi
else
# If you're not using gcc, then you better have a cc/c89
# that is usable. If you have the barebones compiler, it
# won't work. The good compiler uses -Aa for the ANSI
# compatible stuff.
x=`echo $CFLAGS | grep 'Aa' 2>/dev/null`
if test "$x" = "" ; then
CFLAGS="$CFLAGS -Aa"
fi
ac_cv_hpux_flags=yes
fi
# Also add _HPUX_SOURCE to get the extended namespace.
x=`echo $CFLAGS | grep '_HPUX_SOURCE' 2>/dev/null`
if test "$x" = "" ; then
CFLAGS="$CFLAGS -D_HPUX_SOURCE"
fi
fi
AC_MSG_RESULT($ac_cv_hpux_flags)
])
dnl
dnl
dnl
AC_DEFUN(wi_CFLAGS, [AC_REQUIRE([AC_PROG_CC])
wi_HPUX_CFLAGS
if test "$CFLAGS" = "" ; then
CFLAGS="-O"
elif test "$ac_cv_prog_gcc" = "yes" ; then
case "$CFLAGS" in
*"-g -O"*)
#echo "using -g as default gcc CFLAGS" 1>&6
CFLAGS=`echo $CFLAGS | sed 's/-g\ -O/-O/'`
;;
*"-O -g"*)
# Leave the -g, but remove all -O options.
#echo "using -g as default gcc CFLAGS" 1>&6
CFLAGS=`echo $CFLAGS | sed 's/-O\ -g/-O/'`
;;
esac
fi
])
dnl
dnl
dnl
AC_DEFUN(wi_PROTOTYPES, [
AC_MSG_CHECKING(if the compiler supports function prototypes)
AC_TRY_COMPILE(,[extern void exit(int status);],[wi_cv_prototypes=yes
AC_DEFINE(PROTOTYPES)],wi_cv_prototypes=no)
AC_MSG_RESULT($wi_cv_prototypes)
])
dnl
dnl
dnl
AC_DEFUN(wi_ANSI_C, [
AC_MSG_CHECKING(ANSI-style function definitions)
AC_TRY_COMPILE(,[int blubb(int x) { return 0; }],[wi_cv_ansi_funcs=yes
AC_DEFINE(ANSI_FUNCS)],wi_cv_ansi_funcs=no)
AC_MSG_RESULT($wi_cv_ansi_funcs)
])
dnl
dnl
dnl
AC_DEFUN(wi_HEADER_SYS_SELECT_H, [
# See if <sys/select.h> is includable after <sys/time.h>
if test "$ac_cv_header_sys_time_h" = no ; then
AC_CHECK_HEADERS(sys/time.h sys/select.h)
else
AC_CHECK_HEADERS(sys/select.h)
fi
if test "$ac_cv_header_sys_select_h" = yes ; then
AC_MSG_CHECKING([if <sys/select.h> is compatible with <sys/time.h>])
selecth=yes
if test "$ac_cv_header_sys_time_h" = yes ; then
AC_TRY_COMPILE([#include <sys/time.h>
#include <sys/select.h>],[
fd_set a;
struct timeval tmval;
tmval.tv_sec = 0;],selecth=yes,selecth=no)
if test "$selecth" = yes ; then
AC_DEFINE(CAN_USE_SYS_SELECT_H)
fi
fi
AC_MSG_RESULT($selecth)
fi
])
dnl
dnl
dnl
AC_DEFUN(wi_LIB_RESOLV, [
# See if we could access two well-known sites without help of any special
# libraries, like resolv.
AC_TRY_RUN([
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
main()
{
struct hostent *hp1, *hp2;
int result;
hp1 = gethostbyname("gatekeeper.dec.com");
hp2 = gethostbyname("ftp.ncsa.uiuc.edu");
result = ((hp1 != (struct hostent *) 0) && (hp2 != (struct hostent *) 0));
exit(! result);
}],look_for_resolv=no,look_for_resolv=yes,look_for_resolv=yes)
AC_MSG_CHECKING([if we need to look for -lresolv])
AC_MSG_RESULT($look_for_resolv)
if test "$look_for_resolv" = yes ; then
AC_CHECK_LIB(resolv,main)
else
ac_cv_lib_resolv=no
fi
])
dnl
dnl
dnl
AC_DEFUN(wi_LIB_NSL, [
AC_MSG_CHECKING(if we can use -lnsl)
ac_save_LIBS="$LIBS";
LIBS="$LIBS -lnsl";
AC_CACHE_VAL(r_cv_use_libnsl, [
AC_TRY_RUN(
main() { if (getpwuid(getuid())) exit(0); exit(-1); },
nc_cv_use_libnsl=yes, nc_cv_use_libnsl=no, nc_cv_use_libnsl=no)
])
if test "$nc_cv_use_libnsl" = "no"; then LIBS="$ac_save_LIBS"; fi
AC_MSG_RESULT($nc_cv_use_libnsl)
])dnl
dnl
dnl
dnl
AC_DEFUN(nc_PATH_PROG_ZCAT, [
AC_PATH_PROG(GZCAT,gzcat)
AC_PATH_PROG(ZCAT,zcat)
if test "x$GZCAT" = x ; then
if test "x$ZCAT" != x ; then
# See if zcat is really gzcat. gzcat has a --version option, regular
# zcat does not.
AC_MSG_CHECKING(if zcat is really gzcat in disguise)
if $ZCAT --version 2> /dev/null ; then
AC_DEFINE_UNQUOTED(GZCAT, "$ZCAT")
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
fi
else
AC_DEFINE_UNQUOTED(GZCAT, "$GZCAT")
fi
if test "x$ZCAT" != x ; then
AC_DEFINE_UNQUOTED(ZCAT, "$ZCAT")
fi
])
dnl
dnl
dnl
AC_DEFUN(wi_SYSV_EXTRA_DIRS, [
# Use System V because their curses extensions are required. This must
# be done early so we use the -I and -L in the library checks also.
# This is mostly a Solaris/SunOS hack. Note that doing this will also
# use all of the other System V libraries and headers.
AC_MSG_CHECKING(for alternative System V libraries)
if test -f /usr/5include/curses.h ; then
CPPFLAGS="$CPPFLAGS -I/usr/5include"
LDFLAGS="$LDFLAGS -L/usr/5lib"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
])
dnl
dnl
dnl
AC_DEFUN(wi_DEFINE_UNAME, [
# Get first 127 chars of all uname information. Some folks have
# way too much stuff there, so grab only the first 127.
unam=`uname -a 2>/dev/null | cut -c1-127`
if test "$unam" != "" ; then
AC_DEFINE_UNQUOTED(UNAME, "$unam")
fi
])
dnl
dnl
dnl
AC_DEFUN(wi_READLINE_WITH_NCURSES, [
# Readline and Ncurses could both define "backspace".
# Warn about this if we have both things in our definitions list.
if test "$ac_cv_lib_readline" = yes && test "$ac_cv_lib_ncurses" = yes ; then
AC_MSG_CHECKING(if readline and ncurses will link together)
j="$LIBS"
LIBS="-lreadline -lncurses"
AC_TRY_LINK(,[
readline("prompt");
endwin();
],k=yes,k=no)
if test "$k" = no ; then
AC_MSG_RESULT(no)
# Remove '-lreadline' from LIBS.
LIBS=`echo $j | sed s/-lreadline//g`
ac_cv_lib_readline=no
AC_WARN([The versions of GNU readline and ncurses you have installed on this system
can't be used together, because they use the same symbol, backspace. If
possible, recompile one of the libraries with -Dbackspace=back_space, then
re-run configure.])
else
AC_MSG_RESULT(yes)
LIBS="$j"
fi
fi
])
dnl
dnl
dnl
dnl AC_EXT_DAYLIGHT
dnl Check for an external variable daylight. Stolen from w3c-libwww.
AC_DEFUN(AC_EXT_DAYLIGHT,
[ AC_MSG_CHECKING(int daylight variable)
AC_TRY_COMPILE([#include <time.h>], [return daylight;],
have_daylight=yes,
have_daylight=no)
AC_MSG_RESULT($have_daylight)
])dnl
dnl AC_EXT_TIMEZONE
dnl Check for an external variable timezone. Stolen from tcl-8.0.
AC_DEFUN(AC_EXT_TIMEZONE,
[
#
# Its important to include time.h in this check, as some systems (like convex)
# have timezone functions, etc.
#
have_timezone=no
AC_MSG_CHECKING([long timezone variable])
AC_TRY_COMPILE([#include <time.h>],
[extern long timezone;
timezone += 1;
exit (0);],
[have_timezone=yes
AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no))
#
# On some systems (eg IRIX 6.2), timezone is a time_t and not a long.
#
if test "$have_timezone" = no; then
AC_MSG_CHECKING([time_t timezone variable])
AC_TRY_COMPILE([#include <time.h>],
[extern time_t timezone;
timezone += 1;
exit (0);],
[have_timezone=yes
AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no))
fi
])dnl

38
am2dsp.cfg Normal file
View File

@@ -0,0 +1,38 @@
type = StaticLibrary,Multithreaded,
exclude_dir = threads
include_path = .
include_path = ..
include_path = .\SimGear
include_path = ..\zlib-1.2.3
include_path = "..\OpenAL 1.0 Software Development Kit\include"
define = _USE_MATH_DEFINES
define = _CRT_SECURE_NO_DEPRECATE
define = HAVE_CONFIG_H
# Rule to create simgear_config.h
add_source_file = SOURCE=.\simgear\simgear_config.h.vc5\
\
!IF "$(CFG)" == "SimGear - Win32 Release"\
\
# Begin Custom Build - Creating config.h\
InputPath=.\simgear\simgear_config.h.vc5\
\
".\simgear\simgear_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\
copy .\simgear\simgear_config.h.vc5 .\simgear\simgear_config.h\
\
# End Custom Build\
\
!ELSEIF "$(CFG)" == "SimGear - Win32 Debug"\
\
# Begin Custom Build - Creating config.h\
InputPath=.\simgear\simgear_config.h.vc5\
\
".\simgear\simgear_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\
copy .\simgear\simgear_config.h.vc5 .\simgear\simgear_config.h\
\
# End Custom Build\
\
!ENDIF\

52
autogen.sh Executable file
View File

@@ -0,0 +1,52 @@
#!/bin/sh
OSTYPE=`uname -s`
MACHINE=`uname -m`
AUTO_MAKE_VERSION=`automake --version | head -1 | awk '{print $4}' | sed -e 's/\.\([0-9]*\).*/\1/'`
if test $AUTO_MAKE_VERSION -lt 15; then
echo ""
echo "You need to upgrade to automake version 1.5 or greater."
echo "Most distributions have packages available to install or you can"
echo "find the source for the most recent version at"
echo "ftp://ftp.gnu.org/gnu/automake"
exit 1
fi
echo "Host info: $OSTYPE $MACHINE"
echo -n " automake: `automake --version | head -1 | awk '{print $4}'`"
echo " ($AUTO_MAKE_VERSION)"
echo ""
echo "Running aclocal"
aclocal
echo "Running autoheader"
autoheader
if [ ! -e simgear/simgear_config.h.in ]; then
echo "ERROR: autoheader didn't create simgear/simgear_config.h.in!"
exit 1
fi
echo "Running automake --add-missing"
automake --add-missing
echo "Running autoconf"
autoconf
if [ ! -e configure ]; then
echo "ERROR: configure was not created!"
exit 1
fi
echo ""
echo "======================================"
if [ -f config.cache ]; then
echo "config.cache exists. Removing the config.cache file will force"
echo "the ./configure script to rerun all it's tests rather than using"
echo "the previously cached values."
echo ""
fi
echo "Now you are ready to run './configure'"
echo "======================================"

665
configure.ac Normal file
View File

@@ -0,0 +1,665 @@
dnl Process this file with autoget.sh to produce a working configure
dnl script.
AC_INIT
AC_CONFIG_SRCDIR([simgear/bucket/newbucket.cxx])
dnl Require at least automake 2.52
AC_PREREQ(2.52)
dnl Initialize the automake stuff
AM_INIT_AUTOMAKE(SimGear, 2.0.0)
dnl Specify KAI C++ compiler and flags.
dnl Borrowed with slight modification from blitz distribution.
AC_ARG_WITH(cxx,
[ --with-cxx=COMPILER[:name-flags] set options for COMPILER (KCC)],
[case "$withval" in
KCC*) # KAI C++ http://www.kai.com/
echo "Configuring for KAI C++"
AC_SG_SET_COMPILER($withval,"KCC","--restrict --strict_warnings")
CXX_OPTIMIZE_FLAGS=="+K3 -O3"
CXX_DEBUG_FLAGS="-g +K0"
;;
esac
])
AC_MSG_CHECKING([CXX])
AC_MSG_RESULT([$CXX])
AC_MSG_CHECKING([CC])
AC_MSG_RESULT([$CC])
dnl Checks for programs.
AC_PROG_MAKE_SET
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_CXXCPP
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_PROG_LN_S
AX_BOOST_BASE([1.37.0])
if test "x$BOOST_CPPFLAGS" != "x-I/usr/include" ; then
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
fi
dnl set the $host variable based on local machine/os
AC_CANONICAL_HOST
dnl Used on the Irix platform
case "${host}" in
*-*-irix*)
if test "x$CXX" = "xCC" -o "x$CXX" = "xccache CC"; then
AR="$CXX -ar"
ARFLAGS="-o"
CXXFLAGS="$CXXFLAGS -I$(top_srcdir)/simgear/compatibility/MIPSpro740"
compatibility_DIR="compatibility"
MIPSpro_DIRS="MIPSpro740"
AC_MSG_CHECKING([for MIPSpro compiler version 7.4 or newer])
AC_TRY_RUN([
int main() {
if ( _COMPILER_VERSION < 740 ) {
return -1;
}
return 0;
}
], AC_MSG_RESULT(yes),
[ AC_MSG_RESULT(no)
CXXFLAGS="$CXXFLAGS -I$(top_srcdir)/simgear/compatibility/MIPSpro721"
MIPSpro_DIRS="$(MIPSpro_DIRS) MIPSpro721"
AC_MSG_WARN([Using our own subset of the STL headers])
], AC_MSG_RESULT(yes))
AC_SUBST(MIPSpro_DIRS)
fi
;;
*)
AR="ar"
ARFLAGS="cru"
compatibility_DIR=
;;
esac
AC_SUBST(AR)
AC_SUBST(ARFLAGS)
AC_SUBST(compatibility_DIR)
if echo $includedir | egrep "simgear$" > /dev/null; then
echo "includedir is" $includedir "libdir is" $libdir
else
includedir="${includedir}/simgear"
echo "includedir changed to" $includedir "libdir is" $libdir
fi
dnl set logging; default value of with_logging=yes
AC_ARG_WITH(logging, [ --with-logging Include logging output (default)])
if test "x$with_logging" = "xno" ; then
AC_DEFINE([FG_NDEBUG], 1, [Define for no logging output])
fi
# Specify if we want to build with Norman's jpeg image server support.
# This requires libjpeg to be installed and available.
# Default to with_jpeg_server=no
JPEGLIB=''
AC_ARG_WITH(jpeg_factory, [ --with-jpeg-factory Include Norman's jpeg image factory support code])
if test "x$with_jpeg_factory" = "xyes" ; then
echo "Building with Norman's jpeg image factory support"
AC_CHECK_LIB(jpeg, jpeg_start_compress)
if test "x$ac_cv_lib_jpeg_jpeg_start_compress" != "xyes" ; then
echo
echo "In order to build the jpeg factory code you need libjpeg installed."
echo "otherwise please configure with the --with-jpeg-sever=no option"
echo
echo "libjpeg is available at :"
echo " ftp://ftp.uu.net in the directory graphics/jpeg"
exit 1
fi
else
echo "Building without Norman's jpeg image server support"
fi
AM_CONDITIONAL(ENABLE_JPEG_SERVER, test "x$with_jpeg_factory" = "xyes")
# specify the plib location
AC_ARG_WITH(plib, [ --with-plib=PREFIX Specify the prefix path to plib])
if test "x$with_plib" != "x" ; then
echo "plib prefix is $with_plib"
EXTRA_DIRS="${EXTRA_DIRS} $with_plib"
fi
AC_ARG_WITH(plib_framework, [ --with-plib-framework=PREFIX Specify the prefix path to PLIB.framework ])
if test "x$with_plib_framework" != "x"; then
echo "plib framework prefix is $with_plib_framework"
fi
# specify the osg location
AC_ARG_WITH(osg, [ --with-osg=PREFIX Specify the prefix path to osg])
if test "x$with_osg" != "x" ; then
echo "osg prefix is $with_osg"
EXTRA_DIRS="${EXTRA_DIRS} $with_osg"
fi
AC_ARG_WITH(osg_framework, [ --with-osg-framework=PREFIX Specify the prefix path to OSG.framework ])
if test "x$with_osg_framework" != "x"; then
echo "osg framework prefix is $with_osg_framework"
CPPFLAGS = "$CPPFLAGS -F$with-osg-framework"
export DYLD_FRAMEWORK_PATH="$DYLD_FRAMEWORK_PATH:$with_osg_framework"
fi
dnl specifying OpenAL.framework (for user provided OpenAL.framework / ALUT)
AC_ARG_WITH(openal_framework, [ --with-openal-framework=PREFIX Speicfy the prefix path to OpenAL.framework ])
if test "x$with_openal_framework" != "x"; then
echo "OpenAL framework prefix is $with_openal_framework"
fi
dnl Determine an extra directories to add to include/lib search paths
case "${host}" in
*-apple-darwin* | *-*-cygwin* | *-*-mingw32*)
echo no EXTRA_DIRS for $host
;;
*)
if test -d /usr/X11R6 ; then
EXTRA_DIR1="/usr/X11R6"
fi
if test -d /opt/X11R6 ; then
EXTRA_DIR2="/opt/X11R6"
fi
EXTRA_DIRS="${EXTRA_DIRS} $EXTRA_DIR1 $EXTRA_DIR2"
;;
esac
wi_EXTRA_DIRS(no, ${EXTRA_DIRS})
dnl Using AM_CONDITIONAL is a step out of the protected little
dnl automake fold so it is potentially dangerous. But, we are
dnl beginning to run into cases where the standard checks are not
dnl enough. AM_CONDITIONALS are then referenced to conditionally
dnl build a Makefile.in from a Makefile.am which lets us define custom
dnl includes, compile alternative source files, etc.
dnl X11 might be installed on Mac OS X or cygwin/mingwin, we don't want
dnl to use it if it is.
case "${host}" in
*-apple-darwin* | *-*-cygwin* | *-*-mingw32*)
echo no fancy X11 check
;;
*)
AC_PATH_XTRA
;;
esac
dnl Checks for libraries.
dnl Thread related checks
AC_CHECK_HEADER(pthread.h)
AC_SEARCH_LIBS(pthread_exit, [pthread c_r])
if test "x$ac_cv_header_pthread_h" = "xyes"; then
CXXFLAGS="$CXXFLAGS -D_REENTRANT"
CFLAGS="$CFLAGS -D_REENTRANT"
if test "x$ac_cv_search_pthread_exit" = "x-lc_r"; then
CXXFLAGS="-pthread $CXXFLAGS"
CFLAGS="-pthread $CFLAGS"
fi
fi
AM_CONDITIONAL(HAVE_THREADS, test "x$ac_cv_header_pthread_h" = "xyes")
thread_LIBS="$LIBS"
LIBS=""
dnl search for network related libraries
AC_SEARCH_LIBS(inet_addr, xnet)
AC_SEARCH_LIBS(socket, socket)
network_LIBS="$LIBS"
LIBS=""
dnl check for some default libraries
AC_SEARCH_LIBS(cos, m)
AC_SEARCH_LIBS(clock_gettime, rt)
base_LIBS="$LIBS"
dnl check for OpenGL related libraries
case "${host}" in
*-*-cygwin* | *-*-mingw32*)
dnl CygWin under Windoze.
echo Win32 specific hacks...
AC_DEFINE([WIN32], 1, [Define for Win32 platforms])
AC_DEFINE([NOMINMAX], 1, [Define for Win32 platforms])
LIBS="$LIBS -lglu32 -lopengl32"
LIBS="$LIBS -luser32 -lgdi32 -lwinmm"
dnl add -lwsock32 for mingwin
case "${host}" in
*-*-mingw32*)
base_LIBS="$base_LIBS -lws2_32"
;;
esac
echo "Will link apps with $LIBS"
;;
*-apple-darwin*)
dnl Mac OS X
LIBS="$LIBS -framework OpenGL -framework Carbon -lobjc"
;;
*)
dnl X-Windows based machines
AC_SEARCH_LIBS(XCreateWindow, X11)
AC_SEARCH_LIBS(XShmCreateImage, Xext)
AC_SEARCH_LIBS(XGetExtensionVersion, Xi)
AC_SEARCH_LIBS(IceOpenConnection, ICE)
AC_SEARCH_LIBS(SmcOpenConnection, SM)
AC_SEARCH_LIBS(XtMalloc, Xt)
AC_SEARCH_LIBS(XmuLookupStandardColormap, Xmu)
AC_SEARCH_LIBS(glNewList, [ GL GLcore MesaGL ])
if test "x$ac_cv_search_glNewList" = "x-lGLcore"; then
dnl if GLcore found, then also check for GL
AC_SEARCH_LIBS(glXCreateContext, GL)
fi
dnl if using mesa, check for xmesa.h
if test "x$ac_cv_search_glNewList" = "x-lMesaGL"; then
AC_CHECK_HEADER(GL/fxmesa.h)
if test "x$ac_cv_header_GL_fxmesa_h" = "xyes"; then
AC_DEFINE([XMESA], 1, [Define for fxmesa])
AC_DEFINE([FX], 1, [Define for fxmesa])
fi
fi
AC_SEARCH_LIBS(gluLookAt, [ GLU MesaGLU ])
;;
esac
AC_SEARCH_LIBS(glutGetModifiers, [ glut glut32 freeglut ], have_glut=yes, have_glut=no)
AM_CONDITIONAL(HAVE_GLUT, test "x$have_glut" = "xyes")
opengl_LIBS="$LIBS"
LIBS="$base_LIBS"
dnl check for OpenAL libraries
OPENAL_OK="no"
ALUT_OK="no"
case "${host}" in
*-*-cygwin* | *-*-mingw32*)
dnl CygWin under Windoze.
INCLUDES="$INCLUDES -I/usr/local/include/"
LIBS="$LIBS -L/usr/local/lib"
AC_SEARCH_LIBS(alGenBuffers, [ openal32 openal 'openal -ldsound -lwinmm' ] )
AC_SEARCH_LIBS(alutInit, [ openal32 ALut alut ] )
LIBS="$LIBS -lwinmm -ldsound -ldxguid -lole32"
openal_LIBS="$LIBS"
OPENAL_OK="$ac_cv_search_alGenBuffers"
ALUT_OK="$ac_cv_search_alutInit"
;;
*-apple-darwin*)
dnl Mac OS X
LIBS="$LIBS -framework IOKit -framework OpenAL"
openal_LIBS="$LIBS"
OPENAL_OK="yes"
ALUT_OK="no"
if test "x$with_openal_lib" != "x"; then
echo "libopenal is not supported on Mac OS platform."
openal_LIBS=""
fi
OPENAL_OK="yes"
# Looking for alut.h, if found assume that it is a part of
# the OpenAL package.
AC_CHECK_HEADERS([OpenAL/alut.h],[ALUT_OK="yes"])
dnl Thank you Christian Bauer from SheepSaver
dnl Modified by Tatsuhiro Nishioka for accepting a given framework path
dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES, $3=FRAMEWORK_PATH) ; $3 is optional
AC_DEFUN([AC_CHECK_FRAMEWORK], [
AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
AC_CACHE_CHECK([whether compiler supports framework $1],
ac_Framework, [
saved_LIBS="$LIBS"
FRAMEWORKS="$FRAMEWORKS -framework $1"
if test "$3" = ""; then
FRAMEWORKS="$FRAMEWORKS $ADD2LD"
elif test "`echo $FRAMEWORKS | grep -- -F$3`" = ""; then
FRAMEWORKS="$FRAMEWORKS -F$3"
CXXFLAGS="$CXXFLAGS -F$3"
CCFLAGS="$CCFLAGS -F$3"
dnl This is needed for AC_TRY_LINK when a framework path is specified
export DYLD_FRAMEWORK_PATH="${DYLD_FRAMEWORK_PATH}:$3"
fi
AC_TRY_LINK(
[$2], [],
[AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); LIBS="$saved_LIBS"]
)
])
AS_IF([test AS_VAR_GET(ac_Framework) = yes],
[AC_DEFINE(AS_TR_CPP(HAVE_FRAMEWORK_$1), 1, [Define if framework $1 is available.])]
)
AS_VAR_POPDEF([ac_Framework])dnl
])
dnl Check for OpenAL.framework when --with-openal-framework is specified
dnl Of cource OpenAL.framework needs to have alut.h
if test "x$with_openal_framework" != "x"; then
AC_CHECK_FRAMEWORK(OpenAL, [#include <OpenAL/alut.h>], $with_openal_framework)
fi
;;
*)
dnl default unix style machines
save_LIBS=$LIBS
LIBS="$LIBS $thread_LIBS"
AC_SEARCH_LIBS(alGenBuffers, openal)
AC_SEARCH_LIBS(alutInit, [ alut openal ] )
OPENAL_OK="$ac_cv_search_alGenBuffers"
ALUT_OK="$ac_cv_search_alutInit"
openal_LIBS="$LIBS"
LIBS=$save_LIBS
;;
esac
if test "$OPENAL_OK" == "no"; then
echo
echo "You *must* have the openal library installed on your system to build"
echo "SimGear!"
echo
echo "Please see README.OpenAL for more details."
echo
echo "configure aborted."
exit
fi
if test "$ALUT_OK" == "no"; then
echo
echo "You *must* have the alut library installed on your system to build"
echo "SimGear!"
echo
echo "Please see README.OpenAL for more details."
echo
echo "configure aborted."
exit
fi
LIBS="$base_LIBS"
AC_SUBST(base_LIBS)
AC_SUBST(openal_LIBS)
AC_SUBST(opengl_LIBS)
AC_SUBST(thread_LIBS)
AC_SUBST(network_LIBS)
dnl Check for MS Windows environment
AC_CHECK_HEADER(windows.h)
AM_CONDITIONAL(EXTGL_NEEDED, test "x$ac_cv_header_windows_h" = "xyes")
# The following are C++ items that need to be tested for with the c++
# compiler
CXXCPP="g++ -E"
AC_LANG_PUSH(C++)
dnl Check for "plib" without which we cannot go on
case ${host} in
*-apple-darwin*)
# Check PLIB framework availability when with-plib-framework is specified
if test "x$with_plib_framework" != "x"; then
AC_CHECK_FRAMEWORK(PLIB, [#include <plib/ul.h>], $with_plib_framework)
plib_FRAMEWORK="$FRAMEWORKS"
FRAMEWORKS=""
AC_SUBST(plib_FRAMEWORK)
fi
;;
esac
AM_CONDITIONAL(HAVE_FRAMEWORK_PLIB, test "x$ac_cv_framework_PLIB" != "x")
AC_CHECK_HEADER(plib/ul.h)
AC_CHECK_LIB(plibul,ulInit)
if test "x$ac_cv_header_plib_ul_h" != "xyes" \
-o "x$ac_cv_lib_plibul_ulInit" != "xyes" ; then
echo
echo "You *must* have the plib library installed on your system to build"
echo "SimGear!"
echo
echo " LIBS: '$LIBS'"
echo " LDFLAGS: '$LDFLAGS'"
echo " CPPFLAGS: '$CPPFLAGS'"
echo
echo "Please see README.plib for more details."
echo
echo "configure aborted."
exit
fi
AC_MSG_CHECKING([for plib 1.8.5 or newer])
AC_TRY_RUN([
#include <plib/ul.h>
#define MIN_PLIB_VERSION 185
int main() {
if ( PLIB_VERSION < MIN_PLIB_VERSION ) {
return -1;
}
return 0;
}
],
AC_MSG_RESULT(yes),
[AC_MSG_RESULT(wrong version);
AC_MSG_ERROR([Install plib 1.8.5 or later first...])],
AC_MSG_RESULT(yes)
)
LIBS="$saved_LIBS"
# OpenSceneGraph
case "${host}" in
*-apple-darwin*)
if test "x$with_osg_framework" != "x"; then
# AC_CHECK_FRAMEWORK(osgViewer, [#include <osgViewer/Version>], $with_osg_framework)
# AC_CHECK_FRAMEWORK(osgGA, [#include <osgGA/Version>], $with_osg_framework)
# AC_CHECK_FRAMEWORK(osgText, [#include <osgText/Version>], $with_osg_framework)
# AC_CHECK_FRAMEWORK(osgFX, [#include <osgFX/AnisotropicLighting>], $with_osg_framework)
# AC_CHECK_FRAMEWORK(osgUtil, [#include <osgUtil/Version>], $with_osg_framework)
# AC_CHECK_FRAMEWORK(osgDB, [#include <osgDB/Version>], $with_osg_framework)
# AC_CHECK_FRAMEWORK(osgSim, [#include <osgSim/Version>], $with_osg_framework)
# AC_CHECK_FRAMEWORK(osgParticle, [#include <osgParticle/Version>], $with_osg_framework)
# AC_CHECK_FRAMEWORK(osg, [#include <osg/Version>], $with_osg_framework)
# osg_FRAMEWORKS="$FRAMEWORKS"
# FRAMEWORKS=""
# AC_SUBST(osg_FRAMEWORKS)
AC_CHECK_FRAMEWORK(OpenThreads, [#include <OpenThreads/Version>], $with_osg_framework)
openthreads_FRAMEWORK="$FRAMEWORKS"
FRAMEWORKS=""
AC_SUBST(openthreads_FRAMEWORK)
else
dnl
dnl This is needed when osg dynamic libs are specified
dnl instead of OSG frameworks on Mac OS X
dnl
AC_CHECK_LIB(OpenThreads,OpenThreadsGetVersion)
fi
;;
*)
if test "x$enable_osgdebug" = "xyes"; then
AC_CHECK_LIB(OpenThreadsd,OpenThreadsGetVersion)
else
AC_CHECK_LIB(OpenThreads,OpenThreadsGetVersion)
fi
;;
esac
AM_CONDITIONAL(HAVE_FRAMEWORK_OSG, test "x$ac_cv_framework_osg" != "x")
AC_CHECK_HEADER(osg/Version)
if test "x$ac_cv_header_osg_Version" != "xyes" -o "x$ac_cv_lib_OpenThreads_OpenThreadsGetVersion" != "xyes"; then
if test "x$ac_cv_framework_osg" != "xyes"; then
echo
echo "You *must* have the OpenThreads library installed on your system"
echo "to build this version of SimGear!"
echo " Maybe you need to specify --with-osg=DIR."
echo " Maybe you need to specify some LDFLAGS to help the linker."
echo
echo " LIBS: '$LIBS'"
echo " LDFLAGS: '$LDFLAGS'"
echo " CPPFLAGS: '$CPPFLAGS'"
echo
echo "Please see README.OSG for more details."
echo
echo "configure aborted."
exit
fi
fi
AC_CHECK_HEADER(boost/version.hpp)
if test "x$ac_cv_header_boost_version_hpp" != "xyes"; then
echo
echo "You *must* have the Boost library installed on your system"
echo "to build this version of SimGear!"
echo
echo " LIBS: '$LIBS'"
echo " LDFLAGS: '$LDFLAGS'"
echo " CPPFLAGS: '$CPPFLAGS'"
echo
echo "configure aborted."
exit
fi
AC_LANG_POP
dnl Check for system installed zlib
AC_CHECK_HEADER(zlib.h)
if test "x$ac_cv_header_zlib_h" != "xyes"; then
echo
echo "zlib library not found."
echo
echo "If your OS does not provide an installable package for zlib"
echo "you will have to compile and install it first yourself. A copy"
echo "of zlib-1.1.4.tar.gz is included with SimGear. You will"
echo "have to untar this source code, and follow its included instructions"
echo "to compile and install on your system."
echo
echo "configure aborted."
echo
fi
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS( \
fcntl.h getopt.h malloc.h memory.h stdint.h stdlib.h sys/param.h \
sys/stat.h sys/time.h sys/timeb.h unistd.h values.h )
if test "x$ac_cv_header_stdint_h" = "xyes"; then
AC_DEFINE([HAVE_STDINT_H], 1, [Define if stdint.h exists])
fi
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_TYPE_MODE_T
AC_HEADER_TIME
AC_STRUCT_TM
dnl Checks for library functions.
old_LIBS=$LIBS
LIBS="$base_LIBS $network_LIBS $opengl_LIBS"
AC_TYPE_SIGNAL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS( [ \
ftime gettimeofday timegm memcpy bcopy mktime strstr rand \
random drand48 setitimer getitimer signal GetLocalTime rint getrusage ] )
LIBS=$old_LIBS
AM_CONFIG_HEADER(simgear/simgear_config.h)
AC_CONFIG_FILES([ \
Makefile \
SimGear.spec \
simgear/Makefile \
simgear/version.h \
simgear/compatibility/Makefile \
simgear/compatibility/MIPSpro721/Makefile \
simgear/compatibility/MIPSpro740/Makefile \
simgear/bucket/Makefile \
simgear/debug/Makefile \
simgear/ephemeris/Makefile \
simgear/io/Makefile \
simgear/magvar/Makefile \
simgear/math/Makefile \
simgear/environment/Makefile \
simgear/misc/Makefile \
simgear/nasal/Makefile \
simgear/props/Makefile \
simgear/route/Makefile \
simgear/scene/Makefile \
simgear/scene/bvh/Makefile \
simgear/scene/material/Makefile \
simgear/scene/model/Makefile \
simgear/scene/sky/Makefile \
simgear/scene/tgdb/Makefile \
simgear/scene/util/Makefile \
simgear/screen/Makefile \
simgear/serial/Makefile \
simgear/sound/Makefile \
simgear/structure/Makefile \
simgear/threads/Makefile \
simgear/timing/Makefile \
simgear/xml/Makefile \
])
AC_OUTPUT
echo ""
echo "Configure Summary"
echo "================="
echo "Prefix: $prefix"
if test "x$with_logging" != "x"; then
echo "Debug messages: $with_logging"
else
echo "Debug messages: yes"
fi
echo -n "Automake version: "
automake --version | head -1
if test "x$with_jpeg_factory" = "xyes"; then
echo "With JPEG Factory support"
else
echo "Without JPEG Factory support"
fi
if test "x$ac_cv_header_pthread_h" = "xyes"; then
echo "Threads: pthread lib found."
else
echo "Threads: no threads (pthread lib not found.)"
fi

View File

@@ -1,259 +0,0 @@
dnl Process this file with aclocal ; automake -a ; autoconf to produce a
dnl working configure script.
dnl
dnl $Id$
AC_INIT(src/bucket/newbucket.cxx)
dnl Initialize the automake stuff
AM_INIT_AUTOMAKE(SimGear, 0.0.1)
dnl Checks for programs.
AC_PROG_MAKE_SET
AC_PROG_CC
AC_PROG_CXX
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_PROG_LN_S
if echo $includedir | egrep "simgear$" > /dev/null; then
echo "includedir is" $includedir "libdir is" $libdir
else
includedir="${includedir}/simgear"
echo "includedir changed to" $includedir "libdir is" $libdir
fi
dnl Specify if we want logging (testing build) or not (release build)
# set logging default value
# with_logging=yes
AC_ARG_WITH(logging, [ --with-logging Include logging output (default)])
if test "x$with_logging" = "xno" ; then
AC_DEFINE(FG_NDEBUG)
fi
dnl specify if we are building with "checker"
AC_ARG_WITH(efence, [ --with-efence Specify if we are building with "electric-fence"])
if test "x$with_efence" = "xyes" ; then
echo "Building with efence"
LIBS= "$LIBS -lefence"
fi
dnl Check for MS Windows environment
AC_CHECK_HEADER(windows.h)
dnl extra library and include directories
EXTRA_DIRS="/usr/local /usr/local/plib /usr/X11R6"
if test -d /opt/X11R6 ; then
EXTRA_DIRS="$EXTRA_DIRS /opt/X11R6"
fi
if test "x$ac_cv_header_windows_h" = "xyes" ; then
EXTRA_DIRS="${EXTRA_DIRS} `pwd`/Win32"
# elif test `uname -s` = "SunOS" ; then
# EXTRA_DIRS="${EXTRA_DIRS} `pwd`/SunOS"
fi
wi_EXTRA_DIRS(no, ${EXTRA_DIRS})
dnl Using AM_CONDITIONAL is a step out of the protected little
dnl automake fold so it is potentially dangerous. But, we are
dnl beginning to run into cases where the standard checks are not
dnl enough. AM_CONDITIONALS are then referenced to conditionally
dnl build a Makefile.in from a Makefile.am which lets us define custom
dnl includes, compile alternative source files, etc.
dnl Enable serial support on Unix type systems
AM_CONDITIONAL(ENABLE_UNIX_SERIAL, true)
dnl Check for X11 (fancy)
AC_PATH_XTRA
dnl Checks for libraries.
null_LIBS="$LIBS"
AC_CHECK_LIB(m, cos)
base_LIBS="$LIBS"
AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(X11, XCreateWindow)
AC_CHECK_LIB(Xext, XShmCreateImage)
AC_CHECK_LIB(Xi, XGetExtensionVersion)
AC_CHECK_LIB(ICE, IceOpenConnection)
AC_CHECK_LIB(SM, SmcOpenConnection)
AC_CHECK_LIB(Xt, XtMalloc)
AC_CHECK_LIB(Xmu, XmuLookupStandardColormap)
dnl check for OpenGL related libraries
if test "x$ac_cv_header_windows_h" != "xyes" ; then
dnl Reasonable stuff for non-windoze variants ... :-)
AC_CHECK_LIB(GLcore, glNewList)
if test "x$ac_cv_lib_GLcore_glNewList" = "xno" ; then
dnl if no GLcore, check for GL
AC_CHECK_LIB(GL, glNewList)
if test "x$ac_cv_lib_GL_glNewList" = "xno" ; then
dnl if no GL, check for MesaGL
AC_CHECK_LIB(MesaGL, glNewList)
fi
else
dnl if GLcore found, then also check for GL
AC_CHECK_LIB(GL, glXCreateContext)
fi
dnl if using mesa, check for xmesa.h
if test "x$ac_cv_lib_MesaGL_glNewList" = "xyes" ; then
AC_CHECK_HEADER(GL/xmesa.h)
if test "x$ac_cv_header_GL_xmesa_h" = "xyes"; then
AC_DEFINE( XMESA )
AC_DEFINE( FX )
fi
fi
AC_CHECK_LIB(GLU, gluLookAt)
if test "x$ac_cv_lib_GLU_gluLookAt" = "xno" ; then
dnl if no GLU, check for MesaGLU
AC_CHECK_LIB(MesaGLU, gluLookAt)
fi
dnl check for glut
AC_CHECK_LIB(glut, glutGetModifiers)
dnl test for glutGameModeString, but avoid adding glut a second time into
dnl the list of libraries
save_LIBS="$LIBS"
AC_CHECK_LIB(glut, glutGameModeString)
LIBS="$save_LIBS"
else
dnl Win32 is a little wierd because it has to try to handle the various
dnl winbloze-isms. We'll just do this manually for now.
echo Win32 specific hacks...
AC_DEFINE(WIN32)
dnl force a failed check since we will be building under windoze
AM_CONDITIONAL(ENABLE_XMESA_FX, test "no" = "yes")
dnl just define these to true and hope for the best
ac_cv_lib_glut_glutGetModifiers="yes"
ac_cv_lib_glut_glutGameModeString="yes"
if test "x$with_sgi_opengl" = "xyes" ; then
echo "Building with glut.dll, glu.dll, and opengl.dll"
WIN32_GLUT=glut
WIN32_GLU=glu
WIN32_OPENGL=opengl
else
echo "Building with glut32.dll, glu32.dll, and opengl32.dll"
WIN32_GLUT=glut32
WIN32_GLU=glu32
WIN32_OPENGL=opengl32
fi
LIBS="$LIBS -l${WIN32_GLUT} -l${WIN32_GLU} -l${WIN32_OPENGL}"
LIBS="$LIBS -luser32 -lgdi32"
echo "Will link apps with $LIBS"
fi
if test "x$ac_cv_lib_glut_glutGetModifiers" = "xno"; then
echo
echo "Unable to find the necessary OpenGL or GLUT libraries."
echo "See config.log for automated test details and results ..."
exit 1
fi
if test "x$ac_cv_lib_glut_glutGameModeString" = "xno"; then
echo
echo "Your version of glut doesn't support game mode."
echo "You need to fetch and install the latest version of glut from:"
echo
echo " http://reality.sgi.com/opengl/glut3/glut3.html"
exit 1
fi
opengl_LIBS="$LIBS"
LIBS="$base_LIBS"
AC_SUBST(base_LIBS)
AC_SUBST(opengl_LIBS)
AM_CONDITIONAL(HAVE_XWINDOWS, test "x$ac_cv_lib_X11_XCreateWindow" = "xyes" )
dnl Check for "plib" without which we cannot go on
AC_CHECK_HEADER(plib/pu.h)
if test "x$ac_cv_header_plib_pu_h" != "xyes"; then
echo
echo "You *must* have the plib library installed on your system to build"
echo "the FGFS simulator!"
echo
echo "Please see README.plib for more details."
echo
echo "configure aborted."
exit
fi
dnl Check for system installed zlib
AC_CHECK_HEADER(zlib.h)
if test "x$ac_cv_header_zlib_h" != "xyes"; then
echo "no zlib found, building."
fi
AM_CONDITIONAL(HAVE_ZLIB, test "x$ac_cv_header_zlib_h" = "xyes" )
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS( \
fcntl.h getopt.h malloc.h memory.h stdlib.h sys/param.h sys/stat.h \
sys/time.h sys/timeb.h unistd.h windows.h winbase.h values.h )
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
dnl Checks for library functions.
AC_TYPE_SIGNAL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS( ftime gettimeofday timegm memcpy bcopy mktime strstr rand \
random setitimer getitimer signal GetLocalTime rint getrusage )
AM_CONFIG_HEADER(src/include/config.h)
AC_OUTPUT( \
VERSION \
Makefile \
src/Makefile \
src/include/Makefile \
src/bucket/Makefile \
src/debug/Makefile \
src/math/Makefile \
src/misc/Makefile \
src/screen/Makefile \
src/serial/Makefile \
src/xgl/Makefile \
src/zlib/Makefile \
)
AC_OUTPUT_COMMANDS([./mksymlinks.sh])
echo ""
echo "Configure Summary"
echo "================="
echo "Prefix: $prefix"
if test "x$with_logging" != "x"; then
echo "Debug messages: $with_logging"
else
echo "Debug messages: yes"
fi
if test "x$with_efence" != "x"; then
echo "Electric fence: $with_efence"
else
echo "Electric fence: no"
fi

View File

@@ -1,39 +0,0 @@
#! /bin/sh
echo ""
echo "running $0 to rebuild simgear include links"
# toast the old directory
rm -rf src/simgear
mkdir src/simgear
mkdir src/simgear/bucket
mkdir src/simgear/debug
mkdir src/simgear/math
mkdir src/simgear/misc
mkdir src/simgear/screen
mkdir src/simgear/serial
mkdir src/simgear/xgl
mkdir src/simgear/zlib
# build new links
ln -s ../include/compiler.h src/simgear/compiler.h
ln -s ../include/constants.h src/simgear/constants.h
ln -s ../include/fg_traits.hxx src/simgear/fg_traits.hxx
ln -s ../include/fg_zlib.h src/simgear/fg_zlib.h
ln -s ../../bucket/newbucket.hxx src/simgear/bucket/newbucket.hxx
ln -s ../../debug/debug_types.h src/simgear/debug/debug_types.h
ln -s ../../debug/logstream.hxx src/simgear/debug/logstream.hxx
ln -s ../../math/fg_memory.h src/simgear/math/fg_memory.h
ln -s ../../math/fg_types.hxx src/simgear/math/fg_types.hxx
ln -s ../../math/mat3.h src/simgear/math/mat3.h
ln -s ../../math/point3d.hxx src/simgear/math/point3d.hxx
ln -s ../../math/polar3d.hxx src/simgear/math/polar3d.hxx
ln -s ../../misc/fgpath.hxx src/simgear/misc/fgpath.hxx
ln -s ../../misc/fgstream.hxx src/simgear/misc/fgstream.hxx
ln -s ../../misc/zfstream.hxx src/simgear/misc/zfstream.hxx
ln -s ../../xgl/xgl.h src/simgear/xgl/xgl.h

5
projects/VC90/.cvsignore Normal file
View File

@@ -0,0 +1,5 @@
SimGear.ncb
SimGear.suo
*.user
Win32
x64

2016
projects/VC90/SimGear.vcproj Normal file

File diff suppressed because it is too large Load Diff

8
simgear/.cvsignore Normal file
View File

@@ -0,0 +1,8 @@
Makefile
Makefile.in
simgear_config.h
simgear_config.h.in
stamp-h
stamp-h.in
stamp-h1
version.h

View File

@@ -1,27 +1,31 @@
if ENABLE_UNIX_SERIAL
SERIAL_DIRS = serial
else
SERIAL_DIRS =
endif
# METAR_DIRS =
METAR_DIRS = environment
if HAVE_ZLIB
ZLIB_DIRS =
else
ZLIB_DIRS = zlib
endif
EXTRA_DIST = simgear_config.h.vc5 simgear_config.h-msvc71 version.h.in
METAR_DIRS =
# METAR_DIRS = metar
include_HEADERS = \
compiler.h constants.h sg_inlines.h version.h
SUBDIRS = \
include \
bucket \
$(compatibility_DIR) \
xml \
debug \
misc \
structure \
bucket \
ephemeris \
io \
magvar \
math \
$(METAR_DIRS) \
misc \
nasal \
props \
route \
scene \
screen \
$(SERIAL_DIRS) \
xgl \
$(ZLIB_DIRS)
serial \
sound \
threads \
timing
DIST_SUBDIRS = $(SUBDIRS) compatibility

View File

@@ -0,0 +1,3 @@
.deps
Makefile
Makefile.in

View File

@@ -11,7 +11,7 @@ libsgbucket_a_SOURCES = newbucket.cxx
# testbucket_SOURCES = testbucket.cxx
# testbucket_LDADD = \
# $(top_builddir)/bucket/libsgbucket.a \
# libsgbucket.a \
# $(top_builddir)/misc/libsgmisc.a
INCLUDES += -I$(top_builddir)/src
INCLUDES = -I$(top_srcdir)

View File

@@ -3,40 +3,143 @@
*
* Written by Curtis L. Olson, started February 1999.
*
* Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
* Copyright (C) 1999 Curtis L. Olson - http://www.flightgear.org/~curt/
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU 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 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 program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* 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
* General Public License for more details.
* Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $Id$
**************************************************************************/
#ifdef HAVE_CONFIG_H
# include <config.h>
# include <simgear_config.h>
#endif
#include <math.h>
#include <simgear/misc/fgpath.hxx>
#include <simgear/misc/sg_path.hxx>
#include "newbucket.hxx"
// default constructor
SGBucket::SGBucket() {
}
// constructor for specified location
SGBucket::SGBucket(const double dlon, const double dlat) {
set_bucket(dlon, dlat);
}
SGBucket::SGBucket(const SGGeod& geod) {
set_bucket(geod);
}
// create an impossible bucket if false
SGBucket::SGBucket(const bool is_good) {
set_bucket(0.0, 0.0);
if ( !is_good ) {
lon = -1000;
}
}
// Parse a unique scenery tile index and find the lon, lat, x, and y
SGBucket::SGBucket(const long int bindex) {
long int index = bindex;
lon = index >> 14;
index -= lon << 14;
lon -= 180;
lat = index >> 6;
index -= lat << 6;
lat -= 90;
y = index >> 3;
index -= y << 3;
x = index;
}
// Set the bucket params for the specified lat and lon
void SGBucket::set_bucket( double *lonlat ) {
set_bucket( lonlat[0], lonlat[1] );
}
// Set the bucket params for the specified lat and lon
void SGBucket::set_bucket( double dlon, double dlat ) {
//
// latitude first
//
double span = sg_bucket_span( dlat );
double diff = dlon - (double)(int)dlon;
// cout << "diff = " << diff << " span = " << span << endl;
if ( (dlon >= 0) || (fabs(diff) < SG_EPSILON) ) {
lon = (int)dlon;
} else {
lon = (int)dlon - 1;
}
// find subdivision or super lon if needed
if ( span < SG_EPSILON ) {
// polar cap
lon = 0;
x = 0;
} else if ( span <= 1.0 ) {
x = (int)((dlon - lon) / span);
} else {
if ( dlon >= 0 ) {
lon = (int)( (int)(lon / span) * span);
} else {
// cout << " lon = " << lon
// << " tmp = " << (int)((lon-1) / span) << endl;
lon = (int)( (int)((lon + 1) / span) * span - span);
if ( lon < -180 ) {
lon = -180;
}
}
x = 0;
}
//
// then latitude
//
diff = dlat - (double)(int)dlat;
if ( (dlat >= 0) || (fabs(diff) < SG_EPSILON) ) {
lat = (int)dlat;
} else {
lat = (int)dlat - 1;
}
y = (int)((dlat - lat) * 8);
}
void SGBucket::set_bucket(const SGGeod& geod)
{
set_bucket(geod.getLongitudeDeg(), geod.getLatitudeDeg());
}
// Build the path name for this bucket
string FGBucket::gen_base_path() const {
string SGBucket::gen_base_path() const {
// long int index;
int top_lon, top_lat, main_lon, main_lat;
char hem, pole;
@@ -78,25 +181,64 @@ string FGBucket::gen_base_path() const {
hem, top_lon, pole, top_lat,
hem, main_lon, pole, main_lat);
FGPath path( raw_path );
SGPath path( raw_path );
return path.str();
}
// return width of the tile in degrees
double SGBucket::get_width() const {
return sg_bucket_span( get_center_lat() );
}
// return height of the tile in degrees
double SGBucket::get_height() const {
return SG_BUCKET_SPAN;
}
// return width of the tile in meters
double SGBucket::get_width_m() const {
double clat = (int)get_center_lat();
if ( clat > 0 ) {
clat = (int)clat + 0.5;
} else {
clat = (int)clat - 0.5;
}
double clat_rad = clat * SGD_DEGREES_TO_RADIANS;
double cos_lat = cos( clat_rad );
double local_radius = cos_lat * SG_EQUATORIAL_RADIUS_M;
double local_perimeter = local_radius * SGD_2PI;
double degree_width = local_perimeter / 360.0;
return sg_bucket_span( get_center_lat() ) * degree_width;
}
// return height of the tile in meters
double SGBucket::get_height_m() const {
double perimeter = SG_EQUATORIAL_RADIUS_M * SGD_2PI;
double degree_height = perimeter / 360.0;
return SG_BUCKET_SPAN * degree_height;
}
// find the bucket which is offset by the specified tile units in the
// X & Y direction. We need the current lon and lat to resolve
// ambiguities when going from a wider tile to a narrower one above or
// below. This assumes that we are feeding in
FGBucket fgBucketOffset( double dlon, double dlat, int dx, int dy ) {
FGBucket result( dlon, dlat );
double clat = result.get_center_lat() + dy * FG_BUCKET_SPAN;
SGBucket sgBucketOffset( double dlon, double dlat, int dx, int dy ) {
SGBucket result( dlon, dlat );
double clat = result.get_center_lat() + dy * SG_BUCKET_SPAN;
// walk dy units in the lat direction
result.set_bucket( dlon, clat );
// find the lon span for the new latitude
double span = bucket_span( clat );
double span = sg_bucket_span( clat );
// walk dx units in the lon direction
double tmp = dlon + dx * span;
@@ -113,7 +255,7 @@ FGBucket fgBucketOffset( double dlon, double dlat, int dx, int dy ) {
// calculate the offset between two buckets
void fgBucketDiff( const FGBucket& b1, const FGBucket& b2, int *dx, int *dy ) {
void sgBucketDiff( const SGBucket& b1, const SGBucket& b2, int *dx, int *dy ) {
// Latitude difference
double c1_lat = b1.get_center_lat();
@@ -121,26 +263,42 @@ void fgBucketDiff( const FGBucket& b1, const FGBucket& b2, int *dx, int *dy ) {
double diff_lat = c2_lat - c1_lat;
#ifdef HAVE_RINT
*dy = (int)rint( diff_lat / FG_BUCKET_SPAN );
*dy = (int)rint( diff_lat / SG_BUCKET_SPAN );
#else
if ( diff_lat > 0 ) {
*dy = (int)( diff_lat / FG_BUCKET_SPAN + 0.5 );
*dy = (int)( diff_lat / SG_BUCKET_SPAN + 0.5 );
} else {
*dy = (int)( diff_lat / FG_BUCKET_SPAN - 0.5 );
*dy = (int)( diff_lat / SG_BUCKET_SPAN - 0.5 );
}
#endif
// longitude difference
double c1_lon = b1.get_center_lon();
double c2_lon = b2.get_center_lon();
double diff_lon = c2_lon - c1_lon;
double span;
if ( bucket_span(c1_lat) <= bucket_span(c2_lat) ) {
span = bucket_span(c1_lat);
double diff_lon=0.0;
double span=0.0;
SGBucket tmp_bucket;
// To handle crossing the bucket size boundary
// we need to account for different size buckets.
if ( sg_bucket_span(c1_lat) <= sg_bucket_span(c2_lat) )
{
span = sg_bucket_span(c1_lat);
} else {
span = bucket_span(c2_lat);
span = sg_bucket_span(c2_lat);
}
diff_lon = b2.get_center_lon() - b1.get_center_lon();
if (diff_lon <0.0)
{
diff_lon -= b1.get_width()*0.5 + b2.get_width()*0.5 - span;
}
else
{
diff_lon += b1.get_width()*0.5 + b2.get_width()*0.5 - span;
}
#ifdef HAVE_RINT
*dx = (int)rint( diff_lon / span );
#else

View File

@@ -3,128 +3,54 @@
*
* Written by Curtis L. Olson, started February 1999.
*
* Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
* Copyright (C) 1999 Curtis L. Olson - http://www.flightgear.org/~curt
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU 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 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 program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* 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
* General Public License for more details.
* Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $Id$
**************************************************************************/
/** \file newbucket.hxx
* A class and associated utiltity functions to manage world scenery tiling.
*/
#ifndef _NEWBUCKET_HXX
#define _NEWBUCKET_HXX
#include <simgear/compiler.h>
#include <simgear/constants.h>
#include <simgear/math/SGMath.hxx>
#ifdef FG_HAVE_STD_INCLUDES
# include <cmath>
# include <cstdio> // sprintf()
# include <iostream>
#else
# include <math.h>
# include <stdio.h> // sprintf()
# include <iostream.h>
#endif
#include <cmath>
#include <cstdio> // sprintf()
#include <ostream>
#include <string>
// I don't understand ... <math.h> or <cmath> should be included
// already depending on how you defined FG_HAVE_STD_INCLUDES, but I
// can go ahead and add this -- CLO
#ifdef __MWERKS__
# include <math.h> // needed fabs()
#endif
/**
* standard size of a bucket in degrees (1/8 of a degree)
*/
#define SG_BUCKET_SPAN 0.125
#include STL_STRING
FG_USING_STD(string);
#if ! defined( FG_HAVE_NATIVE_SGI_COMPILERS )
FG_USING_STD(ostream);
#endif
#define FG_BUCKET_SPAN 0.125 // 1/8 of a degree
#define FG_HALF_BUCKET_SPAN 0.0625 // 1/2 of 1/8 of a degree = 1/16 = 0.0625
class FGBucket;
ostream& operator<< ( ostream&, const FGBucket& );
bool operator== ( const FGBucket&, const FGBucket& );
class FGBucket {
private:
double cx, cy; // centerpoint (lon, lat) in degrees of bucket
int lon; // longitude index (-180 to 179)
int lat; // latitude index (-90 to 89)
int x; // x subdivision (0 to 7)
int y; // y subdivision (0 to 7)
public:
// default constructor
FGBucket();
// create a bucket which would contain the specified lon/lat
FGBucket(const double lon, const double lat);
// create a bucket based on "long int" index
FGBucket(const long int bindex);
// create an impossible bucket if false
FGBucket(const bool is_good);
~FGBucket();
// Set the bucket params for the specified lat and lon
void set_bucket( double dlon, double dlat );
void make_bad ( void );
// Generate the unique scenery tile index for this bucket
long int gen_index();
string gen_index_str() const;
// Build the path name for this bucket
string gen_base_path() const;
// return the center lon of a tile
double get_center_lon() const;
// return width of the tile
double get_width() const;
// return the center lat of a tile
double get_center_lat() const;
// return height of the tile
double get_height() const;
// Informational methods
inline int get_lon() const { return lon; }
inline int get_lat() const { return lat; }
inline int get_x() const { return x; }
inline int get_y() const { return y; }
// friends
friend ostream& operator<< ( ostream&, const FGBucket& );
friend bool operator== ( const FGBucket&, const FGBucket& );
};
/**
* half of a standard SG_BUCKET_SPAN
*/
#define SG_HALF_BUCKET_SPAN ( 0.5 * SG_BUCKET_SPAN )
// return the horizontal tile span factor based on latitude
inline double bucket_span( double l ) {
static double sg_bucket_span( double l ) {
if ( l >= 89.0 ) {
return 360.0;
} else if ( l >= 88.0 ) {
@@ -159,185 +85,262 @@ inline double bucket_span( double l ) {
}
// Set the bucket params for the specified lat and lon
inline void FGBucket::set_bucket( double dlon, double dlat ) {
//
// latitude first
//
double span = bucket_span( dlat );
double diff = dlon - (double)(int)dlon;
/**
* A class to manage world scenery tiling.
* This class encapsulates the world tiling scheme. It provides ways
* to calculate a unique tile index from a lat/lon, and it can provide
* information such as the dimensions of a given tile.
*/
// cout << "diff = " << diff << " span = " << span << endl;
class SGBucket {
if ( (dlon >= 0) || (fabs(diff) < FG_EPSILON) ) {
lon = (int)dlon;
} else {
lon = (int)dlon - 1;
private:
short lon; // longitude index (-180 to 179)
short lat; // latitude index (-90 to 89)
char x; // x subdivision (0 to 7)
char y; // y subdivision (0 to 7)
public:
/**
* Default constructor.
*/
SGBucket();
/**
* Construct a bucket given a specific location.
* @param dlon longitude specified in degrees
* @param dlat latitude specified in degrees
*/
SGBucket(const double dlon, const double dlat);
/**
* Construct a bucket given a specific location.
* @param dlon longitude specified in degrees
* @param dlat latitude specified in degrees
*/
SGBucket(const SGGeod& geod);
/** Construct a bucket.
* @param is_good if false, create an invalid bucket. This is
* useful * if you are comparing cur_bucket to last_bucket and
* you want to * make sure last_bucket starts out as something
* impossible.
*/
SGBucket(const bool is_good);
/** Construct a bucket given a unique bucket index number.
* @param bindex unique bucket index
*/
SGBucket(const long int bindex);
/**
* Reset a bucket to represent a new lat and lon
* @param dlon longitude specified in degrees
* @param dlat latitude specified in degrees
*/
void set_bucket( double dlon, double dlat );
/**
* Reset a bucket to represent a new lat and lon
* @param lonlat an array of double[2] holding lon and lat
* (specified) in degrees
*/
void set_bucket( double *lonlat );
/**
* Reset a bucket to represent a new lat and lon
* @param dlon longitude specified in degrees
* @param dlat latitude specified in degrees
*/
void set_bucket(const SGGeod& geod);
/**
* Create an impossible bucket.
* This is useful if you are comparing cur_bucket to last_bucket
* and you want to make sure last_bucket starts out as something
* impossible.
*/
inline void make_bad() {
set_bucket(0.0, 0.0);
lon = -1000;
}
// find subdivision or super lon if needed
if ( span < FG_EPSILON ) {
// polar cap
lon = 0;
x = 0;
} else if ( span <= 1.0 ) {
x = (int)((dlon - lon) / span);
} else {
if ( (dlon >= 0) || (fabs(diff) < FG_EPSILON) ) {
lon = (int)( (int)(lon / span) * span);
/**
* Generate the unique scenery tile index for this bucket
*
* The index is constructed as follows:
*
* 9 bits - to represent 360 degrees of longitude (-180 to 179)
* 8 bits - to represent 180 degrees of latitude (-90 to 89)
*
* Each 1 degree by 1 degree tile is further broken down into an 8x8
* grid. So we also need:
*
* 3 bits - to represent x (0 to 7)
* 3 bits - to represent y (0 to 7)
* @return tile index
*/
inline long int gen_index() const {
return ((lon + 180) << 14) + ((lat + 90) << 6) + (y << 3) + x;
}
/**
* Generate the unique scenery tile index for this bucket in ascii
* string form.
* @return tile index in string form
*/
inline std::string gen_index_str() const {
char tmp[20];
std::sprintf(tmp, "%ld",
(((long)lon + 180) << 14) + ((lat + 90) << 6)
+ (y << 3) + x);
return (std::string)tmp;
}
/**
* Build the base path name for this bucket.
* @return base path in string form
*/
std::string gen_base_path() const;
/**
* @return the center lon of a tile.
*/
inline double get_center_lon() const {
double span = sg_bucket_span( lat + y / 8.0 + SG_HALF_BUCKET_SPAN );
if ( span >= 1.0 ) {
return lon + span / 2.0;
} else {
// cout << " lon = " << lon
// << " tmp = " << (int)((lon-1) / span) << endl;
lon = (int)( (int)((lon + 1) / span) * span - span);
if ( lon < -180 ) {
lon = -180;
}
return lon + x * span + span / 2.0;
}
x = 0;
}
//
// then latitude
//
diff = dlat - (double)(int)dlat;
if ( (dlat >= 0) || (fabs(diff) < FG_EPSILON) ) {
lat = (int)dlat;
} else {
lat = (int)dlat - 1;
/**
* @return the center lat of a tile.
*/
inline double get_center_lat() const {
return lat + y / 8.0 + SG_HALF_BUCKET_SPAN;
}
y = (int)((dlat - lat) * 8);
}
/**
* @return the width of the tile in degrees.
*/
double get_width() const;
// default constructor
inline FGBucket::FGBucket() {}
/**
* @return the height of the tile in degrees.
*/
double get_height() const;
/**
* @return the width of the tile in meters.
*/
double get_width_m() const;
// constructor for specified location
inline FGBucket::FGBucket(const double dlon, const double dlat) {
set_bucket(dlon, dlat);
}
/**
* @return the height of the tile in meters.
*/
double get_height_m() const;
/**
* @return the center of the bucket in geodetic coordinates.
*/
SGGeod get_center() const
{ return SGGeod::fromDeg(get_center_lon(), get_center_lat()); }
// create an impossible bucket if false
inline FGBucket::FGBucket(const bool is_good) {
set_bucket(0.0, 0.0);
if ( !is_good ) {
lon = -1000;
/**
* @return the center of the bucket in geodetic coordinates.
*/
SGGeod get_corner(unsigned num) const
{
double lonFac = ((num + 1) & 2) ? 0.5 : -0.5;
double latFac = ((num ) & 2) ? 0.5 : -0.5;
return SGGeod::fromDeg(get_center_lon() + lonFac*get_width(),
get_center_lat() + latFac*get_height());
}
}
// Parse a unique scenery tile index and find the lon, lat, x, and y
inline FGBucket::FGBucket(const long int bindex) {
long int index = bindex;
// Informational methods.
lon = index >> 14;
index -= lon << 14;
lon -= 180;
lat = index >> 6;
index -= lat << 6;
lat -= 90;
y = index >> 3;
index -= y << 3;
/**
* @return the lon of the lower left corner of
* the 1x1 chunk containing this tile.
*/
inline int get_chunk_lon() const { return lon; }
x = index;
}
/**
* @return the lat of the lower left corner of
* the 1x1 chunk containing this tile.
*/
inline int get_chunk_lat() const { return lat; }
/**
* @return the x coord within the 1x1 degree chunk this tile.
*/
inline int get_x() const { return x; }
// default destructor
inline FGBucket::~FGBucket() {}
/**
* @return the y coord within the 1x1 degree chunk this tile.
*/
inline int get_y() const { return y; }
// friends
// Generate the unique scenery tile index for this bucket
//
// The index is constructed as follows:
//
// 9 bits - to represent 360 degrees of longitude (-180 to 179)
// 8 bits - to represent 180 degrees of latitude (-90 to 89)
//
// Each 1 degree by 1 degree tile is further broken down into an 8x8
// grid. So we also need:
//
// 3 bits - to represent x (0 to 7)
// 3 bits - to represent y (0 to 7)
friend std::ostream& operator<< ( std::ostream&, const SGBucket& );
friend bool operator== ( const SGBucket&, const SGBucket& );
};
inline long int FGBucket::gen_index() {
return ((lon + 180) << 14) + ((lat + 90) << 6) + (y << 3) + x;
}
inline string FGBucket::gen_index_str() const {
char tmp[20];
sprintf(tmp, "%ld",
(((long)lon + 180) << 14) + ((lat + 90) << 6) + (y << 3) + x);
return (string)tmp;
}
// return the center lon of a tile
inline double FGBucket::get_center_lon() const {
double span = bucket_span( lat + y / 8.0 + FG_HALF_BUCKET_SPAN );
if ( span >= 1.0 ) {
return lon + span / 2.0;
} else {
return lon + x * span + span / 2.0;
inline bool operator!= (const SGBucket& lhs, const SGBucket& rhs)
{
return !(lhs == rhs);
}
}
// return the center lat of a tile
inline double FGBucket::get_center_lat() const {
return lat + y / 8.0 + FG_HALF_BUCKET_SPAN;
}
/**
* \relates SGBucket
* Return the bucket which is offset from the specified dlon, dlat by
* the specified tile units in the X & Y direction.
* @param dlon starting lon in degrees
* @param dlat starting lat in degrees
* @param x number of bucket units to offset in x (lon) direction
* @param y number of bucket units to offset in y (lat) direction
* @return offset bucket
*/
SGBucket sgBucketOffset( double dlon, double dlat, int x, int y );
// return width of the tile
inline double FGBucket::get_width() const {
return bucket_span( get_center_lat() );
}
/**
* \relates SGBucket
* Calculate the offset between two buckets (in quantity of buckets).
* @param b1 bucket 1
* @param b2 bucket 2
* @param dx offset distance (lon) in tile units
* @param dy offset distance (lat) in tile units
*/
void sgBucketDiff( const SGBucket& b1, const SGBucket& b2, int *dx, int *dy );
// return height of the tile
inline double FGBucket::get_height() const {
return FG_BUCKET_SPAN;
}
// create an impossible bucket
inline void FGBucket::make_bad( void ) {
set_bucket(0.0, 0.0);
lon = -1000;
}
// offset a bucket struct by the specified tile units in the X & Y
// direction
FGBucket fgBucketOffset( double dlon, double dlat, int x, int y );
// calculate the offset between two buckets
void fgBucketDiff( const FGBucket& b1, const FGBucket& b2, int *dx, int *dy );
/*
// Given a lat/lon, fill in the local tile index array
void fgBucketGenIdxArray(fgBUCKET *p1, fgBUCKET *tiles, int width, int height);
*/
inline ostream&
operator<< ( ostream& out, const FGBucket& b )
/**
* Write the bucket lon, lat, x, and y to the output stream.
* @param out output stream
* @param b bucket
*/
inline std::ostream&
operator<< ( std::ostream& out, const SGBucket& b )
{
return out << b.lon << ":" << b.x << ", " << b.lat << ":" << b.y;
}
/**
* Compare two bucket structures for equality.
* @param b1 bucket 1
* @param b2 bucket 2
* @return comparison result
*/
inline bool
operator== ( const FGBucket& b1, const FGBucket& b2 )
operator== ( const SGBucket& b1, const SGBucket& b2 )
{
return ( b1.lon == b2.lon &&
b1.lat == b2.lat &&

View File

@@ -0,0 +1,2 @@
Makefile
Makefile.in

View File

@@ -0,0 +1,2 @@
Makefile
Makefile.in

View File

@@ -0,0 +1,14 @@
includedir = @includedir@/compatibility/
include_HEADERS = \
iostream \
strstream \
sstream \
istream \
fstream \
iterator \
iomanip \
new \
streambuf \
\
irix_string

View File

@@ -0,0 +1,19 @@
#ifndef __SG_FSTREAM
#define __SG_FSTREAM 1
# if defined(sgi) && !defined(__GNUC__)
# include <fstream.h>
namespace std {
using ::fstream;
using ::ofstream;
using ::ifstream;
};
# endif
#endif // !__SG_FSTREAM

View File

@@ -0,0 +1,16 @@
#ifndef __SG_IOMANIP
#define __SG_IOMANIP 1
# include <iomanip.h>
namespace std {
using ::setw;
using ::setprecision;
inline int setfill(int f) { ::setfill(f); }
};
#endif // !__SG_IOMANIP

View File

@@ -0,0 +1,52 @@
#ifndef __SG_IOSTREAM
#define __SG_IOSTREAM 1
# if defined(sgi) && !defined(__GNUC__)
# include <fstream>
# include <iostream.h>
class ios_base : public ios {
public:
typedef int openmode;
typedef int seekdir;
enum { binary = 0 };
};
namespace std {
using ::cin;
using ::cout;
using ::cerr;
using ::clog;
using ::endl;
using ::ios;
using ::ios_base;
using ::iostream;
using ::istream;
using ::ostream;
using ::dec;
using ::oct;
using ::hex;
enum { skipws=ios::skipws,
left=ios::left, right=ios::right, internal=ios::internal,
showbase=ios::showbase, showpoint=ios::showpoint,
uppercase=ios::uppercase, showpos=ios::showpos,
scientific=ios::scientific, fixed=ios::fixed,
unitbuf=ios::unitbuf, stdio=ios::stdio
#if _BOOL && __EDG_ABI_COMPATIBILITY_VERSION>227 /* bool support */
,boolalpha=ios::boolalpha
#endif /* bool support */
};
};
# endif
#endif // !__SG_IOSTREAM

View File

@@ -0,0 +1,47 @@
#ifndef __SGI_HXX
#define __SGI_HXX 1
#ifdef __cplusplus
#include <string>
inline bool
operator!=( const std::string& lhs, const char* rhs)
{
return lhs.compare( rhs ) != 0;
}
inline bool
operator!=( const char* lhs, const std::string& rhs)
{
return rhs.compare( lhs ) != 0;
}
inline bool
operator==( const std::string& lhs, const char* rhs)
{
return lhs.compare( rhs ) == 0;
}
inline bool
operator==( const char* lhs, const std::string& rhs)
{
return rhs.compare( lhs ) == 0;
}
inline std::string
operator+(const std::string& lhs, const char* rhs)
{
return lhs + std::string(rhs);
}
inline std::string
operator+(const char* lhs, const std::string& rhs)
{
return std::string(lhs) + rhs;
}
#endif /* __cplusplus */
#endif /* !__SGI_HXX */

View File

@@ -0,0 +1,17 @@
#ifndef __SG_ISTREAM
#define __SG_ISTREAM 1
# include <iostream>
# if defined(sgi) && !defined(__GNUC__)
# include <stream.h>
# include <string>
using std::getline;
# endif
#endif // !__SG_ISTREAM

View File

@@ -0,0 +1,8 @@
#ifndef __SG_ITERATOR
#define __SG_ITERATOR 1
# include <iterator.h>
#endif // !__SG_ITERATOR

View File

@@ -0,0 +1,12 @@
#ifndef __SG_NEW
#define __SG_NEW 1
#if defined(sgi) && !defined(__GNUC__)
# include <new.h>
#endif
#endif // !__SG_NEW

View File

@@ -0,0 +1,22 @@
#ifndef __SG_SSTREAM
#define __SG_SSTREAM 1
# include <iostream>
# include <strstream>
# include <string>
namespace std {
class ostringstream : public ostrstream {
public:
std::string str() { return string(ostrstream::str()); }
};
typedef istrstream istringstream;
};
#endif // !__SG_SSTREAM

View File

@@ -0,0 +1,38 @@
#ifndef __SG_STREAMBUF
#define __SG_STREAMBUF 1
# include <iostream>
# include <char_traits.h>
//
// Until we find a good way to rename the original streambuf class
// and derive our own streambuf class from that, define this variable
// for now so the code can inherit our streambuf class instead.
//
# define SG_NEED_STREAMBUF_HACK 1
class __streambuf : virtual public streambuf {
public:
typedef std::char_traits<char> traits_type;
typedef std::char_traits<char>::int_type int_type;
typedef streampos pos_type;
typedef streamoff off_type;
};
# if defined(sgi) && !defined(__GNUC__)
# define pubsync sync
namespace std {
using ::streambuf;
using ::streampos;
using ::streamoff;
};
# endif
#endif // !__SG_STREAMBUF

View File

@@ -0,0 +1,20 @@
#ifndef __SG_STRSTREAM
#define __SG_STRSTREAM 1
# include <strstream.h>
# if defined(sgi) && !defined(__GNUC__)
namespace std {
using ::ends;
using ::strstream;
using ::istrstream;
using ::ostrstream;
};
# endif
#endif // !__SG_STRSTREAM

View File

@@ -0,0 +1,2 @@
Makefile
Makefile.in

View File

@@ -0,0 +1,22 @@
includedir = @includedir@/compatibility
EXTRA_DIST = README
include_HEADERS = \
cfloat \
csetjmp \
cstdio \
cwchar \
cassert \
climits \
csignal \
cstdlib \
cwctype \
cctype \
clocale \
cstdarg \
cstring \
cerrno \
cmath \
cstddef \
ctime

View File

@@ -0,0 +1,9 @@
The following header files where taken from the boost clib package
(http://www.boost.org):
cassert climits csignal cstdlib cwctype
cctype clocale cstdarg cstring
cerrno cmath cstddef ctime
cfloat csetjmp cstdio cwchar

View File

@@ -0,0 +1,10 @@
// This file is automatically generated. Do not edit.
// ['../../../libs/compatibility/generate_cpp_c_headers.py']
// Mon Apr 16 15:16:00 2001 ('PST', 'PDT')
#ifndef __CASSERT_HEADER
#define __CASSERT_HEADER
#include <assert.h>
#endif // CASSERT_HEADER

View File

@@ -0,0 +1,26 @@
// This file is automatically generated. Do not edit.
// ['../../../libs/compatibility/generate_cpp_c_headers.py']
// Mon Apr 16 15:16:00 2001 ('PST', 'PDT')
#ifndef __CCTYPE_HEADER
#define __CCTYPE_HEADER
#include <ctype.h>
namespace std {
using ::isalnum;
using ::isdigit;
using ::isprint;
using ::isupper;
using ::tolower;
using ::isalpha;
using ::isgraph;
using ::ispunct;
using ::isxdigit;
using ::toupper;
using ::iscntrl;
using ::islower;
using ::isspace;
}
#endif // CCTYPE_HEADER

View File

@@ -0,0 +1,10 @@
// This file is automatically generated. Do not edit.
// ['../../../libs/compatibility/generate_cpp_c_headers.py']
// Mon Apr 16 15:16:00 2001 ('PST', 'PDT')
#ifndef __CERRNO_HEADER
#define __CERRNO_HEADER
#include <errno.h>
#endif // CERRNO_HEADER

View File

@@ -0,0 +1,10 @@
// This file is automatically generated. Do not edit.
// ['../../../libs/compatibility/generate_cpp_c_headers.py']
// Mon Apr 16 15:16:00 2001 ('PST', 'PDT')
#ifndef __CFLOAT_HEADER
#define __CFLOAT_HEADER
#include <float.h>
#endif // CFLOAT_HEADER

View File

@@ -0,0 +1,10 @@
// This file is automatically generated. Do not edit.
// ['../../../libs/compatibility/generate_cpp_c_headers.py']
// Mon Apr 16 15:16:00 2001 ('PST', 'PDT')
#ifndef __CLIMITS_HEADER
#define __CLIMITS_HEADER
#include <limits.h>
#endif // CLIMITS_HEADER

View File

@@ -0,0 +1,16 @@
// This file is automatically generated. Do not edit.
// ['../../../libs/compatibility/generate_cpp_c_headers.py']
// Mon Apr 16 15:16:00 2001 ('PST', 'PDT')
#ifndef __CLOCALE_HEADER
#define __CLOCALE_HEADER
#include <locale.h>
namespace std {
using ::lconv;
using ::localeconv;
using ::setlocale;
}
#endif // CLOCALE_HEADER

View File

@@ -0,0 +1,35 @@
// This file is automatically generated. Do not edit.
// ['../../../libs/compatibility/generate_cpp_c_headers.py']
// Mon Apr 16 15:16:00 2001 ('PST', 'PDT')
#ifndef __CMATH_HEADER
#define __CMATH_HEADER
#include <math.h>
namespace std {
using ::acos;
using ::cos;
using ::fmod;
using ::modf;
using ::tan;
using ::asin;
using ::cosh;
using ::frexp;
using ::pow;
using ::tanh;
using ::atan;
using ::exp;
using ::ldexp;
using ::sin;
using ::atan2;
using ::fabs;
using ::log;
using ::sinh;
using ::ceil;
using ::floor;
using ::log10;
using ::sqrt;
}
#endif // CMATH_HEADER

View File

@@ -0,0 +1,15 @@
// This file is automatically generated. Do not edit.
// ['../../../libs/compatibility/generate_cpp_c_headers.py']
// Mon Apr 16 15:16:00 2001 ('PST', 'PDT')
#ifndef __CSETJMP_HEADER
#define __CSETJMP_HEADER
#include <setjmp.h>
namespace std {
using ::jmp_buf;
using ::longjmp;
}
#endif // CSETJMP_HEADER

View File

@@ -0,0 +1,16 @@
// This file is automatically generated. Do not edit.
// ['../../../libs/compatibility/generate_cpp_c_headers.py']
// Mon Apr 16 15:16:00 2001 ('PST', 'PDT')
#ifndef __CSIGNAL_HEADER
#define __CSIGNAL_HEADER
#include <signal.h>
namespace std {
using ::sig_atomic_t;
using ::raise;
using ::signal;
}
#endif // CSIGNAL_HEADER

View File

@@ -0,0 +1,14 @@
// This file is automatically generated. Do not edit.
// ['../../../libs/compatibility/generate_cpp_c_headers.py']
// Mon Apr 16 15:16:00 2001 ('PST', 'PDT')
#ifndef __CSTDARG_HEADER
#define __CSTDARG_HEADER
#include <stdarg.h>
namespace std {
using ::va_list;
}
#endif // CSTDARG_HEADER

View File

@@ -0,0 +1,15 @@
// This file is automatically generated. Do not edit.
// ['../../../libs/compatibility/generate_cpp_c_headers.py']
// Mon Apr 16 15:16:00 2001 ('PST', 'PDT')
#ifndef __CSTDDEF_HEADER
#define __CSTDDEF_HEADER
#include <stddef.h>
namespace std {
using ::ptrdiff_t;
using ::size_t;
}
#endif // CSTDDEF_HEADER

View File

@@ -0,0 +1,57 @@
// This file is automatically generated. Do not edit.
// ['../../../libs/compatibility/generate_cpp_c_headers.py']
// Mon Apr 16 15:16:00 2001 ('PST', 'PDT')
#ifndef __CSTDIO_HEADER
#define __CSTDIO_HEADER
#include <stdio.h>
namespace std {
using ::FILE;
using ::fpos_t;
using ::size_t;
using ::clearerr;
using ::fgets;
using ::fscanf;
using ::gets;
using ::rename;
using ::tmpfile;
using ::fclose;
using ::fopen;
using ::fseek;
using ::perror;
using ::rewind;
using ::tmpnam;
using ::feof;
using ::fprintf;
using ::fsetpos;
using ::printf;
using ::scanf;
using ::ungetc;
using ::ferror;
using ::fputc;
using ::ftell;
using ::putc;
using ::setbuf;
using ::vfprintf;
using ::fflush;
using ::fputs;
using ::fwrite;
using ::putchar;
using ::setvbuf;
using ::vprintf;
using ::fgetc;
using ::fread;
using ::getc;
using ::puts;
using ::sprintf;
using ::vsprintf;
using ::fgetpos;
using ::freopen;
using ::getchar;
using ::remove;
using ::sscanf;
}
#endif // CSTDIO_HEADER

View File

@@ -0,0 +1,43 @@
// This file is automatically generated. Do not edit.
// ['../../../libs/compatibility/generate_cpp_c_headers.py']
// Mon Apr 16 15:16:00 2001 ('PST', 'PDT')
#ifndef __CSTDLIB_HEADER
#define __CSTDLIB_HEADER
#include <stdlib.h>
namespace std {
using ::abort;
using ::atexit;
using ::exit;
using ::getenv;
using ::system;
using ::calloc;
using ::malloc;
using ::free;
using ::realloc;
using ::atol;
using ::mblen;
using ::strtod;
using ::wctomb;
using ::atof;
using ::mbstowcs;
using ::strtol;
using ::wcstombs;
using ::atoi;
using ::mbtowc;
using ::strtoul;
using ::bsearch;
using ::qsort;
using ::div_t;
using ::ldiv_t;
using ::abs;
using ::labs;
using ::srand;
using ::div;
using ::ldiv;
using ::rand;
}
#endif // CSTDLIB_HEADER

View File

@@ -0,0 +1,36 @@
// This file is automatically generated. Do not edit.
// ['../../../libs/compatibility/generate_cpp_c_headers.py']
// Mon Apr 16 15:16:00 2001 ('PST', 'PDT')
#ifndef __CSTRING_HEADER
#define __CSTRING_HEADER
#include <string.h>
namespace std {
using ::size_t;
using ::memchr;
using ::strcat;
using ::strcspn;
using ::strncpy;
using ::strtok;
using ::memcmp;
using ::strchr;
using ::strerror;
using ::strpbrk;
using ::strxfrm;
using ::memcpy;
using ::strcmp;
using ::strlen;
using ::strrchr;
using ::memmove;
using ::strcoll;
using ::strncat;
using ::strspn;
using ::memset;
using ::strcpy;
using ::strncmp;
using ::strstr;
}
#endif // CSTRING_HEADER

View File

@@ -0,0 +1,26 @@
// This file is automatically generated. Do not edit.
// ['../../../libs/compatibility/generate_cpp_c_headers.py']
// Mon Apr 16 15:16:00 2001 ('PST', 'PDT')
#ifndef __CTIME_HEADER
#define __CTIME_HEADER
#include <time.h>
namespace std {
using ::size_t;
using ::clock_t;
using ::time_t;
using ::tm;
using ::asctime;
using ::clock;
using ::difftime;
using ::localtime;
using ::strftime;
using ::ctime;
using ::gmtime;
using ::mktime;
using ::time;
}
#endif // CTIME_HEADER

View File

@@ -0,0 +1,156 @@
// This file is automatically generated. Do not edit.
// ['../../../libs/compatibility/generate_cpp_c_headers.py']
// Mon Apr 16 15:16:00 2001 ('PST', 'PDT')
#ifndef __CWCHAR_HEADER
#define __CWCHAR_HEADER
#include <wchar.h>
namespace std {
using ::mbstate_t;
using ::wint_t;
using ::size_t;
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
using ::btowc;
#endif
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
using ::getwchar;
#endif
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
using ::ungetwc;
#endif
using ::wcscpy;
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
using ::wcsrtombs;
#endif
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
using ::wmemchr;
#endif
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
using ::fgetwc;
#endif
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
using ::mbrlen;
#endif
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
using ::vfwprintf;
#endif
#endif
using ::wcscspn;
using ::wcsspn;
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
using ::wmemcmp;
#endif
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
using ::fgetws;
#endif
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
using ::mbrtowc;
#endif
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
using ::vswprintf;
#endif
#endif
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
using ::wcsftime;
#endif
using ::wcsstr;
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
using ::wmemcpy;
#endif
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
using ::fputwc;
#endif
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
using ::mbsinit;
#endif
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
using ::vwprintf;
#endif
#endif
using ::wcslen;
using ::wcstod;
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
using ::wmemmove;
#endif
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
using ::fputws;
#endif
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
using ::mbsrtowcs;
#endif
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
using ::wcrtomb;
#endif
using ::wcsncat;
using ::wcstok;
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
using ::wmemset;
#endif
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
#if !(defined(__DECCXX_VER) && __DECCXX_VER <= 60290024)
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
using ::fwide;
#endif
#endif
#endif
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
using ::putwc;
#endif
using ::wcscat;
using ::wcsncmp;
using ::wcstol;
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
using ::wprintf;
#endif
#endif
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
using ::fwprintf;
#endif
#endif
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
using ::putwchar;
#endif
using ::wcschr;
using ::wcsncpy;
using ::wcstoul;
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
using ::wscanf;
#endif
#endif
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
using ::fwscanf;
#endif
#endif
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
using ::swprintf;
#endif
#endif
using ::wcscmp;
using ::wcspbrk;
using ::wcsxfrm;
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
using ::getwc;
#endif
#if !(defined(__linux) && defined(__DECCXX_VER) && __DECCXX_VER <= 60390005)
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
using ::swscanf;
#endif
#endif
using ::wcscoll;
using ::wcsrchr;
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
using ::wctob;
#endif
}
#endif // CWCHAR_HEADER

View File

@@ -0,0 +1,39 @@
// This file is automatically generated. Do not edit.
// ['../../../libs/compatibility/generate_cpp_c_headers.py']
// Mon Apr 16 15:16:00 2001 ('PST', 'PDT')
#ifndef __CWCTYPE_HEADER
#define __CWCTYPE_HEADER
#include <wctype.h>
namespace std {
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
using ::wctrans_t;
#endif
using ::wctype_t;
using ::wint_t;
using ::iswalnum;
using ::iswctype;
using ::iswlower;
using ::iswspace;
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
using ::towctrans;
#endif
#if !(defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
using ::wctrans;
#endif
using ::iswalpha;
using ::iswdigit;
using ::iswprint;
using ::iswupper;
using ::towlower;
using ::wctype;
using ::iswcntrl;
using ::iswgraph;
using ::iswpunct;
using ::iswxdigit;
using ::towupper;
}
#endif // CWCTYPE_HEADER

View File

@@ -0,0 +1,3 @@
SUBDIRS = $(MIPSpro_DIRS)
DIST_SUBDIRS = MIPSpro721 MIPSpro740

170
simgear/compiler.h Normal file
View File

@@ -0,0 +1,170 @@
/**************************************************************************
* compiler.h -- C++ Compiler Portability Macros
*
* 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 General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $Id$
*
**************************************************************************/
/** \file compiler.h
* A set of defines to encapsulate compiler and platform differences.
* Please refer to the source code for full documentation on this file.
*
* This file is useful to set compiler-specific options in every file - for
* example, disabling warnings.
*
*/
#ifndef _SG_COMPILER_H
#define _SG_COMPILER_H
/*
* Helper macro SG_STRINGIZE:
* Converts the parameter X to a string after macro replacement
* on X has been performed.
*/
#define SG_STRINGIZE(X) SG_DO_STRINGIZE(X)
#define SG_DO_STRINGIZE(X) #X
#ifdef __GNUC__
# if __GNUC__ < 3
# error Time to upgrade. GNU compilers < 3.0 not supported
# elif (__GNUC__ == 3) && (__GNUC_MINOR__ < 4)
# warning GCC compilers prior to 3.4 are suspect
# endif
# define SG_COMPILER_STR "GNU C++ version " SG_STRINGIZE(__GNUC__) "." SG_STRINGIZE(__GNUC_MINOR__)
#endif // __GNUC__
/* KAI C++ */
#if defined(__KCC)
# define SG_COMPILER_STR "Kai C++ version " SG_STRINGIZE(__KCC_VERSION)
#endif // __KCC
//
// Microsoft compilers.
//
#ifdef _MSC_VER
# define bcopy(from, to, n) memcpy(to, from, n)
# if _MSC_VER >= 1200 // msvc++ 6.0 or greater
# define isnan _isnan
# define snprintf _snprintf
# if _MSC_VER < 1500
# define vsnprintf _vsnprintf
# endif
# define copysign _copysign
# pragma warning(disable: 4786) // identifier was truncated to '255' characters
# pragma warning(disable: 4244) // conversion from double to float
# pragma warning(disable: 4305) //
# else
# error What version of MSVC++ is this?
# endif
# define SG_COMPILER_STR "Microsoft Visual C++ version " SG_STRINGIZE(_MSC_VER)
#endif // _MSC_VER
//
// Native SGI compilers
//
#if defined ( sgi ) && !defined( __GNUC__ )
# if (_COMPILER_VERSION < 740)
# error Need MipsPro 7.4.0 or higher now
# endif
#define SG_HAVE_NATIVE_SGI_COMPILERS
#pragma set woff 1001,1012,1014,1116,1155,1172,1174
#pragma set woff 1401,1460,1551,1552,1681
#ifdef __cplusplus
# pragma set woff 1682,3303
# pragma set woff 3624
#endif
# define SG_COMPILER_STR "SGI MipsPro compiler version " SG_STRINGIZE(_COMPILER_VERSION)
#endif // Native SGI compilers
#if defined (__sun)
# include <strings.h>
# include <memory.h>
# if defined ( __cplusplus )
// typedef unsigned int size_t;
extern "C" {
extern void *memmove(void *, const void *, size_t);
}
# else
extern void *memmove(void *, const void *, size_t);
# endif // __cplusplus
# if !defined( __GNUC__ )
# define SG_COMPILER_STR "Sun compiler version " SG_STRINGIZE(__SUNPRO_CC)
# endif
#endif // sun
//
// Intel C++ Compiler
//
#if defined(__ICC) || defined (__ECC)
# define SG_COMPILER_STR "Intel C++ version " SG_STRINGIZE(__ICC)
#endif // __ICC
//
// Platform dependent gl.h and glut.h definitions
//
#ifdef __APPLE__
# ifdef __GNUC__
# if ( __GNUC__ > 3 ) || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 3 )
inline int (isnan)(double r) { return !(r <= 0 || r >= 0); }
# else
// any C++ header file undefines isinf and isnan
// so this should be included before <iostream>
// the functions are STILL in libm (libSystem on mac os x)
extern "C" int (isnan)(double);
extern "C" int (isinf)(double);
# endif
# else
inline int (isnan)(double r) { return !(r <= 0 || r >= 0); }
# endif
#endif
#if defined (__FreeBSD__)
# if __FreeBSD_version < 500000
extern "C" {
inline int isnan(double r) { return !(r <= 0 || r >= 0); }
}
# endif
#endif
#if defined (__CYGWIN__)
# include <ieeefp.h> // isnan
#endif
//
// No user modifiable definitions beyond here.
//
#endif // _SG_COMPILER_H

163
simgear/constants.h Normal file
View File

@@ -0,0 +1,163 @@
// constants.h -- various constant definitions
//
// Written by Curtis Olson, started February 2000.
//
// Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt/
//
// 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 General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// $Id$
/** \file constants.h
* Various constant definitions.
*/
#ifndef _SG_CONSTANTS_H
#define _SG_CONSTANTS_H
#include <simgear/compiler.h>
#include <cmath>
#include <plib/sg.h>
// Make sure PI is defined in its various forms
// SG_PI and SGD_PI (float and double) come from plib/sg.h
/** 2 * PI */
#define SGD_2PI 6.28318530717958647692
/** PI / 2 */
#ifdef M_PI_2
# define SGD_PI_2 M_PI_2
#else
# define SGD_PI_2 1.57079632679489661923
#endif
/** PI / 4 */
#define SGD_PI_4 0.78539816339744830961
/** \def SG_E "e" */
#ifdef M_E
# define SG_E M_E
#else
# define SG_E 2.7182818284590452354
#endif
/** pi/180/60/60, or about 100 feet at earths' equator */
#define SG_ONE_SECOND 4.848136811E-6
/** Radius of Earth in kilometers at the equator. Another source had
* 6378.165 but this is probably close enough */
#define SG_EARTH_RAD 6378.155
// Maximum terrain elevation from sea level
#define SG_MAX_ELEVATION_M 9000.0
// Earth parameters for WGS 84, taken from LaRCsim/ls_constants.h
/** Value of earth radius from LaRCsim (ft) */
#define SG_EQUATORIAL_RADIUS_FT 20925650.
/** Value of earth radius from LaRCsim (meter) */
#define SG_EQUATORIAL_RADIUS_M 6378138.12
/** Radius squared (ft) */
#define SG_EQ_RAD_SQUARE_FT 437882827922500.
/** Radius squared (meter) */
#define SG_EQ_RAD_SQUARE_M 40680645877797.1344
// Conversions
/** Arc seconds to radians. (arcsec*pi)/(3600*180) = rad */
#define SG_ARCSEC_TO_RAD 4.84813681109535993589e-06
/** Radians to arc seconds. (rad*3600*180)/pi = arcsec */
#define SG_RAD_TO_ARCSEC 206264.806247096355156
/** Feet to Meters */
#define SG_FEET_TO_METER 0.3048
/** Meters to Feet */
#define SG_METER_TO_FEET 3.28083989501312335958
/** Meters to Nautical Miles. 1 nm = 6076.11549 feet */
#define SG_METER_TO_NM 0.0005399568034557235
/** Nautical Miles to Meters */
#define SG_NM_TO_METER 1852.0000
/** Meters to Statute Miles. */
#define SG_METER_TO_SM 0.0006213699494949496
/** Statute Miles to Meters. */
#define SG_SM_TO_METER 1609.3412196
/** Radians to Nautical Miles. 1 nm = 1/60 of a degree */
#define SG_NM_TO_RAD 0.00029088820866572159
/** Nautical Miles to Radians */
#define SG_RAD_TO_NM 3437.7467707849392526
/** meters per second to Knots */
#define SG_MPS_TO_KT 1.9438444924406046432
/** Knots to meters per second */
#define SG_KT_TO_MPS 0.5144444444444444444
/** Feet per second to Knots */
#define SG_FPS_TO_KT 0.5924838012958962841
/** Knots to Feet per second */
#define SG_KT_TO_FPS 1.6878098571011956874
/** meters per second to Miles per hour */
#define SG_MPS_TO_MPH 2.2369362920544020312
/** meetrs per hour to Miles per second */
#define SG_MPH_TO_MPS 0.44704
/** Meters per second to Kilometers per hour */
#define SG_MPS_TO_KMH 3.6
/** Kilometers per hour to meters per second */
#define SG_KMH_TO_MPS 0.2777777777777777778
/** Pascal to Inch Mercury */
#define SG_PA_TO_INHG 0.0002952998330101010
/** Inch Mercury to Pascal */
#define SG_INHG_TO_PA 3386.388640341
/** For divide by zero avoidance, this will be close enough to zero */
#define SG_EPSILON 0.0000001
/** Highest binobj format version we know how to read/write. This starts at
* 0 and can go up to 65535 */
#define SG_BINOBJ_VERSION 6
/** for backwards compatibility */
#define SG_SCENERY_FILE_FORMAT "0.4"
#endif // _SG_CONSTANTS_H

3
simgear/debug/.cvsignore Normal file
View File

@@ -0,0 +1,3 @@
.deps
Makefile
Makefile.in

View File

@@ -8,4 +8,4 @@ include_HEADERS = debug_types.h logstream.hxx
libsgdebug_a_SOURCES = logstream.cxx
INCLUDES += -I$(top_builddir)/src
INCLUDES = -I$(top_srcdir)

View File

@@ -1,38 +1,48 @@
// NB: To add a dbg_class, add it here, and add it to the structure in
// fg_debug.c
/** \file debug_types.h
* Define the various logging classes and prioritiess
*/
/**
* Define the possible classes/categories of logging messages
*/
typedef enum {
FG_NONE = 0x00000000,
SG_NONE = 0x00000000,
FG_TERRAIN = 0x00000001,
FG_ASTRO = 0x00000002,
FG_FLIGHT = 0x00000004,
FG_INPUT = 0x00000008,
FG_GL = 0x00000010,
FG_VIEW = 0x00000020,
FG_COCKPIT = 0x00000040,
FG_GENERAL = 0x00000080,
FG_MATH = 0x00000100,
FG_EVENT = 0x00000200,
FG_AIRCRAFT = 0x00000400,
FG_AUTOPILOT = 0x00000800,
FG_IO = 0x00001000,
FG_CLIPPER = 0x00002000,
FG_NETWORK = 0x00004000,
FG_UNDEFD = 0x00008000, // For range checking
SG_TERRAIN = 0x00000001,
SG_ASTRO = 0x00000002,
SG_FLIGHT = 0x00000004,
SG_INPUT = 0x00000008,
SG_GL = 0x00000010,
SG_VIEW = 0x00000020,
SG_COCKPIT = 0x00000040,
SG_GENERAL = 0x00000080,
SG_MATH = 0x00000100,
SG_EVENT = 0x00000200,
SG_AIRCRAFT = 0x00000400,
SG_AUTOPILOT = 0x00000800,
SG_IO = 0x00001000,
SG_CLIPPER = 0x00002000,
SG_NETWORK = 0x00004000,
SG_ATC = 0x00008000,
SG_NASAL = 0x00010000,
SG_INSTR = 0x00020000,
SG_SYSTEMS = 0x00040000,
SG_UNDEFD = 0x00080000, // For range checking
FG_ALL = 0xFFFFFFFF
} fgDebugClass;
SG_ALL = 0xFFFFFFFF
} sgDebugClass;
// NB: To add a priority, add it here.
/**
* Define the possible logging priorities (and their order).
*/
typedef enum {
FG_BULK, // For frequent messages
FG_DEBUG, // Less frequent debug type messages
FG_INFO, // Informatory messages
FG_WARN, // Possible impending problem
FG_ALERT // Very possible impending problem
// FG_EXIT, // Problem (no core)
// FG_ABORT // Abandon ship (core)
} fgDebugPriority;
SG_BULK = 1, // For frequent messages
SG_DEBUG, // Less frequent debug type messages
SG_INFO, // Informatory messages
SG_WARN, // Possible impending problem
SG_ALERT // Very possible impending problem
// SG_EXIT, // Problem (no core)
// SG_ABORT // Abandon ship (core)
} sgDebugPriority;

View File

@@ -4,29 +4,47 @@
//
// Copyright (C) 1998 Bernie Bright - bbright@c031.aone.net.au
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU 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 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 program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// 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
// General Public License for more details.
// Library General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// $Id$
#include <iostream>
#include "logstream.hxx"
logstream *logstream::global_logstream = 0;
bool logbuf::logging_enabled = true;
fgDebugClass logbuf::logClass = FG_NONE;
fgDebugPriority logbuf::logPriority = FG_INFO;
#ifdef _WIN32
bool logbuf::has_console = true;
#endif
sgDebugClass logbuf::logClass = SG_NONE;
sgDebugPriority logbuf::logPriority = SG_INFO;
streambuf* logbuf::sbuf = NULL;
namespace {
struct ignore_me
{
ignore_me()
{
logstream::initGlobalLogstream();
}
};
static ignore_me im;
}
logbuf::logbuf()
{
// if ( sbuf == NULL )
@@ -49,15 +67,48 @@ logbuf::set_sb( streambuf* sb )
}
void
logbuf::set_log_level( fgDebugClass c, fgDebugPriority p )
logbuf::set_log_level( sgDebugClass c, sgDebugPriority p )
{
logClass = c;
logPriority = p;
}
void
logstream::setLogLevels( fgDebugClass c, fgDebugPriority p )
logbuf::set_log_classes (sgDebugClass c)
{
logClass = c;
}
sgDebugClass
logbuf::get_log_classes ()
{
return logClass;
}
void
logbuf::set_log_priority (sgDebugPriority p)
{
logPriority = p;
}
sgDebugPriority
logbuf::get_log_priority ()
{
return logPriority;
}
void
logstream::setLogLevels( sgDebugClass c, sgDebugPriority p )
{
logbuf::set_log_level( c, p );
}
logstream *
logstream::initGlobalLogstream()
{
// Force initialization of cerr.
static std::ios_base::Init initializer;
if( !global_logstream )
global_logstream = new logstream(std::cerr);
return global_logstream;
}

View File

@@ -1,57 +1,44 @@
// Stream based logging mechanism.
//
/** \file logstream.hxx
* Stream based logging mechanism.
*/
// Written by Bernie Bright, 1998
//
// Copyright (C) 1998 Bernie Bright - bbright@c031.aone.net.au
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU 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 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 program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// 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
// General Public License for more details.
// Library General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// $Id$
#ifndef _LOGSTREAM_H
#define _LOGSTREAM_H
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <simgear/compiler.h>
#ifdef FG_HAVE_STD_INCLUDES
# include <streambuf>
# include <iostream>
#else
# include <iostream.h>
# include <simgear/fg_traits.hxx>
#ifdef _WIN32
# include <windows.h>
#endif
#include <streambuf>
#include <ostream>
#include <cstdio>
#include <simgear/debug/debug_types.h>
#ifndef FG_HAVE_NATIVE_SGI_COMPILERS
FG_USING_STD(streambuf);
FG_USING_STD(ostream);
FG_USING_STD(cerr);
FG_USING_STD(endl);
#endif
#ifdef __MWERKS__
# define cerr std::cerr
# define endl std::endl
FG_USING_STD(iostream);
#endif
using std::streambuf;
using std::ostream;
//
// TODO:
@@ -61,52 +48,105 @@ FG_USING_STD(iostream);
// 3. Read environment for default debugClass and debugPriority.
//
//-----------------------------------------------------------------------------
//
// logbuf is an output-only streambuf with the ability to disable sets of
// messages at runtime. Only messages with priority >= logbuf::logPriority
// and debugClass == logbuf::logClass are output.
//
class logbuf : public streambuf
/**
* logbuf is an output-only streambuf with the ability to disable sets of
* messages at runtime. Only messages with priority >= logbuf::logPriority
* and debugClass == logbuf::logClass are output.
*/
#ifdef SG_NEED_STREAMBUF_HACK
class logbuf : public __streambuf
#else
class logbuf : public std::streambuf
#endif
{
public:
#ifndef FG_HAVE_STD_INCLUDES
typedef char_traits<char> traits_type;
typedef char_traits<char>::int_type int_type;
typedef char_traits<char>::pos_type pos_type;
typedef char_traits<char>::off_type off_type;
#endif
// logbuf( streambuf* sb ) : sbuf(sb) {}
// logbuf( streambuf* sb ) : sbuf(sb) {}
/** Constructor */
logbuf();
/** Destructor */
~logbuf();
// Is logging enabled?
/**
* Is logging enabled?
* @return true or false*/
bool enabled() { return logging_enabled; }
// Set the logging level of subsequent messages.
void set_log_state( fgDebugClass c, fgDebugPriority p );
/**
* Set the logging level of subsequent messages.
* @param c debug class
* @param p priority
*/
void set_log_state( sgDebugClass c, sgDebugPriority p );
// Set the global logging level.
static void set_log_level( fgDebugClass c, fgDebugPriority p );
bool would_log( sgDebugClass c, sgDebugPriority p ) const;
//
void set_sb( streambuf* sb );
/**
* Set the global logging level.
* @param c debug class
* @param p priority
*/
static void set_log_level( sgDebugClass c, sgDebugPriority p );
/**
* Set the allowed logging classes.
* @param c All enabled logging classes anded together.
*/
static void set_log_classes (sgDebugClass c);
/**
* Get the logging classes currently enabled.
* @return All enabled debug logging anded together.
*/
static sgDebugClass get_log_classes ();
/**
* Set the logging priority.
* @param c The priority cutoff for logging messages.
*/
static void set_log_priority (sgDebugPriority p);
/**
* Get the current logging priority.
* @return The priority cutoff for logging messages.
*/
static sgDebugPriority get_log_priority ();
/**
* Set the stream buffer
* @param sb stream buffer
*/
void set_sb( std::streambuf* sb );
#ifdef _WIN32
static void has_no_console() { has_console = false; }
#endif
protected:
/** sync/flush */
inline virtual int sync();
/** overflow */
int_type overflow( int ch );
// int xsputn( const char* s, istreamsize n );
// int xsputn( const char* s, istreamsize n );
private:
// The streambuf used for actual output. Defaults to cerr.rdbuf().
static streambuf* sbuf;
static std::streambuf* sbuf;
static bool logging_enabled;
static fgDebugClass logClass;
static fgDebugPriority logPriority;
#ifdef _WIN32
static bool has_console;
#endif
static sgDebugClass logClass;
static sgDebugPriority logPriority;
private:
@@ -118,103 +158,151 @@ private:
inline int
logbuf::sync()
{
#ifdef FG_HAVE_STD_INCLUDES
return sbuf->pubsync();
#else
return sbuf->sync();
#endif
}
inline void
logbuf::set_log_state( fgDebugClass c, fgDebugPriority p )
logbuf::set_log_state( sgDebugClass c, sgDebugPriority p )
{
logging_enabled = ((c & logClass) != 0 && p >= logPriority);
}
inline bool
logbuf::would_log( sgDebugClass c, sgDebugPriority p ) const
{
return ((c & logClass) != 0 && p >= logPriority);
}
inline logbuf::int_type
logbuf::overflow( int c )
{
#ifdef _WIN32
if ( logging_enabled ) {
if ( !has_console ) {
AllocConsole();
freopen("conin$", "r", stdin);
freopen("conout$", "w", stdout);
freopen("conout$", "w", stderr);
has_console = true;
}
return sbuf->sputc(c);
}
else
return EOF == 0 ? 1: 0;
#else
return logging_enabled ? sbuf->sputc(c) : (EOF == 0 ? 1: 0);
#endif
}
//-----------------------------------------------------------------------------
//
// logstream manipulator for setting the log level of a message.
//
/**
* logstream manipulator for setting the log level of a message.
*/
struct loglevel
{
loglevel( fgDebugClass c, fgDebugPriority p )
loglevel( sgDebugClass c, sgDebugPriority p )
: logClass(c), logPriority(p) {}
fgDebugClass logClass;
fgDebugPriority logPriority;
sgDebugClass logClass;
sgDebugPriority logPriority;
};
//-----------------------------------------------------------------------------
//
// A helper class that ensures a streambuf and ostream are constructed and
// destroyed in the correct order. The streambuf must be created before the
// ostream but bases are constructed before members. Thus, making this class
// a private base of logstream, declared to the left of ostream, we ensure the
// correct order of construction and destruction.
//
/**
* A helper class that ensures a streambuf and ostream are constructed and
* destroyed in the correct order. The streambuf must be created before the
* ostream but bases are constructed before members. Thus, making this class
* a private base of logstream, declared to the left of ostream, we ensure the
* correct order of construction and destruction.
*/
struct logstream_base
{
// logstream_base( streambuf* sb ) : lbuf(sb) {}
// logstream_base( streambuf* sb ) : lbuf(sb) {}
logstream_base() {}
logbuf lbuf;
};
//-----------------------------------------------------------------------------
//
//
//
class logstream : private logstream_base, public ostream
/**
* Class to manage the debug logging stream.
*/
class logstream : private logstream_base, public std::ostream
{
public:
// The default is to send messages to cerr.
logstream( ostream& out )
// : logstream_base(out.rdbuf()),
/**
* The default is to send messages to cerr.
* @param out output stream
*/
logstream( std::ostream& out )
// : logstream_base(out.rdbuf()),
: logstream_base(),
ostream(&lbuf) { lbuf.set_sb(out.rdbuf());}
std::ostream(&lbuf) { lbuf.set_sb(out.rdbuf());}
void set_output( ostream& out ) { lbuf.set_sb( out.rdbuf() ); }
/**
* Set the output stream
* @param out output stream
*/
void set_output( std::ostream& out ) { lbuf.set_sb( out.rdbuf() ); }
// Set the global log class and priority level.
void setLogLevels( fgDebugClass c, fgDebugPriority p );
/**
* Set the global log class and priority level.
* @param c debug class
* @param p priority
*/
void setLogLevels( sgDebugClass c, sgDebugPriority p );
// Output operator to capture the debug level and priority of a message.
inline ostream& operator<< ( const loglevel& l );
bool would_log( sgDebugClass c, sgDebugPriority p ) const
{
return lbuf.would_log( c, p );
};
/**
* Output operator to capture the debug level and priority of a message.
* @param l log level
*/
inline std::ostream& operator<< ( const loglevel& l );
friend logstream& sglog();
static logstream *initGlobalLogstream();
protected:
static logstream *global_logstream;
};
inline ostream&
inline std::ostream&
logstream::operator<< ( const loglevel& l )
{
lbuf.set_log_state( l.logClass, l.logPriority );
return *this;
}
//-----------------------------------------------------------------------------
//
// Return the one and only logstream instance.
// We use a function instead of a global object so we are assured that cerr
// has been initialised.
//
/**
* \relates logstream
* Return the one and only logstream instance.
* We use a function instead of a global object so we are assured that cerr
* has been initialised.
* @return current logstream
*/
inline logstream&
fglog()
sglog()
{
static logstream logstrm( cerr );
return logstrm;
return *logstream::initGlobalLogstream();
}
/** \def SG_LOG(C,P,M)
* Log a message.
* @param C debug class
* @param P priority
* @param M message
*/
#ifdef FG_NDEBUG
# define FG_LOG(C,P,M)
#elif defined( __MWERKS__ )
# define FG_LOG(C,P,M) ::fglog() << ::loglevel(C,P) << M << std::endl
# define SG_LOG(C,P,M)
#else
# define FG_LOG(C,P,M) fglog() << loglevel(C,P) << M << endl
# define SG_LOG(C,P,M) do { \
logstream& __tmplogstreamref(sglog()); \
if(__tmplogstreamref.would_log(C,P)) { \
__tmplogstreamref << loglevel(C,P) << M << std::endl; } \
} while(0)
#endif
#define SG_ORIGIN __FILE__ ":" SG_STRINGIZE(__LINE__)
#endif // _LOGSTREAM_H

View File

@@ -1,23 +1,39 @@
#include <string>
#include "Debug/logstream.hxx"
#include <simgear/debug/logstream.hxx>
class Test {
public:
Test() {
//cout << "Cout seems to work" << endl;
//cerr << "Cerr seems to work" << endl;
sglog().setLogLevels( SG_ALL, SG_INFO );
SG_LOG(SG_EVENT, SG_INFO, "Test::Test" << "foo");
}
};
Test test;
int
main( int argc, char* argv[] )
{
fglog().setLogLevels( FG_ALL, FG_INFO );
sglog().setLogLevels( SG_ALL, SG_INFO );
FG_LOG( FG_TERRAIN, FG_BULK, "terrain::bulk" ); // shouldnt appear
FG_LOG( FG_TERRAIN, FG_DEBUG, "terrain::debug" ); // shouldnt appear
FG_LOG( FG_TERRAIN, FG_INFO, "terrain::info" );
FG_LOG( FG_TERRAIN, FG_WARN, "terrain::warn" );
FG_LOG( FG_TERRAIN, FG_ALERT, "terrain::alert" );
//SG_LOG( FG_TERRAIN, FG_BULK, "terrain::bulk" ); // shouldnt appear
//SG_LOG( FG_TERRAIN, SG_DEBUG, "terrain::debug" ); // shouldnt appear
//SG_LOG( FG_TERRAIN, SG_INFO, "terrain::info" );
//SG_LOG( FG_TERRAIN, FG_WARN, "terrain::warn" );
//SG_LOG( FG_TERRAIN, SG_ALERT, "terrain::alert" );
int i = 12345;
long l = 54321L;
double d = 3.14159;
string s = "Hello world!";
FG_LOG( FG_EVENT, FG_INFO, "event::info "
SG_LOG( SG_EVENT, SG_INFO, "event::info "
<< "i=" << i
<< ", l=" << l
<< ", d=" << d
@@ -25,7 +41,7 @@ main( int argc, char* argv[] )
<< ", s=\"" << s << "\"" );
// This shouldn't appear in log output:
FG_LOG( FG_EVENT, FG_DEBUG, "event::debug "
SG_LOG( SG_EVENT, SG_DEBUG, "event::debug "
<< "- this should be seen - "
<< "d=" << d
<< ", s=\"" << s << "\"" );

View File

@@ -0,0 +1,4 @@
.deps
Makefile
Makefile.in
metar

View File

@@ -0,0 +1,9 @@
includedir = @includedir@/environment
lib_LIBRARIES = libsgenvironment.a
include_HEADERS = metar.hxx visual_enviro.hxx precipitation.hxx
libsgenvironment_a_SOURCES = metar.cxx visual_enviro.cxx precipitation.cxx
INCLUDES = -I$(top_srcdir)

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,278 @@
// metar interface class
//
// Written by Melchior FRANZ, started December 2003.
//
// Copyright (C) 2003 Melchior FRANZ - mfranz@aon.at
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
//
// This program 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
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// $Id$
#ifndef _METAR_HXX
#define _METAR_HXX
#include <vector>
#include <map>
#include <string>
#include <simgear/constants.h>
using std::vector;
using std::map;
using std::string;
const double SGMetarNaN = -1E20;
#define NaN SGMetarNaN
struct Token {
const char *id;
const char *text;
};
class SGMetar;
class SGMetarVisibility {
friend class SGMetar;
public:
SGMetarVisibility() :
_distance(NaN),
_direction(-1),
_modifier(EQUALS),
_tendency(NONE) {}
enum Modifier {
NOGO,
EQUALS,
LESS_THAN,
GREATER_THAN
};
enum Tendency {
NONE,
STABLE,
INCREASING,
DECREASING
};
void set(double dist, int dir = -1, int mod = -1, int tend = -1);
inline double getVisibility_m() const { return _distance; }
inline double getVisibility_ft() const { return _distance == NaN ? NaN : _distance * SG_METER_TO_FEET; }
inline double getVisibility_sm() const { return _distance == NaN ? NaN : _distance * SG_METER_TO_SM; }
inline int getDirection() const { return _direction; }
inline int getModifier() const { return _modifier; }
inline int getTendency() const { return _tendency; }
protected:
double _distance;
int _direction;
int _modifier;
int _tendency;
};
// runway condition (surface and visibility)
class SGMetarRunway {
friend class SGMetar;
public:
SGMetarRunway() :
_deposit(-1),
_deposit_string(0),
_extent(-1),
_extent_string(0),
_depth(NaN),
_friction(NaN),
_friction_string(0),
_comment(0),
_wind_shear(false) {}
inline int getDeposit() const { return _deposit; }
inline const char *getDepositString() const { return _deposit_string; }
inline double getExtent() const { return _extent; }
inline const char *getExtentString() const { return _extent_string; }
inline double getDepth() const { return _depth; }
inline double getFriction() const { return _friction; }
inline const char *getFrictionString() const { return _friction_string; }
inline const char *getComment() const { return _comment; }
inline const bool getWindShear() const { return _wind_shear; }
inline const SGMetarVisibility& getMinVisibility() const { return _min_visibility; }
inline const SGMetarVisibility& getMaxVisibility() const { return _max_visibility; }
protected:
SGMetarVisibility _min_visibility;
SGMetarVisibility _max_visibility;
int _deposit;
const char *_deposit_string;
int _extent;
const char *_extent_string;
double _depth;
double _friction;
const char *_friction_string;
const char *_comment;
bool _wind_shear;
};
// cloud layer
class SGMetarCloud {
friend class SGMetar;
public:
SGMetarCloud() : _coverage(-1), _altitude(NaN), _type(0), _type_long(0) {}
void set(double alt, int cov = -1);
inline int getCoverage() const { return _coverage; }
inline double getAltitude_m() const { return _altitude; }
inline double getAltitude_ft() const { return _altitude == NaN ? NaN : _altitude * SG_METER_TO_FEET; }
inline const char *getTypeString() const { return _type; }
inline const char *getTypeLongString() const { return _type_long; }
protected:
int _coverage; // quarters: 0 -> clear ... 4 -> overcast
double _altitude; // 1000 m
const char *_type; // CU
const char *_type_long; // cumulus
};
class SGMetar {
public:
SGMetar(const string& m, const string& proxy = "", const string& port = "",
const string &auth = "", const time_t time = 0);
~SGMetar();
enum ReportType {
NONE,
AUTO,
COR,
RTD
};
inline const char *getData() const { return _data; }
inline const char *getUnusedData() const { return _m; }
inline const bool getProxy() const { return _x_proxy; }
inline const char *getId() const { return _icao; }
inline int getYear() const { return _year; }
inline int getMonth() const { return _month; }
inline int getDay() const { return _day; }
inline int getHour() const { return _hour; }
inline int getMinute() const { return _minute; }
inline int getReportType() const { return _report_type; }
inline int getWindDir() const { return _wind_dir; }
inline double getWindSpeed_mps() const { return _wind_speed; }
inline double getWindSpeed_kmh() const { return _wind_speed == NaN ? NaN : _wind_speed * SG_MPS_TO_KMH; }
inline double getWindSpeed_kt() const { return _wind_speed == NaN ? NaN : _wind_speed * SG_MPS_TO_KT; }
inline double getWindSpeed_mph() const { return _wind_speed == NaN ? NaN : _wind_speed * SG_MPS_TO_MPH; }
inline double getGustSpeed_mps() const { return _gust_speed; }
inline double getGustSpeed_kmh() const { return _gust_speed == NaN ? NaN : _gust_speed * SG_MPS_TO_KMH; }
inline double getGustSpeed_kt() const { return _gust_speed == NaN ? NaN : _gust_speed * SG_MPS_TO_KT; }
inline double getGustSpeed_mph() const { return _gust_speed == NaN ? NaN : _gust_speed * SG_MPS_TO_MPH; }
inline int getWindRangeFrom() const { return _wind_range_from; }
inline int getWindRangeTo() const { return _wind_range_to; }
inline const SGMetarVisibility& getMinVisibility() const { return _min_visibility; }
inline const SGMetarVisibility& getMaxVisibility() const { return _max_visibility; }
inline const SGMetarVisibility& getVertVisibility() const { return _vert_visibility; }
inline const SGMetarVisibility *getDirVisibility() const { return _dir_visibility; }
inline double getTemperature_C() const { return _temp; }
inline double getTemperature_F() const { return _temp == NaN ? NaN : 1.8 * _temp + 32; }
inline double getDewpoint_C() const { return _dewp; }
inline double getDewpoint_F() const { return _dewp == NaN ? NaN : 1.8 * _dewp + 32; }
inline double getPressure_hPa() const { return _pressure == NaN ? NaN : _pressure / 100; }
inline double getPressure_inHg() const { return _pressure == NaN ? NaN : _pressure * SG_PA_TO_INHG; }
inline int getRain() const { return _rain; }
inline int getHail() const { return _hail; }
inline int getSnow() const { return _snow; }
inline bool getCAVOK() const { return _cavok; }
double getRelHumidity() const;
inline const vector<SGMetarCloud>& getClouds() const { return _clouds; }
inline const map<string, SGMetarRunway>& getRunways() const { return _runways; }
inline const vector<string>& getWeather() const { return _weather; }
protected:
string _url;
int _grpcount;
bool _x_proxy;
char *_data;
char *_m;
char _icao[5];
int _year;
int _month;
int _day;
int _hour;
int _minute;
int _report_type;
int _wind_dir;
double _wind_speed;
double _gust_speed;
int _wind_range_from;
int _wind_range_to;
double _temp;
double _dewp;
double _pressure;
int _rain;
int _hail;
int _snow;
bool _cavok;
SGMetarVisibility _min_visibility;
SGMetarVisibility _max_visibility;
SGMetarVisibility _vert_visibility;
SGMetarVisibility _dir_visibility[8];
vector<SGMetarCloud> _clouds;
map<string, SGMetarRunway> _runways;
vector<string> _weather;
bool scanPreambleDate();
bool scanPreambleTime();
void useCurrentDate();
bool scanType();
bool scanId();
bool scanDate();
bool scanModifier();
bool scanWind();
bool scanVariability();
bool scanVisibility();
bool scanRwyVisRange();
bool scanSkyCondition();
bool scanWeather();
bool scanTemperature();
bool scanPressure();
bool scanRunwayReport();
bool scanWindShear();
bool scanTrendForecast();
bool scanColorState();
bool scanRemark();
bool scanRemainder();
int scanNumber(char **str, int *num, int min, int max = 0);
bool scanBoundary(char **str);
const struct Token *scanToken(char **str, const struct Token *list);
char *loadData(const char *id, const string& proxy, const string& port,
const string &auth, time_t time);
void normalizeData();
};
#undef NaN
#endif // _METAR_HXX

View File

@@ -0,0 +1,195 @@
/**
* @file precipitation.cxx
* @author Nicolas VIVIEN
* @date 2008-02-10
*
* @note Copyright (C) 2008 Nicolas VIVIEN
*
* @brief Precipitation effects to draw rain and snow.
*
* @par Licences
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include "precipitation.hxx"
#include "visual_enviro.hxx"
#include <simgear/constants.h>
#include <osg/ClipNode>
/**
* @brief SGPrecipitation constructor
*
* Build a new OSG object from osgParticle.
*/
SGPrecipitation::SGPrecipitation() :
_freeze(false), _snow_intensity(0.0), _rain_intensity(0.0), _clip_distance(5.0)
{
_precipitationEffect = new osgParticle::PrecipitationEffect;
}
/**
* @brief Build and add the object "precipitationEffect"
*
* This function permits you to create an object precipitationEffect and initialize it.
* I define by default the color of water (for raining)
*/
osg::Group* SGPrecipitation::build(void)
{
osg::Group* group = new osg::Group;
_precipitationEffect->snow(0);
_precipitationEffect->rain(0);
if (_clip_distance!=0.0)
{
osg::ref_ptr<osg::ClipNode> clipNode = new osg::ClipNode;
clipNode->addClipPlane( new osg::ClipPlane( 0 ) );
clipNode->getClipPlane(0)->setClipPlane( 0.0, 0.0, -1.0, -_clip_distance );
clipNode->setReferenceFrame(osg::ClipNode::ABSOLUTE_RF);
clipNode->addChild(_precipitationEffect.get());
group->addChild(clipNode.get());
}
else
{
group->addChild(_precipitationEffect.get());
}
return group;
}
/**
* @brief Define the snow intensity
*
* This function permits you to define and change the snow intensity
* The param 'intensity' is normed (0 to 1).
*/
void SGPrecipitation::setSnowIntensity(float intensity)
{
if (this->_snow_intensity < intensity-0.001)
this->_snow_intensity += 0.001;
else if (this->_snow_intensity > intensity+0.001)
this->_snow_intensity -= 0.001;
else
this->_snow_intensity = intensity;
}
/**
* @brief Define the rain intensity
*
* This function permits you to define and change the rain intensity
* The param 'intensity' is normed (0 to 1).
*/
void SGPrecipitation::setRainIntensity(float intensity)
{
if (this->_rain_intensity < intensity-0.001)
this->_rain_intensity += 0.001;
else if (this->_rain_intensity > intensity+0.001)
this->_rain_intensity -= 0.001;
else
this->_rain_intensity = intensity;
}
/**
* @brief Freeze the rain to snow
*
* @param freeze Boolean
*
* This function permits you to turn off the rain to snow.
*/
void SGPrecipitation::setFreezing(bool freeze)
{
this->_freeze = freeze;
}
/**
* @brief Define the wind direction and speed
*
* This function permits you to define and change the wind direction
*
* After apply the MatrixTransform to the osg::Precipitation object,
* x points full south... From wind heading and speed, we can calculate
* the wind vector.
*/
void SGPrecipitation::setWindProperty(double heading, double speed)
{
double x, y, z;
heading = (heading + 180) * SGD_DEGREES_TO_RADIANS;
speed = speed * SG_FEET_TO_METER;
x = -cos(heading) * speed;
y = sin(heading) * speed;
z = 0;
this->_wind_vec = osg::Vec3(x, y, z);
}
/**
* @brief Update the precipitation effects
*
* This function permits you to update the precipitation effects.
* Be careful, if snow and rain intensity are greater than '0', snow effect
* will be first.
*
* The settings come from the osgParticule/PrecipitationEffect.cpp exemple.
*/
bool SGPrecipitation::update(void)
{
if (this->_freeze) {
if (this->_rain_intensity > 0)
this->_snow_intensity = this->_rain_intensity;
}
bool enabled = sgEnviro.get_precipitation_enable_state();
if (enabled && this->_snow_intensity > 0) {
_precipitationEffect->setWind(_wind_vec);
_precipitationEffect->setParticleSpeed( -0.75f - 0.25f*_snow_intensity);
_precipitationEffect->setParticleSize(0.02f + 0.03f*_snow_intensity);
_precipitationEffect->setMaximumParticleDensity(_snow_intensity * 7.2f);
_precipitationEffect->setCellSize(osg::Vec3(5.0f / (0.25f+_snow_intensity), 5.0f / (0.25f+_snow_intensity), 5.0f));
_precipitationEffect->setNearTransition(25.f);
_precipitationEffect->setFarTransition(100.0f - 60.0f*sqrtf(_snow_intensity));
_precipitationEffect->setParticleColor(osg::Vec4(0.85, 0.85, 0.85, 1.0) - osg::Vec4(0.1, 0.1, 0.1, 1.0) * _snow_intensity);
} else if (enabled && this->_rain_intensity > 0) {
_precipitationEffect->setWind(_wind_vec);
_precipitationEffect->setParticleSpeed( -2.0f + -5.0f*_rain_intensity);
_precipitationEffect->setParticleSize(0.01 + 0.02*_rain_intensity);
_precipitationEffect->setMaximumParticleDensity(_rain_intensity * 7.5f);
_precipitationEffect->setCellSize(osg::Vec3(5.0f / (0.25f+_rain_intensity), 5.0f / (0.25f+_rain_intensity), 5.0f));
_precipitationEffect->setNearTransition(25.f);
_precipitationEffect->setFarTransition(100.0f - 60.0f*sqrtf(_rain_intensity));
_precipitationEffect->setParticleColor( osg::Vec4(0x7A, 0xCE, 0xFF, 0x80));
} else {
_precipitationEffect->snow(0);
_precipitationEffect->rain(0);
}
return true;
}

View File

@@ -0,0 +1,61 @@
/**
* @file precipitation.hxx
* @author Nicolas VIVIEN
* @date 2008-02-10
*
* @note Copyright (C) 2008 Nicolas VIVIEN
*
* @brief Precipitation effects to draw rain and snow.
*
* @par Licences
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef _PRECIPITATION_HXX
#define _PRECIPITATION_HXX
#include <osg/Group>
#include <osg/Referenced>
#include <osgParticle/PrecipitationEffect>
class SGPrecipitation : public osg::Referenced
{
private:
bool _freeze;
float _snow_intensity;
float _rain_intensity;
float _clip_distance;
int _wind_dir;
osg::Vec3 _wind_vec;
osg::ref_ptr<osgParticle::PrecipitationEffect> _precipitationEffect;
public:
SGPrecipitation();
virtual ~SGPrecipitation() {}
osg::Group* build(void);
bool update(void);
void setWindProperty(double, double);
void setFreezing(bool);
void setRainIntensity(float);
void setSnowIntensity(float);
};
#endif

View File

@@ -0,0 +1,798 @@
// Visual environment helper class
//
// Written by Harald JOHNSEN, started April 2005.
//
// Copyright (C) 2005 Harald JOHNSEN - hjohnsen@evc.net
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
//
// This program 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
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
//
#ifdef HAVE_CONFIG_H
# include <simgear_config.h>
#endif
#include <simgear/constants.h>
#include <simgear/structure/SGReferenced.hxx>
#include <simgear/structure/SGSharedPtr.hxx>
#include <simgear/math/sg_random.h>
#include <simgear/math/sg_geodesy.hxx>
#include <simgear/math/point3d.hxx>
#include <simgear/math/polar3d.hxx>
#include <simgear/sound/sample_group.hxx>
#include <simgear/scene/sky/cloudfield.hxx>
#include <simgear/scene/sky/newcloud.hxx>
#include <simgear/props/props.hxx>
#include "visual_enviro.hxx"
#include <vector>
using std::vector;
typedef struct {
Point3D pt;
int depth;
int prev;
} lt_tree_seg;
#define MAX_RAIN_SLICE 200
static float rainpos[MAX_RAIN_SLICE];
#define MAX_LT_TREE_SEG 400
#define DFL_MIN_LIGHT 0.35
sgVec3 SGEnviro::min_light = {DFL_MIN_LIGHT, DFL_MIN_LIGHT, DFL_MIN_LIGHT};
#define DFL_STREAK_BRIGHT_NEARMOST_LAYER 0.9
SGfloat SGEnviro::streak_bright_nearmost_layer = DFL_STREAK_BRIGHT_NEARMOST_LAYER;
#define DFL_STREAK_BRIGHT_FARMOST_LAYER 0.5
SGfloat SGEnviro::streak_bright_farmost_layer = DFL_STREAK_BRIGHT_FARMOST_LAYER;
#define DFL_STREAK_PERIOD_MAX 2.5
SGfloat SGEnviro::streak_period_max = DFL_STREAK_PERIOD_MAX;
#define DFL_STREAK_PERIOD_CHANGE_PER_KT 0.005
SGfloat SGEnviro::streak_period_change_per_kt = DFL_STREAK_PERIOD_CHANGE_PER_KT;
#define DFL_STREAK_PERIOD_MIN 1.0
SGfloat SGEnviro::streak_period_min = DFL_STREAK_PERIOD_MIN;
#define DFL_STREAK_LENGTH_MIN 0.03
SGfloat SGEnviro::streak_length_min = DFL_STREAK_LENGTH_MIN;
#define DFL_STREAK_LENGTH_CHANGE_PER_KT 0.0005
SGfloat SGEnviro::streak_length_change_per_kt = DFL_STREAK_LENGTH_CHANGE_PER_KT;
#define DFL_STREAK_LENGTH_MAX 0.1
SGfloat SGEnviro::streak_length_max = DFL_STREAK_LENGTH_MAX;
#define DFL_STREAK_COUNT_MIN 40
int SGEnviro::streak_count_min = DFL_STREAK_COUNT_MIN;
#define DFL_STREAK_COUNT_MAX 190
#if (DFL_STREAK_COUNT_MAX > MAX_RAIN_SLICE)
#error "Bad default!"
#endif
int SGEnviro::streak_count_max = DFL_STREAK_COUNT_MAX;
#define DFL_CONE_BASE_RADIUS 15.0
SGfloat SGEnviro::cone_base_radius = DFL_CONE_BASE_RADIUS;
#define DFL_CONE_HEIGHT 30.0
SGfloat SGEnviro::cone_height = DFL_CONE_HEIGHT;
void SGEnviro::config(const SGPropertyNode* n)
{
if (!n)
return;
const float ml = n->getFloatValue("min-light", DFL_MIN_LIGHT);
sgSetVec3(min_light, ml, ml, ml);
streak_bright_nearmost_layer = n->getFloatValue(
"streak-brightness-nearmost-layer",
DFL_STREAK_BRIGHT_NEARMOST_LAYER);
streak_bright_farmost_layer = n->getFloatValue(
"streak-brightness-farmost-layer",
DFL_STREAK_BRIGHT_FARMOST_LAYER);
streak_period_max = n->getFloatValue(
"streak-period-max",
DFL_STREAK_PERIOD_MAX);
streak_period_min = n->getFloatValue(
"streak-period-min",
DFL_STREAK_PERIOD_MIN);
streak_period_change_per_kt = n->getFloatValue(
"streak-period-change-per-kt",
DFL_STREAK_PERIOD_CHANGE_PER_KT);
streak_length_max = n->getFloatValue(
"streak-length-max",
DFL_STREAK_LENGTH_MAX);
streak_length_min = n->getFloatValue(
"streak-length-min",
DFL_STREAK_LENGTH_MIN);
streak_length_change_per_kt = n->getFloatValue(
"streak-length-change-per-kt",
DFL_STREAK_LENGTH_CHANGE_PER_KT);
streak_count_min = n->getIntValue(
"streak-count-min", DFL_STREAK_COUNT_MIN);
streak_count_max = n->getIntValue(
"streak-count-max", DFL_STREAK_COUNT_MAX);
if (streak_count_max > MAX_RAIN_SLICE)
streak_count_max = MAX_RAIN_SLICE;
cone_base_radius = n->getFloatValue(
"cone-base-radius", DFL_CONE_BASE_RADIUS);
cone_height = n->getFloatValue("cone_height", DFL_CONE_HEIGHT);
}
/**
* A class to render lightnings.
*/
class SGLightning {
public:
/**
* Build a new lightning.
* The lightning has a limited life time. It will also play a thunder sounder once.
* @param lon lon longitude in degree
* @param lat lat latitude in degree
* @param alt asl of top of lightning
*/
SGLightning(double lon, double lat, double alt);
~SGLightning();
void lt_Render(void);
void lt_build(void);
void lt_build_tree_branch(int tree_nr, Point3D &start, float energy, int nbseg, float segsize);
// contains all the segments of the lightning
lt_tree_seg lt_tree[MAX_LT_TREE_SEG];
// segment count
int nb_tree;
// position of lightning
double lon, lat, alt;
int sequence_count;
// time to live
double age;
};
typedef vector<SGLightning *> list_of_lightning;
static list_of_lightning lightnings;
SGEnviro sgEnviro;
SGEnviro::SGEnviro() :
view_in_cloud(false),
precipitation_enable_state(true),
precipitation_density(100.0),
precipitation_max_alt(0.0),
turbulence_enable_state(false),
last_cloud_turbulence(0.0),
cloud_turbulence(0.0),
lightning_enable_state(false),
elapsed_time(0.0),
dt(0.0),
sampleGroup(NULL),
snd_active(false),
snd_dist(0.0),
min_time_before_lt(0.0),
fov_width(55.0),
fov_height(55.0)
{
for(int i = 0; i < MAX_RAIN_SLICE ; i++)
rainpos[i] = sg_random();
radarEcho.reserve(100);
}
SGEnviro::~SGEnviro(void) {
if (sampleGroup) delete sampleGroup;
// OSGFIXME
return;
list_of_lightning::iterator iLightning;
for( iLightning = lightnings.begin() ; iLightning != lightnings.end() ; iLightning++ ) {
delete (*iLightning);
}
lightnings.clear();
}
void SGEnviro::startOfFrame( sgVec3 p, sgVec3 up, double lon, double lat, double alt, double delta_time) {
// OSGFIXME
return;
view_in_cloud = false;
// ask the impostor cache to do some cleanup
last_cloud_turbulence = cloud_turbulence;
cloud_turbulence = 0.0;
elapsed_time += delta_time;
min_time_before_lt -= delta_time;
dt = delta_time;
sgMat4 T1, LON, LAT;
sgVec3 axis;
sgMakeTransMat4( T1, p );
sgSetVec3( axis, 0.0, 0.0, 1.0 );
sgMakeRotMat4( LON, lon, axis );
sgSetVec3( axis, 0.0, 1.0, 0.0 );
sgMakeRotMat4( LAT, 90.0 - lat, axis );
sgMat4 TRANSFORM;
sgCopyMat4( TRANSFORM, T1 );
sgPreMultMat4( TRANSFORM, LON );
sgPreMultMat4( TRANSFORM, LAT );
sgCoord pos;
sgSetCoord( &pos, TRANSFORM );
sgMakeCoordMat4( transform, &pos );
last_lon = lon;
last_lat = lat;
last_alt = alt;
radarEcho.clear();
precipitation_max_alt = 400.0;
}
void SGEnviro::endOfFrame(void) {
}
double SGEnviro::get_cloud_turbulence(void) const {
return last_cloud_turbulence;
}
// this can be queried to add some turbulence for example
bool SGEnviro::is_view_in_cloud(void) const {
return view_in_cloud;
}
void SGEnviro::set_view_in_cloud(bool incloud) {
view_in_cloud = incloud;
}
bool SGEnviro::get_turbulence_enable_state(void) const {
return turbulence_enable_state;
}
void SGEnviro::set_turbulence_enable_state(bool enable) {
turbulence_enable_state = enable;
}
// rain/snow
float SGEnviro::get_precipitation_density(void) const {
return precipitation_density;
}
bool SGEnviro::get_precipitation_enable_state(void) const {
return precipitation_enable_state;
}
void SGEnviro::set_precipitation_density(float density) {
precipitation_density = density;
}
void SGEnviro::set_precipitation_enable_state(bool enable) {
precipitation_enable_state = enable;
}
// others
bool SGEnviro::get_lightning_enable_state(void) const {
return lightning_enable_state;
}
void SGEnviro::set_lightning_enable_state(bool enable) {
lightning_enable_state = enable;
if( ! enable ) {
// TODO:cleanup
}
}
void SGEnviro::setLight(sgVec4 adj_fog_color) {
// OSGFIXME
return;
sgCopyVec4( fog_color, adj_fog_color );
if( false ) {
// ssgGetLight( 0 ) -> setColour( GL_DIFFUSE, l->scene_diffuse() );
}
}
#if 0
void SGEnviro::callback_cloud(float heading, float alt, float radius, int family, float dist, int cloudId) {
// send data to wx radar
// compute turbulence
// draw precipitation
// draw lightning
// compute illumination
// http://www.pilotfriend.com/flight_training/weather/THUNDERSTORM%20HAZARDS1.htm
double turbulence = 0.0;
if( dist < radius * radius * 2.25f ) {
switch(family) {
case SGNewCloud::CLFamilly_st:
turbulence = 0.2;
break;
case SGNewCloud::CLFamilly_ci:
case SGNewCloud::CLFamilly_cs:
case SGNewCloud::CLFamilly_cc:
case SGNewCloud::CLFamilly_ac:
case SGNewCloud::CLFamilly_as:
turbulence = 0.1;
break;
case SGNewCloud::CLFamilly_sc:
turbulence = 0.3;
break;
case SGNewCloud::CLFamilly_ns:
turbulence = 0.4;
break;
case SGNewCloud::CLFamilly_cu:
turbulence = 0.5;
break;
case SGNewCloud::CLFamilly_cb:
turbulence = 0.6;
break;
}
// full turbulence inside cloud, half in the vicinity
if( dist > radius * radius )
turbulence *= 0.5;
if( turbulence > cloud_turbulence )
cloud_turbulence = turbulence;
// we can do 'local' precipitations too
}
// convert to LWC for radar (experimental)
// http://www-das.uwyo.edu/~geerts/cwx/notes/chap08/moist_cloud.html
double LWC = 0.0;
switch(family) {
case SGNewCloud::CLFamilly_st:
LWC = 0.29;
break;
case SGNewCloud::CLFamilly_cu:
LWC = 0.27;
break;
case SGNewCloud::CLFamilly_cb:
LWC = 2.0;
break;
case SGNewCloud::CLFamilly_sc:
LWC = 0.44;
break;
case SGNewCloud::CLFamilly_ci:
LWC = 0.03;
break;
// no data
case SGNewCloud::CLFamilly_cs:
case SGNewCloud::CLFamilly_cc:
case SGNewCloud::CLFamilly_ac:
case SGNewCloud::CLFamilly_as:
LWC = 0.03;
break;
case SGNewCloud::CLFamilly_ns:
LWC = 0.29*2.0;
break;
}
// add to the list for the wxRadar instrument
if( LWC > 0.0 )
radarEcho.push_back( SGWxRadarEcho ( heading, alt, radius, dist, LWC, false, cloudId ) );
// NB:data valid only from cockpit view
// spawn a new lightning
if(lightning_enable_state && min_time_before_lt <= 0.0 && (family == SGNewCloud::CLFamilly_cb) &&
dist < 15000.0 * 15000.0 && sg_random() > 0.9f) {
double lat, lon;
Point3D orig, dest;
orig.setlat(last_lat * SG_DEGREES_TO_RADIANS );
orig.setlon(last_lon * SG_DEGREES_TO_RADIANS );
orig.setelev(0.0);
dist = sgSqrt(dist);
dest = calc_gc_lon_lat(orig, heading, dist);
lon = dest.lon() * SG_RADIANS_TO_DEGREES;
lat = dest.lat() * SG_RADIANS_TO_DEGREES;
addLightning( lon, lat, alt );
// reset timer
min_time_before_lt = 5.0 + sg_random() * 30;
// DEBUG only
// min_time_before_lt = 5.0;
}
if( (alt - radius * 0.1) > precipitation_max_alt )
switch(family) {
case SGNewCloud::CLFamilly_st:
case SGNewCloud::CLFamilly_cu:
case SGNewCloud::CLFamilly_cb:
case SGNewCloud::CLFamilly_ns:
case SGNewCloud::CLFamilly_sc:
precipitation_max_alt = alt - radius * 0.1;
break;
}
}
#endif
list_of_SGWxRadarEcho *SGEnviro::get_radar_echo(void) {
return &radarEcho;
}
// precipitation rendering code
void SGEnviro::DrawCone2(float baseRadius, float height, int slices, bool down, double rain_norm, double speed) {
// OSGFIXME
return;
sgVec3 light;
sgAddVec3( light, fog_color, min_light );
float da = SG_PI * 2.0f / (float) slices;
// low number = faster
float speedf = streak_period_max - speed * streak_period_change_per_kt;
if( speedf < streak_period_min )
speedf = streak_period_min;
float lenf = streak_length_min + speed * streak_length_change_per_kt;
if( lenf > streak_length_max )
lenf = streak_length_max;
float t = fmod((float) elapsed_time, speedf) / speedf;
// t = 0.1f;
if( !down )
t = 1.0f - t;
float angle = 0.0f;
//glColor4f(1.0f, 0.7f, 0.7f, 0.9f); // XXX unneeded? overriden below
glBegin(GL_LINES);
if (slices > MAX_RAIN_SLICE)
slices = MAX_RAIN_SLICE; // should never happen
for( int i = 0 ; i < slices ; i++ ) {
float x = cos(angle) * baseRadius;
float y = sin(angle) * baseRadius;
angle += da;
sgVec3 dir = {x, -height, y};
// rain drops at 2 different speed to simulate depth
float t1 = (i & 1 ? t : t + t) + rainpos[i];
if(t1 > 1.0f) t1 -= 1.0f;
if(t1 > 1.0f) t1 -= 1.0f;
// distant raindrops are more transparent
float c = t1 * (i & 1 ?
streak_bright_farmost_layer
: streak_bright_nearmost_layer);
glColor4f(c * light[0], c * light[1], c * light[2], c);
sgVec3 p1, p2;
sgScaleVec3(p1, dir, t1);
// distant raindrops are shorter
float t2 = t1 + (i & 1 ? lenf : lenf+lenf);
sgScaleVec3(p2, dir, t2);
glVertex3f(p1[0], p1[1] + height, p1[2]);
glVertex3f(p2[0], p2[1] + height, p2[2]);
}
glEnd();
}
void SGEnviro::drawRain(double pitch, double roll, double heading, double hspeed, double rain_norm) {
// OSGFIXME
return;
#if 0
static int debug_period = 0;
if (debug_period++ == 50) {
debug_period = 0;
cout << "drawRain("
<< pitch << ", "
<< roll << ", "
<< heading << ", "
<< hspeed << ", "
<< rain_norm << ");"
//" angle = " << angle
//<< " raindrop(KTS) = " << raindrop_speed_kts
<< endl;
}
#endif
glBindTexture(GL_TEXTURE_2D, 0);
glDisable(GL_DEPTH_TEST);
glShadeModel(GL_SMOOTH);
glEnable(GL_BLEND);
glBlendFunc( GL_ONE, GL_ONE_MINUS_SRC_ALPHA );
glDisable( GL_FOG );
glDisable(GL_LIGHTING);
int slice_count = static_cast<int>(
(streak_count_min + rain_norm*(streak_count_max-streak_count_min))
* precipitation_density / 100.0);
// www.wonderquest.com/falling-raindrops.htm says that
// Raindrop terminal velocity is 5 to 20mph
// Rather than model it accurately (temp, pressure, diameter), and make it
// smaller than terminal when closer to the precipitation cloud base,
// we interpolate in the 5-20mph range according to rain_norm.
double raindrop_speed_kts
= (5.0 + rain_norm*15.0) * SG_MPH_TO_MPS * SG_MPS_TO_KT;
float angle = atanf(hspeed / raindrop_speed_kts) * SG_RADIANS_TO_DEGREES;
glPushMatrix();
// the cone rotate with hspeed
angle = -pitch - angle;
glRotatef(roll, 0.0, 0.0, 1.0);
glRotatef(heading, 0.0, 1.0, 0.0);
glRotatef(angle, 1.0, 0.0, 0.0);
// up cone
DrawCone2(cone_base_radius, cone_height,
slice_count, true, rain_norm, hspeed);
// down cone (usually not visible)
if(angle > 0.0 || heading != 0.0)
DrawCone2(cone_base_radius, -cone_height,
slice_count, false, rain_norm, hspeed);
glPopMatrix();
glEnable(GL_LIGHTING);
glBlendFunc ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ) ;
glEnable( GL_FOG );
glEnable(GL_DEPTH_TEST);
}
void SGEnviro::set_sampleGroup(SGSampleGroup *sgr) {
sampleGroup = sgr;
}
void SGEnviro::drawPrecipitation(double rain_norm, double snow_norm, double hail_norm, double pitch, double roll, double heading, double hspeed) {
// OSGFIXME
return;
if( precipitation_enable_state && rain_norm > 0.0)
if( precipitation_max_alt >= last_alt )
drawRain(pitch, roll, heading, hspeed, rain_norm);
}
SGLightning::SGLightning(double _lon, double _lat, double _alt) :
nb_tree(0),
lon(_lon),
lat(_lat),
alt(_alt),
age(1.0 + sg_random() * 4.0)
{
// sequence_count = 1 + sg_random() * 5.0;
lt_build();
}
SGLightning::~SGLightning() {
}
// lightning rendering code
void SGLightning::lt_build_tree_branch(int tree_nr, Point3D &start, float energy, int nbseg, float segsize) {
// OSGFIXME
return;
sgVec3 dir, newdir;
int nseg = 0;
Point3D pt = start;
if( nbseg == 50 )
sgSetVec3( dir, 0.0, -1.0, 0.0 );
else {
sgSetVec3( dir, sg_random() - 0.5f, sg_random() - 0.5f, sg_random() - 0.5f);
sgNormaliseVec3(dir);
}
if( nb_tree >= MAX_LT_TREE_SEG )
return;
lt_tree[nb_tree].depth = tree_nr;
nseg = 0;
lt_tree[nb_tree].pt = pt;
lt_tree[nb_tree].prev = -1;
nb_tree ++;
// TODO:check agl
while(nseg < nbseg && pt.y() > 0.0) {
int prev = nb_tree - 1;
nseg++;
// add a branch
if( energy * sg_random() > 0.8f )
lt_build_tree_branch(tree_nr + 1, pt, energy * 0.9f, nbseg == 50 ? 10 : static_cast<int>(nbseg * 0.4f), segsize * 0.7f);
if( nb_tree >= MAX_LT_TREE_SEG )
return;
sgSetVec3(newdir, (sg_random() - 0.5f), (sg_random() - 0.5f) - (nbseg == 50 ? 0.5f : 0.0), (sg_random() - 0.5f));
sgNormaliseVec3(newdir);
sgAddVec3( dir, newdir);
sgNormaliseVec3(dir);
sgVec3 scaleDir;
sgScaleVec3( scaleDir, dir, segsize * energy * 0.5f );
pt[PX] += scaleDir[0];
pt[PY] += scaleDir[1];
pt[PZ] += scaleDir[2];
lt_tree[nb_tree].depth = tree_nr;
lt_tree[nb_tree].pt = pt;
lt_tree[nb_tree].prev = prev;
nb_tree ++;
}
}
void SGLightning::lt_build(void) {
// OSGFIXME
return;
Point3D top;
nb_tree = 0;
top[PX] = 0 ;
top[PY] = alt;
top[PZ] = 0;
lt_build_tree_branch(0, top, 1.0, 50, top[PY] / 8.0);
if( ! sgEnviro.sampleGroup )
return;
Point3D start( sgEnviro.last_lon*SG_DEGREES_TO_RADIANS, sgEnviro.last_lat*SG_DEGREES_TO_RADIANS, 0.0 );
Point3D dest( lon*SG_DEGREES_TO_RADIANS, lat*SG_DEGREES_TO_RADIANS, 0.0 );
double course = 0.0, dist = 0.0;
calc_gc_course_dist( dest, start, &course, &dist );
if( dist < 10000.0 && ! sgEnviro.snd_playing && (dist < sgEnviro.snd_dist || ! sgEnviro.snd_active) ) {
sgEnviro.snd_timer = 0.0;
sgEnviro.snd_wait = dist / 340;
sgEnviro.snd_dist = dist;
sgEnviro.snd_pos_lat = lat;
sgEnviro.snd_pos_lon = lon;
sgEnviro.snd_active = true;
sgEnviro.snd_playing = false;
}
}
void SGLightning::lt_Render(void) {
// OSGFIXME
return;
float flash = 0.5;
if( fmod(sgEnviro.elapsed_time*100.0, 100.0) > 50.0 )
flash = sg_random() * 0.75f + 0.25f;
float h = lt_tree[0].pt[PY];
sgVec4 col={0.62f, 0.83f, 1.0f, 1.0f};
sgVec4 c;
#define DRAW_SEG() \
{glColorMaterial(GL_FRONT, GL_EMISSION); \
glDisable(GL_LINE_SMOOTH); glBegin(GL_LINES); \
glColor4fv(c); \
glVertex3f(lt_tree[n].pt[PX], lt_tree[n].pt[PZ], lt_tree[n].pt[PY]); \
glVertex3f(lt_tree[lt_tree[n].prev].pt[PX], lt_tree[lt_tree[n].prev].pt[PZ], lt_tree[lt_tree[n].prev].pt[PY]); \
glEnd(); glEnable(GL_LINE_SMOOTH);}
glDepthMask( GL_FALSE );
glEnable(GL_BLEND);
glBlendFunc( GL_DST_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
glBindTexture(GL_TEXTURE_2D, 0);
glDisable(GL_LIGHTING);
glDisable( GL_FOG );
glPushMatrix();
sgMat4 modelview, tmp;
// OSGFIXME
// ssgGetModelviewMatrix( modelview );
sgCopyMat4( tmp, sgEnviro.transform );
sgPostMultMat4( tmp, modelview );
// OSGFIXME
// ssgLoadModelviewMatrix( tmp );
Point3D start( sgEnviro.last_lon*SG_DEGREES_TO_RADIANS, sgEnviro.last_lat*SG_DEGREES_TO_RADIANS, 0.0 );
Point3D dest( lon*SG_DEGREES_TO_RADIANS, lat*SG_DEGREES_TO_RADIANS, 0.0 );
double course = 0.0, dist = 0.0;
calc_gc_course_dist( dest, start, &course, &dist );
double ax = 0.0, ay = 0.0;
ax = cos(course) * dist;
ay = sin(course) * dist;
glTranslatef( ax, ay, -sgEnviro.last_alt );
sgEnviro.radarEcho.push_back( SGWxRadarEcho ( course, 0.0, 0.0, dist, age, true, 0 ) );
for( int n = 0 ; n < nb_tree ; n++ ) {
if( lt_tree[n].prev < 0 )
continue;
float t1 = sgLerp(0.5, 1.0, lt_tree[n].pt[PY] / h);
t1 *= flash;
if( lt_tree[n].depth >= 2 ) {
glLineWidth(3);
sgScaleVec4(c, col, t1 * 0.6f);
DRAW_SEG();
} else {
if( lt_tree[n].depth == 0 ) {
glLineWidth(12);
sgScaleVec4(c, col, t1 * 0.5f);
DRAW_SEG();
glLineWidth(6);
sgScaleVec4(c, col, t1);
DRAW_SEG();
} else {
glLineWidth(6);
sgScaleVec4(c, col, t1 * 0.7f);
DRAW_SEG();
}
if( lt_tree[n].depth == 0 )
glLineWidth(3);
else
glLineWidth(2);
sgSetVec4(c, t1, t1, t1, t1);
DRAW_SEG();
}
}
glLineWidth(1);
glBlendFunc ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ) ;
glPopMatrix();
glDepthMask( GL_TRUE );
glEnable( GL_FOG );
glEnable(GL_LIGHTING);
}
void SGEnviro::addLightning(double lon, double lat, double alt) {
// OSGFIXME
return;
if( lightnings.size() > 10)
return;
SGLightning *lt= new SGLightning(lon, lat, alt);
lightnings.push_back(lt);
}
void SGEnviro::drawLightning(void) {
// OSGFIXME
return;
list_of_lightning::iterator iLightning;
// play 'thunder' for lightning
if( snd_active ) {
if( !snd_playing ) {
// wait until sound has reached us
snd_timer += dt;
if( snd_timer >= snd_wait ) {
snd_playing = true;
// compute relative position of lightning
Point3D start( sgEnviro.last_lon*SG_DEGREES_TO_RADIANS, sgEnviro.last_lat*SG_DEGREES_TO_RADIANS, 0.0 );
Point3D dest( snd_pos_lon*SG_DEGREES_TO_RADIANS, snd_pos_lat*SG_DEGREES_TO_RADIANS, 0.0 );
double course = 0.0, dist = 0.0;
calc_gc_course_dist( dest, start, &course, &dist );
double ax = 0.0, ay = 0.0;
ax = cos(course) * dist;
ay = sin(course) * dist;
SGSharedPtr<SGSoundSample> snd = sampleGroup->find("thunder");
if( snd ) {
SGVec3d pos = SGVec3d(ax, ay, -sgEnviro.last_alt);
snd->set_position(pos);
snd->play_once();
}
}
} else {
if( !sampleGroup->is_playing("thunder") ) {
snd_active = false;
snd_playing = false;
}
}
}
if( ! lightning_enable_state )
return;
for( iLightning = lightnings.begin() ; iLightning != lightnings.end() ; iLightning++ ) {
if( dt )
if( sg_random() > 0.95f )
(*iLightning)->lt_build();
(*iLightning)->lt_Render();
(*iLightning)->age -= dt;
if( (*iLightning)->age < 0.0 ) {
delete (*iLightning);
lightnings.erase( iLightning );
break;
}
}
}
void SGEnviro::setFOV( float w, float h ) {
fov_width = w;
fov_height = h;
}
void SGEnviro::getFOV( float &w, float &h ) {
w = fov_width;
h = fov_height;
}

View File

@@ -0,0 +1,258 @@
// Visual environment helper class
//
// Written by Harald JOHNSEN, started April 2005.
//
// Copyright (C) 2005 Harald JOHNSEN - hjohnsen@evc.net
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
//
// This program 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
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
//
#ifndef _VISUAL_ENVIRO_HXX
#define _VISUAL_ENVIRO_HXX
#include <plib/sg.h>
#include <simgear/compiler.h>
#include <string>
#include <vector>
using std::vector;
using std::string;
class SGLightning;
class SGSampleGroup;
/**
* Simulate some echo on a weather radar.
* Container class for the wx radar instrument.
*/
class SGWxRadarEcho {
public:
SGWxRadarEcho(float _heading, float _alt, float _radius, float _dist,
double _LWC, bool _lightning, int _cloudId ) :
heading( _heading ),
alt ( _alt ),
radius ( _radius ),
dist ( _dist ),
LWC ( _LWC ),
lightning ( _lightning ),
cloudId ( _cloudId )
{}
/** the heading in radian is versus north */
float heading;
float alt, radius, dist;
/** reflectivity converted to liquid water content. */
double LWC;
/** if true then this data is for a lightning else it is for water echo. */
bool lightning;
/** Unique identifier of cloud */
int cloudId;
};
typedef vector<SGWxRadarEcho> list_of_SGWxRadarEcho;
/**
* Visual environment helper class.
*/
class SGEnviro {
friend class SGLightning;
private:
void DrawCone2(float baseRadius, float height, int slices, bool down, double rain_norm, double speed);
void lt_update(void);
bool view_in_cloud;
bool precipitation_enable_state;
float precipitation_density;
float precipitation_max_alt;
bool turbulence_enable_state;
double last_cloud_turbulence, cloud_turbulence;
bool lightning_enable_state;
double elapsed_time, dt;
sgVec4 fog_color;
sgMat4 transform;
double last_lon, last_lat, last_alt;
SGSampleGroup *sampleGroup;
bool snd_active, snd_playing;
double snd_timer, snd_wait, snd_pos_lat, snd_pos_lon, snd_dist;
double min_time_before_lt;
float fov_width, fov_height;
/** a list of all the radar echo. */
list_of_SGWxRadarEcho radarEcho;
static sgVec3 min_light;
static SGfloat streak_bright_nearmost_layer,
streak_bright_farmost_layer,
streak_period_max,
streak_period_change_per_kt,
streak_period_min,
streak_length_min,
streak_length_change_per_kt,
streak_length_max;
static int streak_count_min, streak_count_max;
static SGfloat cone_base_radius,
cone_height;
public:
SGEnviro();
~SGEnviro();
/** Read the config from the precipitation rendering config properties.
* @param precip_rendering_cfgNode "/sim/rendering/precipitation" in fg
* Set from whatever info present in the
* subnodes passed, substituting hardwired defaults for missing fields.
* If NULL is given, do nothing.
*/
void config(const class SGPropertyNode* precip_rendering_cfgNode);
/**
* Forward a few states used for renderings.
*/
void startOfFrame( sgVec3 p, sgVec3 up, double lon, double lat, double alt, double delta_time);
void endOfFrame(void);
#if 0
/**
* Whenever a cloud is drawn we check his 'impact' on the environment.
* @param heading direction of cloud in radians
* @param alt asl of cloud in meters
* @param radius radius of cloud in meters
* @param family cloud family
* @param dist squared dist to cloud in meters
*/
void callback_cloud(float heading, float alt, float radius, int family, float dist, int cloudId);
#endif
void drawRain(double pitch, double roll, double heading, double hspeed, double rain_norm);
/**
* Draw rain or snow precipitation around the viewer.
* @param rain_norm rain normalized intensity given by metar class
* @param snow_norm snow normalized intensity given by metar class
* @param hail_norm hail normalized intensity given by metar class
* @param pitch pitch rotation of viewer
* @param roll roll rotation of viewer
* @param hspeed moving horizontal speed of viewer in kt
*/
void drawPrecipitation(double rain_norm, double snow_norm, double hail_norm,
double pitch, double roll, double heading, double hspeed);
/**
* Draw the lightnings spawned by cumulo nimbus.
*/
void drawLightning(void);
/**
* Forward the fog color used by the rain rendering.
* @param adj_fog_color color of the fog
*/
void setLight(sgVec4 adj_fog_color);
// this can be queried to add some turbulence for example
bool is_view_in_cloud(void) const;
void set_view_in_cloud(bool incloud);
double get_cloud_turbulence(void) const;
// Clouds
// return the size of the memory pool used by texture impostors
int get_clouds_CacheSize(void) const;
int get_CacheResolution(void) const;
float get_clouds_visibility(void) const;
float get_clouds_density(void) const;
bool get_clouds_enable_state(void) const;
bool get_turbulence_enable_state(void) const;
/**
* Set the size of the impostor texture cache for 3D clouds.
* @param sizeKb size of the texture pool in Kb
*/
void set_clouds_CacheSize(int sizeKb);
/**
* Set the resolution of the impostor texture for 3D clouds.
* @param resolutionPixels size of each texture in pixels (64|128|256)
*/
void set_CacheResolution(int resolutionPixels);
/**
* Set the maximum range used when drawing clouds.
* Clouds are blended from totaly transparent at max range to totaly opaque around the viewer
* @param distance in meters
*/
void set_clouds_visibility(float distance);
/**
* Set the proportion of clouds that will be rendered to limit drop in FPS.
* @param density 0..100 no clouds drawn when density == 0, all are drawn when density == 100
*/
void set_clouds_density(float density);
/**
* Enable or disable the use of 3D clouds.
* @param enable when false we draw the 2D layers
*/
void set_clouds_enable_state(bool enable);
/**
* Enable or disable the use of proximity cloud turbulence.
* @param enable when true the turbulence is computed based on type of cloud around the AC
*/
void set_turbulence_enable_state(bool enable);
// rain/snow
float get_precipitation_density(void) const;
bool get_precipitation_enable_state(void) const;
/**
* Decrease the precipitation density to the given percentage.
* (Only show the given percentage of rain streaks etc.)
* Default precipitation density upon construction is 100.0.
* @param density 0.0 to 100.0
*/
void set_precipitation_density(float density);
/**
* Enable or disable the rendering of precipitation around the viewer.
* @param enable when true we will draw precipitation depending on metar data
*/
void set_precipitation_enable_state(bool enable);
// others
bool get_lightning_enable_state(void) const;
/**
* Enable or disable the rendering of lightning and the thunder sound.
* @param enable when true we will draw lightning spwaned by cumulonimbus
*/
void set_lightning_enable_state(bool enable);
/**
* Spawn a new lighning at specified lon/lat.
* @param lon position of the new lightning
* @param lat position of the new lightning
* @param alt asl of the starting point of the lightning in meters
*/
void addLightning(double lon, double lat, double alt);
/**
* Forward the sound manager instance to be able to play samples.
* @param mgr a running sound manager
*/
void set_sampleGroup(SGSampleGroup *sgr);
void setFOV( float w, float h );
void getFOV( float &w, float &h );
list_of_SGWxRadarEcho *get_radar_echo(void);
sgMat4 *get_transform(void) { return &transform; }
};
extern SGEnviro sgEnviro;
#endif // _VISUAL_ENVIRO_HXX

View File

@@ -0,0 +1,3 @@
.deps
Makefile
Makefile.in

View File

@@ -1,19 +1,34 @@
noinst_LIBRARIES = libAstro.a
includedir = @includedir@/ephemeris
libAstro_a_SOURCES = \
celestialBody.cxx celestialBody.hxx \
jupiter.cxx jupiter.hxx \
mars.cxx mars.hxx \
mercury.cxx mercury.hxx \
moon.cxx moon.hxx \
neptune.cxx neptune.hxx \
lib_LIBRARIES = libsgephem.a
include_HEADERS = \
celestialBody.hxx \
ephemeris.hxx \
jupiter.hxx \
mars.hxx \
mercury.hxx \
moonpos.hxx \
neptune.hxx \
saturn.hxx \
star.hxx \
stardata.hxx \
uranus.hxx \
venus.hxx
libsgephem_a_SOURCES = \
celestialBody.cxx \
ephemeris.cxx \
jupiter.cxx \
mars.cxx \
mercury.cxx \
moonpos.cxx \
neptune.cxx \
pluto.hxx \
saturn.cxx saturn.hxx \
sky.cxx sky.hxx \
solarsystem.cxx solarsystem.hxx \
star.cxx star.hxx \
stars.cxx stars.hxx \
uranus.cxx uranus.hxx \
venus.cxx venus.hxx
saturn.cxx \
star.cxx \
stardata.cxx \
uranus.cxx \
venus.cxx
INCLUDES += -I$(top_builddir) -I$(top_builddir)/src
INCLUDES = -I$(top_srcdir)

View File

@@ -5,28 +5,25 @@
* September 1998. This code is based upon algorithms and data kindly
* provided by Mr. Paul Schlyter. (pausch@saaf.se).
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU 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 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 program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* 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
* General Public License for more details.
* Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $Id$
**************************************************************************/
#include <simgear/debug/logstream.hxx>
#ifdef FG_MATH_EXCEPTION_CLASH
# define exception c_exception
#endif
#include <math.h>
#include "celestialBody.hxx"
@@ -34,7 +31,7 @@
/**************************************************************************
* void CelestialBody::updatePosition(fgTIME *t, Star *ourSun)
* void CelestialBody::updatePosition(double mjd, Star *ourSun)
*
* Basically, this member function provides a general interface for
* calculating the right ascension and declinaion. This function is
@@ -45,25 +42,25 @@
* position is calculated an a slightly different manner.
*
* arguments:
* fgTIME t: provides the current time.
* double mjd: provides the modified julian date.
* Star *ourSun: the sun's position is needed to convert heliocentric
* coordinates into geocentric coordinates.
*
* return value: none
*
*************************************************************************/
void CelestialBody::updatePosition(FGTime *t, Star *ourSun)
void CelestialBody::updatePosition(double mjd, Star *ourSun)
{
double eccAnom, v, ecl, actTime,
xv, yv, xh, yh, zh, xg, yg, zg, xe, ye, ze;
updateOrbElements(t);
actTime = fgCalcActTime(t);
updateOrbElements(mjd);
actTime = sgCalcActTime(mjd);
// calcualate the angle bewteen ecliptic and equatorial coordinate system
ecl = DEG_TO_RAD * (23.4393 - 3.563E-7 *actTime);
ecl = SGD_DEGREES_TO_RADIANS * (23.4393 - 3.563E-7 *actTime);
eccAnom = fgCalcEccAnom(M, e); //calculate the eccentric anomaly
eccAnom = sgCalcEccAnom(M, e); //calculate the eccentric anomaly
xv = a * (cos(eccAnom) - e);
yv = a * (sqrt (1.0 - e*e) * sin(eccAnom));
v = atan2(yv, xv); // the planet's true anomaly
@@ -87,8 +84,8 @@ void CelestialBody::updatePosition(FGTime *t, Star *ourSun)
ze = yg * sin(ecl) + zg * cos(ecl);
rightAscension = atan2(ye, xe);
declination = atan2(ze, sqrt(xe*xe + ye*ye));
FG_LOG(FG_GENERAL, FG_INFO, "Planet found at : "
<< rightAscension << " (ra), " << declination << " (dec)" );
/* SG_LOG(SG_GENERAL, SG_INFO, "Planet found at : "
<< rightAscension << " (ra), " << declination << " (dec)" ); */
//calculate some variables specific to calculating the magnitude
//of the planet
@@ -106,11 +103,11 @@ void CelestialBody::updatePosition(FGTime *t, Star *ourSun)
tmp = -1.0;
}
FV = RAD_TO_DEG * acos( tmp );
};
FV = SGD_RADIANS_TO_DEGREES * acos( tmp );
}
/****************************************************************************
* double CelestialBody::fgCalcEccAnom(double M, double e)
* double CelestialBody::sgCalcEccAnom(double M, double e)
* this private member calculates the eccentric anomaly of a celestial body,
* given its mean anomaly and eccentricity.
*
@@ -135,7 +132,7 @@ void CelestialBody::updatePosition(FGTime *t, Star *ourSun)
* the eccentric anomaly
*
****************************************************************************/
double CelestialBody::fgCalcEccAnom(double M, double e)
double CelestialBody::sgCalcEccAnom(double M, double e)
{
double
eccAnom, E0, E1, diff;
@@ -151,28 +148,118 @@ double CelestialBody::fgCalcEccAnom(double M, double e)
diff = fabs(E0 - E1);
E0 = E1;
}
while (diff > (DEG_TO_RAD * 0.001));
while (diff > (SGD_DEGREES_TO_RADIANS * 0.001));
return E0;
}
return eccAnom;
}
/*****************************************************************************
* inline CelestialBody::CelestialBody
* public constructor for a generic celestialBody object.
* initializes the 6 primary orbital elements. The elements are:
* N: longitude of the ascending node
* i: inclination to the ecliptic
* w: argument of perihelion
* a: semi-major axis, or mean distance from the sun
* e: eccenticity
* M: mean anomaly
* Each orbital element consists of a constant part and a variable part that
* gradually changes over time.
*
* Argumetns:
* the 13 arguments to the constructor constitute the first, constant
* ([NiwaeM]f) and the second variable ([NiwaeM]s) part of the orbital
* elements. The 13th argument is the current time. Note that the inclination
* is written with a capital (If, Is), because 'if' is a reserved word in the
* C/C++ programming language.
***************************************************************************/
CelestialBody::CelestialBody(double Nf, double Ns,
double If, double Is,
double wf, double ws,
double af, double as,
double ef, double es,
double Mf, double Ms, double mjd)
{
NFirst = Nf; NSec = Ns;
iFirst = If; iSec = Is;
wFirst = wf; wSec = ws;
aFirst = af; aSec = as;
eFirst = ef; eSec = es;
MFirst = Mf; MSec = Ms;
updateOrbElements(mjd);
}
CelestialBody::CelestialBody(double Nf, double Ns,
double If, double Is,
double wf, double ws,
double af, double as,
double ef, double es,
double Mf, double Ms)
{
NFirst = Nf; NSec = Ns;
iFirst = If; iSec = Is;
wFirst = wf; wSec = ws;
aFirst = af; aSec = as;
eFirst = ef; eSec = es;
MFirst = Mf; MSec = Ms;
}
/****************************************************************************
* inline void CelestialBody::updateOrbElements(double mjd)
* given the current time, this private member calculates the actual
* orbital elements
*
* Arguments: double mjd: the current modified julian date:
*
* return value: none
***************************************************************************/
void CelestialBody::updateOrbElements(double mjd)
{
double actTime = sgCalcActTime(mjd);
M = SGD_DEGREES_TO_RADIANS * (MFirst + (MSec * actTime));
w = SGD_DEGREES_TO_RADIANS * (wFirst + (wSec * actTime));
N = SGD_DEGREES_TO_RADIANS * (NFirst + (NSec * actTime));
i = SGD_DEGREES_TO_RADIANS * (iFirst + (iSec * actTime));
e = eFirst + (eSec * actTime);
a = aFirst + (aSec * actTime);
}
/*****************************************************************************
* inline double CelestialBody::sgCalcActTime(double mjd)
* this private member function returns the offset in days from the epoch for
* wich the orbital elements are calculated (Jan, 1st, 2000).
*
* Argument: the current time
*
* return value: the (fractional) number of days until Jan 1, 2000.
****************************************************************************/
double CelestialBody::sgCalcActTime(double mjd)
{
return (mjd - 36523.5);
}
/*****************************************************************************
* inline void CelestialBody::getPos(double* ra, double* dec)
* gives public access to Right Ascension and declination
*
****************************************************************************/
void CelestialBody::getPos(double* ra, double* dec)
{
*ra = rightAscension;
*dec = declination;
}
/*****************************************************************************
* inline void CelestialBody::getPos(double* ra, double* dec, double* magnitude
* gives public acces to the current Right ascension, declination, and
* magnitude
****************************************************************************/
void CelestialBody::getPos(double* ra, double* dec, double* magn)
{
*ra = rightAscension;
*dec = declination;
*magn = magnitude;
}

View File

@@ -5,19 +5,19 @@
* September 1998. This code is based upon algorithms and data kindly
* provided by Mr. Paul Schlyter. (pausch@saaf.se).
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU 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 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 program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* 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
* General Public License for more details.
* Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $Id$
**************************************************************************/
@@ -26,21 +26,19 @@
#ifndef _CELESTIALBODY_H_
#define _CELESTIALBODY_H_
#ifndef __cplusplus
#ifndef __cplusplus
# error This library requires C++
#endif
#endif
#include <simgear/constants.h>
#include <Time/fg_time.hxx>
class Star;
class CelestialBody
{
protected: // make the data protected, in order to give the inherited
// classes direct access to the data
protected: // make the data protected, in order to give the
// inherited classes direct access to the data
double NFirst; /* longitude of the ascending node first part */
double NSec; /* longitude of the ascending node second part */
double iFirst; /* inclination to the ecliptic first part */
@@ -61,9 +59,9 @@ protected: // make the data protected, in order to give the inherit
double magnitude;
double lonEcl, latEcl;
double fgCalcEccAnom(double M, double e);
double fgCalcActTime(FGTime *t);
void updateOrbElements(FGTime *t);
double sgCalcEccAnom(double M, double e);
double sgCalcActTime(double mjd);
void updateOrbElements(double mjd);
public:
CelestialBody(double Nf, double Ns,
@@ -71,105 +69,26 @@ public:
double wf, double ws,
double af, double as,
double ef, double es,
double Mf, double Ms, FGTime *t);
double Mf, double Ms, double mjd);
CelestialBody(double Nf, double Ns,
double If, double Is,
double wf, double ws,
double af, double as,
double ef, double es,
double Mf, double Ms);
void getPos(double *ra, double *dec);
void getPos(double *ra, double *dec, double *magnitude);
double getRightAscension();
double getDeclination();
double getMagnitude();
double getLon();
double getLat();
void updatePosition(FGTime *t, Star *ourSun);
void updatePosition(double mjd, Star *ourSun);
};
/*****************************************************************************
* inline CelestialBody::CelestialBody
* public constructor for a generic celestialBody object.
* initializes the 6 primary orbital elements. The elements are:
* N: longitude of the ascending node
* i: inclination to the ecliptic
* w: argument of perihelion
* a: semi-major axis, or mean distance from the sun
* e: eccenticity
* M: mean anomaly
* Each orbital element consists of a constant part and a variable part that
* gradually changes over time.
*
* Argumetns:
* the 13 arguments to the constructor constitute the first, constant
* ([NiwaeM]f) and the second variable ([NiwaeM]s) part of the orbital
* elements. The 13th argument is the current time. Note that the inclination
* is written with a capital (If, Is), because 'if' is a reserved word in the
* C/C++ programming language.
***************************************************************************/
inline CelestialBody::CelestialBody(double Nf, double Ns,
double If, double Is,
double wf, double ws,
double af, double as,
double ef, double es,
double Mf, double Ms, FGTime *t)
{
NFirst = Nf; NSec = Ns;
iFirst = If; iSec = Is;
wFirst = wf; wSec = ws;
aFirst = af; aSec = as;
eFirst = ef; eSec = es;
MFirst = Mf; MSec = Ms;
updateOrbElements(t);
};
/****************************************************************************
* inline void CelestialBody::updateOrbElements(FGTime *t)
* given the current time, this private member calculates the actual
* orbital elements
*
* Arguments: FGTime *t: the current time:
*
* return value: none
***************************************************************************/
inline void CelestialBody::updateOrbElements(FGTime *t)
{
double actTime = fgCalcActTime(t);
M = DEG_TO_RAD * (MFirst + (MSec * actTime));
w = DEG_TO_RAD * (wFirst + (wSec * actTime));
N = DEG_TO_RAD * (NFirst + (NSec * actTime));
i = DEG_TO_RAD * (iFirst + (iSec * actTime));
e = eFirst + (eSec * actTime);
a = aFirst + (aSec * actTime);
}
/*****************************************************************************
* inline double CelestialBody::fgCalcActTime(FGTime *t)
* this private member function returns the offset in days from the epoch for
* wich the orbital elements are calculated (Jan, 1st, 2000).
*
* Argument: the current time
*
* return value: the (fractional) number of days until Jan 1, 2000.
****************************************************************************/
inline double CelestialBody::fgCalcActTime(FGTime *t)
{
return (t->getMjd() - 36523.5);
}
/*****************************************************************************
* inline void CelestialBody::getPos(double* ra, double* dec)
* gives public access to Right Ascension and declination
*
****************************************************************************/
inline void CelestialBody::getPos(double* ra, double* dec)
{
*ra = rightAscension;
*dec = declination;
}
/*****************************************************************************
* inline void CelestialBody::getPos(double* ra, double* dec, double* magnitude
* gives public acces to the current Right ascension, declination, and
* magnitude
****************************************************************************/
inline void CelestialBody::getPos(double* ra, double* dec, double* magn)
{
*ra = rightAscension;
*dec = declination;
*magn = magnitude;
}
inline double CelestialBody::getRightAscension() { return rightAscension; }
inline double CelestialBody::getDeclination() { return declination; }
inline double CelestialBody::getMagnitude() { return magnitude; }
inline double CelestialBody::getLon()
{
@@ -183,14 +102,3 @@ inline double CelestialBody::getLat()
#endif // _CELESTIALBODY_H_

View File

@@ -0,0 +1,90 @@
// ephemeris.cxx -- Top level class for calculating current positions of
// astronomical objects
//
// Written by Curtis Olson, started March 2000.
//
// Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
//
// 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 General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// $Id$
#ifdef HAVE_CONFIG_H
# include <simgear_config.h>
#endif
#include <iostream>
#include "ephemeris.hxx"
// Constructor
SGEphemeris::SGEphemeris( const std::string &path ) {
our_sun = new Star;
moon = new MoonPos;
mercury = new Mercury;
venus = new Venus;
mars = new Mars;
jupiter = new Jupiter;
saturn = new Saturn;
uranus = new Uranus;
neptune = new Neptune;
nplanets = 7;
for ( int i = 0; i < nplanets; ++i )
planets[i] = SGVec3d::zeros();
stars = new SGStarData( SGPath(path) );
}
// Destructor
SGEphemeris::~SGEphemeris( void ) {
delete our_sun;
delete moon;
delete mercury;
delete venus;
delete mars;
delete jupiter;
delete saturn;
delete uranus;
delete neptune;
delete stars;
}
// Update (recalculate) the positions of all objects for the specified
// time
void SGEphemeris::update( double mjd, double lst, double lat ) {
// update object positions
our_sun->updatePosition( mjd );
moon->updatePosition( mjd, lst, lat, our_sun );
mercury->updatePosition( mjd, our_sun );
venus->updatePosition( mjd, our_sun );
mars->updatePosition( mjd, our_sun );
jupiter->updatePosition( mjd, our_sun );
saturn->updatePosition( mjd, our_sun );
uranus->updatePosition( mjd, our_sun );
neptune->updatePosition( mjd, our_sun );
// update planets list
nplanets = 7;
mercury->getPos( &planets[0][0], &planets[0][1], &planets[0][2] );
venus ->getPos( &planets[1][0], &planets[1][1], &planets[1][2] );
mars ->getPos( &planets[2][0], &planets[2][1], &planets[2][2] );
jupiter->getPos( &planets[3][0], &planets[3][1], &planets[3][2] );
saturn ->getPos( &planets[4][0], &planets[4][1], &planets[4][2] );
uranus ->getPos( &planets[5][0], &planets[5][1], &planets[5][2] );
neptune->getPos( &planets[6][0], &planets[6][1], &planets[6][2] );
}

View File

@@ -0,0 +1,180 @@
/** \file ephemeris.hxx
* Top level class for calculating current positions of astronomical objects.
*/
// Top level interface written by Curtis Olson, started March 2000.
//
// All the core code underneath this is written by Durk Talsma. See
// the headers of all the other individual files for details.
//
// Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
//
// 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 General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// $Id$
#ifndef _EPHEMERIS_HXX
#define _EPHEMERIS_HXX
#include <string>
#include <simgear/ephemeris/star.hxx>
#include <simgear/ephemeris/moonpos.hxx>
#include <simgear/ephemeris/mercury.hxx>
#include <simgear/ephemeris/venus.hxx>
#include <simgear/ephemeris/mars.hxx>
#include <simgear/ephemeris/jupiter.hxx>
#include <simgear/ephemeris/saturn.hxx>
#include <simgear/ephemeris/uranus.hxx>
#include <simgear/ephemeris/neptune.hxx>
#include <simgear/ephemeris/stardata.hxx>
#include <simgear/math/SGMath.hxx>
#include <simgear/misc/sg_path.hxx>
/** Ephemeris class
*
* Written by Durk Talsma <d.talsma@direct.a2000.nl> and Curtis Olson
* <http://www.flightgear.org/~curt>
*
* Introduction
*
* The SGEphemeris class computes and stores the positions of the Sun,
* the Moon, the planets, and the brightest stars. These positions
* can then be used to accurately render the dominant visible items in
* the Earth's sky. Note, this class isn't intended for use in an
* interplanetary/interstellar/intergalactic type application. It is
* calculates everything relative to the Earth and is therefore best
* suited for Earth centric applications.
*
* The positions of the various astronomical objects are time
* dependent, so to maintain accuracy, you will need to periodically
* call the update() method. The SGTime class conveniently provides
* the two time related values you need to pass to the update()
* method.
*/
class SGEphemeris {
Star *our_sun;
MoonPos *moon;
Mercury *mercury;
Venus *venus;
Mars *mars;
Jupiter *jupiter;
Saturn *saturn;
Uranus *uranus;
Neptune *neptune;
// 9 planets, minus earth, minus pluto which we don't draw = 7
// planets[i][0] = Right Ascension
// planets[i][1] = Declination
// planets[i][2] = Magnitude
int nplanets;
SGVec3d planets[7];
SGStarData *stars;
public:
/**
* Constructor.
* This creates an instance of the SGEphemeris object. When
* calling the constructor you need to provide a path pointing to
* your star database file.
* @param path path to your star database */
SGEphemeris( const std::string &path );
/** Destructor */
~SGEphemeris( void );
/**
* Update (recalculate) the positions of all objects for the
* specified time. The update() method requires you to pass in
* the current modified Julian date, the current local sidereal
* time, and the current latitude. The update() method is designed
* to be called by the host application before every frame.
* @param mjd modified julian date
* @param lst current local sidereal time
* @param lat current latitude
*/
void update(double mjd, double lst, double lat);
/**
* @return a pointer to a Star class containing all the positional
* information for Earth's Sun.
*/
inline Star *get_sun() const { return our_sun; }
/** @return the right ascension of the Sun. */
inline double getSunRightAscension() const {
return our_sun->getRightAscension();
}
/** @return the declination of the Sun. */
inline double getSunDeclination() const {
return our_sun->getDeclination();
}
/**
* @return a pointer to a Moon class containing all the positional
* information for Earth's Moon.
*/
inline MoonPos *get_moon() const { return moon; }
/** @return the right ascension of the Moon. */
inline double getMoonRightAscension() const {
return moon->getRightAscension();
}
/** @return the declination of the Moon. */
inline double getMoonDeclination() const {
return moon->getDeclination();
}
/** @return the numbers of defined planets. */
inline int getNumPlanets() const { return nplanets; }
/**
* Returns a pointer to an array of planet data in sgdVec3
* format. (See plib.sourceforge.net for information on plib and
* the ``sg'' package.) An sgdVec3 is a 3 element double
* array. The first element is the right ascension of the planet,
* the second is the declination, and the third is the magnitude.
* @return planets array
*/
inline SGVec3d *getPlanets() { return planets; }
inline const SGVec3d *getPlanets() const { return planets; }
/** @return the numbers of defined stars. */
inline int getNumStars() const { return stars->getNumStars(); }
/**
* Returns a pointer to an array of star data in sgdVec3
* format. An The first element of the sgdVec3 is the right
* ascension of the planet, the second is the declination, and the
* third is the magnitude.
* @returns star array
*/
inline SGVec3d *getStars() { return stars->getStars(); }
inline const SGVec3d *getStars() const { return stars->getStars(); }
};
#endif // _EPHEMERIS_HXX

View File

@@ -5,58 +5,64 @@
* September 1998. This code is based upon algorithms and data kindly
* provided by Mr. Paul Schlyter. (pausch@saaf.se).
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU 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 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 program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* 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
* General Public License for more details.
* Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $Id$
**************************************************************************/
#ifdef __BORLANDC__
# define exception c_exception
#endif
#include <math.h>
#include "jupiter.hxx"
/*************************************************************************
* Jupiter::Jupiter(FGTime *t)
* Jupiter::Jupiter(double mjd)
* Public constructor for class Jupiter
* Argument: The current time.
* the hard coded orbital elements for Jupiter are passed to
* CelestialBody::CelestialBody();
************************************************************************/
Jupiter::Jupiter(FGTime *t) :
Jupiter::Jupiter(double mjd) :
CelestialBody(100.4542, 2.7685400E-5,
1.3030, -1.557E-7,
273.8777, 1.6450500E-5,
5.2025600, 0.000000,
0.048498, 4.469E-9,
19.89500, 0.08308530010, t)
19.89500, 0.08308530010, mjd)
{
}
Jupiter::Jupiter() :
CelestialBody(100.4542, 2.7685400E-5,
1.3030, -1.557E-7,
273.8777, 1.6450500E-5,
5.2025600, 0.000000,
0.048498, 4.469E-9,
19.89500, 0.08308530010)
{
}
/*************************************************************************
* void Jupiter::updatePosition(FGTime *t, Star *ourSun)
* void Jupiter::updatePosition(double mjd, Star *ourSun)
*
* calculates the current position of Jupiter, by calling the base class,
* CelestialBody::updatePosition(); The current magnitude is calculated using
* a Jupiter specific equation
*************************************************************************/
void Jupiter::updatePosition(FGTime *t, Star *ourSun)
void Jupiter::updatePosition(double mjd, Star *ourSun)
{
CelestialBody::updatePosition(t, ourSun);
CelestialBody::updatePosition(mjd, ourSun);
magnitude = -9.25 + 5*log10( r*R ) + 0.014 * FV;
}

View File

@@ -5,34 +5,34 @@
* September 1998. This code is based upon algorithms and data kindly
* provided by Mr. Paul Schlyter. (pausch@saaf.se).
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU 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 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 program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* 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
* General Public License for more details.
* Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $Id$
**************************************************************************/
#ifndef _JUPITER_HXX_
#define _JUPITER_HXX_
#include <Time/fg_time.hxx>
#include "celestialBody.hxx"
#include "star.hxx"
#include <simgear/ephemeris/celestialBody.hxx>
#include <simgear/ephemeris/star.hxx>
class Jupiter : public CelestialBody
{
public:
Jupiter (FGTime *t);
void updatePosition(FGTime *t, Star *ourSun);
Jupiter (double mjd);
Jupiter ();
void updatePosition(double mjd, Star *ourSun);
};
#endif // _JUPITER_HXX_

View File

@@ -5,55 +5,61 @@
* September 1998. This code is based upon algorithms and data kindly
* provided by Mr. Paul Schlyter. (pausch@saaf.se).
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU 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 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 program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* 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
* General Public License for more details.
* Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $Id$
**************************************************************************/
#ifdef __BORLANDC__
# define exception c_exception
#endif
#include <math.h>
#include "mars.hxx"
/*************************************************************************
* Mars::Mars(FGTime *t)
* Mars::Mars(double mjd)
* Public constructor for class Mars
* Argument: The current time.
* the hard coded orbital elements for Mars are passed to
* CelestialBody::CelestialBody();
************************************************************************/
Mars::Mars(FGTime *t) :
Mars::Mars(double mjd) :
CelestialBody(49.55740, 2.1108100E-5,
1.8497, -1.78E-8,
286.5016, 2.9296100E-5,
1.5236880, 0.000000,
0.093405, 2.516E-9,
18.60210, 0.52402077660, t)
18.60210, 0.52402077660, mjd)
{
}
Mars::Mars() :
CelestialBody(49.55740, 2.1108100E-5,
1.8497, -1.78E-8,
286.5016, 2.9296100E-5,
1.5236880, 0.000000,
0.093405, 2.516E-9,
18.60210, 0.52402077660)
{
}
/*************************************************************************
* void Mars::updatePosition(FGTime *t, Star *ourSun)
* void Mars::updatePosition(double mjd, Star *ourSun)
*
* calculates the current position of Mars, by calling the base class,
* CelestialBody::updatePosition(); The current magnitude is calculated using
* a Mars specific equation
*************************************************************************/
void Mars::updatePosition(FGTime *t, Star *ourSun)
void Mars::updatePosition(double mjd, Star *ourSun)
{
CelestialBody::updatePosition(t, ourSun);
CelestialBody::updatePosition(mjd, ourSun);
magnitude = -1.51 + 5*log10( r*R ) + 0.016 * FV;
}

View File

@@ -5,34 +5,34 @@
* September 1998. This code is based upon algorithms and data kindly
* provided by Mr. Paul Schlyter. (pausch@saaf.se).
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU 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 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 program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* 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
* General Public License for more details.
* Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $Id$
**************************************************************************/
#ifndef _MARS_HXX_
#define _MARS_HXX_
#include <Time/fg_time.hxx>
#include "celestialBody.hxx"
#include "star.hxx"
#include <simgear/ephemeris/celestialBody.hxx>
#include <simgear/ephemeris/star.hxx>
class Mars : public CelestialBody
{
public:
Mars ( FGTime *t);
void updatePosition(FGTime *t, Star *ourSun);
Mars ( double mjd );
Mars ();
void updatePosition(double mjd, Star *ourSun);
};
#endif // _MARS_HXX_

View File

@@ -5,56 +5,62 @@
* September 1998. This code is based upon algorithms and data kindly
* provided by Mr. Paul Schlyter. (pausch@saaf.se).
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU 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 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 program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* 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
* General Public License for more details.
* Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $Id$
**************************************************************************/
#ifdef __BORLANDC__
# define exception c_exception
#endif
#include <math.h>
#include "mercury.hxx"
/*************************************************************************
* Mercury::Mercury(FGTime *t)
* Mercury::Mercury(double mjd)
* Public constructor for class Mercury
* Argument: The current time.
* the hard coded orbital elements for Mercury are passed to
* CelestialBody::CelestialBody();
************************************************************************/
Mercury::Mercury(FGTime *t) :
Mercury::Mercury(double mjd) :
CelestialBody (48.33130, 3.2458700E-5,
7.0047, 5.00E-8,
29.12410, 1.0144400E-5,
0.3870980, 0.000000,
0.205635, 5.59E-10,
168.6562, 4.09233443680, t)
168.6562, 4.09233443680, mjd)
{
}
Mercury::Mercury() :
CelestialBody (48.33130, 3.2458700E-5,
7.0047, 5.00E-8,
29.12410, 1.0144400E-5,
0.3870980, 0.000000,
0.205635, 5.59E-10,
168.6562, 4.09233443680)
{
}
/*************************************************************************
* void Mercury::updatePosition(FGTime *t, Star *ourSun)
* void Mercury::updatePosition(double mjd, Star *ourSun)
*
* calculates the current position of Mercury, by calling the base class,
* CelestialBody::updatePosition(); The current magnitude is calculated using
* a Mercury specific equation
*************************************************************************/
void Mercury::updatePosition(FGTime *t, Star *ourSun)
void Mercury::updatePosition(double mjd, Star *ourSun)
{
CelestialBody::updatePosition(t, ourSun);
CelestialBody::updatePosition(mjd, ourSun);
magnitude = -0.36 + 5*log10( r*R ) + 0.027 * FV + 2.2E-13 * pow(FV, 6);
}

View File

@@ -5,34 +5,34 @@
* September 1998. This code is based upon algorithms and data kindly
* provided by Mr. Paul Schlyter. (pausch@saaf.se).
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU 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 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 program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* 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
* General Public License for more details.
* Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $Id$
**************************************************************************/
#ifndef _MERCURY_HXX_
#define _MERCURY_HXX_
#include <Time/fg_time.hxx>
#include "celestialBody.hxx"
#include "star.hxx"
#include <simgear/ephemeris/celestialBody.hxx>
#include <simgear/ephemeris/star.hxx>
class Mercury : public CelestialBody
{
public:
Mercury ( FGTime *t);
void updatePosition(FGTime *t, Star* ourSun);
Mercury (double mjd);
Mercury ();
void updatePosition(double mjd, Star* ourSun);
};
#endif // _MERURY_HXX_

View File

@@ -1,398 +0,0 @@
/**************************************************************************
* moon.cxx
* Written by Durk Talsma. Originally started October 1997, for distribution
* with the FlightGear project. Version 2 was written in August and
* September 1998. This code is based upon algorithms and data kindly
* provided by Mr. Paul Schlyter. (pausch@saaf.se).
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id$
**************************************************************************/
#include <string.h>
#include <simgear/debug/logstream.hxx>
#include <simgear/misc/fgpath.hxx>
#include <Main/options.hxx>
#include <Objects/texload.h>
#ifdef __BORLANDC__
# define exception c_exception
#endif
#include <math.h>
#include <FDM/flight.hxx>
#include "moon.hxx"
/*************************************************************************
* Moon::Moon(FGTime *t)
* Public constructor for class Moon. Initializes the orbital elements and
* sets up the moon texture.
* Argument: The current time.
* the hard coded orbital elements for Moon are passed to
* CelestialBody::CelestialBody();
************************************************************************/
Moon::Moon(FGTime *t) :
CelestialBody(125.1228, -0.0529538083,
5.1454, 0.00000,
318.0634, 0.1643573223,
60.266600, 0.000000,
0.054900, 0.000000,
115.3654, 13.0649929509, t)
{
int width, height;
FG_LOG( FG_GENERAL, FG_INFO, "Initializing Moon Texture");
#ifdef GL_VERSION_1_1
xglGenTextures(1, &moon_texid);
xglBindTexture(GL_TEXTURE_2D, moon_texid);
#elif GL_EXT_texture_object
xglGenTexturesEXT(1, &moon_texid);
xglBindTextureEXT(GL_TEXTURE_2D, moon_texid);
#else
# error port me
#endif
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
// load in the texture data
FGPath tpath( current_options.get_fg_root() );
tpath.append( "Textures" );
tpath.append( "moon.rgb" );
if ( (moon_texbuf = read_rgb_texture(tpath.c_str(), &width, &height))
== NULL )
{
// Try compressed
FGPath fg_tpath = tpath;
fg_tpath.append( ".gz" );
if ( (moon_texbuf = read_rgb_texture(fg_tpath.c_str(), &width, &height))
== NULL )
{
FG_LOG( FG_GENERAL, FG_ALERT,
"Error in loading moon texture " << tpath.str() );
exit(-1);
}
}
glTexImage2D( GL_TEXTURE_2D,
0,
GL_RGB,
256, 256,
0,
GL_RGB, GL_UNSIGNED_BYTE,
moon_texbuf);
// setup the halo texture
FG_LOG( FG_GENERAL, FG_INFO, "Initializing Moon Texture");
#ifdef GL_VERSION_1_1
xglGenTextures(1, &moon_halotexid);
xglBindTexture(GL_TEXTURE_2D, moon_halotexid);
#elif GL_EXT_texture_object
xglGenTexturesEXT(1, &moon_halotexid);
xglBindTextureEXT(GL_TEXTURE_2D, moon_halotexid);
#else
# error port me
#endif
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
setHalo();
glTexImage2D( GL_TEXTURE_2D,
0,
GL_RGBA,
256, 256,
0,
GL_RGBA, GL_UNSIGNED_BYTE,
moon_halotexbuf);
moonObject = gluNewQuadric();
}
Moon::~Moon()
{
//delete moonObject;
delete moon_texbuf;
delete moon_halotexbuf;
}
static int texWidth = 256; /* 64x64 is plenty */
void Moon::setHalo()
{
int texSize;
//void *textureBuf;
GLubyte *p;
int i,j;
double radius;
texSize = texWidth*texWidth;
moon_halotexbuf = new GLubyte[texSize*4];
if (!moon_halotexbuf)
return; // Ugly!
p = moon_halotexbuf;
radius = (double)(texWidth / 2);
for (i=0; i < texWidth; i++) {
for (j=0; j < texWidth; j++) {
double x, y, d;
*p = 0xff;
*(p+1) = 0xff;
*(p+2) = 0xff;
x = fabs((double)(i - (texWidth / 2)));
y = fabs((double)(j - (texWidth / 2)));
d = sqrt((x * x) + (y * y));
if (d < radius) {
double t = 1.0 - (d / radius); // t is 1.0 at center, 0.0 at edge */
// inverse square looks nice
*(p+3) = (int)((double) 0x20 * (t*t));
} else {
*(p+3) = 0x00;
}
p += 4;
}
}
//gluBuild2DMipmaps(GL_TEXTURE_2D, 1, texWidth, texWidth,
// GL_LUMINANCE,
// GL_UNSIGNED_BYTE, textureBuf);
//free(textureBuf);
}
/*****************************************************************************
* void Moon::updatePosition(FGTime *t, Star *ourSun)
* this member function calculates the actual topocentric position (i.e.)
* the position of the moon as seen from the current position on the surface
* of the moon.
****************************************************************************/
void Moon::updatePosition(FGTime *t, Star *ourSun)
{
double
eccAnom, ecl, actTime,
xv, yv, v, r, xh, yh, zh, xg, yg, zg, xe, ye, ze,
Ls, Lm, D, F, mpar, gclat, rho, HA, g,
geoRa, geoDec;
fgAIRCRAFT *air;
FGInterface *f;
air = &current_aircraft;
f = air->fdm_state;
updateOrbElements(t);
actTime = fgCalcActTime(t);
// calculate the angle between ecliptic and equatorial coordinate system
// in Radians
ecl = ((DEG_TO_RAD * 23.4393) - (DEG_TO_RAD * 3.563E-7) * actTime);
eccAnom = fgCalcEccAnom(M, e); // Calculate the eccentric anomaly
xv = a * (cos(eccAnom) - e);
yv = a * (sqrt(1.0 - e*e) * sin(eccAnom));
v = atan2(yv, xv); // the moon's true anomaly
r = sqrt (xv*xv + yv*yv); // and its distance
// estimate the geocentric rectangular coordinates here
xh = r * (cos(N) * cos (v+w) - sin (N) * sin(v+w) * cos(i));
yh = r * (sin(N) * cos (v+w) + cos (N) * sin(v+w) * cos(i));
zh = r * (sin(v+w) * sin(i));
// calculate the ecliptic latitude and longitude here
lonEcl = atan2 (yh, xh);
latEcl = atan2(zh, sqrt(xh*xh + yh*yh));
/* Calculate a number of perturbatioin, i.e. disturbances caused by the
* gravitational infuence of the sun and the other major planets.
* The largest of these even have a name */
Ls = ourSun->getM() + ourSun->getw();
Lm = M + w + N;
D = Lm - Ls;
F = Lm - N;
lonEcl += DEG_TO_RAD * (-1.274 * sin (M - 2*D)
+0.658 * sin (2*D)
-0.186 * sin(ourSun->getM())
-0.059 * sin(2*M - 2*D)
-0.057 * sin(M - 2*D + ourSun->getM())
+0.053 * sin(M + 2*D)
+0.046 * sin(2*D - ourSun->getM())
+0.041 * sin(M - ourSun->getM())
-0.035 * sin(D)
-0.031 * sin(M + ourSun->getM())
-0.015 * sin(2*F - 2*D)
+0.011 * sin(M - 4*D)
);
latEcl += DEG_TO_RAD * (-0.173 * sin(F-2*D)
-0.055 * sin(M - F - 2*D)
-0.046 * sin(M + F - 2*D)
+0.033 * sin(F + 2*D)
+0.017 * sin(2*M + F)
);
r += (-0.58 * cos(M - 2*D)
-0.46 * cos(2*D)
);
FG_LOG(FG_GENERAL, FG_INFO, "Running moon update");
xg = r * cos(lonEcl) * cos(latEcl);
yg = r * sin(lonEcl) * cos(latEcl);
zg = r * sin(latEcl);
xe = xg;
ye = yg * cos(ecl) -zg * sin(ecl);
ze = yg * sin(ecl) +zg * cos(ecl);
geoRa = atan2(ye, xe);
geoDec = atan2(ze, sqrt(xe*xe + ye*ye));
/* FG_LOG( FG_GENERAL, FG_INFO,
"(geocentric) geoRa = (" << (RAD_TO_DEG * geoRa)
<< "), geoDec= (" << (RAD_TO_DEG * geoDec) << ")" ); */
// Given the moon's geocentric ra and dec, calculate its
// topocentric ra and dec. i.e. the position as seen from the
// surface of the earth, instead of the center of the earth
// First calculate the moon's parrallax, that is, the apparent size of the
// (equatorial) radius of the earth, as seen from the moon
mpar = asin ( 1 / r);
// FG_LOG( FG_GENERAL, FG_INFO, "r = " << r << " mpar = " << mpar );
// FG_LOG( FG_GENERAL, FG_INFO, "lat = " << f->get_Latitude() );
gclat = f->get_Latitude() - 0.003358 *
sin (2 * DEG_TO_RAD * f->get_Latitude() );
// FG_LOG( FG_GENERAL, FG_INFO, "gclat = " << gclat );
rho = 0.99883 + 0.00167 * cos(2 * DEG_TO_RAD * f->get_Latitude());
// FG_LOG( FG_GENERAL, FG_INFO, "rho = " << rho );
if (geoRa < 0)
geoRa += (2*FG_PI);
HA = t->getLst() - (3.8197186 * geoRa);
/* FG_LOG( FG_GENERAL, FG_INFO, "t->getLst() = " << t->getLst()
<< " HA = " << HA ); */
g = atan (tan(gclat) / cos ((HA / 3.8197186)));
// FG_LOG( FG_GENERAL, FG_INFO, "g = " << g );
rightAscension = geoRa - mpar * rho * cos(gclat) * sin(HA) / cos (geoDec);
declination = geoDec - mpar * rho * sin (gclat) * sin (g - geoDec) / sin(g);
/* FG_LOG( FG_GENERAL, FG_INFO,
"Ra = (" << (RAD_TO_DEG *rightAscension)
<< "), Dec= (" << (RAD_TO_DEG *declination) << ")" ); */
}
/************************************************************************
* void Moon::newImage()
*
* This function regenerates a new visual image of the moon, which is added to
* solarSystem display list.
*
* Arguments: Right Ascension and declination
*
* return value: none
**************************************************************************/
void Moon::newImage()
{
fgLIGHT *l = &cur_light_params;
float moon_angle = l->moon_angle;
/*double x_2, x_4, x_8, x_10;
GLfloat ambient;
GLfloat amb[4];*/
int moonSize = 550;
GLfloat moonColor[4] = {0.85, 0.75, 0.35, 1.0};
GLfloat black[4] = {0.0, 0.0, 0.0, 1.0};
GLfloat white[4] = {1.0, 1.0, 1.0, 0.0};
if( moon_angle*RAD_TO_DEG < 100 )
{
FG_LOG( FG_ASTRO, FG_INFO, "Generating Moon Image" );
xglPushMatrix();
{
xglRotatef(((RAD_TO_DEG * rightAscension)- 90.0), 0.0, 0.0, 1.0);
xglRotatef((RAD_TO_DEG * declination), 1.0, 0.0, 0.0);
FG_LOG( FG_GENERAL, FG_INFO,
"Ra = (" << (RAD_TO_DEG *rightAscension)
<< "), Dec= (" << (RAD_TO_DEG *declination) << ")" );
xglTranslatef(0.0, 60000.0, 0.0);
glEnable(GL_BLEND); // BLEND ENABLED
// Draw the halo...
if (current_options.get_textures())
{
// glBlendFunc(GL_SRC_ALPHA, GL_ONE);
glBlendFunc ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ) ;
glEnable(GL_TEXTURE_2D); // TEXTURE ENABLED
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glBindTexture(GL_TEXTURE_2D, moon_halotexid);
glBegin(GL_QUADS);
glTexCoord2f(0.0f, 0.0f); glVertex3f(-5000, 0.0, -5000);
glTexCoord2f(1.0f, 0.0f); glVertex3f( 5000, 0.0, -5000);
glTexCoord2f(1.0f, 1.0f); glVertex3f( 5000, 0.0, 5000);
glTexCoord2f(0.0f, 1.0f); glVertex3f(-5000, 0.0, 5000);
glEnd();
}
xglEnable(GL_LIGHTING); // LIGHTING ENABLED
xglEnable( GL_LIGHT0 );
// set lighting parameters
xglLightfv(GL_LIGHT0, GL_AMBIENT, white );
xglLightfv(GL_LIGHT0, GL_DIFFUSE, white );
// Enable( GL_CULL_FACE );
xglMaterialfv(GL_FRONT, GL_AMBIENT, black);
xglMaterialfv(GL_FRONT, GL_DIFFUSE, moonColor);
//glEnable(GL_TEXTURE_2D);
glBlendFunc(GL_ONE, GL_ONE);
//glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
// Draw the moon-proper
if (current_options.get_textures())
{
glBindTexture(GL_TEXTURE_2D, moon_texid);
gluQuadricTexture(moonObject, GL_TRUE );
}
gluSphere(moonObject, moonSize, 12, 12 );
glDisable(GL_TEXTURE_2D); // TEXTURE DISABLED
glDisable(GL_BLEND); // BLEND DISABLED
}
xglPopMatrix();
glDisable(GL_LIGHTING); // Lighting Disabled.
}
else
{
}
}

View File

@@ -1,57 +0,0 @@
/**************************************************************************
* moon.hxx
* Written by Durk Talsma. Originally started October 1997, for distribution
* with the FlightGear project. Version 2 was written in August and
* September 1998. This code is based upon algorithms and data kindly
* provided by Mr. Paul Schlyter. (pausch@saaf.se).
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id$
**************************************************************************/
#ifndef _MOON_HXX_
#define _MOON_HXX_
#include <simgear/constants.h>
#include <Aircraft/aircraft.hxx>
#include <Main/views.hxx>
#include <Time/fg_time.hxx>
#include "celestialBody.hxx"
#include "star.hxx"
class Moon : public CelestialBody
{
private:
void TexInit(); // This should move to the constructor eventually.
GLUquadricObj *moonObject;
GLuint Sphere;
GLuint moon_texid;
GLuint moon_halotexid;
GLubyte *moon_texbuf;
GLubyte *moon_halotexbuf;
void setHalo();
public:
Moon ( FGTime *t);
~Moon();
void updatePosition(FGTime *t, Star *ourSun);
void newImage();
};
#endif // _MOON_HXX_

View File

@@ -0,0 +1,196 @@
/**************************************************************************
* moonpos.cxx
* Written by Durk Talsma. Originally started October 1997, for distribution
* with the FlightGear project. Version 2 was written in August and
* September 1998. This code is based upon algorithms and data kindly
* provided by Mr. Paul Schlyter. (pausch@saaf.se).
*
* 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 General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $Id$
**************************************************************************/
#include <string.h>
#include <simgear/debug/logstream.hxx>
#include <math.h>
// #include <FDM/flight.hxx>
#include "moonpos.hxx"
/*************************************************************************
* MoonPos::MoonPos(double mjd)
* Public constructor for class MoonPos. Initializes the orbital elements and
* sets up the moon texture.
* Argument: The current time.
* the hard coded orbital elements for MoonPos are passed to
* CelestialBody::CelestialBody();
************************************************************************/
MoonPos::MoonPos(double mjd) :
CelestialBody(125.1228, -0.0529538083,
5.1454, 0.00000,
318.0634, 0.1643573223,
60.266600, 0.000000,
0.054900, 0.000000,
115.3654, 13.0649929509, mjd)
{
}
MoonPos::MoonPos() :
CelestialBody(125.1228, -0.0529538083,
5.1454, 0.00000,
318.0634, 0.1643573223,
60.266600, 0.000000,
0.054900, 0.000000,
115.3654, 13.0649929509)
{
}
MoonPos::~MoonPos()
{
}
/*****************************************************************************
* void MoonPos::updatePosition(double mjd, Star *ourSun)
* this member function calculates the actual topocentric position (i.e.)
* the position of the moon as seen from the current position on the surface
* of the moon.
****************************************************************************/
void MoonPos::updatePosition(double mjd, double lst, double lat, Star *ourSun)
{
double
eccAnom, ecl, actTime,
xv, yv, v, r, xh, yh, zh, xg, yg, zg, xe, ye, ze,
Ls, Lm, D, F, mpar, gclat, rho, HA, g,
geoRa, geoDec;
updateOrbElements(mjd);
actTime = sgCalcActTime(mjd);
// calculate the angle between ecliptic and equatorial coordinate system
// in Radians
ecl = ((SGD_DEGREES_TO_RADIANS * 23.4393) - (SGD_DEGREES_TO_RADIANS * 3.563E-7) * actTime);
eccAnom = sgCalcEccAnom(M, e); // Calculate the eccentric anomaly
xv = a * (cos(eccAnom) - e);
yv = a * (sqrt(1.0 - e*e) * sin(eccAnom));
v = atan2(yv, xv); // the moon's true anomaly
r = sqrt (xv*xv + yv*yv); // and its distance
// estimate the geocentric rectangular coordinates here
xh = r * (cos(N) * cos (v+w) - sin (N) * sin(v+w) * cos(i));
yh = r * (sin(N) * cos (v+w) + cos (N) * sin(v+w) * cos(i));
zh = r * (sin(v+w) * sin(i));
// calculate the ecliptic latitude and longitude here
lonEcl = atan2 (yh, xh);
latEcl = atan2(zh, sqrt(xh*xh + yh*yh));
/* Calculate a number of perturbatioin, i.e. disturbances caused by the
* gravitational infuence of the sun and the other major planets.
* The largest of these even have a name */
Ls = ourSun->getM() + ourSun->getw();
Lm = M + w + N;
D = Lm - Ls;
F = Lm - N;
lonEcl += SGD_DEGREES_TO_RADIANS * (-1.274 * sin (M - 2*D)
+0.658 * sin (2*D)
-0.186 * sin(ourSun->getM())
-0.059 * sin(2*M - 2*D)
-0.057 * sin(M - 2*D + ourSun->getM())
+0.053 * sin(M + 2*D)
+0.046 * sin(2*D - ourSun->getM())
+0.041 * sin(M - ourSun->getM())
-0.035 * sin(D)
-0.031 * sin(M + ourSun->getM())
-0.015 * sin(2*F - 2*D)
+0.011 * sin(M - 4*D)
);
latEcl += SGD_DEGREES_TO_RADIANS * (-0.173 * sin(F-2*D)
-0.055 * sin(M - F - 2*D)
-0.046 * sin(M + F - 2*D)
+0.033 * sin(F + 2*D)
+0.017 * sin(2*M + F)
);
r += (-0.58 * cos(M - 2*D)
-0.46 * cos(2*D)
);
// SG_LOG(SG_GENERAL, SG_INFO, "Running moon update");
xg = r * cos(lonEcl) * cos(latEcl);
yg = r * sin(lonEcl) * cos(latEcl);
zg = r * sin(latEcl);
xe = xg;
ye = yg * cos(ecl) -zg * sin(ecl);
ze = yg * sin(ecl) +zg * cos(ecl);
geoRa = atan2(ye, xe);
geoDec = atan2(ze, sqrt(xe*xe + ye*ye));
/* SG_LOG( SG_GENERAL, SG_INFO,
"(geocentric) geoRa = (" << (SGD_RADIANS_TO_DEGREES * geoRa)
<< "), geoDec= (" << (SGD_RADIANS_TO_DEGREES * geoDec) << ")" ); */
// Given the moon's geocentric ra and dec, calculate its
// topocentric ra and dec. i.e. the position as seen from the
// surface of the earth, instead of the center of the earth
// First calculate the moon's parrallax, that is, the apparent size of the
// (equatorial) radius of the earth, as seen from the moon
mpar = asin ( 1 / r);
// SG_LOG( SG_GENERAL, SG_INFO, "r = " << r << " mpar = " << mpar );
// SG_LOG( SG_GENERAL, SG_INFO, "lat = " << f->get_Latitude() );
gclat = lat - 0.003358 *
sin (2 * SGD_DEGREES_TO_RADIANS * lat );
// SG_LOG( SG_GENERAL, SG_INFO, "gclat = " << gclat );
rho = 0.99883 + 0.00167 * cos(2 * SGD_DEGREES_TO_RADIANS * lat);
// SG_LOG( SG_GENERAL, SG_INFO, "rho = " << rho );
if (geoRa < 0)
geoRa += SGD_2PI;
HA = lst - (3.8197186 * geoRa);
/* SG_LOG( SG_GENERAL, SG_INFO, "t->getLst() = " << t->getLst()
<< " HA = " << HA ); */
g = atan (tan(gclat) / cos ((HA / 3.8197186)));
// SG_LOG( SG_GENERAL, SG_INFO, "g = " << g );
rightAscension = geoRa - mpar * rho * cos(gclat) * sin(HA) / cos (geoDec);
if (fabs(lat) > 0) {
declination
= geoDec - mpar * rho * sin (gclat) * sin (g - geoDec) / sin(g);
} else {
declination = geoDec;
// cerr << "Geocentric vs. Topocentric position" << endl;
// cerr << "RA (difference) : "
// << SGD_RADIANS_TO_DEGREES * (geoRa - rightAscension) << endl;
// cerr << "Dec (difference) : "
// << SGD_RADIANS_TO_DEGREES * (geoDec - declination) << endl;
}
/* SG_LOG( SG_GENERAL, SG_INFO,
"Ra = (" << (SGD_RADIANS_TO_DEGREES *rightAscension)
<< "), Dec= (" << (SGD_RADIANS_TO_DEGREES *declination) << ")" ); */
}

View File

@@ -0,0 +1,60 @@
/**************************************************************************
* moonpos.hxx
* Written by Durk Talsma. Originally started October 1997, for distribution
* with the FlightGear project. Version 2 was written in August and
* September 1998. This code is based upon algorithms and data kindly
* provided by Mr. Paul Schlyter. (pausch@saaf.se).
*
* 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 General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $Id$
**************************************************************************/
#ifndef _MOONPOS_HXX_
#define _MOONPOS_HXX_
#include <simgear/constants.h>
#include <simgear/ephemeris/celestialBody.hxx>
#include <simgear/ephemeris/star.hxx>
class MoonPos : public CelestialBody
{
private:
// void TexInit(); // This should move to the constructor eventually.
// GLUquadricObj *moonObject;
// GLuint Sphere;
// GLuint moon_texid;
// GLuint moon_halotexid;
// GLubyte *moon_texbuf;
// GLubyte *moon_halotexbuf;
// void setHalo();
public:
MoonPos(double mjd);
MoonPos();
~MoonPos();
void updatePosition(double mjd, double lst, double lat, Star *ourSun);
// void newImage();
};
#endif // _MOONPOS_HXX_

Some files were not shown because too many files have changed in this diff Show More