Commit Graph

5972 Commits

Author SHA1 Message Date
James Turner
1f1b047981 Add range() function to Nasal 2022-01-07 16:14:44 +00:00
Julian Smith
8772ff4e2a simgear/props/props.*: added SGPropertyNode::getValue<std::string>() specialisation.
This is needed for external VR code that used to use
SGPropertyNode::getValue<const char*>() (which has been removed).
2022-01-06 22:02:45 +00:00
Fahim Imaduddin Dalvi
c4c5829d37 Added airport terrain check for random objects
Random objects like lights and trees are not placed on airport terrain
anymore. This commit also refactors some of the existing code for clarity.
Discussion can be found here [1] and detailed history here [2].

[1] https://sourceforge.net/p/flightgear/simgear/merge-requests/102/
[2] https://sourceforge.net/u/fahimdalvi/simgear/ci/bugfix/ws30_random_objects_avoid_airports/~/tree/

Squashed commit of the following:

commit 643198f8d52da8d65a674b052c508f03d7f83ac0
Author: Fahim Imaduddin Dalvi <dalvifahim@gmail.com>
Date:   Tue Jan 4 09:57:34 2022 +0300

    Implemented corrected airport intersection logic

    We now convert the point into the correct coordinate system before
    checking for intersections with the airport geometry.

commit 7e0819e4f88992658301a2c15d890fc489cfe3b6
Author: Fahim Imaduddin Dalvi <dalvifahim@gmail.com>
Date:   Wed Nov 10 19:59:04 2021 +0300

    Added airport terrain check code for random objects

    This commit does not work as expected. The light-coverage check is disabled
    to amplify the bug.

commit eb21e8fd256dcf124857ac51afc0d7c3c90ae1c6
Author: Fahim Imaduddin Dalvi <dalvifahim@gmail.com>
Date:   Wed Nov 10 19:53:44 2021 +0300

    Refactored elevation constraint checking code

    This commit provides a separate elevation constraint function that does not
    displace the given point. The current function has been renamed to indicate
    the displacement side effect.
2022-01-04 18:10:03 +03:00
Fahim Imaduddin Dalvi
d4b02d58d6 Refactored constraint checking for random objects
The Random objects check now happens in the scanline read in VPBTechnique,
rather in the VBPMaterialHandler objects. These checks are not specific
to any handler, and are thus better suited to be outside of specific
material handling logic.
2022-01-04 17:56:41 +03:00
Stuart Buchanan
65542e7521 WS30: Disable texture cache for material atlas
The texture cache interacts badly with the code creating the WS30
texture atlas, resulting in a bad atlas.  This change adds a new
SGReaderWriterOptions::LoadOriginHint::ORIGIN_MATERIAL_ATLAS
which causes the material cache not to cache the texture.
2022-01-03 17:17:17 +00:00
Scott Giese
301da53ba4 Remove FormFeeds 2021-12-27 02:29:46 -06:00
Jonathan Redpath
25f66995da osgText: improve code to search aircraft directory for font 2021-12-25 15:20:53 +00:00
James Turner
782378a1b6 Always set USE_OPENALSOFT
WIthout this, the generated SimgearConfig.cmake is a bit
unhappy.
2021-12-24 15:30:31 +00:00
Julian Smith
5fe9fd0fc6 simgear/props/props.cxx: moved common members into SGPropertyLock base class. 2021-12-24 14:49:09 +00:00
Julian Smith
23b3824170 simgear/props/props.*: added defaultValue arg to node get*Value() methods.
Add defaultValue arg to get*Value() methods that previously took no args. We
do this for getBoolValue(), getIntValue(), getLongValue(), getFloatValue() and
getDoubleValue(). The default value is returned if the node's string is not
convertible to the requested type.

This can enable some calling code to be optimised where it previously checked
for getStringValue() (which is slow now that it returns a std::string)
returning an empty string, before calling getDoubleValue().
2021-12-24 14:49:09 +00:00
Lars Toenning
dd09e5f466 Make SGPropertyNode::getStringValue() thread-safe.
This is by Lars Toenning <dev@ltoenning.de>, Roman Ludwicki <romek21@op.pl> and
SDeAstis <salvatore.deastis@gmail.com>, in 2021 Hackathon.

SGPropertyNode::getStringValue() now returns std::string by value instead of
const char* pointer into SGPropertyNode's internal data.

Patched up various call sites to use new API.

Remove SGPropertyNode::getName() and use SGPropertyNode::getNameString()
everywhere.
2021-12-24 14:49:08 +00:00
James Turner
da3507f3df CMake config option to use OpenAL-soft
THis enables overriding the Apple OpenAL.framework on
macOS, and using OpenAL-soft instead.
2021-12-24 13:23:34 +00:00
Scott Giese
854ad8c3fa apt_signs: provide content with Apt Sign messages.
Useful to help track down which sign failed to parse.
2021-12-22 23:41:58 -06:00
Scott Giese
578ffec2da SGText: minor typo correction 2021-12-22 23:39:44 -06:00
Henning Stahlke
d448ad4eb3 simgear/scene/model/SGLight.cxx: listen to entire /scenery/lights subtree.
Set VALUE_CHANGED_DOWN attribute on /scenery/lights so that listeners see
changes to all nodes in subtree.
2021-12-22 21:13:15 +00:00
Erik Hofman
9a9b1a8db4 Revert 1269a8d27c, the friction factor on ice relies on too many parameters to calculate here. 2021-12-22 08:24:51 +01:00
Erik Hofman
1269a8d27c Introduce a factor for when the lakes are frozen over and use it to alter the fricton factor, bumpiness and load resistance factor 2021-12-21 10:30:30 +01:00
Erik Hofman
612dff2ea1 Remove a stale character 2021-12-19 11:20:46 +01:00
Erik Hofman
33b0c39dbd Make it possible to use a property reference for the solid property of a material. e.g.: <solid><property>/sim/ice</property></solid> 2021-12-19 11:18:49 +01:00
Stuart Buchanan
06ecfe1927 WS30: Revert to green channel for texture atlas 2021-12-18 21:45:50 +00:00
James Turner
db5a2353bd FFmpeg: tweak components we use 2021-12-12 19:48:54 +00:00
James Turner
dd61ad8bd0 FFmpeg Cmake support for video recording 2021-12-12 18:32:01 +00:00
Julian Smith
5627b135b4 simgear/screen/: added support for video encoding.
Uses ffmpeg libraries to provide video encoding of an osg::GraphicsContext
(which could be for Flightgear's main window) to file.

The video codec is specified as a string at runtime. Success depends on what is
supported by the system's ffmpeg installation.

Handling of resize doesn't always work. We finish current stream and create a
new encoder and continue. Works ok with mpeg2, but with more modern codecs vlc
usually fails to handle the change.

We call the encoder on a separate thread to avoid latency.

If SG_FFMPEG is not defined, we don't make calls to ffmpeg libraries and
VideoEncoder class's constructor always throws an exception.
2021-12-08 10:31:27 +00:00
Stuart Buchanan
0e13e48123 WS30: Improved material Uniforms 2021-12-05 13:45:01 +00:00
b'James Turner
922ad8d2e7 Merge /u/r-a-sattarov/simgear/ branch next into next
https://sourceforge.net/p/flightgear/simgear/merge-requests/103/
2021-11-29 10:18:36 +00:00
Stuart Buchanan
8a014df26d WS30: Improved atlas with multi-texture support.
- Prefix all WS30 Uniforms with "fg_"
- fix modelOffset (needs to be passed in as a float)
- Create a true atlas with indexes for relevant material textures
2021-11-28 19:28:54 +00:00
r-a-sattarov
21e9bf4678 nasal/naref.h: added e2k endianness (MCST Elbrus 2000) 2021-11-24 23:52:58 +03:00
r-a-sattarov
f364aedf96 math/simd.hxx: fix build by MCST lcc compiler when using ENABLE_SIMD_CODE=ON
MCST E2K (Elbrus 2000) - this is VLIW/EPIC architecture, like Intel Itanium (IA-64) architecture.

e2k architecture has half native / half software support of most Intel/AMD SIMD
e.g. MMX/SSE/SSE2/SSE3/SSSE3/SSE4.1/SSE4.2/AES/AVX/AVX2 & 3DNow!/SSE4a/XOP/FMA4

Ref: https://en.wikipedia.org/wiki/Elbrus_2000
2021-11-23 22:26:33 +03:00
Stuart Buchanan
fee4481ef6 WS30: Add zUpTransform and modelOffset Uniforms. 2021-11-19 22:05:47 +00:00
James Turner
6562546771 Nasal Math: add precision to floor(), add trunc()
To simplify various rounding / truncation operations, especially when
dealing with frequency values, give floor() the same precision control
already present in math.round(), and add math.trunc() which always 
truncates towards zero.
2021-11-16 10:59:01 +00:00
Julian Smith
ddea2de3a0 simgear/nasal/codegen.c: avoid compiler warning in findConstantIndex(). 2021-11-12 23:03:47 +00:00
Julian Smith
5ce5044dce simgear/scene/tgdb/VPBTechnique.*: fix a clang sign-comparison warning.
Also removed unnecessary initialisation of _fileName to "".
2021-11-12 22:58:56 +00:00
Julian Smith
067875ab93 simgear/scene/util/OrthophotoManager.cxx: added missing break statement. 2021-11-12 22:58:51 +00:00
Julian Smith
7cd5d5312e simgear/props/props.hxx:SGPropertyNode: removed ununsed debug state for locking. 2021-11-11 21:07:09 +00:00
Stuart Buchanan
0470375889 WS30 Uniform arrays and photoscenery search path 2021-11-10 22:57:08 +00:00
Stuart Buchanan
2ec9df7597 Fix compile error on MacOS 2021-11-09 22:10:26 +00:00
Stuart Buchanan
6be17cc9e8 WS30: Add photoScenery Uniform for orthoscenery 2021-11-09 18:13:16 +00:00
Stuart Buchanan
9528bd0749 WS30: Photoscenery code cleanup, reduce log spam 2021-11-07 09:16:45 +00:00
Stuart Buchanan
7a7b26e75d WS30: Initial photoscenery work
Hack for hackathon
2021-11-06 14:42:23 +00:00
Stuart Buchanan
6ea99e43f1 WS30: Use NEAREST_MIPMAP_NEAREST for landclass
Only for the MIN filter, as the MAX filter causes
significant interpolation issues.
2021-11-05 01:12:01 +00:00
Stuart Buchanan
1553ac2e17 WS30: Minor cleanup and run generators for ALS (If required) 2021-11-04 21:44:01 +00:00
Fahim Imaduddin Dalvi
419e9bc128 WS30: Fix random lights density
Earlier calculations assumed degrees instead of radians for the
granularity of random lights, resulting to the wrong density. This
is now fixed. The scanline for random lights is also more efficient
now, taking the lower limit of light-coverage into account.
2021-10-30 13:07:35 +03:00
Stuart Buchanan
a1d748a0de WS30: Fix filtering of texture atlas
Previously we were taking the nearest pixel from the nearest
mipmap.  Which was braindead.  Now just use the OSG defaults,
which are NEAREST_MIPMAP_LINEAR for MIN and LINEAR for MAX.

Thanks to Julian and Henning for helping diagnose this on
the weekly hangout.
2021-10-24 21:25:08 +01:00
Stuart Buchanan
7916dfb61d WS30 Move VPB tile loading to the tile manager
Previously VPB tiles were loaded by the STG file handler.
Now they are loaded directly by the tile manager, allowing
better management of tile loading.
2021-10-20 23:37:59 +01:00
b'Fernando Garc\xc3\xada Li\xc3\xb1\xc3\xa1n
fc1d02110c Merge /u/amalon/simgear/ branch vr_5 into next
https://sourceforge.net/p/flightgear/simgear/merge-requests/100/
2021-10-20 22:21:01 +00:00
Fahim Imaduddin Dalvi
6e7fa6b139 WS30: Generic Materials handler and Random tile lights
This commit implements a generic materials handler providing an easy way to
extend the efficient landclass scanning code for new material-specific
processing like trees, random lights, random buildings etc. The existing
vegetation code has been ported to make use of this generic interface,
and random tile lights have been added as well. Detailed commit log can
be found at [1], discussions can be found at [2] and [3].

[1] https://sourceforge.net/u/fahimdalvi/simgear/ci/feat/ws30_random_lights/~/tree/
[2] https://sourceforge.net/p/flightgear/mailman/flightgear-devel/thread/AC818EC5-84A3-425B-98CB-352CCB0B8910%40gmail.com/#msg37356997
[3] https://sourceforge.net/p/flightgear/simgear/merge-requests/99/
2021-10-21 00:34:32 +03:00
James Turner
6d71ab75b2 METAR: Remove duplicate lines from manual merge
Thanks to Tobias Dammers for pointing this out.
2021-10-20 13:16:31 +01:00
Richard Harrison
148ba367ee Material animation include model directory
Include model directory in the texture path - to allows short paths relative to model root when set via a texture-prop
2021-10-18 11:40:25 +02:00
Richard Harrison
7ac90850d3 Fix axis object in translate animation
This will allow an object to be moved using a line (with 2d points).

Use the factor to switch direction (direction will depend on the order of definition of the end points of the vertex and) together with a (usually normalised property to define how much of the translation to apply).

<animation>
    <type>translate</type>
    <object-name>mm_radios-display</object-name>
    <property>/sim/model/f-14/radio-position-norm</property>
    <factor>-1</factor>
    <axis>
        <object-name>mm_radios-display-alt-position-axis</object-name>
    </axis>
</animation>
2021-10-18 11:40:25 +02:00
James Turner
bf1db210d7 SGMetar: avoid raw char pointers in the public API
Ideally would refactor to remove the raw pointers internally, but this
is a good first step.
2021-10-15 15:31:06 +01:00