Commit Graph

1651 Commits

Author SHA1 Message Date
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