Commit Graph

1586 Commits

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