Compare commits
35 Commits
translatio
...
spacecruft
Author | SHA1 | Date |
---|---|---|
Jeff Moe | d0cec92b62 | |
Jeff Moe | 34a3b5a9cd | |
Jeff Moe | 470cbc3c99 | |
Jeff Moe | 88047d9b06 | |
Jeff Moe | 71cf5dda82 | |
Jeff Moe | 646e755964 | |
Jeff Moe | d00a02c463 | |
Jeff Moe | 791c80d3d0 | |
Jeff Moe | 7693e49057 | |
Jeff Moe | e5c825b5f0 | |
Jeff Moe | 916ac7be22 | |
Jeff Moe | 9878b500b1 | |
Jeff Moe | 9b561aa551 | |
dave-kaye | 804a5de2a7 | |
Andrew Tribick | c6a320d086 | |
Andrew Tribick | 0c177cae01 | |
Andrew Tribick | bc75235150 | |
Hleb Valoshka | 4c6fa126d6 | |
Hleb Valoshka | 698d03cd82 | |
Hleb Valoshka | 6ab7660e0c | |
Levin Li | b4cf176ac3 | |
Georgi | 71a65fb33c | |
Georgi | 704a075d0a | |
Georgi | a87dc1bc62 | |
Hleb Valoshka | f4bd55991f | |
Hleb Valoshka | 746b9e3ef3 | |
Hleb Valoshka | ca80f4448a | |
Hleb Valoshka | dee6a216f7 | |
Andrew Tribick | 2f77629216 | |
Andrew Tribick | d2f53d0a56 | |
Hleb Valoshka | fb08de771a | |
Levin Li | 318b4378a9 | |
Levin Li | 6b856b3352 | |
Heiko Becker | e51f3d5b97 | |
Andrew Tribick | 60ed8238b1 |
|
@ -9,6 +9,7 @@ Release/
|
||||||
*.la
|
*.la
|
||||||
*.exe
|
*.exe
|
||||||
*.dll
|
*.dll
|
||||||
|
*.swp
|
||||||
.DS_Store
|
.DS_Store
|
||||||
po*/*.gmo
|
po*/*.gmo
|
||||||
po*/POTFILES
|
po*/POTFILES
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
[submodule "thirdparty/Spice"]
|
[submodule "thirdparty/Spice"]
|
||||||
path = thirdparty/Spice
|
path = thirdparty/Spice
|
||||||
url = https://github.com/OpenSpace/Spice.git
|
url = https://github.com/OpenSpace/Spice.git
|
||||||
[submodule "content"]
|
|
||||||
path = content
|
|
||||||
url = https://github.com/CelestiaProject/CelestiaContent.git
|
|
||||||
[submodule "thirdparty/fmt"]
|
[submodule "thirdparty/fmt"]
|
||||||
path = thirdparty/fmt
|
path = thirdparty/fmt
|
||||||
url = https://github.com/fmtlib/fmt.git
|
url = https://github.com/fmtlib/fmt.git
|
||||||
|
|
|
@ -2,6 +2,11 @@ cmake_minimum_required(VERSION 3.8)
|
||||||
|
|
||||||
option(LEGACY_OPENGL_LIBS "Use legacy OpenGL libraries instead of glvnd library (Default: off)" OFF)
|
option(LEGACY_OPENGL_LIBS "Use legacy OpenGL libraries instead of glvnd library (Default: off)" OFF)
|
||||||
|
|
||||||
|
# Plain and keyword target_link_libraries() signatures cannot be mixed
|
||||||
|
if (POLICY CMP0023)
|
||||||
|
cmake_policy(SET CMP0023 NEW)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Honor link flags in try_compile()
|
# Honor link flags in try_compile()
|
||||||
if (POLICY CMP0056)
|
if (POLICY CMP0056)
|
||||||
cmake_policy(SET CMP0056 NEW)
|
cmake_policy(SET CMP0056 NEW)
|
||||||
|
@ -245,6 +250,14 @@ endif()
|
||||||
find_package(Freetype REQUIRED)
|
find_package(Freetype REQUIRED)
|
||||||
link_libraries(Freetype::Freetype)
|
link_libraries(Freetype::Freetype)
|
||||||
|
|
||||||
|
find_package(meshoptimizer CONFIG QUIET)
|
||||||
|
if(meshoptimizer_FOUND)
|
||||||
|
message(STATUS "Found meshoptimizer library")
|
||||||
|
set(HAVE_MESHOPTIMIZER 1)
|
||||||
|
else()
|
||||||
|
message(STATUS "meshoptimizer library is missing")
|
||||||
|
endif()
|
||||||
|
|
||||||
#[[
|
#[[
|
||||||
get_cmake_property(_variableNames VARIABLES)
|
get_cmake_property(_variableNames VARIABLES)
|
||||||
list (SORT _variableNames)
|
list (SORT _variableNames)
|
||||||
|
|
108
ChangeLog
108
ChangeLog
|
@ -246,7 +246,7 @@ Code:
|
||||||
* Windows version: InstallShield setup
|
* Windows version: InstallShield setup
|
||||||
* Windows version: added controls help dialog
|
* Windows version: added controls help dialog
|
||||||
* UNIX version: implemented find object and about dialogs (Gnome/Gtk only)
|
* UNIX version: implemented find object and about dialogs (Gnome/Gtk only)
|
||||||
|
|
||||||
Code:
|
Code:
|
||||||
* Moved star browser and solar system browser code into separate modules
|
* Moved star browser and solar system browser code into separate modules
|
||||||
* Fixed DPRINTF macro so it's not broken in g++
|
* Fixed DPRINTF macro so it's not broken in g++
|
||||||
|
@ -276,7 +276,7 @@ Code:
|
||||||
textures added to OpenGL Info dialog.
|
textures added to OpenGL Info dialog.
|
||||||
* New objects: Comet Borrelly, the giant Kuiper Belt object 2001 KX76,
|
* New objects: Comet Borrelly, the giant Kuiper Belt object 2001 KX76,
|
||||||
and the Hubble Space Telescope
|
and the Hubble Space Telescope
|
||||||
|
|
||||||
Code:
|
Code:
|
||||||
* Rewrote texture and model managers
|
* Rewrote texture and model managers
|
||||||
* Cleaned up simulation.cpp to use frames of reference and eliminated a lot
|
* Cleaned up simulation.cpp to use frames of reference and eliminated a lot
|
||||||
|
@ -393,7 +393,7 @@ Code:
|
||||||
a single modeless dialog.
|
a single modeless dialog.
|
||||||
* Fixed period and rotation of Phoebe
|
* Fixed period and rotation of Phoebe
|
||||||
|
|
||||||
|
|
||||||
1.2.1
|
1.2.1
|
||||||
* Unix: configure.in changes to better find OpenGL libraries by Bruckner.
|
* Unix: configure.in changes to better find OpenGL libraries by Bruckner.
|
||||||
* Added accurate orbital calculations for Galilean satellites.
|
* Added accurate orbital calculations for Galilean satellites.
|
||||||
|
@ -404,7 +404,7 @@ Code:
|
||||||
* Windows: Fixed crash that occurred when recalling a location with
|
* Windows: Fixed crash that occurred when recalling a location with
|
||||||
no selection
|
no selection
|
||||||
|
|
||||||
|
|
||||||
1.2.2
|
1.2.2
|
||||||
* Improved find algorithm for starnames, and combined names from hdnames.dat
|
* Improved find algorithm for starnames, and combined names from hdnames.dat
|
||||||
into starnames.dat. Also added several additional names and variant spellings
|
into starnames.dat. Also added several additional names and variant spellings
|
||||||
|
@ -557,7 +557,7 @@ Code:
|
||||||
* New colors for celestial grid and constellation figures
|
* New colors for celestial grid and constellation figures
|
||||||
* Tuning of Gnome GUI: underlined key accelerators, enabled operation of all
|
* Tuning of Gnome GUI: underlined key accelerators, enabled operation of all
|
||||||
dialogs and menus with ALT <key>, arrow keys, and Tab
|
dialogs and menus with ALT <key>, arrow keys, and Tab
|
||||||
* Linux: GUI now synced with current state of pixel/vertex shaders
|
* Linux: GUI now synced with current state of pixel/vertex shaders
|
||||||
* New keyboard bindings:
|
* New keyboard bindings:
|
||||||
Ctrl+Y : automag toggle
|
Ctrl+Y : automag toggle
|
||||||
Ctrl+T : toggle display of comet tails
|
Ctrl+T : toggle display of comet tails
|
||||||
|
@ -572,16 +572,16 @@ Code:
|
||||||
when building with VS.NET
|
when building with VS.NET
|
||||||
* Cleaned up OpenGL extension initialization
|
* Cleaned up OpenGL extension initialization
|
||||||
* Significantly improved the reliability of object selection via mouse
|
* Significantly improved the reliability of object selection via mouse
|
||||||
click, notably for small fields of view in the arcsec range.
|
click, notably for small fields of view in the arcsec range.
|
||||||
* Fixed the 'move' script command
|
* Fixed the 'move' script command
|
||||||
* New script commands: setfaintestautomag45deg {magnitude float},
|
* New script commands: setfaintestautomag45deg {magnitude float},
|
||||||
lookback {}
|
lookback {}
|
||||||
* [,] keys now adjust the limiting magnitude at 45 degrees
|
* [,] keys now adjust the limiting magnitude at 45 degrees
|
||||||
field of view, if automag is ON. Values displayed via flash messages
|
field of view, if automag is ON. Values displayed via flash messages
|
||||||
* Associated the 'looking back' operation with the '*' key shortcut
|
* Associated the 'looking back' operation with the '*' key shortcut
|
||||||
* Fixed bug in orbits of Galilean moons
|
* Fixed bug in orbits of Galilean moons
|
||||||
* Corrected equatorial planes and rotation offsets for the major planets
|
* Corrected equatorial planes and rotation offsets for the major planets
|
||||||
* Linux: Added KDE interface, all features of the GTK interface are
|
* Linux: Added KDE interface, all features of the GTK interface are
|
||||||
available (except for the Tour Guide), new features include:
|
available (except for the Tour Guide), new features include:
|
||||||
- Bookmarks / URLs;
|
- Bookmarks / URLs;
|
||||||
- History navigation;* Improved drag and drop of cel:// URLs on Windows
|
- History navigation;* Improved drag and drop of cel:// URLs on Windows
|
||||||
|
@ -632,8 +632,8 @@ Code:
|
||||||
- Markers may also be set on objects using the right-click context menu
|
- Markers may also be set on objects using the right-click context menu
|
||||||
- Added mark/unmark commands for scripts
|
- Added mark/unmark commands for scripts
|
||||||
- Bound Ctrl+K to toggle display of markers
|
- Bound Ctrl+K to toggle display of markers
|
||||||
- Added flash messages indicating on|off status of markers
|
- Added flash messages indicating on|off status of markers
|
||||||
- Implemented markers into KDE interface
|
- Implemented markers into KDE interface
|
||||||
* Added triangle-accurate picking of mesh objects
|
* Added triangle-accurate picking of mesh objects
|
||||||
* Multiview
|
* Multiview
|
||||||
- Ctrl+R : split view vertically
|
- Ctrl+R : split view vertically
|
||||||
|
@ -664,7 +664,7 @@ Code:
|
||||||
* Updated configuration files for new versions of autoconf
|
* Updated configuration files for new versions of autoconf
|
||||||
|
|
||||||
1.3.1
|
1.3.1
|
||||||
* Improved inclusion of light travel delay, also in KDE time setting dialog
|
* Improved inclusion of light travel delay, also in KDE time setting dialog
|
||||||
* Fixed lookback command for subsequent changes of target speed
|
* Fixed lookback command for subsequent changes of target speed
|
||||||
* Allow wildcard character * inplace of extension for texture filenames
|
* Allow wildcard character * inplace of extension for texture filenames
|
||||||
* Fix bump mapping (again)
|
* Fix bump mapping (again)
|
||||||
|
@ -706,7 +706,7 @@ Code:
|
||||||
* Made cancel script command stop motion, tracking, and any object-relative
|
* Made cancel script command stop motion, tracking, and any object-relative
|
||||||
coordinate system.
|
coordinate system.
|
||||||
* Adjusted estimates for radii and rotation periods of extrasolar planets;
|
* Adjusted estimates for radii and rotation periods of extrasolar planets;
|
||||||
rotation rates account (somewhat) for the effects of tidal despinning.
|
rotation rates account (somewhat) for the effects of tidal despinning.
|
||||||
* Fixed a bug that was causing precision loss in orientation values; this fixes
|
* Fixed a bug that was causing precision loss in orientation values; this fixes
|
||||||
some of the jerkiness apparent at very low fields of view.
|
some of the jerkiness apparent at very low fields of view.
|
||||||
* Corrected radii of Uranus's rings
|
* Corrected radii of Uranus's rings
|
||||||
|
@ -739,7 +739,7 @@ Code:
|
||||||
* Eliminated obscuring of location labels that occurred low view aspect ratios
|
* Eliminated obscuring of location labels that occurred low view aspect ratios
|
||||||
* Added models of comet Halley and the small moons Pandora and Larissa
|
* Added models of comet Halley and the small moons Pandora and Larissa
|
||||||
* Added limit of knowledge masks for the Galilean moons
|
* Added limit of knowledge masks for the Galilean moons
|
||||||
* Changed spectral class of carbon stars to C, which supercedes and combines
|
* Changed spectral class of carbon stars to C, which supersedes and combines
|
||||||
R and N
|
R and N
|
||||||
* Lua scripting additions
|
* Lua scripting additions
|
||||||
* View management commands
|
* View management commands
|
||||||
|
@ -760,7 +760,7 @@ Code:
|
||||||
* Implemented an algorithm for importance weights to avoid overlapping or
|
* Implemented an algorithm for importance weights to avoid overlapping or
|
||||||
too crowded location labels for Mars, Venus and the Moon
|
too crowded location labels for Mars, Venus and the Moon
|
||||||
* Added new textures for Titan based on recent imaging from the Cassini
|
* Added new textures for Titan based on recent imaging from the Cassini
|
||||||
mission
|
mission
|
||||||
* Improved depth sorting so that hidden surface removal works properly for
|
* Improved depth sorting so that hidden surface removal works properly for
|
||||||
overlapping objects
|
overlapping objects
|
||||||
* Added theoretical estimates of oblateness and rotation rate for extrasolar
|
* Added theoretical estimates of oblateness and rotation rate for extrasolar
|
||||||
|
@ -805,16 +805,16 @@ Code:
|
||||||
* Implemented new GLSL render path; NVIDIA combiners and GeForceFX paths
|
* Implemented new GLSL render path; NVIDIA combiners and GeForceFX paths
|
||||||
deprecated.
|
deprecated.
|
||||||
* Display UTF-8 superscript digits in some star names
|
* Display UTF-8 superscript digits in some star names
|
||||||
* Updated the Titan texture. It accomodates all published high resolution
|
* Updated the Titan texture. It accomodates all published high resolution
|
||||||
imaging from the Cassini mission until and including the flyby of 03/31/05.
|
imaging from the Cassini mission until and including the flyby of 03/31/05.
|
||||||
* Updated the Iapetus texture. It accomodates all published high resolution
|
* Updated the Iapetus texture. It accomodates all published high resolution
|
||||||
imaging from the Cassini mission, including also a unique hires photo taken
|
imaging from the Cassini mission, including also a unique hires photo taken
|
||||||
in "Saturn shine".
|
in "Saturn shine".
|
||||||
* Added catalogs of 163 visual and 39 spectroscopic binary orbits,
|
* Added catalogs of 163 visual and 39 spectroscopic binary orbits,
|
||||||
respectively, (S<>erhjelm 1999, Pourbaix 2000) with known primary/secondary
|
respectively, (S<>erhjelm 1999, Pourbaix 2000) with known primary/secondary
|
||||||
mass ratios.
|
mass ratios.
|
||||||
* Added an extended and precise data base of 942 galaxies
|
* Added an extended and precise data base of 942 galaxies
|
||||||
(Steinicke's rev. NGC/IC, 2005) with a magnitude cutoff Bmag < 12.
|
(Steinicke's rev. NGC/IC, 2005) with a magnitude cutoff Bmag < 12.
|
||||||
* Included the commented PERL scripts used to extract and adapt the binary
|
* Included the commented PERL scripts used to extract and adapt the binary
|
||||||
orbit and galaxy data from published professional catalogs.
|
orbit and galaxy data from published professional catalogs.
|
||||||
* Added --extrasdir command line option for specifying additional directories
|
* Added --extrasdir command line option for specifying additional directories
|
||||||
|
@ -843,13 +843,13 @@ Code:
|
||||||
- fixed automake bug where GConf schema would always install
|
- fixed automake bug where GConf schema would always install
|
||||||
- removed linking against glut for no reason
|
- removed linking against glut for no reason
|
||||||
* Implemented complete precision catalog (Steinicke's revised NGC/IC, 2005) of
|
* Implemented complete precision catalog (Steinicke's revised NGC/IC, 2005) of
|
||||||
10610 galaxies with
|
10610 galaxies with
|
||||||
- distance information from four catalogs ( 6 methods ),
|
- distance information from four catalogs ( 6 methods ),
|
||||||
- <= 4 alternate names,
|
- <= 4 alternate names,
|
||||||
- info-URLs,
|
- info-URLs,
|
||||||
- absolute magnitudes and
|
- absolute magnitudes and
|
||||||
- correct sizes & orientations in space, as calculated from catalog
|
- correct sizes & orientations in space, as calculated from catalog
|
||||||
parameters.
|
parameters.
|
||||||
* Included well commented Perl script (deepsky.pl) as documentation. The used distance determination method is indicated in catalog for each galaxy.
|
* Included well commented Perl script (deepsky.pl) as documentation. The used distance determination method is indicated in catalog for each galaxy.
|
||||||
* Updated binary star data base (visualbins.stc, spectbins.dsc) and respective
|
* Updated binary star data base (visualbins.stc, spectbins.dsc) and respective
|
||||||
PERL catalog extraction scripts (visualbins.pl, spectbins.pl), such as to eliminate double occurences wrto nearstars.stc (, which remained unaffected).
|
PERL catalog extraction scripts (visualbins.pl, spectbins.pl), such as to eliminate double occurences wrto nearstars.stc (, which remained unaffected).
|
||||||
|
@ -890,7 +890,7 @@ Code:
|
||||||
template from S0 disk template via rescaling by (1.0f, 3.8f, 1.0f);
|
template from S0 disk template via rescaling by (1.0f, 3.8f, 1.0f);
|
||||||
- fixed wrong x,y alignment of elliptical rescaling.
|
- fixed wrong x,y alignment of elliptical rescaling.
|
||||||
* Added code to ease compilation with newer Xcode versions (Macintosh).
|
* Added code to ease compilation with newer Xcode versions (Macintosh).
|
||||||
* Updated src/celengine/Makefile.am for Linux building.
|
* Updated src/celengine/Makefile.am for Linux building.
|
||||||
* Introduced a new cel function => renderflags {set "nebulae"}.
|
* Introduced a new cel function => renderflags {set "nebulae"}.
|
||||||
* Reduced the default value of 'faintestAutoMag45deg' from 8.5 to 7.0.
|
* Reduced the default value of 'faintestAutoMag45deg' from 8.5 to 7.0.
|
||||||
* Fixed the visibility of the Milky Way during day-time and the abrupt
|
* Fixed the visibility of the Milky Way during day-time and the abrupt
|
||||||
|
@ -904,10 +904,10 @@ Code:
|
||||||
* Deleted various source code files that became superfluous.
|
* Deleted various source code files that became superfluous.
|
||||||
* Improved comet display. Introduced a neat scheme implementing comet tail
|
* Improved comet display. Introduced a neat scheme implementing comet tail
|
||||||
fading (between 4 and 6 AU for Sol). Systems with several suns and
|
fading (between 4 and 6 AU for Sol). Systems with several suns and
|
||||||
luminosities different from the solar one are accounted for.
|
luminosities different from the solar one are accounted for.
|
||||||
* Implemented a new, simple scheme avoiding overcrowded galaxy labels.
|
* Implemented a new, simple scheme avoiding overcrowded galaxy labels.
|
||||||
Their "importance" is sorted according to apparent magnitude! Thus the
|
Their "importance" is sorted according to apparent magnitude! Thus the
|
||||||
labels of the brightest galaxies pop up first upon zooming in...
|
labels of the brightest galaxies pop up first upon zooming in...
|
||||||
* Fixes/workarounds for OpenGL 2.0 render paths on both nVidia and ATI cards.
|
* Fixes/workarounds for OpenGL 2.0 render paths on both nVidia and ATI cards.
|
||||||
|
|
||||||
|
|
||||||
|
@ -932,7 +932,7 @@ Code:
|
||||||
located inside the galaxy (Milky Way...).
|
located inside the galaxy (Milky Way...).
|
||||||
* Eliminated various incorrect Hubble type acronyms in deepsky.dsc that had
|
* Eliminated various incorrect Hubble type acronyms in deepsky.dsc that had
|
||||||
penetrated the PERL filter.
|
penetrated the PERL filter.
|
||||||
* Add the corrected PERL script deepsky.pl.
|
* Add the corrected PERL script deepsky.pl.
|
||||||
* Mac: Universal binary - runs natively on Intel and PPC
|
* Mac: Universal binary - runs natively on Intel and PPC
|
||||||
* Mac: OpenGL 2.0 render path should now work on many configurations
|
* Mac: OpenGL 2.0 render path should now work on many configurations
|
||||||
(requires OS X 10.4.3 or later)
|
(requires OS X 10.4.3 or later)
|
||||||
|
@ -948,7 +948,7 @@ Code:
|
||||||
* Mac: Fixed crash when LANG or LC environment variables are set
|
* Mac: Fixed crash when LANG or LC environment variables are set
|
||||||
* Mac: Added bona fide English and French help menu
|
* Mac: Added bona fide English and French help menu
|
||||||
* Mac: Cleaned up README in general
|
* Mac: Cleaned up README in general
|
||||||
* Added Phoebe textures in medres and lores directories from recent published
|
* Added Phoebe textures in medres and lores directories from recent published
|
||||||
Ciclops cylindrical maps
|
Ciclops cylindrical maps
|
||||||
* Updated Titan and Iapetus textures in lores directory
|
* Updated Titan and Iapetus textures in lores directory
|
||||||
* Windows: save and restore the last used GL render path
|
* Windows: save and restore the last used GL render path
|
||||||
|
@ -959,10 +959,10 @@ Code:
|
||||||
* KDE: Reverted mouse wheel action to be compatible with the other interfaces.
|
* KDE: Reverted mouse wheel action to be compatible with the other interfaces.
|
||||||
* KDE: New configurable splash screen
|
* KDE: New configurable splash screen
|
||||||
(http://celestia.teyssier.org/splash_spec.html)
|
(http://celestia.teyssier.org/splash_spec.html)
|
||||||
* Updated/added Tethys textures in lores, medres and hires directories.
|
* Updated/added Tethys textures in lores, medres and hires directories.
|
||||||
* Added locations on Phoebe in satmoons2.ssc, as extracted from USGS/IAU
|
* Added locations on Phoebe in satmoons2.ssc, as extracted from USGS/IAU
|
||||||
official data.
|
official data.
|
||||||
* Added Mesh for Phoebe texture.
|
* Added Mesh for Phoebe texture.
|
||||||
* Updated Iapetus texture.
|
* Updated Iapetus texture.
|
||||||
* Moved locations files from extras into data directory for inclusion in
|
* Moved locations files from extras into data directory for inclusion in
|
||||||
standard package.
|
standard package.
|
||||||
|
@ -1002,7 +1002,7 @@ Code:
|
||||||
- HIP 14810 c, HD 185269 b, Gliese 849 b
|
- HIP 14810 c, HD 185269 b, Gliese 849 b
|
||||||
- Mu Ara e
|
- Mu Ara e
|
||||||
- Gliese 581 c & d, HD 175541 b, HD 210702 b, HD192699 b
|
- Gliese 581 c & d, HD 175541 b, HD 210702 b, HD192699 b
|
||||||
- HD 47536 c, XO-2 b, HD 147506 (HAT-P-2), HD 17092 b
|
- HD 47536 c, XO-2 b, HD 147506 (HAT-P-2), HD 17092 b
|
||||||
* Revised orbits of many extrasolar planets to reflect new data
|
* Revised orbits of many extrasolar planets to reflect new data
|
||||||
* Added stars for new extrasolar planets: GSC 92941-01657
|
* Added stars for new extrasolar planets: GSC 92941-01657
|
||||||
* Mac: Show menu bar when moving mouse to top of screen in full screen
|
* Mac: Show menu bar when moving mouse to top of screen in full screen
|
||||||
|
@ -1067,7 +1067,7 @@ Code:
|
||||||
* Added cmodsphere, a utility for producing cmod meshes from height samples
|
* Added cmodsphere, a utility for producing cmod meshes from height samples
|
||||||
regularly spaced in longitude and latitude.
|
regularly spaced in longitude and latitude.
|
||||||
* COPYING, controls.txt, start script, and guide can all be localized
|
* COPYING, controls.txt, start script, and guide can all be localized
|
||||||
* cel and celx scripting:
|
* cel and celx scripting:
|
||||||
- added openclusters and cloudshadows render flags
|
- added openclusters and cloudshadows render flags
|
||||||
- added location, nebulae, openclusers, and i18nconsteallations label flags
|
- added location, nebulae, openclusers, and i18nconsteallations label flags
|
||||||
* Established Barycentric Dynamical Time (TDB) as the time scale used
|
* Established Barycentric Dynamical Time (TDB) as the time scale used
|
||||||
|
@ -1090,12 +1090,12 @@ Code:
|
||||||
spectra
|
spectra
|
||||||
* Made star orbit paths visible
|
* Made star orbit paths visible
|
||||||
* galaxies:
|
* galaxies:
|
||||||
-changed galaxy template format to standard (grayscale) PNG
|
-changed galaxy template format to standard (grayscale) PNG
|
||||||
-allow a custom template for each galaxy in deepsky.dsc
|
-allow a custom template for each galaxy in deepsky.dsc
|
||||||
-new approach to thickness of galaxy (arms): assumed proportional to read-in
|
-new approach to thickness of galaxy (arms): assumed proportional to read-in
|
||||||
brightness values
|
brightness values
|
||||||
-emulate dust lanes around galactic plane (y=0)
|
-emulate dust lanes around galactic plane (y=0)
|
||||||
-considerable improvement of Milky Way appearance as seen from Earth
|
-considerable improvement of Milky Way appearance as seen from Earth
|
||||||
-implement galaxy labels of transparency increasing with distance, thus
|
-implement galaxy labels of transparency increasing with distance, thus
|
||||||
providing a neat 3d effect
|
providing a neat 3d effect
|
||||||
* galaxy templates:
|
* galaxy templates:
|
||||||
|
@ -1114,10 +1114,10 @@ Code:
|
||||||
- Guarded against crash when the JPL ephemeris file can't be found
|
- Guarded against crash when the JPL ephemeris file can't be found
|
||||||
* Generalized rotations
|
* Generalized rotations
|
||||||
- Clear syntax for ssc files
|
- Clear syntax for ssc files
|
||||||
- UniformRotation
|
- UniformRotation
|
||||||
- PrecessingOrientation
|
- PrecessingOrientation
|
||||||
- SampledOrientation - interpolated sequence of quaternion key frames
|
- SampledOrientation - interpolated sequence of quaternion key frames
|
||||||
* Scripting improvements
|
* Scripting improvements
|
||||||
- New celx scripting commands:
|
- New celx scripting commands:
|
||||||
- utctotdb and tdbtoutc
|
- utctotdb and tdbtoutc
|
||||||
- gl commands
|
- gl commands
|
||||||
|
@ -1125,7 +1125,7 @@ Code:
|
||||||
- iterators: celestia:stars and celestia:dsos
|
- iterators: celestia:stars and celestia:dsos
|
||||||
- get/setaltazimuthmode
|
- get/setaltazimuthmode
|
||||||
- Lua hooks for script extensions to Celestia
|
- Lua hooks for script extensions to Celestia
|
||||||
- Script interfaces for orbits and rotation models (ScriptedOrbit and
|
- Script interfaces for orbits and rotation models (ScriptedOrbit and
|
||||||
ScriptedRotation)
|
ScriptedRotation)
|
||||||
- Support Lua 5.1 (5.0 compatibility retained)
|
- Support Lua 5.1 (5.0 compatibility retained)
|
||||||
- Made celestia:loadtexture use relative file names
|
- Made celestia:loadtexture use relative file names
|
||||||
|
@ -1148,7 +1148,7 @@ Code:
|
||||||
* Corrected kilometers per light year constant
|
* Corrected kilometers per light year constant
|
||||||
* Added various improvements to the MilkyWay & other galaxy template display.
|
* Added various improvements to the MilkyWay & other galaxy template display.
|
||||||
* Added E0.png galaxy template that allows for better En, n=1..7 elliptical
|
* Added E0.png galaxy template that allows for better En, n=1..7 elliptical
|
||||||
shapes.
|
shapes.
|
||||||
* Fixed sizes of irregular galaxies (factor of 2!).
|
* Fixed sizes of irregular galaxies (factor of 2!).
|
||||||
* Prevented galaxy code from crashing if a template is missing.
|
* Prevented galaxy code from crashing if a template is missing.
|
||||||
* Improved selection of galaxies by taking into account their 3d shape
|
* Improved selection of galaxies by taking into account their 3d shape
|
||||||
|
@ -1163,11 +1163,11 @@ Code:
|
||||||
* Windows: Fixed crash that occurred when star browser was closed
|
* Windows: Fixed crash that occurred when star browser was closed
|
||||||
* Fixed bug that made moons disappear as a planet approached stellar transit
|
* Fixed bug that made moons disappear as a planet approached stellar transit
|
||||||
* Added a major update of the galaxy database such that close to 100% of the
|
* Added a major update of the galaxy database such that close to 100% of the
|
||||||
galaxies now involve distance measurements
|
galaxies now involve distance measurements
|
||||||
* Included the complete local group of galaxies
|
* Included the complete local group of galaxies
|
||||||
* Added varying label transparency also for stars
|
* Added varying label transparency also for stars
|
||||||
* Added the PERL scripts used for extraction of galaxy and binary orbit data
|
* Added the PERL scripts used for extraction of galaxy and binary orbit data
|
||||||
from scientific sources. They both are useful tools and a concise
|
from scientific sources. They both are useful tools and a concise
|
||||||
documentation of Celestia's data
|
documentation of Celestia's data
|
||||||
* updated binary orbit data (visualbins.stc and spectbins.stc) along with
|
* updated binary orbit data (visualbins.stc and spectbins.stc) along with
|
||||||
respective PERL scripts (visualbins.pl and spectbins.pl)
|
respective PERL scripts (visualbins.pl and spectbins.pl)
|
||||||
|
@ -1220,7 +1220,7 @@ Code:
|
||||||
HD 167042 b, HD 74156 d, HD 285968 b, V391 Peg b,
|
HD 167042 b, HD 74156 d, HD 285968 b, V391 Peg b,
|
||||||
HD 132406 b, HD 43691 b, NGC 2423 3 b, Gliese 317 b & c,
|
HD 132406 b, HD 43691 b, NGC 2423 3 b, Gliese 317 b & c,
|
||||||
TrES-3, HD 155358 b&c, HD 5319 b, HD 75898 b, OGLE-TR-182 b, WASP-3 b,
|
TrES-3, HD 155358 b&c, HD 5319 b, HD 75898 b, OGLE-TR-182 b, WASP-3 b,
|
||||||
55 Cnc f, Lupus-TR-3 b, OGLE-TR-211 b, HD 156846 b, HD 4113 b, Kap CrB b,
|
55 Cnc f, Lupus-TR-3 b, OGLE-TR-211 b, HD 156846 b, HD 4113 b, Kap CrB b,
|
||||||
GD 66 b, XO-3 b, WASP-4 b TW Hya b
|
GD 66 b, XO-3 b, WASP-4 b TW Hya b
|
||||||
removed HD 33636 b
|
removed HD 33636 b
|
||||||
* Set up transit of Gliese 436
|
* Set up transit of Gliese 436
|
||||||
|
@ -1383,7 +1383,7 @@ Bug fixes
|
||||||
* Fixed search path for Lua scripts
|
* Fixed search path for Lua scripts
|
||||||
* Fixed numerous bugs that occurred when an object's orbit center was different
|
* Fixed numerous bugs that occurred when an object's orbit center was different
|
||||||
* Fixed a bug in the celx function celestia:getscreendimension
|
* Fixed a bug in the celx function celestia:getscreendimension
|
||||||
* Fixed bug with returning Hubble type for galaxies
|
* Fixed bug with returning Hubble type for galaxies
|
||||||
* Eliminated error-prone min/max macros; use STL functions instead
|
* Eliminated error-prone min/max macros; use STL functions instead
|
||||||
* Fixed discrepancy between apparent magnitudes shown in the 3D view and
|
* Fixed discrepancy between apparent magnitudes shown in the 3D view and
|
||||||
the star browser.
|
the star browser.
|
||||||
|
@ -1424,9 +1424,9 @@ Data file updates
|
||||||
* Changed class of small outer planet moons to minormoon
|
* Changed class of small outer planet moons to minormoon
|
||||||
* Included new and updated solar system body features from the IAU
|
* Included new and updated solar system body features from the IAU
|
||||||
* Added provisional rotation period for Eris
|
* Added provisional rotation period for Eris
|
||||||
|
|
||||||
Tools
|
Tools
|
||||||
* Added Perl script globulars.pl used to extract the globular data from scientific publications and as documentation
|
* Added Perl script globulars.pl used to extract the globular data from scientific publications and as documentation
|
||||||
* Added spice2xyzv tool for extracting xyzv files from a pool of SPICE kernels
|
* Added spice2xyzv tool for extracting xyzv files from a pool of SPICE kernels
|
||||||
* Added Perl script to build cross-indices
|
* Added Perl script to build cross-indices
|
||||||
* Added Perl script to generate CHARM2 catalog
|
* Added Perl script to generate CHARM2 catalog
|
||||||
|
@ -1557,7 +1557,7 @@ Scripting
|
||||||
- windowbordersvisible, setwindowbordersvisible
|
- windowbordersvisible, setwindowbordersvisible
|
||||||
* Split celx scripting support into several modules
|
* Split celx scripting support into several modules
|
||||||
* Cel scripting
|
* Cel scripting
|
||||||
- splitview, deleteview, singleview, setactiveview
|
- splitview, deleteview, singleview, setactiveview
|
||||||
- setgalaxylightgain
|
- setgalaxylightgain
|
||||||
- setradius
|
- setradius
|
||||||
- setlinecolor
|
- setlinecolor
|
||||||
|
|
|
@ -0,0 +1,142 @@
|
||||||
|
| **`Release`** | **`Localized`** | **`License`** | **`Contribute`** |
|
||||||
|
|-------------------|---------------|---------------|---------------|
|
||||||
|
|[![GitHub release](https://img.shields.io/github/v/release/CelestiaProject/Celestia?label=Release)](https://celestia.space/download.html) | [![Localization](https://img.shields.io/badge/Localized-85%25-green.svg)](#) | [![License](https://img.shields.io/github/license/CelestiaProject/Celestia?label=License)](https://github.com/CelestiaProject/Celestia/blob/master/COPYING) | [![Contribute](https://img.shields.io/badge/PRs-Welcome-brightgreen.svg)](#contributing) |
|
||||||
|
|
||||||
|
# Celestia
|
||||||
|
![Celestia](celestia-logo.png)<br>
|
||||||
|
**A real-time space simulation that lets you experience our universe in three dimensions.**
|
||||||
|
|
||||||
|
**Copyright © 2001-2021, Celestia Development Team**<br>
|
||||||
|
**Celestia website: https://celestia.space**<br>
|
||||||
|
**Celestia Wikibook: https://en.wikibooks.org/wiki/Celestia**<br>
|
||||||
|
**Celestia forums: https://celestia.space/forum/**<br>
|
||||||
|
**Celestia Subreddit: https://www.reddit.com/r/Celestiasoftware/**<br>
|
||||||
|
**Celestia Archive Repository: https://github.com/Anthony-B-Russo10/Celestia-Archive**
|
||||||
|
## License
|
||||||
|
|
||||||
|
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,
|
||||||
|
which you should have received along with this program (filename: COPYING).
|
||||||
|
If not, request a copy from:<br>
|
||||||
|
Free Software Foundation, Inc.<br>
|
||||||
|
59 Temple Place - Suite 330<br>
|
||||||
|
Boston, MA 02111-1307<br>
|
||||||
|
USA
|
||||||
|
|
||||||
|
## Getting started
|
||||||
|
|
||||||
|
Celestia will start up in a window, and if everything is working correctly,
|
||||||
|
you'll see Earth in front of a field of stars. Displayed on-screen, is some
|
||||||
|
information about your target (Earth), your speed, and the current time
|
||||||
|
(Universal Time, so it'll probably be a few hours off from your computer's
|
||||||
|
clock).
|
||||||
|
|
||||||
|
Right drag the mouse to orbit Earth and you might see the Moon and some
|
||||||
|
familiar constellations. Left dragging the mouse changes your orientation
|
||||||
|
also, but the camera rotates about its center instead of rotating around
|
||||||
|
Earth. Rolling the mouse wheel will change your distance to Earth--you can
|
||||||
|
move light years away, then roll the wheel in the opposite direction to get
|
||||||
|
back to your starting location. If your mouse lacks a wheel, you can use the
|
||||||
|
Home and End keys instead.
|
||||||
|
|
||||||
|
When running Celestia, you will usually have some object selected. Currently,
|
||||||
|
it's Earth, but it could also be a star, moon, spacecraft, galaxy, or some
|
||||||
|
other object. The simplest way to select an object is to click on it. Try
|
||||||
|
clicking on a star to select it. The information about Earth is replaced with
|
||||||
|
some details about the star. Press G (or use the Navigation menu), and you'll
|
||||||
|
zoom through space toward the selected star. If you press G again, you'll
|
||||||
|
approach the star even closer.
|
||||||
|
|
||||||
|
Press H to select our Sun, and then G to go back to our Sun. Right click on
|
||||||
|
the sun to bring up a menu of planets and other objects in the solar system.
|
||||||
|
After selecting a planet from the menu, hit G again to travel toward it. Once
|
||||||
|
there, hold down the right mouse button and drag to orbit the planet.
|
||||||
|
|
||||||
|
The Tour Guide is a list of some of the more interesting objects you can visit
|
||||||
|
in Celestia. Select the Tour Guide option in the Navigation menu to display
|
||||||
|
the Tour Guide window. Choose a destination from the list, click the Goto
|
||||||
|
button, and you're off.
|
||||||
|
|
||||||
|
That covers the very basics. For a more in-depth look at Celestia and the
|
||||||
|
controls available to you, download the "Celestia User's Guide" (written by
|
||||||
|
Frank Gregorio), available in several languages, from:<br>
|
||||||
|
https://celestia.space/guides.html<br>
|
||||||
|
This web page also includes links to the Celestia README file translated into
|
||||||
|
Japanese.
|
||||||
|
|
||||||
|
### Star browser
|
||||||
|
By default, the Star Browser window displays a table of the 100 nearest stars,
|
||||||
|
along with their Distance, Apparent and Absolute Magnitude, and Type. Clicking
|
||||||
|
on the column headers will sort the stars. The table is not continuously
|
||||||
|
updated, so if you travel to another star, you should press the Refresh button
|
||||||
|
to update the table for your current position. The radio buttons beneath the
|
||||||
|
table let you switch between viewing a list of Nearest, Brightest, or 'With
|
||||||
|
planets' stars. As with the solar system browser, clicking on any star name
|
||||||
|
in the table will select it. Use this feature along with the Center and Go
|
||||||
|
To buttons to tour the stars visible from any night sky in the galaxy.
|
||||||
|
|
||||||
|
### Solar system browser
|
||||||
|
The Solar System Browser displays a window with a tree view of all the objects
|
||||||
|
in the nearest solar system (if there is one within a light year of your current
|
||||||
|
position.) Clicking on the name of any object in the window will select it.
|
||||||
|
You can then use the Center or Go To buttons to display that object in the main
|
||||||
|
Celestia window.
|
||||||
|
|
||||||
|
### Selecting objects by name
|
||||||
|
Celestia provides several ways to select an object by name...
|
||||||
|
1. Choose 'Select Object' from the Navigation menu, type in the object name, and click OK.
|
||||||
|
2. Press Enter, type in the entire object name, and press Enter again.
|
||||||
|
3. Press Enter, type in the first few characters of the object name,
|
||||||
|
press the Tab key to move through the displayed listing until the object is highlighted,
|
||||||
|
then press Enter again.
|
||||||
|
|
||||||
|
You can use common names, Bayer designations or catalog numbers for stars.
|
||||||
|
Celestia currently supports the HIP, HD and SAO catalogs. Catalog numbers must
|
||||||
|
be entered with a space between the prefix and the catalog number.
|
||||||
|
|
||||||
|
### Known issues
|
||||||
|
For up-to-the-minute answers to some common problems encountered when running
|
||||||
|
Celestia, please view either the FAQ in the Help menu or take a look at the
|
||||||
|
"Celestia User's FAQ" located on the Celestia User's Forum:
|
||||||
|
https://celestia.space/forum/
|
||||||
|
|
||||||
|
### User modifiable elements
|
||||||
|
You can modify how Celestia starts up each time you run it, by defining your
|
||||||
|
own start-up settings. Simply open the file "start.cel" in a plain text
|
||||||
|
editor and follow the in-file instructions. Also, view the celestia.cfg file
|
||||||
|
in a plain text editor to see additional settings.
|
||||||
|
|
||||||
|
Celestia allows you to easily add real, hypothetical, or fictional objects
|
||||||
|
by creating new catalog files. It is *not* recommended that you alter the
|
||||||
|
built-in data files; nearly all desired modifications and additions can be
|
||||||
|
made by placing new catalog files in Celestia's extras folders. There are three
|
||||||
|
types of catalog files:
|
||||||
|
* ssc (solar system catalog: planets, moons, spacecraft, etc.)
|
||||||
|
* stc (star catalog)
|
||||||
|
* dsc (deep sky catalog: galaxies, star clusters, and nebulae)
|
||||||
|
|
||||||
|
All three types of catalog file are text files that can be updated with your
|
||||||
|
favorite text editing program.
|
||||||
|
|
||||||
|
### Building from sources
|
||||||
|
See instructions in file [INSTALL.md](INSTALL.md).
|
||||||
|
|
||||||
|
## Contributions
|
||||||
|
| **`Authors`** | **`Contributors`** | **`Documentation`** | **`Other`** |
|
||||||
|
|-----------------|---------------------|------------------|-------------------|
|
||||||
|
| Chris Laurel, Clint Weisbrod, Fridger Schrempp, Bob Ippolito, Christophe Teyssier, Hank Ramsey, Grant Hutchison, Pat Suwalski, Toti, Da Woon Jung, Vincent Giangiulio, Andrew Tribick, Hleb Valoshka, Łukasz Buczyński, Li Linfeng | Deon Ramsey, Christopher Andre, Colin Walters, Peter Chapman, James Holmes, Harald Schmidt, Nils Larsson, Sergey Leonov, Alexell, Dmitry Brant, Janus | Selden Ball, Frank Gregorio, Hitoshi Suzuki, Christophe Teyssier, Diego Rodriguez, Don Goyette, Harald Schmidt | Creators of scientific database, texture maps, 3D models and used libraries, you can see in full README.|
|
||||||
|
|
||||||
|
### Contributing
|
||||||
|
|
||||||
|
**We welcome feedback, bug reports, and pull requests!**
|
||||||
|
|
||||||
|
For pull requests, please stick to the following guidelines:
|
||||||
|
* Be sure to test your code changes.
|
||||||
|
* Follow the existing code style (e.g., indents).
|
||||||
|
* Put a lot of comments into the code, if necessary.
|
||||||
|
* Separate unrelated changes into multiple pull requests.
|
207
README.md
207
README.md
|
@ -1,143 +1,110 @@
|
||||||
| **`Release`** | **`Localized`** | **`License`** | **`Contribute`** |
|
|
||||||
|-------------------|---------------|---------------|---------------|
|
|
||||||
|[![GitHub release](https://img.shields.io/github/v/release/CelestiaProject/Celestia?label=Release)](https://celestia.space/download.html) | [![Localization](https://img.shields.io/badge/Localized-85%25-green.svg)](#) | [![License](https://img.shields.io/github/license/CelestiaProject/Celestia?label=License)](https://github.com/CelestiaProject/Celestia/blob/master/COPYING) | [![Contribute](https://img.shields.io/badge/PRs-Welcome-brightgreen.svg)](#contributing) |
|
|
||||||
|
|
||||||
# Celestia
|
# Celestia
|
||||||
![Celestia](celestia-logo.png)<br>
|
Celestia is a "real-time space simulation that lets you experience
|
||||||
**A real-time space simulation that lets you experience our universe in three dimensions.**
|
our universe in three dimensions".
|
||||||
|
|
||||||
**Copyright © 2001-2021, Celestia Development Team**<br>
|
![celestia-screenshot](pics/celestia-screenshot.png)
|
||||||
**Celestia website: https://celestia.space**<br>
|
|
||||||
**Celestia Wikibook: https://en.wikibooks.org/wiki/Celestia**<br>
|
|
||||||
**Celestia forums: https://celestia.space/forum/**<br>
|
|
||||||
**Celestia Discord Server: https://discordapp.com/invite/WEWDcJh**<br>
|
|
||||||
**Celestia Subreddit: https://www.reddit.com/r/Celestiasoftware/**<br>
|
|
||||||
**Celestia Archive Repository: https://github.com/Anthony-B-Russo10/Celestia-Archive**
|
|
||||||
## License
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under
|
# Upstream
|
||||||
the terms of the GNU General Public License as published by the Free Software Foundation;
|
This repo is a lesser fork of the upstream project,
|
||||||
either version 2 of the License, or (at your option) any later version.
|
which has been revived.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, but WITHOUT
|
* https://celestia.space/
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details,
|
|
||||||
which you should have received along with this program (filename: COPYING).
|
|
||||||
If not, request a copy from:<br>
|
|
||||||
Free Software Foundation, Inc.<br>
|
|
||||||
59 Temple Place - Suite 330<br>
|
|
||||||
Boston, MA 02111-1307<br>
|
|
||||||
USA
|
|
||||||
|
|
||||||
## Getting started
|
* https://github.com/CelestiaProject/Celestia
|
||||||
|
|
||||||
Celestia will start up in a window, and if everything is working correctly,
|
See also: `README-upstream`, `README-upstream.md`.
|
||||||
you'll see Earth in front of a field of stars. Displayed on-screen, is some
|
|
||||||
information about your target (Earth), your speed, and the current time
|
|
||||||
(Universal Time, so it'll probably be a few hours off from your computer's
|
|
||||||
clock).
|
|
||||||
|
|
||||||
Right drag the mouse to orbit Earth and you might see the Moon and some
|
## License/Copyright
|
||||||
familiar constellations. Left dragging the mouse changes your orientation
|
GPLv2+
|
||||||
also, but the camera rotates about its center instead of rotating around
|
|
||||||
Earth. Rolling the mouse wheel will change your distance to Earth--you can
|
|
||||||
move light years away, then roll the wheel in the opposite direction to get
|
|
||||||
back to your starting location. If your mouse lacks a wheel, you can use the
|
|
||||||
Home and End keys instead.
|
|
||||||
|
|
||||||
When running Celestia, you will usually have some object selected. Currently,
|
Copyright © 2001-2021, Celestia Development Team
|
||||||
it's Earth, but it could also be a star, moon, spacecraft, galaxy, or some
|
|
||||||
other object. The simplest way to select an object is to click on it. Try
|
|
||||||
clicking on a star to select it. The information about Earth is replaced with
|
|
||||||
some details about the star. Press G (or use the Navigation menu), and you'll
|
|
||||||
zoom through space toward the selected star. If you press G again, you'll
|
|
||||||
approach the star even closer.
|
|
||||||
|
|
||||||
Press H to select our Sun, and then G to go back to our Sun. Right click on
|
# Debian
|
||||||
the sun to bring up a menu of planets and other objects in the solar system.
|
Package was removed from Debian in the ancient days due to bitrot.
|
||||||
After selecting a planet from the menu, hit G again to travel toward it. Once
|
The upstream code has a new team and active development, using
|
||||||
there, hold down the right mouse button and drag to orbit the planet.
|
recent libraries. The package can be built under Debian Ok, except
|
||||||
|
for the `data/` files.
|
||||||
|
|
||||||
The Tour Guide is a list of some of the more interesting objects you can visit
|
Debian upstream bug:
|
||||||
in Celestia. Select the Tour Guide option in the Navigation menu to display
|
|
||||||
the Tour Guide window. Choose a destination from the list, click the Goto
|
|
||||||
button, and you're off.
|
|
||||||
|
|
||||||
That covers the very basics. For a more in-depth look at Celestia and the
|
* https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=809916
|
||||||
controls available to you, download the "Celestia User's Guide" (written by
|
|
||||||
Frank Gregorio), available in several languages, from:<br>
|
|
||||||
https://celestia.space/guides.html<br>
|
|
||||||
This web page also includes links to the Celestia README file translated into
|
|
||||||
Japanese.
|
|
||||||
|
|
||||||
### Star browser
|
```
|
||||||
By default, the Star Browser window displays a table of the 100 nearest stars,
|
Upstream has not produced any new releases in the last 4 years. In the
|
||||||
along with their Distance, Apparent and Absolute Magnitude, and Type. Clicking
|
mean time, the package is accumulating bugs due to bitrot. It already
|
||||||
on the column headers will sort the stars. The table is not continuously
|
wasn't a trouble-free package, due to some quite important resources not
|
||||||
updated, so if you travel to another star, you should press the Refresh button
|
being DFSG compliant.
|
||||||
to update the table for your current position. The radio buttons beneath the
|
```
|
||||||
table let you switch between viewing a list of Nearest, Brightest, or 'With
|
|
||||||
planets' stars. As with the solar system browser, clicking on any star name
|
|
||||||
in the table will select it. Use this feature along with the Center and Go
|
|
||||||
To buttons to tour the stars visible from any night sky in the galaxy.
|
|
||||||
|
|
||||||
### Solar system browser
|
I do see some of the resources now are CC-by-SA 4.0, a license which
|
||||||
The Solar System Browser displays a window with a tree view of all the objects
|
didn't exist when the Debian bug was created. So it may be that it
|
||||||
in the nearest solar system (if there is one within a light year of your current
|
can be built happily without DFSG issues using new data files.
|
||||||
position.) Clicking on the name of any object in the window will select it.
|
|
||||||
You can then use the Center or Go To buttons to display that object in the main
|
|
||||||
Celestia window.
|
|
||||||
|
|
||||||
### Selecting objects by name
|
|
||||||
Celestia provides several ways to select an object by name...
|
|
||||||
1. Choose 'Select Object' from the Navigation menu, type in the object name, and click OK.
|
|
||||||
2. Press Enter, type in the entire object name, and press Enter again.
|
|
||||||
3. Press Enter, type in the first few characters of the object name,
|
|
||||||
press the Tab key to move through the displayed listing until the object is highlighted,
|
|
||||||
then press Enter again.
|
|
||||||
|
|
||||||
You can use common names, Bayer designations or catalog numbers for stars.
|
|
||||||
Celestia currently supports the HIP, HD and SAO catalogs. Catalog numbers must
|
|
||||||
be entered with a space between the prefix and the catalog number.
|
|
||||||
|
|
||||||
### Known issues
|
Celestia depending on NASA's Spice/NAIF may be afoul of Debian's
|
||||||
For up-to-the-minute answers to some common problems encountered when running
|
DFSG because the terms are unique. It isn't really a standard license.
|
||||||
Celestia, please view either the FAQ in the Help menu or take a look at the
|
|
||||||
"Celestia User's FAQ" located on the Celestia User's Forum:
|
|
||||||
https://celestia.space/forum/
|
|
||||||
|
|
||||||
### User modifiable elements
|
|
||||||
You can modify how Celestia starts up each time you run it, by defining your
|
|
||||||
own start-up settings. Simply open the file "start.cel" in a plain text
|
|
||||||
editor and follow the in-file instructions. Also, view the celestia.cfg file
|
|
||||||
in a plain text editor to see additional settings.
|
|
||||||
|
|
||||||
Celestia allows you to easily add real, hypothetical, or fictional objects
|
Debian tracker link:
|
||||||
by creating new catalog files. It is *not* recommended that you alter the
|
|
||||||
built-in data files; nearly all desired modifications and additions can be
|
|
||||||
made by placing new catalog files in Celestia's extras folders. There are three
|
|
||||||
types of catalog files:
|
|
||||||
* ssc (solar system catalog: planets, moons, spacecraft, etc.)
|
|
||||||
* stc (star catalog)
|
|
||||||
* dsc (deep sky catalog: galaxies, star clusters, and nebulae)
|
|
||||||
|
|
||||||
All three types of catalog file are text files that can be updated with your
|
* https://tracker.debian.org/pkg/celestia
|
||||||
favorite text editing program.
|
|
||||||
|
|
||||||
### Building from sources
|
# Build
|
||||||
See instructions in file [INSTALL.md](INSTALL.md).
|
Mini Debian package build howto.
|
||||||
|
|
||||||
## Contributions
|
```
|
||||||
| **`Authors`** | **`Contributors`** | **`Documentation`** | **`Other`** |
|
# Install deps
|
||||||
|-----------------|---------------------|------------------|-------------------|
|
sudo apt update
|
||||||
| Chris Laurel, Clint Weisbrod, Fridger Schrempp, Bob Ippolito, Christophe Teyssier, Hank Ramsey, Grant Hutchison, Pat Suwalski, Toti, Da Woon Jung, Vincent Giangiulio, Andrew Tribick, Hleb Valoshka, Łukasz Buczyński, Li Linfeng | Deon Ramsey, Christopher Andre, Colin Walters, Peter Chapman, James Holmes, Harald Schmidt, Nils Larsson, Sergey Leonov, Alexell, Dmitry Brant, Janus | Selden Ball, Frank Gregorio, Hitoshi Suzuki, Christophe Teyssier, Diego Rodriguez, Don Goyette, Harald Schmidt | Creators of scientific database, texture maps, 3D models and used libraries, you can see in full README.|
|
sudo apt install build-essential ccache devscripts \
|
||||||
|
debhelper chrpath cmake freeglut3-dev libeigen3-dev libfmt-dev \
|
||||||
|
libfreetype6-dev libepoxy-dev libglu1-mesa-dev libgtk2.0-dev \
|
||||||
|
libgtkglext1-dev libjpeg62-turbo-dev libluajit-5.1-dev libpng-dev \
|
||||||
|
libqt5opengl5-dev libtheora-dev qtbase5-dev qtbase5-dev-tools
|
||||||
|
|
||||||
### Contributing
|
# Add ccache to PATH in ~/.bashrc, and log back in
|
||||||
|
PATH=/usr/lib/ccache:$PATH
|
||||||
|
|
||||||
**We welcome feedback, bug reports, and pull requests!**
|
# Make dirs to put it all, as it writes packages to the *parent* dir.
|
||||||
|
mkdir celestia-deb
|
||||||
|
cd celestia-deb
|
||||||
|
|
||||||
|
git clone https://spacecruft.org/spacecruft/CelestiaContent
|
||||||
|
cd CelestiaContent
|
||||||
|
|
||||||
|
# Build the source package, writes to parent dir
|
||||||
|
dpkg-buildpackage -rfakeroot -S -uc -us -sa
|
||||||
|
|
||||||
|
# Build Debian Packages
|
||||||
|
dpkg-buildpackage -rfakeroot -b -uc
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
# Install the data package
|
||||||
|
sudo dpkg -i celestia-data_1.7.0~git20211202+668347e9+0_all.deb
|
||||||
|
|
||||||
|
# Make sure apt is happy
|
||||||
|
sudo apt -f install
|
||||||
|
|
||||||
|
git clone --recursive https://spacecruft.org/spacecruft/celestia
|
||||||
|
cd celestia
|
||||||
|
|
||||||
|
# Build the source package, writes to parent dir
|
||||||
|
dpkg-buildpackage -rfakeroot -S -uc -us -sa
|
||||||
|
|
||||||
|
# Build Debian Packages
|
||||||
|
dpkg-buildpackage -rfakeroot -b -uc
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
# Install
|
||||||
|
sudo dpkg -i celestia_1.7.0~git20220520+1_all.deb \
|
||||||
|
celestia-common_1.7.0~git20220520+1_all.deb \
|
||||||
|
celestia-qt_1.7.0~git20220520+1_amd64.deb \
|
||||||
|
celestia-tools_1.7.0~git20220520+1_amd64.deb \
|
||||||
|
libcelestia1.7_1.7.0~git20220520+1_amd64.deb
|
||||||
|
|
||||||
|
# Make sure apt is happy
|
||||||
|
sudo apt -f install
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
For pull requests, please stick to the following guidelines:
|
|
||||||
* Be sure to test your code changes.
|
|
||||||
* Follow the existing code style (e.g., indents).
|
|
||||||
* Put a lot of comments into the code, if necessary.
|
|
||||||
* Separate unrelated changes into multiple pull requests.
|
|
||||||
|
|
|
@ -227,16 +227,17 @@ StarTextures
|
||||||
# text on the display screen. To view the list of fonts available with
|
# text on the display screen. To view the list of fonts available with
|
||||||
# your distribution of Celestia, look in the fonts directory located
|
# your distribution of Celestia, look in the fonts directory located
|
||||||
# under the Celestia root directory. The default fonts are UTF-8
|
# under the Celestia root directory. The default fonts are UTF-8
|
||||||
# compatible in order to display non-English characters.
|
# compatible in order to display non-English characters. Font size is
|
||||||
|
# measured in points to ensure the same sizes on all DPI configurations.
|
||||||
#
|
#
|
||||||
# Font: Used to display all informational text.
|
# Font: Used to display all informational text.
|
||||||
# Default: "sans12.txf"
|
# Default: "DejaVuSans.ttf,9"
|
||||||
#
|
#
|
||||||
# LabelFont: Used to display all label text (objects, locations, etc.).
|
# LabelFont: Used to display all label text (objects, locations, etc.).
|
||||||
# Default "sans12.txf"
|
# Default "DejaVuSans.ttf,9"
|
||||||
#
|
#
|
||||||
# TitleFont: Used to display object names, messages, and script text.
|
# TitleFont: Used to display object names, messages, and script text.
|
||||||
# Default "sansbold20.txf"
|
# Default "DejaVuSans-Bold.ttf,15"
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
Font "DejaVuSans.ttf,9"
|
Font "DejaVuSans.ttf,9"
|
||||||
LabelFont "DejaVuSans.ttf,9"
|
LabelFont "DejaVuSans.ttf,9"
|
||||||
|
|
|
@ -212,6 +212,7 @@ Source: "locale\controls_zh_CN.txt"; DestDir: "{app}/locale"; Flags: ignor
|
||||||
Source: "locale\controls_zh_TW.txt"; DestDir: "{app}/locale"; Flags: ignoreversion
|
Source: "locale\controls_zh_TW.txt"; DestDir: "{app}/locale"; Flags: ignoreversion
|
||||||
|
|
||||||
Source: "locale\demo_be.cel"; DestDir: "{app}/locale"; Flags: ignoreversion
|
Source: "locale\demo_be.cel"; DestDir: "{app}/locale"; Flags: ignoreversion
|
||||||
|
Source: "locale\demo_bg.cel"; DestDir: "{app}/locale"; Flags: ignoreversion
|
||||||
Source: "locale\demo_de.cel"; DestDir: "{app}/locale"; Flags: ignoreversion
|
Source: "locale\demo_de.cel"; DestDir: "{app}/locale"; Flags: ignoreversion
|
||||||
Source: "locale\demo_es.cel"; DestDir: "{app}/locale"; Flags: ignoreversion
|
Source: "locale\demo_es.cel"; DestDir: "{app}/locale"; Flags: ignoreversion
|
||||||
Source: "locale\demo_fr.cel"; DestDir: "{app}/locale"; Flags: ignoreversion
|
Source: "locale\demo_fr.cel"; DestDir: "{app}/locale"; Flags: ignoreversion
|
||||||
|
|
|
@ -3,4 +3,5 @@
|
||||||
#cmakedefine HAVE_FLOAT_CHARCONV
|
#cmakedefine HAVE_FLOAT_CHARCONV
|
||||||
#cmakedefine HAVE_STD_FILESYSTEM
|
#cmakedefine HAVE_STD_FILESYSTEM
|
||||||
#cmakedefine HAVE_WORDEXP
|
#cmakedefine HAVE_WORDEXP
|
||||||
|
#cmakedefine HAVE_MESHOPTIMIZER
|
||||||
#cmakedefine WORDS_BIGENDIAN
|
#cmakedefine WORDS_BIGENDIAN
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
README
|
README.md
|
||||||
|
README-upstream
|
||||||
|
README-upstream.md
|
||||||
AUTHORS
|
AUTHORS
|
||||||
TRANSLATORS
|
TRANSLATORS
|
||||||
|
|
|
@ -12,7 +12,7 @@ usr/bin/3dstocmod
|
||||||
usr/bin/cmodfix
|
usr/bin/cmodfix
|
||||||
usr/bin/txt2cmod
|
usr/bin/txt2cmod
|
||||||
usr/bin/cmodsphere
|
usr/bin/cmodsphere
|
||||||
usr/bin/qttxf
|
#usr/bin/qttxf
|
||||||
#usr/bin/spice2xyzv
|
#usr/bin/spice2xyzv
|
||||||
usr/bin/vsoptrunc-rect
|
usr/bin/vsoptrunc-rect
|
||||||
usr/bin/vsoptrunc-sph
|
usr/bin/vsoptrunc-sph
|
||||||
|
|
|
@ -1,3 +1,16 @@
|
||||||
|
celestia (1.7.0~git20220520+1) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
|
* Fix control character ^M in perl scripts.
|
||||||
|
|
||||||
|
-- Jeff Moe <moe@spacecruft.org> Fri, 20 May 2022 21:02:00 -0600
|
||||||
|
|
||||||
|
celestia (1.7.0~git20220520+0) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
|
* New snapshot build.
|
||||||
|
* Remove missing qttxf.
|
||||||
|
|
||||||
|
-- Jeff Moe <moe@spacecruft.org> Fri, 20 May 2022 19:55:59 -0600
|
||||||
|
|
||||||
celestia (1.7.0~git20190807+d9746691+0) UNRELEASED; urgency=medium
|
celestia (1.7.0~git20190807+d9746691+0) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
* New snapshot build
|
* New snapshot build
|
||||||
|
|
|
@ -5,6 +5,7 @@ Maintainer: Hleb Valoshka <375gnu@gmail.com>
|
||||||
Build-Depends: debhelper (>= 10~),
|
Build-Depends: debhelper (>= 10~),
|
||||||
chrpath,
|
chrpath,
|
||||||
cmake (>= 3.1~),
|
cmake (>= 3.1~),
|
||||||
|
dos2unix,
|
||||||
freeglut3-dev,
|
freeglut3-dev,
|
||||||
libeigen3-dev (>= 3.3~),
|
libeigen3-dev (>= 3.3~),
|
||||||
libfmt-dev (>= 4),
|
libfmt-dev (>= 4),
|
||||||
|
|
|
@ -26,6 +26,8 @@ override_dh_auto_configure:
|
||||||
|
|
||||||
|
|
||||||
override_dh_install:
|
override_dh_install:
|
||||||
|
dos2unix ./src/tools/stardb/buildstardb.pl
|
||||||
|
dos2unix ./src/tools/xindex/buildxindices.pl
|
||||||
find debian/tmp/usr/bin/ -type f ! -name *.pl -exec chrpath --delete {} ';'
|
find debian/tmp/usr/bin/ -type f ! -name *.pl -exec chrpath --delete {} ';'
|
||||||
chrpath --delete debian/tmp/usr/lib/*/libcelestia.so.*
|
chrpath --delete debian/tmp/usr/lib/*/libcelestia.so.*
|
||||||
dh_install --fail-missing
|
dh_install --fail-missing
|
||||||
|
|
|
@ -3,10 +3,10 @@
|
||||||
labels { clear "planets|minorplanets|stars|constellations" }
|
labels { clear "planets|minorplanets|stars|constellations" }
|
||||||
renderflags { set "stars|planets"
|
renderflags { set "stars|planets"
|
||||||
clear "constellations|orbits|cloudmaps" }
|
clear "constellations|orbits|cloudmaps" }
|
||||||
print { text "Начало на демонстрацията . . .\nНатиснете ESC за край." origin "center" duration 2 }
|
print { text "Начало на демонстрацията...\nНатиснете „Esc“ за край." origin "center" duration 2 }
|
||||||
wait { duration 2.0 }
|
wait { duration 2.0 }
|
||||||
|
|
||||||
print { text "Нека да започнем от нашия дом . . ." row -3 }
|
print { text "Нека да започнем от нашия дом..." row -3 }
|
||||||
select { object "Sol/Earth" }
|
select { object "Sol/Earth" }
|
||||||
cancel {}
|
cancel {}
|
||||||
# goto { time 0 distance 3 upframe "ecliptical" }
|
# goto { time 0 distance 3 upframe "ecliptical" }
|
||||||
|
@ -18,25 +18,25 @@
|
||||||
wait { duration 1.0 }
|
wait { duration 1.0 }
|
||||||
follow {}
|
follow {}
|
||||||
|
|
||||||
print { text "В момента се намираме на 12 500 км над Земята" row -3 duration 5 }
|
print { text "В момента се намираме на 12 500 км. над Земята." row -3 duration 5 }
|
||||||
orbit { axis [ 0 1 0 ] rate 30 duration 10 }
|
orbit { axis [ 0 1 0 ] rate 30 duration 10 }
|
||||||
print { text "Като добавим и облаците, Земята изглежда по позната." row -3}
|
print { text "Като добавим и облаците, Земята изглежда по-позната." row -3}
|
||||||
wait { duration 0.1 }
|
wait { duration 0.1 }
|
||||||
renderflags { set "cloudmaps" }
|
renderflags { set "cloudmaps" }
|
||||||
orbit { axis [ 0 1 0 ] rate 30 duration 6 }
|
orbit { axis [ 0 1 0 ] rate 30 duration 6 }
|
||||||
|
|
||||||
print { text "Следваща спирка: Луната." row -3 }
|
print { text "Следваща спирка: Луната" row -3 }
|
||||||
select { object "Moon" }
|
select { object "Moon" }
|
||||||
goto { time 5 distance 4 upframe "equatorial" }
|
goto { time 5 distance 4 upframe "equatorial" }
|
||||||
wait { duration 5.5 }
|
wait { duration 5.5 }
|
||||||
print { text "Оглеждайте се за Земята и Слънцето, докато се движим около Луната" row -3}
|
print { text "Оглеждайте се за Земята и Слънцето, докато обикаляме около Луната." row -3}
|
||||||
orbit { axis [ 0 1 0 ] rate 30 duration 10 }
|
orbit { axis [ 0 1 0 ] rate 30 duration 10 }
|
||||||
|
|
||||||
print { text "Напред към Слънцето." row -3}
|
print { text "Напред към Слънцето!" row -3}
|
||||||
select { object "Sol" }
|
select { object "Sol" }
|
||||||
goto { time 8 distance 12 upframe "equatorial" up [ 0 1 0 ] }
|
goto { time 8 distance 12 upframe "equatorial" up [ 0 1 0 ] }
|
||||||
wait { duration 8.5 }
|
wait { duration 8.5 }
|
||||||
print { text "От това разстояние могат да се видят тъмните слънчеви петна по повърхността му." row -3}
|
print { text "От това разстояние може да видим тъмните слънчеви петна по повърхността му." row -3}
|
||||||
orbit { axis [ 0 1 0 ] rate 20 duration 10 }
|
orbit { axis [ 0 1 0 ] rate 20 duration 10 }
|
||||||
|
|
||||||
print { text "Нека да се отдалечим и разгледаме вътрешната част на Слънчевата система." row -3}
|
print { text "Нека да се отдалечим и разгледаме вътрешната част на Слънчевата система." row -3}
|
||||||
|
@ -44,10 +44,10 @@
|
||||||
renderflags { set "orbits" }
|
renderflags { set "orbits" }
|
||||||
changedistance { duration 4.0 rate 1.0 }
|
changedistance { duration 4.0 rate 1.0 }
|
||||||
|
|
||||||
print { text "Да включим имената на планетите . . ." row -3}
|
print { text "Да включим имената на планетите..." row -3}
|
||||||
labels { set "planets" }
|
labels { set "planets" }
|
||||||
wait { duration 1.0 }
|
wait { duration 1.0 }
|
||||||
print { text "Можем да ускорим времето за да видим как планетите обикалят около Слънцето." row -3}
|
print { text "Може да ускорим времето за да видим как планетите обикалят около Слънцето." row -3}
|
||||||
timerate { rate 2592000 }
|
timerate { rate 2592000 }
|
||||||
wait { duration 3.0 }
|
wait { duration 3.0 }
|
||||||
print { text "Всяка секунда в реално време е равна на един месец в симулацията." row -3}
|
print { text "Всяка секунда в реално време е равна на един месец в симулацията." row -3}
|
||||||
|
@ -56,7 +56,7 @@
|
||||||
print { text "В момента, времето е спряно." row -3}
|
print { text "В момента, времето е спряно." row -3}
|
||||||
|
|
||||||
wait { duration 1.0 }
|
wait { duration 1.0 }
|
||||||
print { text "Следващата ни дестинация е Сатурн." row -3}
|
print { text "Следваща спирка: Сатурн" row -3}
|
||||||
select { object "Saturn" }
|
select { object "Saturn" }
|
||||||
center { time 2 }
|
center { time 2 }
|
||||||
wait { duration 2 }
|
wait { duration 2 }
|
||||||
|
@ -64,12 +64,12 @@
|
||||||
wait { duration 6.5 }
|
wait { duration 6.5 }
|
||||||
renderflags { clear "orbits" }
|
renderflags { clear "orbits" }
|
||||||
labels { clear "planets" }
|
labels { clear "planets" }
|
||||||
print { text "Няколко от луните на Сатурн са видими като ярки точки" row -3 duration 3}
|
print { text "Няколко от спътниците на Сатурн са видими като ярки точки." row -3 duration 3}
|
||||||
orbit { axis [ 0 1 0 ] rate 30 duration 12 }
|
orbit { axis [ 0 1 0 ] rate 30 duration 12 }
|
||||||
|
|
||||||
select { object "Mimas" }
|
select { object "Mimas" }
|
||||||
goto { time 5 distance 4 upframe "equatorial" }
|
goto { time 5 distance 4 upframe "equatorial" }
|
||||||
print { text "Най-интересната характеристика на Мимас е огромния кратер Хершел." row -3 duration 9 }
|
print { text "Най-интересната характеристика на Мимас е огромният кратер Хершел." row -3 duration 9 }
|
||||||
orbit { axis [ 0 1 0 ] rate 30 duration 12 }
|
orbit { axis [ 0 1 0 ] rate 30 duration 12 }
|
||||||
changedistance { duration 6.0 rate 0.5 }
|
changedistance { duration 6.0 rate 0.5 }
|
||||||
|
|
||||||
|
@ -82,22 +82,22 @@
|
||||||
wait { duration 2 }
|
wait { duration 2 }
|
||||||
select { object "Alpha UMa" }
|
select { object "Alpha UMa" }
|
||||||
center { time 2 }
|
center { time 2 }
|
||||||
print { text "Ако живеете в северното полукълбо, ще разпознаете Колата в съзвездието Голямата мечка." row -3 duration 3 }
|
print { text "Ако живеете в северното полукълбо, ще разпознаете Волската кола в съзвездието Голямата мечка." row -3 duration 3 }
|
||||||
wait { duration 4 }
|
wait { duration 4 }
|
||||||
|
|
||||||
select { object "Polaris" }
|
select { object "Polaris" }
|
||||||
center { time 2 }
|
center { time 2 }
|
||||||
wait { duration 2 }
|
wait { duration 2 }
|
||||||
print { text "А това е Поларис, известна още като Северната звезда." row -3}
|
print { text "Това е Поларис, известна още като Северната звезда." row -3}
|
||||||
wait { duration 1 }
|
wait { duration 1 }
|
||||||
labels { set "stars" }
|
labels { set "stars" }
|
||||||
wait { duration 2 }
|
wait { duration 2 }
|
||||||
print { text "Поларис е част от Малката мечка." row -3}
|
print { text "Поларис е част от Малката мечка." row -3}
|
||||||
wait { duration 2 }
|
wait { duration 2 }
|
||||||
print { text "За по-добра ориентация в небето, Celestia може да активира диаграмите на съзвездията . . ." row -3}
|
print { text "За по-добра ориентация в небето, „Celestia“ може да активира очертанията на съзвездията..." row -3}
|
||||||
renderflags { set "constellations" }
|
renderflags { set "constellations" }
|
||||||
wait { duration 2 }
|
wait { duration 2 }
|
||||||
print { text ". . . и имената на съзвездията" row -3}
|
print { text "...и имената на съзвездията." row -3}
|
||||||
labels { set "constellations" }
|
labels { set "constellations" }
|
||||||
wait { duration 2 }
|
wait { duration 2 }
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@
|
||||||
wait { duration 4 }
|
wait { duration 4 }
|
||||||
|
|
||||||
rotate { axis [ 0.707 0.707 0 ] rate 20 duration 7 }
|
rotate { axis [ 0.707 0.707 0 ] rate 20 duration 7 }
|
||||||
print { text "Нека да включим рендерирането на галактиките за да видим Млечния път" row -3 duration 4 }
|
print { text "Нека да включим показването на галактиките за да видим Млечния път." row -3 duration 4 }
|
||||||
renderflags { set "galaxies" }
|
renderflags { set "galaxies" }
|
||||||
rotate { axis [ 0.707 0.707 0 ] rate 20 duration 14 }
|
rotate { axis [ 0.707 0.707 0 ] rate 20 duration 14 }
|
||||||
rotate { axis [ 0.707 0.707 0 ] rate 20 duration 10 }
|
rotate { axis [ 0.707 0.707 0 ] rate 20 duration 10 }
|
||||||
|
@ -122,7 +122,7 @@
|
||||||
select { object "Antares" }
|
select { object "Antares" }
|
||||||
center { time 5 }
|
center { time 5 }
|
||||||
wait { duration 3 }
|
wait { duration 3 }
|
||||||
print { text "Сега ще пътуваме до Антарес, това е звезда червен гигант в съзвездието Скорпион." row -3 duration 5 }
|
print { text "Сега ще посетим Антарес, това е звезда червен гигант в съзвездието Скорпион." row -3 duration 5 }
|
||||||
wait { duration 2 }
|
wait { duration 2 }
|
||||||
renderflags { clear "constellations" }
|
renderflags { clear "constellations" }
|
||||||
labels { clear "constellations|stars" }
|
labels { clear "constellations|stars" }
|
||||||
|
@ -134,13 +134,13 @@
|
||||||
print { text "Въпреки че сме 10 пъти по-далече от Антарес\nотколкото Земята е от Слънцето, масивната звезда червен гигант изглежда застрашително голяма." row -3}
|
print { text "Въпреки че сме 10 пъти по-далече от Антарес\nотколкото Земята е от Слънцето, масивната звезда червен гигант изглежда застрашително голяма." row -3}
|
||||||
wait { duration 4.0 }
|
wait { duration 4.0 }
|
||||||
|
|
||||||
print { text "Нека да се отдалечим за да видим как изглежда нашата галактика . . ." row -3}
|
print { text "Нека да се отдалечим за да видим как изглежда нашата галактика..." row -3}
|
||||||
changedistance { duration 10.0 rate 2.0 }
|
changedistance { duration 10.0 rate 2.0 }
|
||||||
|
|
||||||
select { object "Milky Way" }
|
select { object "Milky Way" }
|
||||||
print { text "Това е Млечния път." row -3 duration 6 }
|
print { text "Това е Млечният път." row -3 duration 6 }
|
||||||
orbit { axis [ 1 0 0 ] rate 30 duration 16.0 }
|
orbit { axis [ 1 0 0 ] rate 30 duration 16.0 }
|
||||||
print { text "Време е да се прибираме . . ." row -3}
|
print { text "Време е да се прибираме..." row -3}
|
||||||
|
|
||||||
select { object "Sol/Earth" }
|
select { object "Sol/Earth" }
|
||||||
goto { time 20 distance 10 upframe "equatorial" }
|
goto { time 20 distance 10 upframe "equatorial" }
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
Name "Юпитер"
|
Name "Юпитер"
|
||||||
Target "Sol/Jupiter"
|
Target "Sol/Jupiter"
|
||||||
Description "Юпитер е най-голямата планета в Слънчевата система и е на пета позиция от Слънцето. Както и останалите външни планети, Юпитер е газов гигант без твърда повърхност. Голямото червено петно е най-голямата и най-продължителната буря в турболентната атмосфера на планетата; тази вихрушка с размерите на Земята съществува от около 300 години."
|
Description "Юпитер е най-голямата планета в Слънчевата система и е на пета позиция от Слънцето. Както и останалите външни планети, Юпитер е газов гигант без твърда повърхност. Голямото червено петно е най-голямата и най-продължителната буря в турболентната атмосфера на планетата – тази вихрушка с размерите на Земята съществува от около 300 години."
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -9,13 +9,13 @@
|
||||||
Target "Sol/Pluto"
|
Target "Sol/Pluto"
|
||||||
Distance 40000
|
Distance 40000
|
||||||
DistanceUnits "km"
|
DistanceUnits "km"
|
||||||
Description "Плутон обикаля около Слънцето на средно разстояние от шест милиарда километра. Луната му Харон е толкова голяма, че често ги наричат с Плутон 'двойна планета'."
|
Description "Плутон обикаля около Слънцето на средно разстояние от шест милиарда километра. Спътникът му Харон е толкова голям, че често ги наричат заедно с Плутон „двойната планета“."
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
Name "Ерос"
|
Name "Ерос"
|
||||||
Target "Sol/Eros"
|
Target "Sol/Eros"
|
||||||
Description "Ерос е астероид във формата на картоф и е дълъг около 33 км. Благодарение на космическия апарат NEAR Shoemaker, за Ерос знаем повече, отколкото за който и да било друг астероид. На 14 февруари 2001 г. NEAR се спусна на Ерос и стана първият апарат, приземил се на астероид."
|
Description "Ерос е астероид във формата на картоф и е дълъг около 33 км. Благодарение на космическия апарат „NEAR Shoemaker“, за Ерос знаем повече, отколкото за който и да било друг астероид. На 14 Февруари 2001 г., „NEAR“ се спусна на Ерос и стана първият апарат, приземил се на астероид."
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
Target "Alpha Centauri"
|
Target "Alpha Centauri"
|
||||||
Distance 90
|
Distance 90
|
||||||
DistanceUnits "au"
|
DistanceUnits "au"
|
||||||
Description "Алфа Кантавър А и Б, заедно с Проксима Кентавър, са най-близката звездна система до Земята. Алфа Кентавър А много прилича на Слънцето, въпреки че е малко по-стара и по-ярка. Б е по-тъмна и по-червеникава, а Проксима е толкова слаба, че не може да се види с невъоръжено око, въпреки, че е най-близката звезда до Слънцето."
|
Description "Алфа Кентавър А и Б, заедно с Проксима Кентавър, са най-близката звездна система до Земята. Алфа Кентавър А много прилича на Слънцето, въпреки че е малко по-стара и по-ярка звезда. Алфа Кентавър Б е по-тъмна и по-червеникава, а Проксима Кентавър е толкова слаба, че не може да се види с невъоръжено око, въпреки, че е най-близката звезда до Слънцето."
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
Target "Alcyone"
|
Target "Alcyone"
|
||||||
Distance 35
|
Distance 35
|
||||||
DistanceUnits "ly"
|
DistanceUnits "ly"
|
||||||
Description "Звездния куп Плеяди е група ярки, наскоро формирани звезди. Плеядите носят името на седем сестри от гръцката митология, въпреки, че телескопите са разкрили, че в звездния куп има доста повече от седем звезди."
|
Description "Звездният куп Плеяди е група ярки, наскоро формирани звезди. Плеядите носят името на седем сестри от гръцката митология, въпреки че телескопите са разкрили, че в звездния куп има доста повече от седем звезди."
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -39,13 +39,13 @@
|
||||||
Target "63 Tau"
|
Target "63 Tau"
|
||||||
Distance 25
|
Distance 25
|
||||||
DistanceUnits "ly"
|
DistanceUnits "ly"
|
||||||
Description "Носещи името на петте дъщери на Атлас и Аетра, Хиядите са един от най-видните разсеяни звездни купове в небето. Звездите от звездния куп Хияди са на около 660 милиона години - около шест пъти по-стари от по-горещите и по-сини Плеяди."
|
Description "Носещи името на петте дъщери на Атлас и Аетра, Хиядите са един от най-видните разсеяни звездни купове в небето. Звездите от звездния куп Хияди са на около 660 милиона години - около шест пъти по-стари от по-горещите и по-сини Плеяди."
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
Name "Глийзе 876 б"
|
Name "Глийзе 876 б"
|
||||||
Target "Gliese 876/b"
|
Target "Gliese 876/b"
|
||||||
Description "Глийзе 876/б е гигантска планета в орбита около червено джудже. Тя е в резонанс 2:1 с друга планета от същата система."
|
Description "Глийзе 876/б е гигантска планета в орбита около червено джудже. Тя е в резонанс 2:1 с друга планета от същата система."
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -53,24 +53,24 @@
|
||||||
Target "Sol/Ida"
|
Target "Sol/Ida"
|
||||||
Distance 200
|
Distance 200
|
||||||
DistanceUnits "km"
|
DistanceUnits "km"
|
||||||
Description "Космическият апарат Галилео фотографира астероида 243 Ида през 1993 г. на път към Юпитер. Снимките разкриха, че Ида има малък сателит, по-късно наречен Дактил. От тогава насам са открити още няколко астероида със спътници."
|
Description "Космическият апарат Галилео засне астероида 243 Ида през 1993 г. на път към Юпитер. Снимките разкриха, че Ида има малък спътник, по-късно наречен Дактил. От тогава до сега са открити още няколко астероида със спътници."
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
Name "51 Пегас б"
|
Name "51 Пегас б"
|
||||||
Target "51 Peg/b"
|
Target "51 Peg/b"
|
||||||
Description "51 Пегас б е първата открита планета, която обикаля около нормална звезда, различна от Слънцето. Тя е планета газов гигант и орбитата ѝ е изключително близо до звездата ѝ - по-малко от една пета от разстоянието между Меркурий и Слънцето. Съществуването на такава планета толкова близо до звезда накара астрономите да преразгледат теориите си за формирането на планетните системи."
|
Description "51 Пегас б е първата открита планета, която обикаля около нормална звезда, различна от Слънцето. Тя е газов гигант и орбитата ѝ е изключително близо до нейната звездата - по-малко от една пета от разстоянието между Меркурий и Слънцето. Съществуването на такава планета толкова близо до звезда накара астрономите да преразгледат теориите си за формирането на планетните системи."
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
Name "Албирео"
|
Name "Албирео"
|
||||||
Target "Albireo"
|
Target "Albireo"
|
||||||
Distance 0.6
|
Distance 0.6
|
||||||
Description "Заради контрастните оранжеви и синьо-бели цветове на съставните ѝ звезди, двойната звездна система Албирео е смятана за една от най-красивите двойки в небето. Оранжевата звезда е клас K гигант, а спътникът ѝ е B джудже."
|
Description "Заради контрастните оранжеви и синьо-бели цветове на съставните ѝ звезди, двойната звездна система Албирео е смятана за една от най-красивите двойки в небето. Оранжевата звезда е гигант от клас K, а спътникът ѝ е джудже от клас B."
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
Name "Кометата Борели"
|
Name "Кометата Борели"
|
||||||
Target "Sol/Borrelly"
|
Target "Sol/Borrelly"
|
||||||
Description "На 22 Септември 2001 г., кометата Борели стана втората комета, която беше снимана от космически апарат от близко разстояние. Въпреки че не беше проектиран да облита комети, Deep Space 1 се приближи на 2 200 километра от ядрото на Борели и ни изпрати най-добрите снимки на ядро на комета, с които разполагаме."
|
Description "На 22 Септември 2001 г., кометата Борели стана втората комета, която е заснета от космически апарат от близко разстояние. Въпреки че не е проектиран за това, „Deep Space“ 1 се приближи на 2 200 километра от ядрото на Борели и изпрати най-добрите снимки на ядро на комета, с които разполагаме."
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 716 KiB |
File diff suppressed because it is too large
Load Diff
|
@ -100,7 +100,7 @@ void Nebula::render(const Vector3f& /*offset*/,
|
||||||
getOrientation());
|
getOrientation());
|
||||||
|
|
||||||
GLSLUnlit_RenderContext rc(renderer, getRadius(), &mv, m.projection);
|
GLSLUnlit_RenderContext rc(renderer, getRadius(), &mv, m.projection);
|
||||||
rc.setPointScale(2.0f * getRadius() / pixelSize * renderer->getScreenDpi() / 96.0f);
|
rc.setPointScale(2.0f * getRadius() / pixelSize);
|
||||||
g->render(rc);
|
g->render(rc);
|
||||||
|
|
||||||
renderer->enableBlending();
|
renderer->enableBlending();
|
||||||
|
|
|
@ -2570,14 +2570,14 @@ void Renderer::renderObject(const Vector3f& pos,
|
||||||
geometryScale = obj.radius;
|
geometryScale = obj.radius;
|
||||||
scaleFactors = obj.radius * obj.semiAxes;
|
scaleFactors = obj.radius * obj.semiAxes;
|
||||||
ringsScaleFactor = obj.radius * obj.semiAxes.maxCoeff();
|
ringsScaleFactor = obj.radius * obj.semiAxes.maxCoeff();
|
||||||
ri.pointScale = 2.0f * obj.radius / pixelSize * screenDpi / 96.0f;
|
ri.pointScale = 2.0f * obj.radius / pixelSize;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
geometryScale = obj.geometryScale;
|
geometryScale = obj.geometryScale;
|
||||||
scaleFactors = Vector3f::Constant(geometryScale);
|
scaleFactors = Vector3f::Constant(geometryScale);
|
||||||
ringsScaleFactor = geometryScale;
|
ringsScaleFactor = geometryScale;
|
||||||
ri.pointScale = 2.0f * geometryScale / pixelSize * screenDpi / 96.0f;
|
ri.pointScale = 2.0f * geometryScale / pixelSize;
|
||||||
}
|
}
|
||||||
// Apply the modelview transform for the object
|
// Apply the modelview transform for the object
|
||||||
Affine3f transform = Translation3f(pos) * obj.orientation.conjugate();
|
Affine3f transform = Translation3f(pos) * obj.orientation.conjugate();
|
||||||
|
|
|
@ -387,7 +387,7 @@ static float rotperiod_M[3][10] =
|
||||||
|
|
||||||
|
|
||||||
const char* LumClassNames[StellarClass::Lum_Count] = {
|
const char* LumClassNames[StellarClass::Lum_Count] = {
|
||||||
"I-a0", "I-a", "I-b", "II", "III", "IV", "V", "VI", ""
|
"Ia-0", "Ia", "Ib", "II", "III", "IV", "V", "VI", ""
|
||||||
};
|
};
|
||||||
|
|
||||||
const char* SubclassNames[11] = {
|
const char* SubclassNames[11] = {
|
||||||
|
|
|
@ -17,59 +17,43 @@
|
||||||
using namespace Eigen;
|
using namespace Eigen;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
// TODO: More of the functions in this module should be converted to
|
|
||||||
// methods of the StarBrowser class.
|
|
||||||
|
|
||||||
struct CloserStarPredicate
|
struct CloserStarPredicate
|
||||||
{
|
{
|
||||||
Vector3f pos;
|
Vector3f pos;
|
||||||
bool operator()(const Star* star0, const Star* star1) const
|
bool operator()(const Star* star0, const Star* star1) const
|
||||||
{
|
{
|
||||||
Vector3f p0 = star0->getPosition();
|
return (pos - star0->getPosition()).squaredNorm() < (pos - star1->getPosition()).squaredNorm();
|
||||||
Vector3f p1 = star1->getPosition();
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
Vector3f v0(p0.x * 1e6 - pos.x, p0.y * 1e6 - pos.y, p0.z * 1e6 - pos.z);
|
|
||||||
Vector3f v1(p1.x * 1e6 - pos.x, p1.y * 1e6 - pos.y, p1.z * 1e6 - pos.z);
|
|
||||||
#endif
|
|
||||||
Vector3f v0 = p0 * 1.0e6f - pos;
|
|
||||||
Vector3f v1 = p1 * 1.0e6f - pos;
|
|
||||||
|
|
||||||
return (v0.squaredNorm() < v1.squaredNorm());
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct BrighterStarPredicate
|
struct BrighterStarPredicate
|
||||||
{
|
{
|
||||||
Vector3f pos;
|
Vector3f pos;
|
||||||
UniversalCoord ucPos;
|
UniversalCoord ucPos;
|
||||||
bool operator()(const Star* star0, const Star* star1) const
|
bool operator()(const Star* star0, const Star* star1) const
|
||||||
{
|
{
|
||||||
Vector3f p0 = star0->getPosition();
|
float d0 = (pos - star0->getPosition()).norm();
|
||||||
Vector3f p1 = star1->getPosition();
|
float d1 = (pos - star1->getPosition()).norm();
|
||||||
Vector3f v0 = p0 * 1.0e6f - pos;
|
|
||||||
Vector3f v1 = p1 * 1.0e6f - pos;
|
|
||||||
float d0 = v0.norm();
|
|
||||||
float d1 = v1.norm();
|
|
||||||
|
|
||||||
return (star0->getApparentMagnitude(d0) <
|
// If the stars are closer than one light year, use
|
||||||
star1->getApparentMagnitude(d1));
|
// a more precise distance estimate.
|
||||||
|
if (d0 < 1.0f)
|
||||||
|
d0 = ucPos.offsetFromLy(star0->getPosition()).norm();
|
||||||
|
if (d1 < 1.0f)
|
||||||
|
d1 = ucPos.offsetFromLy(star1->getPosition()).norm();
|
||||||
|
|
||||||
|
return star0->getApparentMagnitude(d0) < star1->getApparentMagnitude(d1);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct BrightestStarPredicate
|
struct BrightestStarPredicate
|
||||||
{
|
{
|
||||||
bool operator()(const Star* star0, const Star* star1) const
|
bool operator()(const Star* star0, const Star* star1) const
|
||||||
{
|
{
|
||||||
return (star0->getAbsoluteMagnitude() <
|
return star0->getAbsoluteMagnitude() < star1->getAbsoluteMagnitude();
|
||||||
star1->getAbsoluteMagnitude());
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct SolarSystemPredicate
|
struct SolarSystemPredicate
|
||||||
{
|
{
|
||||||
Vector3f pos;
|
Vector3f pos;
|
||||||
|
@ -85,11 +69,7 @@ struct SolarSystemPredicate
|
||||||
bool hasPlanets1 = (iter != solarSystems->end());
|
bool hasPlanets1 = (iter != solarSystems->end());
|
||||||
if (hasPlanets1 == hasPlanets0)
|
if (hasPlanets1 == hasPlanets0)
|
||||||
{
|
{
|
||||||
Vector3f p0 = star0->getPosition();
|
return ((pos - star0->getPosition()).squaredNorm() < (pos - star1->getPosition()).squaredNorm());
|
||||||
Vector3f p1 = star1->getPosition();
|
|
||||||
Vector3f v0 = p0 * 1.0e6f - pos;
|
|
||||||
Vector3f v1 = p1 * 1.0e6f - pos;
|
|
||||||
return (v0.squaredNorm() < v1.squaredNorm());
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -57,62 +57,6 @@ Color StellarClass::getApparentColor(StellarClass::SpectralClass sc) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// The << method of converting the stellar class to a string is
|
|
||||||
// preferred, but it's not always practical, especially when you've
|
|
||||||
// got a completely broken implementation of stringstreams to
|
|
||||||
// deal with (*cough* gcc *cough*).
|
|
||||||
string StellarClass::str() const
|
|
||||||
{
|
|
||||||
char s0, s1;
|
|
||||||
const char* s2 = "";
|
|
||||||
|
|
||||||
switch (getStarType())
|
|
||||||
{
|
|
||||||
case StellarClass::WhiteDwarf:
|
|
||||||
return "WD";
|
|
||||||
case StellarClass::NeutronStar:
|
|
||||||
return "Q";
|
|
||||||
case StellarClass::BlackHole:
|
|
||||||
return "X";
|
|
||||||
case StellarClass::NormalStar:
|
|
||||||
s0 = "OBAFGKMRSNWWW?LTYC"[(unsigned int) getSpectralClass()];
|
|
||||||
s1 = "0123456789"[getSubclass()];
|
|
||||||
switch (getLuminosityClass())
|
|
||||||
{
|
|
||||||
case StellarClass::Lum_Ia0:
|
|
||||||
s2 = " I-a0";
|
|
||||||
break;
|
|
||||||
case StellarClass::Lum_Ia:
|
|
||||||
s2 = " I-a";
|
|
||||||
break;
|
|
||||||
case StellarClass::Lum_Ib:
|
|
||||||
s2 = " I-b";
|
|
||||||
break;
|
|
||||||
case StellarClass::Lum_II:
|
|
||||||
s2 = " II";
|
|
||||||
break;
|
|
||||||
case StellarClass::Lum_III:
|
|
||||||
s2 = " III";
|
|
||||||
break;
|
|
||||||
case StellarClass::Lum_IV:
|
|
||||||
s2 = " IV";
|
|
||||||
break;
|
|
||||||
case StellarClass::Lum_V:
|
|
||||||
s2 = " V";
|
|
||||||
break;
|
|
||||||
case StellarClass::Lum_VI:
|
|
||||||
s2 = " VI";
|
|
||||||
break;
|
|
||||||
default: break; // Do nothing, but prevent GCC4 warnings (Beware: potentially dangerous)
|
|
||||||
}
|
|
||||||
return fmt::sprintf("%c%c%s", s0, s1, s2);
|
|
||||||
}
|
|
||||||
|
|
||||||
return "?";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
uint16_t
|
uint16_t
|
||||||
StellarClass::packV1() const
|
StellarClass::packV1() const
|
||||||
{
|
{
|
||||||
|
@ -238,14 +182,6 @@ StellarClass::unpackV2(uint16_t st)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ostream& operator<<(ostream& os, const StellarClass& sc)
|
|
||||||
{
|
|
||||||
os << sc.str();
|
|
||||||
|
|
||||||
return os;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool operator<(const StellarClass& sc0, const StellarClass& sc1)
|
bool operator<(const StellarClass& sc0, const StellarClass& sc1)
|
||||||
{
|
{
|
||||||
return sc0.packV2() < sc1.packV2();
|
return sc0.packV2() < sc1.packV2();
|
||||||
|
@ -273,6 +209,7 @@ enum ParseState
|
||||||
LumClassVState,
|
LumClassVState,
|
||||||
LumClassIdashState,
|
LumClassIdashState,
|
||||||
LumClassIaState,
|
LumClassIaState,
|
||||||
|
LumClassIdashaState,
|
||||||
WDTypeState,
|
WDTypeState,
|
||||||
WDExtendedTypeState,
|
WDExtendedTypeState,
|
||||||
WDSubclassState,
|
WDSubclassState,
|
||||||
|
@ -482,6 +419,8 @@ StellarClass::parse(const string& st)
|
||||||
case 'V':
|
case 'V':
|
||||||
state = LumClassVState;
|
state = LumClassVState;
|
||||||
break;
|
break;
|
||||||
|
case ' ':
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
state = EndState;
|
state = EndState;
|
||||||
break;
|
break;
|
||||||
|
@ -535,7 +474,8 @@ StellarClass::parse(const string& st)
|
||||||
switch (c)
|
switch (c)
|
||||||
{
|
{
|
||||||
case 'a':
|
case 'a':
|
||||||
state = LumClassIaState;
|
state = LumClassIdashaState;
|
||||||
|
i++;
|
||||||
break;
|
break;
|
||||||
case 'b':
|
case 'b':
|
||||||
lumClass = StellarClass::Lum_Ib;
|
lumClass = StellarClass::Lum_Ib;
|
||||||
|
@ -549,6 +489,24 @@ StellarClass::parse(const string& st)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LumClassIaState:
|
case LumClassIaState:
|
||||||
|
switch (c)
|
||||||
|
{
|
||||||
|
case '0':
|
||||||
|
lumClass = StellarClass::Lum_Ia0;
|
||||||
|
state = EndState;
|
||||||
|
break;
|
||||||
|
case '-':
|
||||||
|
state = LumClassIdashaState;
|
||||||
|
i++;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
lumClass = StellarClass::Lum_Ia;
|
||||||
|
state = EndState;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case LumClassIdashaState:
|
||||||
switch (c)
|
switch (c)
|
||||||
{
|
{
|
||||||
case '0':
|
case '0':
|
||||||
|
|
|
@ -35,9 +35,9 @@ public:
|
||||||
Spectral_G = 4,
|
Spectral_G = 4,
|
||||||
Spectral_K = 5,
|
Spectral_K = 5,
|
||||||
Spectral_M = 6,
|
Spectral_M = 6,
|
||||||
Spectral_R = 7, // superceded by class C
|
Spectral_R = 7, // superseded by class C
|
||||||
Spectral_S = 8,
|
Spectral_S = 8,
|
||||||
Spectral_N = 9, // superceded by class C
|
Spectral_N = 9, // superseded by class C
|
||||||
Spectral_WC = 10,
|
Spectral_WC = 10,
|
||||||
Spectral_WN = 11,
|
Spectral_WN = 11,
|
||||||
Spectral_WO = 12,
|
Spectral_WO = 12,
|
||||||
|
@ -98,8 +98,6 @@ public:
|
||||||
Color getApparentColor() const;
|
Color getApparentColor() const;
|
||||||
Color getApparentColor(StellarClass::SpectralClass sc) const;
|
Color getApparentColor(StellarClass::SpectralClass sc) const;
|
||||||
|
|
||||||
std::string str() const;
|
|
||||||
|
|
||||||
static StellarClass parse(const std::string&);
|
static StellarClass parse(const std::string&);
|
||||||
|
|
||||||
friend bool operator<(const StellarClass& sc0, const StellarClass& sc1);
|
friend bool operator<(const StellarClass& sc0, const StellarClass& sc1);
|
||||||
|
@ -123,8 +121,6 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
std::ostream& operator<<(std::ostream& os, const StellarClass& sc);
|
|
||||||
|
|
||||||
// A rough ordering of stellar classes, from 'early' to 'late' . . .
|
// A rough ordering of stellar classes, from 'early' to 'late' . . .
|
||||||
// Useful for organizing a list of stars by spectral class.
|
// Useful for organizing a list of stars by spectral class.
|
||||||
bool operator<(const StellarClass& sc0, const StellarClass& sc1);
|
bool operator<(const StellarClass& sc0, const StellarClass& sc1);
|
||||||
|
|
|
@ -80,6 +80,10 @@ if(ENABLE_FFMPEG)
|
||||||
target_link_libraries(celestia ${FFMPEG_LIBRARIES})
|
target_link_libraries(celestia ${FFMPEG_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (HAVE_MESHOPTIMIZER)
|
||||||
|
target_link_libraries(celestia meshoptimizer::meshoptimizer)
|
||||||
|
endif()
|
||||||
|
|
||||||
install(TARGETS celestia LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} NAMELINK_SKIP)
|
install(TARGETS celestia LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} NAMELINK_SKIP)
|
||||||
|
|
||||||
add_subdirectory(glut)
|
add_subdirectory(glut)
|
||||||
|
|
|
@ -943,6 +943,11 @@ void actionRenderSpacecrafts(GtkToggleAction* action, AppData* app)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void actionRenderPlanetRings(GtkToggleAction* action, AppData* app)
|
||||||
|
{
|
||||||
|
setRenderFlag(app, Renderer::ShowPlanetRings, gtk_toggle_action_get_active(action));
|
||||||
|
}
|
||||||
|
|
||||||
void actionRenderRingShadows(GtkToggleAction* action, AppData* app)
|
void actionRenderRingShadows(GtkToggleAction* action, AppData* app)
|
||||||
{
|
{
|
||||||
setRenderFlag(app, Renderer::ShowRingShadows, gtk_toggle_action_get_active(action));
|
setRenderFlag(app, Renderer::ShowRingShadows, gtk_toggle_action_get_active(action));
|
||||||
|
@ -1270,9 +1275,9 @@ void resyncRenderActions(AppData* app)
|
||||||
|
|
||||||
/* Unlike the other interfaces, which go through each menu item and set
|
/* Unlike the other interfaces, which go through each menu item and set
|
||||||
* the corresponding renderFlag, we go the other way and set the menu
|
* the corresponding renderFlag, we go the other way and set the menu
|
||||||
* based on the renderFlag. Last one is ShowFadingOrbits. */
|
* based on the renderFlag. Last one is ShowPlanetRings. */
|
||||||
|
|
||||||
for (uint64_t i = Renderer::ShowStars; i <= Renderer::ShowFadingOrbits; i *= 2)
|
for (uint64_t i = Renderer::ShowStars; i <= Renderer::ShowPlanetRings; i *= 2)
|
||||||
{
|
{
|
||||||
switch (i)
|
switch (i)
|
||||||
{
|
{
|
||||||
|
@ -1294,6 +1299,7 @@ void resyncRenderActions(AppData* app)
|
||||||
case Renderer::ShowAtmospheres: actionName = "RenderAtmospheres"; break;
|
case Renderer::ShowAtmospheres: actionName = "RenderAtmospheres"; break;
|
||||||
case Renderer::ShowSmoothLines: actionName = "RenderAA"; break;
|
case Renderer::ShowSmoothLines: actionName = "RenderAA"; break;
|
||||||
case Renderer::ShowEclipseShadows: actionName = "RenderEclipseShadows"; break;
|
case Renderer::ShowEclipseShadows: actionName = "RenderEclipseShadows"; break;
|
||||||
|
case Renderer::ShowPlanetRings: actionName = "RenderPlanetRings"; break;
|
||||||
case Renderer::ShowRingShadows: actionName = "RenderRingShadows"; break;
|
case Renderer::ShowRingShadows: actionName = "RenderRingShadows"; break;
|
||||||
case Renderer::ShowBoundaries: actionName = "RenderConstellationBoundaries"; break;
|
case Renderer::ShowBoundaries: actionName = "RenderConstellationBoundaries"; break;
|
||||||
case Renderer::ShowAutoMag: actionName = "RenderAutoMagnitude"; break;
|
case Renderer::ShowAutoMag: actionName = "RenderAutoMagnitude"; break;
|
||||||
|
@ -1317,7 +1323,7 @@ void resyncRenderActions(AppData* app)
|
||||||
action = gtk_action_group_get_action(app->agRender, actionName);
|
action = gtk_action_group_get_action(app->agRender, actionName);
|
||||||
|
|
||||||
/* The current i anded with the renderFlags gives state of flag */
|
/* The current i anded with the renderFlags gives state of flag */
|
||||||
gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), (i & rf));
|
gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), (i & rf) != 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,6 +96,7 @@ void actionRenderMinorMoons(GtkToggleAction*, AppData*);
|
||||||
void actionRenderAsteroids(GtkToggleAction*, AppData*);
|
void actionRenderAsteroids(GtkToggleAction*, AppData*);
|
||||||
void actionRenderComets(GtkToggleAction*, AppData*);
|
void actionRenderComets(GtkToggleAction*, AppData*);
|
||||||
void actionRenderSpacecrafts(GtkToggleAction*, AppData*);
|
void actionRenderSpacecrafts(GtkToggleAction*, AppData*);
|
||||||
|
void actionRenderPlanetRings(GtkToggleAction*, AppData*);
|
||||||
void actionRenderRingShadows(GtkToggleAction*, AppData*);
|
void actionRenderRingShadows(GtkToggleAction*, AppData*);
|
||||||
void actionRenderStars(GtkToggleAction*, AppData*);
|
void actionRenderStars(GtkToggleAction*, AppData*);
|
||||||
|
|
||||||
|
|
|
@ -58,6 +58,7 @@
|
||||||
<menuitem action='RenderAsteroids'/>
|
<menuitem action='RenderAsteroids'/>
|
||||||
<menuitem action='RenderComets'/>
|
<menuitem action='RenderComets'/>
|
||||||
<menuitem action='RenderSpacecrafts'/>
|
<menuitem action='RenderSpacecrafts'/>
|
||||||
|
<menuitem action='RenderPlanetRings'/>
|
||||||
<menuitem action='RenderRingShadows'/>
|
<menuitem action='RenderRingShadows'/>
|
||||||
<menuitem action='RenderStars'/>
|
<menuitem action='RenderStars'/>
|
||||||
</menu>
|
</menu>
|
||||||
|
|
|
@ -149,9 +149,15 @@ static void addPlanetarySystemToTree(const PlanetarySystem* sys, GtkTreeStore* s
|
||||||
case Body::Planet:
|
case Body::Planet:
|
||||||
type = "Planet";
|
type = "Planet";
|
||||||
break;
|
break;
|
||||||
|
case Body::DwarfPlanet:
|
||||||
|
type = "Dwarf Planet";
|
||||||
|
break;
|
||||||
case Body::Moon:
|
case Body::Moon:
|
||||||
type = "Moon";
|
type = "Moon";
|
||||||
break;
|
break;
|
||||||
|
case Body::MinorMoon:
|
||||||
|
type = "Minor Moon";
|
||||||
|
break;
|
||||||
case Body::Asteroid:
|
case Body::Asteroid:
|
||||||
type = "Asteroid";
|
type = "Asteroid";
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -155,6 +155,7 @@ void applySettingsFileMain(AppData* app, GKeyFile* file)
|
||||||
getFlag64(file, &rf, Renderer::ShowAtmospheres, "RenderFlags", "atmospheres", &errors);
|
getFlag64(file, &rf, Renderer::ShowAtmospheres, "RenderFlags", "atmospheres", &errors);
|
||||||
getFlag64(file, &rf, Renderer::ShowSmoothLines, "RenderFlags", "smoothLines", &errors);
|
getFlag64(file, &rf, Renderer::ShowSmoothLines, "RenderFlags", "smoothLines", &errors);
|
||||||
getFlag64(file, &rf, Renderer::ShowEclipseShadows, "RenderFlags", "eclipseShadows", &errors);
|
getFlag64(file, &rf, Renderer::ShowEclipseShadows, "RenderFlags", "eclipseShadows", &errors);
|
||||||
|
getFlag64(file, &rf, Renderer::ShowPlanetRings, "RenderFlags", "planetRings", &errors);
|
||||||
getFlag64(file, &rf, Renderer::ShowRingShadows, "RenderFlags", "ringShadows", &errors);
|
getFlag64(file, &rf, Renderer::ShowRingShadows, "RenderFlags", "ringShadows", &errors);
|
||||||
getFlag64(file, &rf, Renderer::ShowBoundaries, "RenderFlags", "boundaries", &errors);
|
getFlag64(file, &rf, Renderer::ShowBoundaries, "RenderFlags", "boundaries", &errors);
|
||||||
getFlag64(file, &rf, Renderer::ShowAutoMag, "RenderFlags", "autoMag", &errors);
|
getFlag64(file, &rf, Renderer::ShowAutoMag, "RenderFlags", "autoMag", &errors);
|
||||||
|
@ -267,6 +268,7 @@ void saveSettingsFile(AppData* app)
|
||||||
g_key_file_set_boolean(file, "RenderFlags", "atmospheres", (rf & Renderer::ShowAtmospheres) != 0);
|
g_key_file_set_boolean(file, "RenderFlags", "atmospheres", (rf & Renderer::ShowAtmospheres) != 0);
|
||||||
g_key_file_set_boolean(file, "RenderFlags", "smoothLines", (rf & Renderer::ShowSmoothLines) != 0);
|
g_key_file_set_boolean(file, "RenderFlags", "smoothLines", (rf & Renderer::ShowSmoothLines) != 0);
|
||||||
g_key_file_set_boolean(file, "RenderFlags", "eclipseShadows", (rf & Renderer::ShowEclipseShadows) != 0);
|
g_key_file_set_boolean(file, "RenderFlags", "eclipseShadows", (rf & Renderer::ShowEclipseShadows) != 0);
|
||||||
|
g_key_file_set_boolean(file, "RenderFlags", "planetRings", (rf & Renderer::ShowPlanetRings) != 0);
|
||||||
g_key_file_set_boolean(file, "RenderFlags", "ringShadows", (rf & Renderer::ShowRingShadows) != 0);
|
g_key_file_set_boolean(file, "RenderFlags", "ringShadows", (rf & Renderer::ShowRingShadows) != 0);
|
||||||
g_key_file_set_boolean(file, "RenderFlags", "boundaries", (rf & Renderer::ShowBoundaries) != 0);
|
g_key_file_set_boolean(file, "RenderFlags", "boundaries", (rf & Renderer::ShowBoundaries) != 0);
|
||||||
g_key_file_set_boolean(file, "RenderFlags", "autoMag", (rf & Renderer::ShowAutoMag) != 0);
|
g_key_file_set_boolean(file, "RenderFlags", "autoMag", (rf & Renderer::ShowAutoMag) != 0);
|
||||||
|
|
|
@ -155,6 +155,7 @@ static const GtkToggleActionEntry actionsRenderFlags[] = {
|
||||||
{ "RenderComets", NULL, "Comets", NULL, NULL, G_CALLBACK(actionRenderComets), FALSE },
|
{ "RenderComets", NULL, "Comets", NULL, NULL, G_CALLBACK(actionRenderComets), FALSE },
|
||||||
{ "RenderAsteroids", NULL, "Asteroids", NULL, NULL, G_CALLBACK(actionRenderAsteroids), FALSE },
|
{ "RenderAsteroids", NULL, "Asteroids", NULL, NULL, G_CALLBACK(actionRenderAsteroids), FALSE },
|
||||||
{ "RenderSpacecrafts", NULL, "Spacecraft", NULL, NULL, G_CALLBACK(actionRenderSpacecrafts), FALSE },
|
{ "RenderSpacecrafts", NULL, "Spacecraft", NULL, NULL, G_CALLBACK(actionRenderSpacecrafts), FALSE },
|
||||||
|
{ "RenderPlanetRings", NULL, "Planet Rings", NULL, NULL, G_CALLBACK(actionRenderPlanetRings), FALSE },
|
||||||
{ "RenderRingShadows", NULL, "Ring Shadows", NULL, NULL, G_CALLBACK(actionRenderRingShadows), FALSE },
|
{ "RenderRingShadows", NULL, "Ring Shadows", NULL, NULL, G_CALLBACK(actionRenderRingShadows), FALSE },
|
||||||
{ "RenderStars", NULL, "Stars", NULL, NULL, G_CALLBACK(actionRenderStars), FALSE },
|
{ "RenderStars", NULL, "Stars", NULL, NULL, G_CALLBACK(actionRenderStars), FALSE },
|
||||||
};
|
};
|
||||||
|
|
|
@ -14,9 +14,15 @@
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
#include <celutil/logger.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_MESHOPTIMIZER
|
||||||
|
#include <meshoptimizer.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "mesh.h"
|
#include "mesh.h"
|
||||||
|
|
||||||
|
using celestia::util::GetLogger;
|
||||||
|
|
||||||
namespace cmod
|
namespace cmod
|
||||||
{
|
{
|
||||||
|
@ -38,6 +44,13 @@ VertexDescription appendingAttributes(const VertexDescription& desc, It begin, I
|
||||||
return VertexDescription(std::move(allAttributes));
|
return VertexDescription(std::move(allAttributes));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
isOpaqueMaterial(const Material &material)
|
||||||
|
{
|
||||||
|
return (!(material.opacity > 0.01f && material.opacity < 1.0f)) &&
|
||||||
|
material.blend != BlendMode::AdditiveBlend;
|
||||||
|
}
|
||||||
|
|
||||||
} // end unnamed namespace
|
} // end unnamed namespace
|
||||||
|
|
||||||
|
|
||||||
|
@ -320,13 +333,7 @@ Mesh::addGroup(PrimitiveGroupType prim,
|
||||||
{
|
{
|
||||||
PrimitiveGroup g;
|
PrimitiveGroup g;
|
||||||
if (prim == PrimitiveGroupType::LineStrip || prim == PrimitiveGroupType::LineList)
|
if (prim == PrimitiveGroupType::LineStrip || prim == PrimitiveGroupType::LineList)
|
||||||
{
|
|
||||||
g = createLinePrimitiveGroup(prim == PrimitiveGroupType::LineStrip, indices);
|
g = createLinePrimitiveGroup(prim == PrimitiveGroupType::LineStrip, indices);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
g.primOverride = prim;
|
|
||||||
}
|
|
||||||
|
|
||||||
g.indices = std::move(indices);
|
g.indices = std::move(indices);
|
||||||
g.prim = prim;
|
g.prim = prim;
|
||||||
|
@ -393,9 +400,80 @@ Mesh::aggregateByMaterial()
|
||||||
{
|
{
|
||||||
return g0.materialIndex < g1.materialIndex;
|
return g0.materialIndex < g1.materialIndex;
|
||||||
});
|
});
|
||||||
|
mergePrimitiveGroups();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
Mesh::mergePrimitiveGroups()
|
||||||
|
{
|
||||||
|
if (groups.size() < 2)
|
||||||
|
return;
|
||||||
|
|
||||||
|
std::vector<PrimitiveGroup> newGroups;
|
||||||
|
for (size_t i = 0; i < groups.size(); i++)
|
||||||
|
{
|
||||||
|
auto &g = groups[i];
|
||||||
|
|
||||||
|
if (g.vertexCountOverride == 0 && g.prim == PrimitiveGroupType::TriStrip)
|
||||||
|
{
|
||||||
|
std::vector<Index32> newIndices;
|
||||||
|
newIndices.reserve(g.indices.size() * 2);
|
||||||
|
for (size_t j = 0, e = g.indices.size() - 2; j < e; j++)
|
||||||
|
{
|
||||||
|
auto x = g.indices[j + 0];
|
||||||
|
auto y = g.indices[j + 1];
|
||||||
|
auto z = g.indices[j + 2];
|
||||||
|
// skip degenerated triangles
|
||||||
|
if (x == y || y == z || z == x)
|
||||||
|
continue;
|
||||||
|
if ((j & 1) != 0) // FIXME: CCW hardcoded
|
||||||
|
std::swap(y, z);
|
||||||
|
newIndices.push_back(x);
|
||||||
|
newIndices.push_back(y);
|
||||||
|
newIndices.push_back(z);
|
||||||
|
}
|
||||||
|
g.indices = std::move(newIndices);
|
||||||
|
g.prim = PrimitiveGroupType::TriList;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i == 0 || g.vertexCountOverride != 0 || g.prim != PrimitiveGroupType::TriList)
|
||||||
|
{
|
||||||
|
newGroups.push_back(std::move(g));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
auto &p = newGroups.back();
|
||||||
|
if (p.prim != g.prim || p.materialIndex != g.materialIndex)
|
||||||
|
{
|
||||||
|
newGroups.push_back(std::move(g));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
p.indices.reserve(p.indices.size() + g.indices.size());
|
||||||
|
p.indices.insert(p.indices.end(), g.indices.begin(), g.indices.end());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GetLogger()->info("Optimized mesh groups: had {} groups, now: {} of them.\n", groups.size(), newGroups.size());
|
||||||
|
groups = std::move(newGroups);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Mesh::optimize()
|
||||||
|
{
|
||||||
|
#ifdef HAVE_MESHOPTIMIZER
|
||||||
|
if (groups.size() > 1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
auto &g = groups.front();
|
||||||
|
|
||||||
|
meshopt_optimizeVertexCache(g.indices.data(), g.indices.data(), g.indices.size(), nVertices);
|
||||||
|
meshopt_optimizeOverdraw(g.indices.data(), g.indices.data(), g.indices.size(), reinterpret_cast<float*>(vertices.data()), nVertices, vertexDesc.strideBytes, 1.05f);
|
||||||
|
meshopt_optimizeVertexFetch(vertices.data(), g.indices.data(), g.indices.size(), vertices.data(), nVertices, vertexDesc.strideBytes);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Mesh::pick(const Eigen::Vector3d& rayOrigin, const Eigen::Vector3d& rayDirection, PickResult* result) const
|
Mesh::pick(const Eigen::Vector3d& rayOrigin, const Eigen::Vector3d& rayDirection, PickResult* result) const
|
||||||
{
|
{
|
||||||
|
@ -663,4 +741,52 @@ Mesh::getPrimitiveCount() const
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Mesh::merge(const Mesh &other)
|
||||||
|
{
|
||||||
|
auto &ti = groups.front().indices;
|
||||||
|
const auto &oi = other.groups.front().indices;
|
||||||
|
|
||||||
|
ti.reserve(ti.size() + oi.size());
|
||||||
|
for (auto i : oi)
|
||||||
|
ti.push_back(i + nVertices);
|
||||||
|
|
||||||
|
vertices.reserve(vertices.size() + other.vertices.size());
|
||||||
|
vertices.insert(vertices.end(), other.vertices.begin(), other.vertices.end());
|
||||||
|
|
||||||
|
nVertices += other.nVertices;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
Mesh::canMerge(const Mesh &other, const std::vector<Material> &materials) const
|
||||||
|
{
|
||||||
|
if (getGroupCount() != 1 || other.getGroupCount() != 1)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
const auto &tg = groups.front();
|
||||||
|
const auto &og = other.groups.front();
|
||||||
|
|
||||||
|
if (tg.vertexCountOverride != 0 || og.vertexCountOverride != 0 || tg.prim != PrimitiveGroupType::TriList)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (std::tie(tg.materialIndex, tg.prim, vertexDesc.strideBytes) !=
|
||||||
|
std::tie(og.materialIndex, og.prim, other.vertexDesc.strideBytes))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!isOpaqueMaterial(materials[tg.materialIndex]) || !isOpaqueMaterial(materials[og.materialIndex]))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
for (auto i = VertexAttributeSemantic::Position;
|
||||||
|
i < VertexAttributeSemantic::SemanticMax;
|
||||||
|
i = static_cast<VertexAttributeSemantic>(1 + static_cast<uint16_t>(i)))
|
||||||
|
{
|
||||||
|
auto &ta = vertexDesc.getAttribute(i);
|
||||||
|
auto &oa = other.vertexDesc.getAttribute(i);
|
||||||
|
if (ta.format != oa.format || ta.offsetWords != oa.offsetWords)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
} // end namespace cmod
|
} // end namespace cmod
|
||||||
|
|
|
@ -237,8 +237,13 @@ class Mesh
|
||||||
unsigned int getVertexStrideWords() const { return vertexDesc.strideBytes / sizeof(cmod::VWord); }
|
unsigned int getVertexStrideWords() const { return vertexDesc.strideBytes / sizeof(cmod::VWord); }
|
||||||
unsigned int getPrimitiveCount() const;
|
unsigned int getPrimitiveCount() const;
|
||||||
|
|
||||||
|
void merge(const Mesh&);
|
||||||
|
bool canMerge(const Mesh&, const std::vector<Material> &materials) const;
|
||||||
|
void optimize();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PrimitiveGroup createLinePrimitiveGroup(bool lineStrip, const std::vector<Index32>& indices);
|
PrimitiveGroup createLinePrimitiveGroup(bool lineStrip, const std::vector<Index32>& indices);
|
||||||
|
void mergePrimitiveGroups();
|
||||||
|
|
||||||
VertexDescription vertexDesc{ };
|
VertexDescription vertexDesc{ };
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,11 @@
|
||||||
|
|
||||||
#include <Eigen/Geometry>
|
#include <Eigen/Geometry>
|
||||||
|
|
||||||
|
#include <celutil/logger.h>
|
||||||
|
|
||||||
#include "model.h"
|
#include "model.h"
|
||||||
|
|
||||||
|
using celestia::util::GetLogger;
|
||||||
|
|
||||||
namespace cmod
|
namespace cmod
|
||||||
{
|
{
|
||||||
|
@ -315,7 +318,6 @@ Model::usesTextureType(TextureSemantic t) const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Model::OpacityComparator::operator()(const Mesh& a, const Mesh& b) const
|
Model::OpacityComparator::operator()(const Mesh& a, const Mesh& b) const
|
||||||
{
|
{
|
||||||
|
@ -335,6 +337,25 @@ Model::sortMeshes(const MeshComparator& comparator)
|
||||||
|
|
||||||
// Sort the meshes so that completely opaque ones are first
|
// Sort the meshes so that completely opaque ones are first
|
||||||
std::sort(meshes.begin(), meshes.end(), std::ref(comparator));
|
std::sort(meshes.begin(), meshes.end(), std::ref(comparator));
|
||||||
|
|
||||||
|
std::vector<Mesh> newMeshes;
|
||||||
|
newMeshes.push_back(meshes[0].clone());
|
||||||
|
|
||||||
|
for (size_t i = 1; i < meshes.size(); i++)
|
||||||
|
{
|
||||||
|
auto &p = newMeshes.back();
|
||||||
|
if (!p.canMerge(meshes[i], materials))
|
||||||
|
{
|
||||||
|
newMeshes.push_back(meshes[i].clone());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
p.merge(meshes[i]);
|
||||||
|
}
|
||||||
|
GetLogger()->info("Merged similar meshes: {} -> {}.\n", meshes.size(), newMeshes.size());
|
||||||
|
|
||||||
|
for (auto &mesh : newMeshes)
|
||||||
|
mesh.optimize();
|
||||||
|
meshes = std::move(newMeshes);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end namespace cmod
|
} // end namespace cmod
|
||||||
|
|
|
@ -266,6 +266,9 @@ static void checkTimeslice(lua_State* l, lua_Debug* /*ar*/)
|
||||||
// allow the script to perform cleanup
|
// allow the script to perform cleanup
|
||||||
void LuaState::cleanup()
|
void LuaState::cleanup()
|
||||||
{
|
{
|
||||||
|
if (!costate)
|
||||||
|
return;
|
||||||
|
|
||||||
if (ioMode == Asking)
|
if (ioMode == Asking)
|
||||||
{
|
{
|
||||||
// Restore renderflags:
|
// Restore renderflags:
|
||||||
|
|
|
@ -11,7 +11,9 @@
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QGLFormat>
|
#include <QGLFormat>
|
||||||
|
#include <celutil/logger.h>
|
||||||
|
|
||||||
|
using celestia::util::CreateLogger;
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
|
@ -51,5 +53,7 @@ main(int argc, char *argv[])
|
||||||
// open events.
|
// open events.
|
||||||
app.installEventFilter(&window);
|
app.installEventFilter(&window);
|
||||||
|
|
||||||
|
CreateLogger();
|
||||||
|
|
||||||
return app.exec();
|
return app.exec();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
if(NOT ENABLE_QT)
|
|
||||||
message("Qt frontend is disabled, not building qttxf.")
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(USE_QT6)
|
|
||||||
message("Qt tools not supported on Qt6, not building cmodview.")
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(APPLE AND EXISTS /usr/local/opt/qt5)
|
|
||||||
# Homebrew installs Qt5 (up to at least 5.9.1) in
|
|
||||||
# /usr/local/qt5, ensure it can be found by CMake since
|
|
||||||
# it is not in the default /usr/local prefix.
|
|
||||||
list(APPEND CMAKE_PREFIX_PATH "/usr/local/opt/qt5")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(QT_LIBS Widgets)
|
|
||||||
find_package(Qt5 COMPONENTS ${QT_LIBS} CONFIG REQUIRED)
|
|
||||||
|
|
||||||
# Instruct CMake to run moc automatically when needed
|
|
||||||
set(CMAKE_AUTOMOC ON)
|
|
||||||
# Find includes in corresponding build directories
|
|
||||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
||||||
|
|
||||||
add_executable(qttxf WIN32 main.cpp mainwindow.cpp)
|
|
||||||
install(TARGETS qttxf RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
||||||
qt5_use_modules(qttxf ${QT_LIBS})
|
|
|
@ -1,10 +0,0 @@
|
||||||
qttxf is a simple GUI tool for creating bitmap font files for use with
|
|
||||||
Celestia and other applications. The font files are saved in the TXF format
|
|
||||||
introduced by Mark Kilgard in his GLUT toolkit.
|
|
||||||
|
|
||||||
qttxf is Copyright (C) 2009 by Chris Laurel, and is distributed under the
|
|
||||||
terms of the GNU General Public License version 2. Please forward comments
|
|
||||||
and patches to claurel@gmail.com.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
// qttxf - a Qt-based application to generate GLUT txf files from
|
|
||||||
// system fonts
|
|
||||||
//
|
|
||||||
// Copyright (C) 2009, Chris Laurel <claurel@gmail.com>
|
|
||||||
//
|
|
||||||
// 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.
|
|
||||||
|
|
||||||
#include <QApplication>
|
|
||||||
#include "mainwindow.h"
|
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
QApplication app(argc, argv);
|
|
||||||
MainWindow window;
|
|
||||||
window.show();
|
|
||||||
|
|
||||||
return app.exec();
|
|
||||||
}
|
|
|
@ -1,391 +0,0 @@
|
||||||
// qttxf - a Qt-based application to generate GLUT txf files from
|
|
||||||
// system fonts
|
|
||||||
//
|
|
||||||
// Copyright (C) 2009, Chris Laurel <claurel@gmail.com>
|
|
||||||
//
|
|
||||||
// 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.
|
|
||||||
|
|
||||||
#include "mainwindow.h"
|
|
||||||
#include <QComboBox>
|
|
||||||
#include <QFontComboBox>
|
|
||||||
#include <QScrollArea>
|
|
||||||
#include <QLabel>
|
|
||||||
#include <QFont>
|
|
||||||
#include <QDataStream>
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QMessageBox>
|
|
||||||
#include <QFile>
|
|
||||||
#include <QAction>
|
|
||||||
#include <QMenuBar>
|
|
||||||
#include <QMenu>
|
|
||||||
#include <QHBoxLayout>
|
|
||||||
#include <QVBoxLayout>
|
|
||||||
#include <QFileDialog>
|
|
||||||
#include <QPainter>
|
|
||||||
|
|
||||||
// TXF format constants
|
|
||||||
const char* TXF_HEADER_BYTES = "\377txf";
|
|
||||||
const quint32 TXF_ENDIANNESS_TEST = 0x12345678;
|
|
||||||
|
|
||||||
|
|
||||||
MainWindow::MainWindow() :
|
|
||||||
m_scrollArea(nullptr),
|
|
||||||
m_imageWidget(nullptr),
|
|
||||||
m_fontCombo(nullptr),
|
|
||||||
m_sizeCombo(nullptr),
|
|
||||||
m_styleCombo(nullptr),
|
|
||||||
m_saveAction(nullptr)
|
|
||||||
{
|
|
||||||
QWidget *centralWidget = new QWidget();
|
|
||||||
|
|
||||||
QLabel *fontLabel = new QLabel(tr("Font:"));
|
|
||||||
m_fontCombo = new QFontComboBox;
|
|
||||||
QLabel *sizeLabel = new QLabel(tr("Size:"));
|
|
||||||
m_sizeCombo = new QComboBox;
|
|
||||||
QLabel *styleLabel = new QLabel(tr("Style:"));
|
|
||||||
m_styleCombo = new QComboBox;
|
|
||||||
|
|
||||||
m_scrollArea = new QScrollArea();
|
|
||||||
m_imageWidget = new QLabel();
|
|
||||||
|
|
||||||
m_scrollArea->setWidget(m_imageWidget);
|
|
||||||
|
|
||||||
findStyles(m_fontCombo->currentFont());
|
|
||||||
findSizes(m_fontCombo->currentFont());
|
|
||||||
|
|
||||||
connect(m_fontCombo, SIGNAL(currentFontChanged(const QFont &)),
|
|
||||||
this, SLOT(findStyles(const QFont &)));
|
|
||||||
connect(m_fontCombo, SIGNAL(currentFontChanged(const QFont &)),
|
|
||||||
this, SLOT(findSizes(const QFont &)));
|
|
||||||
connect(m_fontCombo, SIGNAL(currentFontChanged(const QFont &)),
|
|
||||||
this, SLOT(updateFont(const QFont &)));
|
|
||||||
connect(m_sizeCombo, SIGNAL(currentIndexChanged(const QString &)),
|
|
||||||
this, SLOT(updateSize(const QString &)));
|
|
||||||
connect(m_styleCombo, SIGNAL(currentIndexChanged(const QString &)),
|
|
||||||
this, SLOT(updateStyle(const QString &)));
|
|
||||||
|
|
||||||
QHBoxLayout *controlsLayout = new QHBoxLayout;
|
|
||||||
controlsLayout->addWidget(fontLabel);
|
|
||||||
controlsLayout->addWidget(m_fontCombo, 1);
|
|
||||||
controlsLayout->addWidget(sizeLabel);
|
|
||||||
controlsLayout->addWidget(m_sizeCombo, 1);
|
|
||||||
controlsLayout->addWidget(styleLabel);
|
|
||||||
controlsLayout->addWidget(m_styleCombo, 1);
|
|
||||||
|
|
||||||
QVBoxLayout *centralLayout = new QVBoxLayout();
|
|
||||||
centralLayout->addLayout(controlsLayout);
|
|
||||||
centralLayout->addWidget(m_scrollArea, 1);
|
|
||||||
centralWidget->setLayout(centralLayout);
|
|
||||||
|
|
||||||
setCentralWidget(centralWidget);
|
|
||||||
setWindowTitle("QtTXF");
|
|
||||||
|
|
||||||
QMenuBar* menuBar = new QMenuBar(this);
|
|
||||||
|
|
||||||
QMenu* fileMenu = new QMenu(tr("File"));
|
|
||||||
m_saveAction = new QAction(tr("&Save..."), this);
|
|
||||||
QAction* quitAction = new QAction(tr("&Quit"), this);
|
|
||||||
fileMenu->addAction(m_saveAction);
|
|
||||||
fileMenu->addAction(quitAction);
|
|
||||||
menuBar->addMenu(fileMenu);
|
|
||||||
|
|
||||||
setMenuBar(menuBar);
|
|
||||||
|
|
||||||
m_saveAction->setShortcut(QKeySequence::Save);
|
|
||||||
connect(m_saveAction, SIGNAL(triggered()), this, SLOT(saveFont()));
|
|
||||||
quitAction->setShortcut(QKeySequence("Ctrl+Q"));
|
|
||||||
connect(quitAction, SIGNAL(triggered()), this, SLOT(close()));
|
|
||||||
|
|
||||||
buildTxf();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void MainWindow::findStyles(const QFont &font)
|
|
||||||
{
|
|
||||||
QFontDatabase fontDatabase;
|
|
||||||
QString currentItem = m_styleCombo->currentText();
|
|
||||||
m_styleCombo->clear();
|
|
||||||
|
|
||||||
QString style;
|
|
||||||
foreach (style, fontDatabase.styles(font.family()))
|
|
||||||
{
|
|
||||||
m_styleCombo->addItem(style);
|
|
||||||
}
|
|
||||||
|
|
||||||
int styleIndex = m_styleCombo->findText(currentItem);
|
|
||||||
|
|
||||||
if (styleIndex == -1)
|
|
||||||
m_styleCombo->setCurrentIndex(0);
|
|
||||||
else
|
|
||||||
m_styleCombo->setCurrentIndex(styleIndex);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void MainWindow::findSizes(const QFont &font)
|
|
||||||
{
|
|
||||||
QFontDatabase fontDatabase;
|
|
||||||
QString currentSize = m_sizeCombo->currentText();
|
|
||||||
m_sizeCombo->blockSignals(true);
|
|
||||||
m_sizeCombo->clear();
|
|
||||||
|
|
||||||
int size;
|
|
||||||
if (fontDatabase.isSmoothlyScalable(font.family(), fontDatabase.styleString(font)))
|
|
||||||
{
|
|
||||||
foreach(size, QFontDatabase::standardSizes())
|
|
||||||
{
|
|
||||||
m_sizeCombo->addItem(QVariant(size).toString());
|
|
||||||
m_sizeCombo->setEditable(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
foreach (size, fontDatabase.smoothSizes(font.family(), fontDatabase.styleString(font)))
|
|
||||||
{
|
|
||||||
m_sizeCombo->addItem(QVariant(size).toString());
|
|
||||||
m_sizeCombo->setEditable(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
m_sizeCombo->blockSignals(false);
|
|
||||||
|
|
||||||
int sizeIndex = m_sizeCombo->findText(currentSize);
|
|
||||||
if (sizeIndex == -1)
|
|
||||||
{
|
|
||||||
m_sizeCombo->setCurrentIndex(qMax(0, m_sizeCombo->count() / 3));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_sizeCombo->setCurrentIndex(sizeIndex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
MainWindow::updateFont(const QFont& font)
|
|
||||||
{
|
|
||||||
qDebug() << font.family() << " match: " << font.exactMatch();
|
|
||||||
m_currentFont.setFamily(font.family());
|
|
||||||
buildTxf();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
MainWindow::updateSize(const QString& sizeString)
|
|
||||||
{
|
|
||||||
m_currentFont.setPointSize(sizeString.toInt());
|
|
||||||
buildTxf();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
MainWindow::updateStyle(const QString& /* styleName */)
|
|
||||||
{
|
|
||||||
buildTxf();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
MainWindow::saveFont()
|
|
||||||
{
|
|
||||||
if (!m_fontData.isEmpty())
|
|
||||||
{
|
|
||||||
QString fileName = QFileDialog::getSaveFileName(this,
|
|
||||||
tr("Save Font File"),
|
|
||||||
"",
|
|
||||||
tr("Texture Fonts (*.txf)"));
|
|
||||||
QFile file(fileName);
|
|
||||||
if (!file.open(QIODevice::WriteOnly))
|
|
||||||
{
|
|
||||||
QMessageBox::warning(this, tr("File Error"), tr("Error writing to %1").arg(fileName));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
QDataStream out(&file);
|
|
||||||
out.writeRawData(m_fontData.data(), m_fontData.length());
|
|
||||||
file.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
struct BasicGlyphInfo
|
|
||||||
{
|
|
||||||
QChar ch;
|
|
||||||
int height;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool operator<(const BasicGlyphInfo& info0, const BasicGlyphInfo& info1)
|
|
||||||
{
|
|
||||||
return info0.height > info1.height;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool
|
|
||||||
MainWindow::buildTxf()
|
|
||||||
{
|
|
||||||
// Build a txf font from the current system font. Attempt to fit it into a 128x128
|
|
||||||
// texture, progressively increasing the texture size until it fits.
|
|
||||||
bool fitsInTexture = false;
|
|
||||||
int textureWidth = 128;
|
|
||||||
int textureHeight = 128;
|
|
||||||
|
|
||||||
while (textureWidth <= 1024 && !fitsInTexture)
|
|
||||||
{
|
|
||||||
m_fontData.clear();
|
|
||||||
QDataStream out(&m_fontData, QIODevice::WriteOnly);
|
|
||||||
if (buildTxf(m_currentFont, out, textureWidth, textureHeight))
|
|
||||||
{
|
|
||||||
fitsInTexture = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (textureWidth == textureHeight)
|
|
||||||
textureWidth *= 2;
|
|
||||||
else
|
|
||||||
textureHeight *= 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!fitsInTexture)
|
|
||||||
{
|
|
||||||
QMessageBox::warning(this,
|
|
||||||
tr("Font Error"),
|
|
||||||
tr("Font is too large to fit in texture"));
|
|
||||||
m_fontData.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
m_saveAction->setEnabled(fitsInTexture);
|
|
||||||
|
|
||||||
return fitsInTexture;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
QString characterRange(unsigned int firstChar, unsigned int lastChar)
|
|
||||||
{
|
|
||||||
QString s;
|
|
||||||
for (unsigned int i = firstChar; i <= lastChar; ++i)
|
|
||||||
{
|
|
||||||
s += QChar(i);
|
|
||||||
}
|
|
||||||
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool
|
|
||||||
MainWindow::buildTxf(const QFont& font, QDataStream& out, int texWidth, int texHeight)
|
|
||||||
{
|
|
||||||
QString charset;
|
|
||||||
|
|
||||||
charset += characterRange(0x0020, 0x007e); // ASCII
|
|
||||||
charset += characterRange(0x00a0, 0x00ff); // Latin-1 supplement
|
|
||||||
charset += characterRange(0x0100, 0x017f); // Latin Extended-A
|
|
||||||
charset += characterRange(0x0391, 0x03ce); // Greek
|
|
||||||
|
|
||||||
QPixmap pixmap(texWidth, texHeight);
|
|
||||||
QPainter painter(&pixmap);
|
|
||||||
|
|
||||||
QVector<BasicGlyphInfo> glyphInfoList;
|
|
||||||
|
|
||||||
QFont devFont(font, &pixmap);
|
|
||||||
QFontMetrics fm(devFont);
|
|
||||||
for (int i = 0; i < charset.length(); i++)
|
|
||||||
{
|
|
||||||
QChar ch = charset[i];
|
|
||||||
if (fm.inFont(ch))
|
|
||||||
{
|
|
||||||
BasicGlyphInfo info;
|
|
||||||
info.ch = ch;
|
|
||||||
info.height = fm.boundingRect(ch).height();
|
|
||||||
glyphInfoList << info;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sort the glyphs by height so that they pack more compactly
|
|
||||||
// into the available space.
|
|
||||||
std::sort(glyphInfoList.begin(), glyphInfoList.end());
|
|
||||||
|
|
||||||
if (glyphInfoList.isEmpty())
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Write txf file header
|
|
||||||
int maxAscent = 0;
|
|
||||||
int maxDescent = 0;
|
|
||||||
out.writeRawData(TXF_HEADER_BYTES, 4);
|
|
||||||
out << TXF_ENDIANNESS_TEST;
|
|
||||||
out << (quint32) 0;
|
|
||||||
out << (quint32) texWidth << (quint32) texHeight;
|
|
||||||
out << (quint32) maxAscent << (quint32) maxDescent;
|
|
||||||
out << (quint32) glyphInfoList.size();
|
|
||||||
|
|
||||||
// Clear the image
|
|
||||||
painter.fillRect(0, 0, texWidth, texHeight, Qt::black);
|
|
||||||
|
|
||||||
int rowHeight = glyphInfoList.first().height;
|
|
||||||
int x = 1;
|
|
||||||
int y = rowHeight;
|
|
||||||
int xSpacing = 3;
|
|
||||||
int ySpacing = 3;
|
|
||||||
|
|
||||||
painter.setFont(devFont);
|
|
||||||
foreach (BasicGlyphInfo info, glyphInfoList)
|
|
||||||
{
|
|
||||||
QRect bounds = fm.boundingRect(info.ch);
|
|
||||||
if (x + bounds.width() >= texWidth)
|
|
||||||
{
|
|
||||||
y += rowHeight + ySpacing;
|
|
||||||
rowHeight = bounds.height();
|
|
||||||
x = 1;
|
|
||||||
|
|
||||||
if (y >= texHeight)
|
|
||||||
{
|
|
||||||
qDebug() << "Not enough room in font glyph texture.";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
painter.setPen(Qt::white);
|
|
||||||
painter.drawText(x - bounds.left(), y - bounds.bottom(), QString(info.ch));
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
// Show bounding rectangles for debugging
|
|
||||||
painter.setPen(Qt::red);
|
|
||||||
QRect glyphRect = bounds;
|
|
||||||
glyphRect.translate(x - bounds.left(), y - bounds.bottom());
|
|
||||||
painter.drawRect(glyphRect);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Write out the glyph record;
|
|
||||||
out << (quint16) info.ch.unicode();
|
|
||||||
out << (quint8) (bounds.width() + 2) << (quint8) (bounds.height() + 2);
|
|
||||||
out << (qint8) bounds.left() << (qint8) (-bounds.bottom());
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
|
|
||||||
out << (qint8) fm.horizontalAdvance(info.ch);
|
|
||||||
#else
|
|
||||||
out << (qint8) fm.width(info.ch);
|
|
||||||
#endif
|
|
||||||
out << (quint8) 0; /* unused */
|
|
||||||
out << (quint16) (x - 1) << (quint16) (texHeight - y - 2);
|
|
||||||
|
|
||||||
x += bounds.width() + xSpacing;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Write out the glyph texture map
|
|
||||||
QImage glyphImage = pixmap.toImage();
|
|
||||||
for (int iy = 0; iy < texHeight; iy++)
|
|
||||||
{
|
|
||||||
for (int ix = 0; ix < texWidth; ix++)
|
|
||||||
{
|
|
||||||
QRgb rgb = glyphImage.pixel(ix, texHeight - iy - 1);
|
|
||||||
out << (quint8) qGreen(rgb);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QLabel* label = new QLabel(m_scrollArea);
|
|
||||||
label->setPixmap(pixmap);
|
|
||||||
m_scrollArea->setWidget(label);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
|
@ -1,54 +0,0 @@
|
||||||
// qttxf - a Qt-based application to generate GLUT txf files from
|
|
||||||
// system fonts
|
|
||||||
//
|
|
||||||
// Copyright (C) 2009, Chris Laurel <claurel@gmail.com>
|
|
||||||
//
|
|
||||||
// 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.
|
|
||||||
|
|
||||||
#ifndef _QTTXF_MAINWINDOW_H_
|
|
||||||
#define _QTTXF_MAINWINDOW_H_
|
|
||||||
|
|
||||||
#include <QMainWindow>
|
|
||||||
#include <QString>
|
|
||||||
|
|
||||||
class QComboBox;
|
|
||||||
class QFontComboBox;
|
|
||||||
class QScrollArea;
|
|
||||||
class QLabel;
|
|
||||||
class QFont;
|
|
||||||
class QDataStream;
|
|
||||||
|
|
||||||
class MainWindow : public QMainWindow
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
MainWindow();
|
|
||||||
|
|
||||||
bool buildTxf();
|
|
||||||
bool buildTxf(const QFont& font, QDataStream& out, int texWidth, int texHeight);
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
void findStyles(const QFont& font);
|
|
||||||
void findSizes(const QFont& font);
|
|
||||||
void updateFont(const QFont& font);
|
|
||||||
void updateSize(const QString& sizeString);
|
|
||||||
void updateStyle(const QString& styleName);
|
|
||||||
void saveFont();
|
|
||||||
|
|
||||||
private:
|
|
||||||
QScrollArea *m_scrollArea;
|
|
||||||
QLabel* m_imageWidget;
|
|
||||||
QFontComboBox* m_fontCombo;
|
|
||||||
QComboBox* m_sizeCombo;
|
|
||||||
QComboBox* m_styleCombo;
|
|
||||||
QAction* m_saveAction;
|
|
||||||
QFont m_currentFont;
|
|
||||||
QByteArray m_fontData;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // _QTTXF_MAINWINDOW_H_
|
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
TEMPLATE = app
|
|
||||||
TARGET = qttxf
|
|
||||||
|
|
||||||
QT += widgets
|
|
||||||
|
|
||||||
DESTDIR = build
|
|
||||||
OBJECTS_DIR = build
|
|
||||||
MOC_DIR = build
|
|
||||||
|
|
||||||
HEADERS = \
|
|
||||||
mainwindow.h
|
|
||||||
|
|
||||||
SOURCES = \
|
|
||||||
mainwindow.cpp \
|
|
||||||
main.cpp
|
|
|
@ -161,13 +161,13 @@ void printStellarClass(uint16_t sc, ostream& out)
|
||||||
switch (luminosityClass) //without this questionmark a nullchar is written to the file
|
switch (luminosityClass) //without this questionmark a nullchar is written to the file
|
||||||
{ //causing that a dump of stardb is not a textfile but binary.
|
{ //causing that a dump of stardb is not a textfile but binary.
|
||||||
case StellarClass::Lum_Ia0:
|
case StellarClass::Lum_Ia0:
|
||||||
out << "I-a0";
|
out << "Ia-0";
|
||||||
break;
|
break;
|
||||||
case StellarClass::Lum_Ia:
|
case StellarClass::Lum_Ia:
|
||||||
out << "I-a";
|
out << "Ia";
|
||||||
break;
|
break;
|
||||||
case StellarClass::Lum_Ib:
|
case StellarClass::Lum_Ib:
|
||||||
out << "I-b";
|
out << "Ib";
|
||||||
break;
|
break;
|
||||||
case StellarClass::Lum_II:
|
case StellarClass::Lum_II:
|
||||||
out << "II";
|
out << "II";
|
||||||
|
|
|
@ -111,13 +111,13 @@ void printStellarClass(uint16_t sc, ostream& out)
|
||||||
switch (luminosityClass)
|
switch (luminosityClass)
|
||||||
{
|
{
|
||||||
case StellarClass::Lum_Ia0:
|
case StellarClass::Lum_Ia0:
|
||||||
out << "I-a0";
|
out << "Ia-0";
|
||||||
break;
|
break;
|
||||||
case StellarClass::Lum_Ia:
|
case StellarClass::Lum_Ia:
|
||||||
out << "I-a";
|
out << "Ia";
|
||||||
break;
|
break;
|
||||||
case StellarClass::Lum_Ib:
|
case StellarClass::Lum_Ib:
|
||||||
out << "I-b";
|
out << "Ib";
|
||||||
break;
|
break;
|
||||||
case StellarClass::Lum_II:
|
case StellarClass::Lum_II:
|
||||||
out << "II";
|
out << "II";
|
||||||
|
|
Binary file not shown.
|
@ -0,0 +1,37 @@
|
||||||
|
#include <cstdint>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
#include <catch.hpp>
|
||||||
|
|
||||||
|
#include <cel3ds/3dsmodel.h>
|
||||||
|
#include <cel3ds/3dsread.h>
|
||||||
|
|
||||||
|
TEST_CASE("Load a 3DS file", "[3ds] [integration]")
|
||||||
|
{
|
||||||
|
std::unique_ptr<M3DScene> scene = Read3DSFile("huygens.3ds");
|
||||||
|
REQUIRE(scene != nullptr);
|
||||||
|
REQUIRE(scene->getMaterialCount() == 4);
|
||||||
|
|
||||||
|
REQUIRE(scene->getModelCount() == UINT32_C(8));
|
||||||
|
|
||||||
|
std::uint32_t meshCount = 0;
|
||||||
|
std::uint32_t faceCount = 0;
|
||||||
|
std::uint32_t vertexCount = 0;
|
||||||
|
for (std::uint32_t i = 0; i < scene->getModelCount(); ++i)
|
||||||
|
{
|
||||||
|
const M3DModel* model = scene->getModel(i);
|
||||||
|
REQUIRE(model != nullptr);
|
||||||
|
meshCount += model->getTriMeshCount();
|
||||||
|
for (std::uint32_t j = 0; j < model->getTriMeshCount(); ++j)
|
||||||
|
{
|
||||||
|
const M3DTriangleMesh* mesh = model->getTriMesh(j);
|
||||||
|
REQUIRE(mesh != nullptr);
|
||||||
|
faceCount += static_cast<std::uint32_t>(mesh->getFaceCount());
|
||||||
|
vertexCount += static_cast<std::uint32_t>(mesh->getVertexCount());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
REQUIRE(meshCount == 8);
|
||||||
|
REQUIRE(faceCount == 6098);
|
||||||
|
REQUIRE(vertexCount == 3263);
|
||||||
|
}
|
|
@ -1,4 +1,7 @@
|
||||||
|
test_case(3ds_load)
|
||||||
test_case(cmod_bin_ascii_roundtrip)
|
test_case(cmod_bin_ascii_roundtrip)
|
||||||
|
|
||||||
|
file(COPY "${CMAKE_SOURCE_DIR}/test/data/huygens.3ds"
|
||||||
|
DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
|
||||||
file(COPY "${CMAKE_SOURCE_DIR}/test/data/iss/models/iss.cmod"
|
file(COPY "${CMAKE_SOURCE_DIR}/test/data/iss/models/iss.cmod"
|
||||||
DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
|
DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
test_case(charconv_compat)
|
if(NOT HAVE_FLOAT_CHARCONV)
|
||||||
|
test_case(charconv_compat)
|
||||||
|
endif()
|
||||||
test_case(greek)
|
test_case(greek)
|
||||||
test_case(hash)
|
test_case(hash)
|
||||||
test_case(logger)
|
test_case(logger)
|
||||||
|
|
|
@ -1,22 +1,22 @@
|
||||||
#include <celengine/stellarclass.h>
|
#include <cstdint>
|
||||||
|
|
||||||
#include <catch.hpp>
|
#include <catch.hpp>
|
||||||
|
|
||||||
#define CHECK_NORMAL_STAR(u, _class, _str) \
|
#include <celengine/stellarclass.h>
|
||||||
|
|
||||||
|
#define CHECK_NORMAL_STAR(u, _class) \
|
||||||
REQUIRE(u.getStarType() == StellarClass::NormalStar); \
|
REQUIRE(u.getStarType() == StellarClass::NormalStar); \
|
||||||
REQUIRE(u.getSpectralClass() == _class); \
|
REQUIRE(u.getSpectralClass() == _class); \
|
||||||
REQUIRE(u.getSubclass() == 5); \
|
REQUIRE(u.getSubclass() == 5); \
|
||||||
REQUIRE(u.getLuminosityClass() == StellarClass::Lum_Ia0); \
|
REQUIRE(u.getLuminosityClass() == StellarClass::Lum_Ia0);
|
||||||
REQUIRE(u.str() == _str);
|
|
||||||
|
|
||||||
#define CHECK_WHITE_DWARF(u, _class, _str) \
|
#define CHECK_WHITE_DWARF(u, _class) \
|
||||||
REQUIRE(u.getStarType() == StellarClass::WhiteDwarf); \
|
REQUIRE(u.getStarType() == StellarClass::WhiteDwarf); \
|
||||||
REQUIRE(u.getSpectralClass() == _class); \
|
REQUIRE(u.getSpectralClass() == _class); \
|
||||||
REQUIRE(u.getSubclass() == 5); \
|
REQUIRE(u.getSubclass() == 5); \
|
||||||
REQUIRE(u.getLuminosityClass() == StellarClass::Lum_Unknown); \
|
REQUIRE(u.getLuminosityClass() == StellarClass::Lum_Unknown);
|
||||||
REQUIRE(u.str() == _str);
|
|
||||||
|
|
||||||
TEST_CASE("StellarClass", "[StellarClass]")
|
TEST_CASE("StellarClass packing", "[StellarClass]")
|
||||||
{
|
{
|
||||||
SECTION("StellarClass::Spectral_WO")
|
SECTION("StellarClass::Spectral_WO")
|
||||||
{
|
{
|
||||||
|
@ -25,21 +25,21 @@ TEST_CASE("StellarClass", "[StellarClass]")
|
||||||
5,
|
5,
|
||||||
StellarClass::Lum_Ia0);
|
StellarClass::Lum_Ia0);
|
||||||
|
|
||||||
uint16_t packed;
|
std::uint16_t packed;
|
||||||
StellarClass u;
|
StellarClass u;
|
||||||
|
|
||||||
SECTION("Packed as V1")
|
SECTION("Packed as V1")
|
||||||
{
|
{
|
||||||
packed = sc.packV1();
|
packed = sc.packV1();
|
||||||
REQUIRE(u.unpackV1(packed));
|
REQUIRE(u.unpackV1(packed));
|
||||||
CHECK_NORMAL_STAR(u, StellarClass::Spectral_Unknown, "?5 I-a0");
|
CHECK_NORMAL_STAR(u, StellarClass::Spectral_Unknown);
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("Packed as V2")
|
SECTION("Packed as V2")
|
||||||
{
|
{
|
||||||
packed = sc.packV2();
|
packed = sc.packV2();
|
||||||
REQUIRE(u.unpackV2(packed));
|
REQUIRE(u.unpackV2(packed));
|
||||||
CHECK_NORMAL_STAR(u, StellarClass::Spectral_WO, "W5 I-a0");
|
CHECK_NORMAL_STAR(u, StellarClass::Spectral_WO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,21 +50,21 @@ TEST_CASE("StellarClass", "[StellarClass]")
|
||||||
5,
|
5,
|
||||||
StellarClass::Lum_Ia0);
|
StellarClass::Lum_Ia0);
|
||||||
|
|
||||||
uint16_t packed;
|
std::uint16_t packed;
|
||||||
StellarClass u;
|
StellarClass u;
|
||||||
|
|
||||||
SECTION("Packed as V1")
|
SECTION("Packed as V1")
|
||||||
{
|
{
|
||||||
packed = sc.packV1();
|
packed = sc.packV1();
|
||||||
REQUIRE(u.unpackV1(packed));
|
REQUIRE(u.unpackV1(packed));
|
||||||
CHECK_NORMAL_STAR(u, StellarClass::Spectral_Unknown, "?5 I-a0");
|
CHECK_NORMAL_STAR(u, StellarClass::Spectral_Unknown);
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("Packed as V2")
|
SECTION("Packed as V2")
|
||||||
{
|
{
|
||||||
packed = sc.packV2();
|
packed = sc.packV2();
|
||||||
REQUIRE(u.unpackV2(packed));
|
REQUIRE(u.unpackV2(packed));
|
||||||
CHECK_NORMAL_STAR(u, StellarClass::Spectral_Y, "Y5 I-a0");
|
CHECK_NORMAL_STAR(u, StellarClass::Spectral_Y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,21 +75,21 @@ TEST_CASE("StellarClass", "[StellarClass]")
|
||||||
5,
|
5,
|
||||||
StellarClass::Lum_Ia0);
|
StellarClass::Lum_Ia0);
|
||||||
|
|
||||||
uint16_t packed;
|
std::uint16_t packed;
|
||||||
StellarClass u;
|
StellarClass u;
|
||||||
|
|
||||||
SECTION("Packed as V1")
|
SECTION("Packed as V1")
|
||||||
{
|
{
|
||||||
packed = sc.packV1();
|
packed = sc.packV1();
|
||||||
REQUIRE(u.unpackV1(packed));
|
REQUIRE(u.unpackV1(packed));
|
||||||
CHECK_NORMAL_STAR(u, StellarClass::Spectral_Unknown, "?5 I-a0");
|
CHECK_NORMAL_STAR(u, StellarClass::Spectral_Unknown);
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("Packed as V2")
|
SECTION("Packed as V2")
|
||||||
{
|
{
|
||||||
packed = sc.packV2();
|
packed = sc.packV2();
|
||||||
REQUIRE(u.unpackV2(packed));
|
REQUIRE(u.unpackV2(packed));
|
||||||
CHECK_NORMAL_STAR(u, StellarClass::Spectral_Unknown, "?5 I-a0");
|
CHECK_NORMAL_STAR(u, StellarClass::Spectral_Unknown);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,21 +100,21 @@ TEST_CASE("StellarClass", "[StellarClass]")
|
||||||
5,
|
5,
|
||||||
StellarClass::Lum_Ia0);
|
StellarClass::Lum_Ia0);
|
||||||
|
|
||||||
uint16_t packed;
|
std::uint16_t packed;
|
||||||
StellarClass u;
|
StellarClass u;
|
||||||
|
|
||||||
SECTION("Packed as V1")
|
SECTION("Packed as V1")
|
||||||
{
|
{
|
||||||
packed = sc.packV1();
|
packed = sc.packV1();
|
||||||
REQUIRE(u.unpackV1(packed));
|
REQUIRE(u.unpackV1(packed));
|
||||||
CHECK_NORMAL_STAR(u, StellarClass::Spectral_C, "C5 I-a0");
|
CHECK_NORMAL_STAR(u, StellarClass::Spectral_C);
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("Packed as V2")
|
SECTION("Packed as V2")
|
||||||
{
|
{
|
||||||
packed = sc.packV2();
|
packed = sc.packV2();
|
||||||
REQUIRE(u.unpackV2(packed));
|
REQUIRE(u.unpackV2(packed));
|
||||||
CHECK_NORMAL_STAR(u, StellarClass::Spectral_C, "C5 I-a0");
|
CHECK_NORMAL_STAR(u, StellarClass::Spectral_C);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,21 +125,21 @@ TEST_CASE("StellarClass", "[StellarClass]")
|
||||||
5,
|
5,
|
||||||
StellarClass::Lum_Ia0);
|
StellarClass::Lum_Ia0);
|
||||||
|
|
||||||
uint16_t packed;
|
std::uint16_t packed;
|
||||||
StellarClass u;
|
StellarClass u;
|
||||||
|
|
||||||
SECTION("Packed as V1")
|
SECTION("Packed as V1")
|
||||||
{
|
{
|
||||||
packed = sc.packV1();
|
packed = sc.packV1();
|
||||||
REQUIRE(u.unpackV1(packed));
|
REQUIRE(u.unpackV1(packed));
|
||||||
CHECK_NORMAL_STAR(u, StellarClass::Spectral_L, "L5 I-a0");
|
CHECK_NORMAL_STAR(u, StellarClass::Spectral_L);
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("Packed as V2")
|
SECTION("Packed as V2")
|
||||||
{
|
{
|
||||||
packed = sc.packV2();
|
packed = sc.packV2();
|
||||||
REQUIRE(u.unpackV2(packed));
|
REQUIRE(u.unpackV2(packed));
|
||||||
CHECK_NORMAL_STAR(u, StellarClass::Spectral_L, "L5 I-a0");
|
CHECK_NORMAL_STAR(u, StellarClass::Spectral_L);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,21 +151,21 @@ TEST_CASE("StellarClass", "[StellarClass]")
|
||||||
5,
|
5,
|
||||||
StellarClass::Lum_Ia0);
|
StellarClass::Lum_Ia0);
|
||||||
|
|
||||||
uint16_t packed;
|
std::uint16_t packed;
|
||||||
StellarClass u;
|
StellarClass u;
|
||||||
|
|
||||||
SECTION("Packed as V1")
|
SECTION("Packed as V1")
|
||||||
{
|
{
|
||||||
packed = sc.packV1();
|
packed = sc.packV1();
|
||||||
REQUIRE(u.unpackV1(packed));
|
REQUIRE(u.unpackV1(packed));
|
||||||
CHECK_NORMAL_STAR(u, StellarClass::Spectral_T, "T5 I-a0");
|
CHECK_NORMAL_STAR(u, StellarClass::Spectral_T);
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("Packed as V2")
|
SECTION("Packed as V2")
|
||||||
{
|
{
|
||||||
packed = sc.packV2();
|
packed = sc.packV2();
|
||||||
REQUIRE(u.unpackV2(packed));
|
REQUIRE(u.unpackV2(packed));
|
||||||
CHECK_NORMAL_STAR(u, StellarClass::Spectral_T, "T5 I-a0");
|
CHECK_NORMAL_STAR(u, StellarClass::Spectral_T);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -176,22 +176,87 @@ TEST_CASE("StellarClass", "[StellarClass]")
|
||||||
5,
|
5,
|
||||||
StellarClass::Lum_Ia0);
|
StellarClass::Lum_Ia0);
|
||||||
|
|
||||||
uint16_t packed;
|
std::uint16_t packed;
|
||||||
StellarClass u;
|
StellarClass u;
|
||||||
|
|
||||||
SECTION("Packed as V1")
|
SECTION("Packed as V1")
|
||||||
{
|
{
|
||||||
packed = sc.packV1();
|
packed = sc.packV1();
|
||||||
REQUIRE(u.unpackV1(packed));
|
REQUIRE(u.unpackV1(packed));
|
||||||
CHECK_WHITE_DWARF(u, StellarClass::Spectral_DO, "WD");
|
CHECK_WHITE_DWARF(u, StellarClass::Spectral_DO);
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("Packed as V2")
|
SECTION("Packed as V2")
|
||||||
{
|
{
|
||||||
packed = sc.packV2();
|
packed = sc.packV2();
|
||||||
REQUIRE(u.unpackV2(packed));
|
REQUIRE(u.unpackV2(packed));
|
||||||
CHECK_WHITE_DWARF(u, StellarClass::Spectral_DO, "WD");
|
CHECK_WHITE_DWARF(u, StellarClass::Spectral_DO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_CASE("StellarClass parsing", "[StellarClass]")
|
||||||
|
{
|
||||||
|
SECTION("Luminosity class I-a0")
|
||||||
|
{
|
||||||
|
StellarClass sc = StellarClass::parse("A9I-a0");
|
||||||
|
REQUIRE(sc.getStarType() == StellarClass::NormalStar);
|
||||||
|
REQUIRE(sc.getSpectralClass() == StellarClass::Spectral_A);
|
||||||
|
REQUIRE(sc.getSubclass() == 9);
|
||||||
|
REQUIRE(sc.getLuminosityClass() == StellarClass::Lum_Ia0);
|
||||||
|
}
|
||||||
|
|
||||||
|
SECTION("Luminosity class Ia-0")
|
||||||
|
{
|
||||||
|
StellarClass sc = StellarClass::parse("K Ia-0");
|
||||||
|
REQUIRE(sc.getStarType() == StellarClass::NormalStar);
|
||||||
|
REQUIRE(sc.getSpectralClass() == StellarClass::Spectral_K);
|
||||||
|
REQUIRE(sc.getSubclass() == StellarClass::Subclass_Unknown);
|
||||||
|
REQUIRE(sc.getLuminosityClass() == StellarClass::Lum_Ia0);
|
||||||
|
}
|
||||||
|
|
||||||
|
SECTION("Luminosity class Ia0")
|
||||||
|
{
|
||||||
|
StellarClass sc = StellarClass::parse("M3Ia0");
|
||||||
|
REQUIRE(sc.getStarType() == StellarClass::NormalStar);
|
||||||
|
REQUIRE(sc.getSpectralClass() == StellarClass::Spectral_M);
|
||||||
|
REQUIRE(sc.getSubclass() == 3);
|
||||||
|
REQUIRE(sc.getLuminosityClass() == StellarClass::Lum_Ia0);
|
||||||
|
}
|
||||||
|
|
||||||
|
SECTION("Luminosity class Ia")
|
||||||
|
{
|
||||||
|
StellarClass sc = StellarClass::parse("F7Ia");
|
||||||
|
REQUIRE(sc.getStarType() == StellarClass::NormalStar);
|
||||||
|
REQUIRE(sc.getSpectralClass() == StellarClass::Spectral_F);
|
||||||
|
REQUIRE(sc.getSubclass() == 7);
|
||||||
|
REQUIRE(sc.getLuminosityClass() == StellarClass::Lum_Ia);
|
||||||
|
}
|
||||||
|
|
||||||
|
SECTION("Luminosity class I-a")
|
||||||
|
{
|
||||||
|
StellarClass sc = StellarClass::parse("G4 I-a");
|
||||||
|
REQUIRE(sc.getStarType() == StellarClass::NormalStar);
|
||||||
|
REQUIRE(sc.getSpectralClass() == StellarClass::Spectral_G);
|
||||||
|
REQUIRE(sc.getSubclass() == 4);
|
||||||
|
REQUIRE(sc.getLuminosityClass() == StellarClass::Lum_Ia);
|
||||||
|
}
|
||||||
|
|
||||||
|
SECTION("Luminosity class Ib")
|
||||||
|
{
|
||||||
|
StellarClass sc = StellarClass::parse("B6 Ib");
|
||||||
|
REQUIRE(sc.getStarType() == StellarClass::NormalStar);
|
||||||
|
REQUIRE(sc.getSpectralClass() == StellarClass::Spectral_B);
|
||||||
|
REQUIRE(sc.getSubclass() == 6);
|
||||||
|
REQUIRE(sc.getLuminosityClass() == StellarClass::Lum_Ib);
|
||||||
|
}
|
||||||
|
|
||||||
|
SECTION("Luminosity class I-b")
|
||||||
|
{
|
||||||
|
StellarClass sc = StellarClass::parse("O5I-b");
|
||||||
|
REQUIRE(sc.getStarType() == StellarClass::NormalStar);
|
||||||
|
REQUIRE(sc.getSpectralClass() == StellarClass::Spectral_O);
|
||||||
|
REQUIRE(sc.getSubclass() == 5);
|
||||||
|
REQUIRE(sc.getLuminosityClass() == StellarClass::Lum_Ib);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue