Compare commits
411 Commits
OpenSceneG
...
OpenSceneG
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
925270d909 | ||
|
|
dd1745896a | ||
|
|
6c1cbb1f48 | ||
|
|
5a939746cc | ||
|
|
606a32685e | ||
|
|
06558a5dda | ||
|
|
7505cb4603 | ||
|
|
8b20f0adef | ||
|
|
fee977ac90 | ||
|
|
62dbe7b85e | ||
|
|
ecaca716e9 | ||
|
|
df21f59779 | ||
|
|
e28f789ffa | ||
|
|
b7fa2d7914 | ||
|
|
51924943e2 | ||
|
|
969c1821be | ||
|
|
2695f29be0 | ||
|
|
78cb12b531 | ||
|
|
beb9bc3cf2 | ||
|
|
d11e84178f | ||
|
|
b14eecb3c7 | ||
|
|
9fb010fadd | ||
|
|
8a15f23c15 | ||
|
|
e260dfb582 | ||
|
|
b728587fab | ||
|
|
f29af50b76 | ||
|
|
8b2e02b71d | ||
|
|
5faae0e52e | ||
|
|
5d51e5bf2a | ||
|
|
159c0271b7 | ||
|
|
94d5211f43 | ||
|
|
219adb7419 | ||
|
|
b101b4b4d2 | ||
|
|
b8862d0420 | ||
|
|
8a0114a46a | ||
|
|
199035ae51 | ||
|
|
23b4345517 | ||
|
|
b5b0bed7c3 | ||
|
|
a531f2bd13 | ||
|
|
f36e9f2a4a | ||
|
|
b7c186f6d3 | ||
|
|
927d2f0f10 | ||
|
|
644251db98 | ||
|
|
295bfffc17 | ||
|
|
b4663ded94 | ||
|
|
44d3da02a9 | ||
|
|
4093860c32 | ||
|
|
0161b8ab46 | ||
|
|
417f78ac5e | ||
|
|
8195b9c8e7 | ||
|
|
5ca6759a1f | ||
|
|
9c7cde1db4 | ||
|
|
aed9fd74f6 | ||
|
|
39a78e075f | ||
|
|
b4eb001d14 | ||
|
|
6cd699e55f | ||
|
|
4b0bed8161 | ||
|
|
ddbed23537 | ||
|
|
a13f8cf4b4 | ||
|
|
fab1431e59 | ||
|
|
073cfab166 | ||
|
|
bf279a59fa | ||
|
|
4ad410969e | ||
|
|
f50d32547d | ||
|
|
8406442a96 | ||
|
|
7994bfa767 | ||
|
|
b8982224c3 | ||
|
|
8178b51956 | ||
|
|
a7a7c0de8b | ||
|
|
2ade061ced | ||
|
|
0415b7df84 | ||
|
|
43724f004e | ||
|
|
300ba7aa02 | ||
|
|
97a4094d76 | ||
|
|
6b95718d65 | ||
|
|
47ab799168 | ||
|
|
c3108697de | ||
|
|
ba70c7d543 | ||
|
|
855212548d | ||
|
|
47207248d4 | ||
|
|
e1e6e07de3 | ||
|
|
508cf89f9c | ||
|
|
f29ecc10a8 | ||
|
|
46505f66d3 | ||
|
|
fb63c5b0a5 | ||
|
|
2b64d30fca | ||
|
|
e0b288fe37 | ||
|
|
91cfc02700 | ||
|
|
b29fb0b870 | ||
|
|
6ca2487362 | ||
|
|
197fc401b4 | ||
|
|
16cd192562 | ||
|
|
2f043345c9 | ||
|
|
24fc34a440 | ||
|
|
decf339b74 | ||
|
|
889325b496 | ||
|
|
126623645f | ||
|
|
6c908e9081 | ||
|
|
e4373b0143 | ||
|
|
16a5e019c5 | ||
|
|
597441ca33 | ||
|
|
864b087b1f | ||
|
|
75d03de844 | ||
|
|
1bd75f464a | ||
|
|
d501def836 | ||
|
|
cdbec116fa | ||
|
|
68c5e6e6ca | ||
|
|
638069f93b | ||
|
|
a827840baf | ||
|
|
35f3876797 | ||
|
|
2e0472ba7e | ||
|
|
36e47d31bd | ||
|
|
994ea4d203 | ||
|
|
54ac72a126 | ||
|
|
6559295768 | ||
|
|
9b41f260d9 | ||
|
|
7a442801cd | ||
|
|
f3c615631b | ||
|
|
62cd8850e2 | ||
|
|
14e7bc5a17 | ||
|
|
5ac3a982ae | ||
|
|
a90a9a0a15 | ||
|
|
995e849e8a | ||
|
|
ddb72691bc | ||
|
|
817d92b703 | ||
|
|
8fb5ba4a3f | ||
|
|
3ef5d2b331 | ||
|
|
c64b94da2e | ||
|
|
19cf8b46c3 | ||
|
|
2568d1ac79 | ||
|
|
84ee98d9c4 | ||
|
|
49921bf300 | ||
|
|
b063f510c1 | ||
|
|
396cfca1ae | ||
|
|
aebc71a113 | ||
|
|
d8896f4bcb | ||
|
|
b2b6ee952b | ||
|
|
fbe4e1cf2f | ||
|
|
2b9c501e18 | ||
|
|
3930621edc | ||
|
|
9305485a11 | ||
|
|
9e75926338 | ||
|
|
d969516595 | ||
|
|
457d12d9b2 | ||
|
|
61c7ee76c5 | ||
|
|
605821e655 | ||
|
|
d1ff16614c | ||
|
|
8551f25da0 | ||
|
|
315031fa3b | ||
|
|
f4fe1e5cec | ||
|
|
7e8665308d | ||
|
|
c50b699992 | ||
|
|
cd5740e98f | ||
|
|
023bfb8bbb | ||
|
|
c5ff9e63df | ||
|
|
e5e5ea6239 | ||
|
|
9ae47b921b | ||
|
|
994b066329 | ||
|
|
ad82aea2e3 | ||
|
|
5f2a3ef76f | ||
|
|
2e7a7d786a | ||
|
|
67523373a9 | ||
|
|
f38fa9e9c3 | ||
|
|
99b2fffa7c | ||
|
|
3fbf24759f | ||
|
|
d215b255c4 | ||
|
|
51fee80224 | ||
|
|
fefabb6c2b | ||
|
|
27e3f57da2 | ||
|
|
56835cf821 | ||
|
|
445596e59c | ||
|
|
c0ea4c6310 | ||
|
|
ddea94b41c | ||
|
|
5f1e33fcb3 | ||
|
|
46e17699b3 | ||
|
|
38807c4bb8 | ||
|
|
987521ba9c | ||
|
|
6776cc2c63 | ||
|
|
3fe2e5a9e0 | ||
|
|
0d94d8e5a6 | ||
|
|
c8e283cfe9 | ||
|
|
b1314c0fb8 | ||
|
|
a86b90ca4a | ||
|
|
bc3372fda0 | ||
|
|
6477397b95 | ||
|
|
8f6eff9de5 | ||
|
|
c4e7a07367 | ||
|
|
23b7c4d47d | ||
|
|
a9900712a4 | ||
|
|
6774f77779 | ||
|
|
5516f86f9e | ||
|
|
a9546da368 | ||
|
|
415925b024 | ||
|
|
30aae63c3b | ||
|
|
694b1c3d32 | ||
|
|
a2436fa8b5 | ||
|
|
64d9b51f91 | ||
|
|
a3b507bb01 | ||
|
|
cbac09902d | ||
|
|
515a0bbe65 | ||
|
|
0c142215b9 | ||
|
|
dcc6dce8e3 | ||
|
|
7b3d1dff25 | ||
|
|
842b334803 | ||
|
|
8f5695eafb | ||
|
|
0a704161fe | ||
|
|
149c04b0df | ||
|
|
92abaca210 | ||
|
|
0e5bb43841 | ||
|
|
b3808ef89c | ||
|
|
99847c3ef2 | ||
|
|
0a6bea870c | ||
|
|
312f640a4a | ||
|
|
2b0105f875 | ||
|
|
b0c89b137d | ||
|
|
b2daa32420 | ||
|
|
bf208e1d10 | ||
|
|
24d61c2df0 | ||
|
|
e6f6de640a | ||
|
|
00679c7631 | ||
|
|
4e126469fc | ||
|
|
ccbc632afc | ||
|
|
060a641c2b | ||
|
|
cd124228fd | ||
|
|
4ad34877d2 | ||
|
|
2a8b760833 | ||
|
|
8dea265a91 | ||
|
|
7ec8b65ec4 | ||
|
|
c6c49c3745 | ||
|
|
acac960227 | ||
|
|
da6b4df00a | ||
|
|
7f370bdfc6 | ||
|
|
587fd6a022 | ||
|
|
730e6ad8f5 | ||
|
|
a8017cb807 | ||
|
|
ac6b082963 | ||
|
|
61957024fc | ||
|
|
117fd42efc | ||
|
|
387e66911b | ||
|
|
dc9f6f2751 | ||
|
|
8a4cdcf264 | ||
|
|
02d91a3eea | ||
|
|
59f417f1e0 | ||
|
|
9ad7ae5524 | ||
|
|
0c7fda710c | ||
|
|
cbf5b14f61 | ||
|
|
2e33cf0abc | ||
|
|
361ea5d15d | ||
|
|
a3b2ac63b3 | ||
|
|
3f9ab5689c | ||
|
|
af5a794a82 | ||
|
|
faa2b1d964 | ||
|
|
ab95a79540 | ||
|
|
079cf6c090 | ||
|
|
7dbcb4b7d3 | ||
|
|
634bd7f12d | ||
|
|
384cc25380 | ||
|
|
b43a59aa5d | ||
|
|
e135a85c1a | ||
|
|
2f914506e9 | ||
|
|
e5c951f5a3 | ||
|
|
9566fb7acf | ||
|
|
511f7be394 | ||
|
|
56e2a03378 | ||
|
|
5fc917881d | ||
|
|
00e2930fb7 | ||
|
|
fe9c235806 | ||
|
|
8d505e80a9 | ||
|
|
b6cb11b655 | ||
|
|
4b6d9287bc | ||
|
|
b41c5bde96 | ||
|
|
2ac97b5ece | ||
|
|
21c0affe66 | ||
|
|
68fc6ca610 | ||
|
|
52edc4af8d | ||
|
|
c1757aadb4 | ||
|
|
cfd190a9fa | ||
|
|
5311d6fb6b | ||
|
|
e31afbf78a | ||
|
|
be6bc39016 | ||
|
|
38727ed4b4 | ||
|
|
8491fd780d | ||
|
|
3ccdc66717 | ||
|
|
2f71c55da9 | ||
|
|
7b6135f0f7 | ||
|
|
05e896af7e | ||
|
|
33bf30cd8c | ||
|
|
fd014e3b52 | ||
|
|
3f0c1daaa2 | ||
|
|
c9fc6e0f79 | ||
|
|
348fbfe410 | ||
|
|
47ec2c7951 | ||
|
|
6ea8ebf25a | ||
|
|
2b65555d5f | ||
|
|
2439679b0c | ||
|
|
0cbf839425 | ||
|
|
82cae6daf4 | ||
|
|
6767ff540b | ||
|
|
69ebfecfcc | ||
|
|
3834172342 | ||
|
|
036bb7b472 | ||
|
|
b5dff94107 | ||
|
|
1784381dc7 | ||
|
|
9e18a7542b | ||
|
|
1c6fd4da9b | ||
|
|
e1b3c78013 | ||
|
|
f263ad29db | ||
|
|
dd32ee2945 | ||
|
|
0b5cb65cdd | ||
|
|
a8e78fde99 | ||
|
|
43b274f65c | ||
|
|
f97ea3577d | ||
|
|
9726617b6e | ||
|
|
997276d359 | ||
|
|
dceb353fe6 | ||
|
|
d8600411bd | ||
|
|
066c272f7a | ||
|
|
7ebe56291f | ||
|
|
c89a7fe67c | ||
|
|
b14bb21801 | ||
|
|
37eae8c719 | ||
|
|
12b298130a | ||
|
|
c548289ac1 | ||
|
|
2ebde09aff | ||
|
|
049f88325a | ||
|
|
cc68d7f151 | ||
|
|
5770774e00 | ||
|
|
5624a22fe4 | ||
|
|
9905b90a18 | ||
|
|
6d5c6ad6cc | ||
|
|
971eba37ad | ||
|
|
43574b52c1 | ||
|
|
625c771641 | ||
|
|
1504a54cd8 | ||
|
|
0f2e9e6557 | ||
|
|
cd150cbe96 | ||
|
|
02d7d980a7 | ||
|
|
c8521068a5 | ||
|
|
832d8d5228 | ||
|
|
bdd0be2f8f | ||
|
|
968a427e00 | ||
|
|
b8f9249bea | ||
|
|
e2fb88e187 | ||
|
|
749dc86dd3 | ||
|
|
84bae01643 | ||
|
|
8a5d1b9f44 | ||
|
|
488b4854b2 | ||
|
|
6455159757 | ||
|
|
2e68db5b55 | ||
|
|
2e29085669 | ||
|
|
f223fec92d | ||
|
|
cc3cb92ddc | ||
|
|
4dcb2bbf3c | ||
|
|
eeb13d1efc | ||
|
|
fe98c3d7f5 | ||
|
|
46b07141e8 | ||
|
|
02bfd05d6f | ||
|
|
035abfdb71 | ||
|
|
0c99326db3 | ||
|
|
8103da6ef1 | ||
|
|
bd83044c08 | ||
|
|
f6b64afdfc | ||
|
|
1c65815f4e | ||
|
|
5e9be10da6 | ||
|
|
820532ddff | ||
|
|
6951c44464 | ||
|
|
e12049ed47 | ||
|
|
fd47b84bd7 | ||
|
|
b7947b13f3 | ||
|
|
7a601753e0 | ||
|
|
07e5480b57 | ||
|
|
ea1e832d4d | ||
|
|
da7bf3ff81 | ||
|
|
a6fbf73f36 | ||
|
|
ef8fd268de | ||
|
|
064c39a7f3 | ||
|
|
5eb9ab1d75 | ||
|
|
e8ba57b22f | ||
|
|
47aa320787 | ||
|
|
3a3ddfce49 | ||
|
|
dc2aa77d98 | ||
|
|
aa6cd2d7da | ||
|
|
658fd4d19d | ||
|
|
8b4359b77e | ||
|
|
c5d00bc223 | ||
|
|
1eedae844e | ||
|
|
e819ea9c0e | ||
|
|
15b9a493ed | ||
|
|
0341d6f873 | ||
|
|
3577fd9d90 | ||
|
|
a47294a580 | ||
|
|
452802b168 | ||
|
|
5a3f2e287c | ||
|
|
bf5a88870f | ||
|
|
8af46a6e98 | ||
|
|
56617a4bfb | ||
|
|
7eaceb0baa | ||
|
|
8feae585e1 | ||
|
|
fa7843d520 | ||
|
|
d48a304569 | ||
|
|
ce90a9b2da | ||
|
|
273dd046c2 | ||
|
|
627c3df093 | ||
|
|
ab372b9ead | ||
|
|
247eee2ca1 | ||
|
|
d4bbec4a0c | ||
|
|
114c818f2e | ||
|
|
1ee6d476f8 | ||
|
|
8a29c504e4 | ||
|
|
f376af1fd5 | ||
|
|
e663330bdf |
12
.gitignore
vendored
12
.gitignore
vendored
@@ -6,6 +6,10 @@ doc/openthreads.doxyfile
|
||||
|
||||
doc/OpenSceneGraphReferenceDocs/
|
||||
doc/OpenThreadsReferenceDocs/
|
||||
doc/*.chm
|
||||
|
||||
CMakeDoxyfile.in
|
||||
CMakeDoxygenDefaults.cmake
|
||||
|
||||
cmake_uninstall.cmake
|
||||
|
||||
@@ -59,6 +63,10 @@ install_manifest*.txt
|
||||
*.out
|
||||
*.app
|
||||
|
||||
# Automatically generated Package files
|
||||
packaging/cmake/*
|
||||
configure/*
|
||||
|
||||
# Platform Specifics - auto generated files
|
||||
PlatformSpecifics/Windows/*.rc
|
||||
|
||||
@@ -79,6 +87,10 @@ PlatformSpecifics/Windows/*.rc
|
||||
*.sdf
|
||||
*.opensdf
|
||||
|
||||
# Visual Studio - Cache/Options Directory
|
||||
.vs/
|
||||
.vscode/*
|
||||
|
||||
#osx xcode
|
||||
DerivedData/
|
||||
*.DS_Store
|
||||
|
||||
@@ -15,8 +15,8 @@ matrix:
|
||||
dist: trusty
|
||||
language: cpp
|
||||
env:
|
||||
- CMAKECMD_ARGS="-DBUILD_OSG_EXAMPLES=ON -DBUILD_OSG_PLUGINS_BY_DEFAULT=ON -DBUILD_OSG_APPLICATIONS=ON"
|
||||
# - CMAKECMD_ARGS="-DBUILD_OSG_EXAMPLES=OFF -DBUILD_OSG_PLUGINS_BY_DEFAULT=ON -DBUILD_OSG_APPLICATIONS=ON"
|
||||
# - CMAKECMD_ARGS="-DBUILD_OSG_EXAMPLES=ON -DBUILD_OSG_PLUGINS_BY_DEFAULT=ON -DBUILD_OSG_APPLICATIONS=ON"
|
||||
- CMAKECMD_ARGS="-DBUILD_OSG_EXAMPLES=OFF -DBUILD_OSG_PLUGINS_BY_DEFAULT=ON -DBUILD_OSG_APPLICATIONS=ON"
|
||||
#- LLVM_VERSION=3.8
|
||||
sudo: false
|
||||
cache:
|
||||
|
||||
47
AUTHORS.txt
47
AUTHORS.txt
@@ -1,6 +1,6 @@
|
||||
OpenSceneGraph Library 3.6.3
|
||||
OpenSceneGraph Library 3.6.4
|
||||
|
||||
569 Contributors:
|
||||
570 Contributors:
|
||||
|
||||
Firstname Surname
|
||||
-----------------
|
||||
@@ -10,10 +10,10 @@ Stephan Huber
|
||||
Paul Martz
|
||||
Laurens Voerman
|
||||
Farshid Lashkari
|
||||
Mathias Frhlich
|
||||
Mathias Fr<EFBFBD>hlich
|
||||
Marco Jez
|
||||
Wang Rui
|
||||
Jean-Sbastien Guay
|
||||
Jean-S<EFBFBD>bastien Guay
|
||||
Ulrich Hertlein
|
||||
Mike Weiblen
|
||||
Sukender
|
||||
@@ -43,8 +43,8 @@ Chris Hanson
|
||||
Roland Smeenk
|
||||
Roger James
|
||||
Jeremy Moles
|
||||
J.P. Delport
|
||||
Andy Skinner
|
||||
J.P. Delport
|
||||
Magnus Kessler
|
||||
David Fries
|
||||
Tom Jolley
|
||||
@@ -67,11 +67,11 @@ Norman Vine
|
||||
Chris Denham
|
||||
Sherman Wilcox
|
||||
Serge Lages
|
||||
Romano Jos Magacho da Silva
|
||||
Romano Jos<EFBFBD> Magacho da Silva
|
||||
Mourad Boufarguine
|
||||
Alberto Farre
|
||||
Glenn Waldron
|
||||
Andr Garneau
|
||||
Andr<EFBFBD> Garneau
|
||||
Adrian Egli
|
||||
Sebastian Messerschmidt
|
||||
Randall Hopper
|
||||
@@ -86,7 +86,7 @@ Michael Gronager
|
||||
Martin Naylor
|
||||
Joakim Simonsson
|
||||
David Spilling
|
||||
Daniel Sjlie
|
||||
Daniel Sj<EFBFBD>lie
|
||||
Bryan Thrall
|
||||
Andreas Ekstrand
|
||||
Rafa Gaitan
|
||||
@@ -123,7 +123,7 @@ Gordon Tomlinson
|
||||
Frederic Marmond
|
||||
Frederic Bouvier
|
||||
Carlo Camporesi
|
||||
Bjrn Blissing
|
||||
Bj<EFBFBD>rn Blissing
|
||||
Alexander Sinditskiy
|
||||
Vladimir Chebaev
|
||||
Thibault Genessay
|
||||
@@ -143,7 +143,7 @@ Uwe Woessner
|
||||
Tony Horrobin
|
||||
Thom DeCarlo
|
||||
Tatsuhiro Nishioka
|
||||
Tanguy Fautr
|
||||
Tanguy Fautr<EFBFBD>
|
||||
Sean Spicer
|
||||
Ryan Kawicki
|
||||
Richard Schmidt
|
||||
@@ -202,7 +202,7 @@ Phil Atkin
|
||||
Pawel Ksiezopolski
|
||||
Patrick Neary
|
||||
Nathan Monteleone
|
||||
Miha Ravelj
|
||||
Miha Rav<EFBFBD>elj
|
||||
Miguel Escriva
|
||||
Mattias Linde
|
||||
Mark Sciabica
|
||||
@@ -232,10 +232,11 @@ Dietmar Funck
|
||||
Colin Cochran
|
||||
Christian Ruzicka
|
||||
Christian Buchner
|
||||
Chris Djali
|
||||
Charles Cole
|
||||
Blake Williams
|
||||
Bjrn Hein
|
||||
Aurlien Chatelain
|
||||
Bj<EFBFBD>rn Hein
|
||||
Aur<EFBFBD>lien Chatelain
|
||||
Antoine Hue
|
||||
Andrew Bettison
|
||||
Andreas Henne
|
||||
@@ -264,7 +265,7 @@ Paul Obermeier
|
||||
Nguyen Van Truong
|
||||
Nathan Cournia
|
||||
Morten Haukness
|
||||
Morn Pistorius
|
||||
Morn<EFBFBD> Pistorius
|
||||
Michael Mc Donnell
|
||||
Michael Henheffer
|
||||
Michael Guerrero
|
||||
@@ -297,7 +298,7 @@ Guillaume Taze
|
||||
Guillaume Chouvenc
|
||||
Giuseppe Donvito
|
||||
Gill Peacegood
|
||||
Giampaolo Vigan
|
||||
Giampaolo Vigan<EFBFBD>
|
||||
Gerrick Bivins
|
||||
George Tarantilis
|
||||
Ferdi Smit
|
||||
@@ -305,7 +306,7 @@ Eduardo Poyart
|
||||
Edgar Ellis
|
||||
Dmitry Marakasov
|
||||
Dimi Christopoulos
|
||||
Diane Delalle
|
||||
Diane Delall<EFBFBD>e
|
||||
David Longest
|
||||
David Ergo
|
||||
Daniel Trstenjak
|
||||
@@ -337,7 +338,7 @@ Vasily Radostev
|
||||
Valery Bickov
|
||||
Valeriy Dubov
|
||||
Vaclav Bilek
|
||||
Tyge Lvset
|
||||
Tyge L<EFBFBD>vset
|
||||
Troy Yee
|
||||
Torben Dannahauer
|
||||
Tony Vasile
|
||||
@@ -387,7 +388,7 @@ Piotr Rak
|
||||
Pierre Bourdin
|
||||
Philipp Svehla
|
||||
Philipp Siemoleit
|
||||
Philipp Mchler
|
||||
Philipp M<EFBFBD>chler
|
||||
Philip Lamb
|
||||
Petr Salinger
|
||||
Peter Bear
|
||||
@@ -412,7 +413,7 @@ Nick Thu
|
||||
Nick Black
|
||||
Mojtaba Fathi
|
||||
Mirko Viviani
|
||||
Mikkel Gjl
|
||||
Mikkel Gj<EFBFBD>l
|
||||
Mike Krus
|
||||
Mike Garrity
|
||||
Mick Thu
|
||||
@@ -465,7 +466,7 @@ Juan Hernando
|
||||
Josh Portway
|
||||
Jonathan Greig
|
||||
John Tan
|
||||
John Hedstrm
|
||||
John Hedström
|
||||
John Grant
|
||||
John Farrier
|
||||
John Donovan
|
||||
@@ -523,11 +524,11 @@ David Jung
|
||||
Danny Valente
|
||||
Daniel Stien
|
||||
Dan Minor
|
||||
Csar L. B. Silveira
|
||||
C<EFBFBD>sar L. B. Silveira
|
||||
Cyril Brulebois
|
||||
Curtis Rubel
|
||||
Cory Slep
|
||||
Clment Bsch
|
||||
Cl<EFBFBD>ment B<EFBFBD>sch
|
||||
Clay Fowler
|
||||
Claus Steuer
|
||||
Chuck Sembroski
|
||||
@@ -539,8 +540,8 @@ Christian Kaser
|
||||
Christian Ehrlicher
|
||||
Chris White
|
||||
Chris McGlone
|
||||
Chris Djali
|
||||
Carlos Garcea
|
||||
Capostrophic
|
||||
Bryce Eldridge
|
||||
Bruno Herbelin
|
||||
Brian Keener
|
||||
|
||||
258
CMakeLists.txt
258
CMakeLists.txt
@@ -3,8 +3,8 @@
|
||||
#
|
||||
SET(OPENSCENEGRAPH_MAJOR_VERSION 3)
|
||||
SET(OPENSCENEGRAPH_MINOR_VERSION 6)
|
||||
SET(OPENSCENEGRAPH_PATCH_VERSION 3)
|
||||
SET(OPENSCENEGRAPH_SOVERSION 158)
|
||||
SET(OPENSCENEGRAPH_PATCH_VERSION 5)
|
||||
SET(OPENSCENEGRAPH_SOVERSION 162)
|
||||
|
||||
|
||||
# set to 0 when not a release candidate, non zero means that any generated
|
||||
@@ -30,6 +30,9 @@ if(COMMAND cmake_policy)
|
||||
cmake_policy(SET CMP0017 NEW)
|
||||
endif()
|
||||
|
||||
# INTERPROCEDURAL_OPTIMIZATION is enforced when enabled.
|
||||
# Allows passing -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON
|
||||
cmake_policy(SET CMP0069 NEW)
|
||||
endif()
|
||||
|
||||
IF(APPLE)
|
||||
@@ -41,6 +44,8 @@ IF(APPLE)
|
||||
OSG_OSX_VERSION "${OSG_OSX_VERSION}")
|
||||
ENDIF()
|
||||
|
||||
PROJECT(OpenSceneGraph)
|
||||
|
||||
# Set OSX architecture flags here, since they must be specified before
|
||||
# creating the actual OSG project.
|
||||
# Note that the CMAKE_OSX_* variables are not well documented in
|
||||
@@ -48,67 +53,77 @@ ENDIF()
|
||||
# See https://cmake.org/Bug/view.php?id=14695#c34953
|
||||
# Additionally, OSG_WINDOWING_SYSTEM is set here for OSX since its
|
||||
# value is needed to find the correct version of OpenGL (X11 or Cocoa).
|
||||
IF(APPLE AND NOT ANDROID)
|
||||
|
||||
# Here we check if the user specified IPhone SDK
|
||||
# These options are formally defined later, but can also be specified
|
||||
# by the user at the command line using the cmake -D switch
|
||||
# Note that FORCE is used since the user will likely enable IPhone
|
||||
# build via CMake GUI after already having configured once
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
|
||||
SET(OSG_WINDOWING_SYSTEM "IOS" CACHE STRING "Windowing system type for graphics window creation, options only IOS.")
|
||||
IF(ANDROID)
|
||||
SET(OSG_WINDOWING_SYSTEM "None" CACHE STRING "Windowing system type for graphics window creation; options: None.")
|
||||
ELSEIF(WIN32 OR MINGW)
|
||||
SET(OSG_WINDOWING_SYSTEM "Win32" CACHE STRING "Windowing system type for graphics window creation; options: Win32 or None.")
|
||||
ELSEIF(APPLE)
|
||||
# custom option to flag an iOS build
|
||||
OPTION(OSG_BUILD_PLATFORM_IPHONE "Enable IPhoneSDK Device support" OFF)
|
||||
|
||||
#set iphone arch and flags taken from http://sites.google.com/site/michaelsafyan/coding/resources/how-to-guides/cross-compile-for-the-iphone/how-to-cross-compile-for-the-iphone-using-cmake
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE)
|
||||
IF(${IPHONE_VERSION_MIN} LESS "7.0")
|
||||
SET(CMAKE_OSX_ARCHITECTURES "armv6;armv7" CACHE STRING "Build architectures for iOS" FORCE)
|
||||
ELSE()
|
||||
SET(CMAKE_OSX_ARCHITECTURES "armv7;armv7s;arm64" CACHE STRING "Build architectures for iOS" FORCE)
|
||||
ENDIF()
|
||||
|
||||
# set sdk and min versions
|
||||
SET (IPHONE_SDKVER "10.2" CACHE STRING "IOS SDK-Version")
|
||||
SET (IPHONE_VERSION_MIN "7.0" CACHE STRING "IOS minimum os version, use 7.0 or greater to get 64bit support")
|
||||
|
||||
# get full path to sdk from requested versions
|
||||
SET (IPHONE_DEVROOT "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer")
|
||||
SET (IPHONE_SDKROOT "${IPHONE_DEVROOT}/SDKs/iPhoneOS${IPHONE_SDKVER}.sdk")
|
||||
|
||||
# optionally enable bitcode for the build
|
||||
SET (IPHONE_ENABLE_BITCODE "NO" CACHE STRING "IOS Enable Bitcode")
|
||||
|
||||
# seamless toggle between device and simulator
|
||||
SET(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos;-iphonesimulator" CACHE STRING "Xcode effective platforms for iOS")
|
||||
|
||||
# set deployment target to min version
|
||||
SET(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "${IPHONE_VERSION_MIN}" CACHE STRING "Xcode deployment target for iOS")
|
||||
|
||||
# Set standard architectures
|
||||
SET(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD)" CACHE STRING "Build architectures for iOS")
|
||||
|
||||
ELSE()
|
||||
#simulator uses i386 and x86_64 architectures
|
||||
SET(CMAKE_OSX_ARCHITECTURES "i386;x86_64" CACHE STRING "Build architectures for iOS Simulator" FORCE)
|
||||
ENDIF()
|
||||
# OSX >= 10.5 uses Cocoa windowing system, otherwise Carbon
|
||||
IF(OSG_OSX_VERSION VERSION_LESS 10.5)
|
||||
SET(OSG_WINDOWING_SYSTEM "Carbon" CACHE STRING "Windowing system type for graphics window creation; options: Carbon, Cocoa, X11 or None.")
|
||||
SET(OSG_WINDOWING_SYSTEM_CARBON ON INTERNAL "use Carbon (apple; 32 bit only)")
|
||||
ELSE()
|
||||
SET(OSG_WINDOWING_SYSTEM "Cocoa" CACHE STRING "Windowing system type for graphics window creation; options: Carbon, Cocoa, X11 or None.")
|
||||
ENDIF()
|
||||
|
||||
#here we set the specific iphone sdk version. We can only set either device or simulator sdk. So if you want both you currently have to have two separate projects
|
||||
SET(CMAKE_OSX_SYSROOT "${IPHONE_SDKROOT}" CACHE STRING "System root for iOS" FORCE)
|
||||
|
||||
ELSE()
|
||||
# OSX >= 10.5 uses Cocoa windowing system, otherwise Carbon
|
||||
IF(OSG_OSX_VERSION VERSION_LESS 10.5)
|
||||
SET(OSG_WINDOWING_SYSTEM "Carbon" CACHE STRING "Windowing system type for graphics window creation, options Carbon, Cocoa or X11.")
|
||||
ELSE()
|
||||
SET(OSG_WINDOWING_SYSTEM "Cocoa" CACHE STRING "Windowing system type for graphics window creation, options Carbon, Cocoa or X11.")
|
||||
# Set defaults for Universal Binaries. We want 32-bit Intel/PPC on 10.4
|
||||
# and 32/64-bit Intel/PPC on >= 10.5. Anything <= 10.3 doesn't support.
|
||||
# These are set the first time CMake is run, and can be changed by
|
||||
# the user at any time.
|
||||
IF(OSG_OSX_VERSION VERSION_GREATER 10.7)
|
||||
# 64 Bit Works, i386,ppc is not supported any more
|
||||
SET(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architectures for OSX")
|
||||
SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.8" CACHE STRING "Target OSX version")
|
||||
ELSEIF(OSG_OSX_VERSION VERSION_EQUAL 10.7)
|
||||
# 64 Bit Works, PPC is not supported any more
|
||||
SET(CMAKE_OSX_ARCHITECTURES "i386;x86_64" CACHE STRING "Build architectures for OSX")
|
||||
ELSEIF(OSG_OSX_VERSION VERSION_GREATER 10.4)
|
||||
# 64-bit compiles are not supported with Carbon.
|
||||
SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX")
|
||||
SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.5" CACHE STRING "Target OSX version")
|
||||
ELSEIF(OSG_OSX_VERSION VERSION_EQUAL 10.4)
|
||||
# 64-bit compiles are not supported with Carbon.
|
||||
SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX")
|
||||
ELSE()
|
||||
# No Universal Binary support and SDK detection is too unreliable.
|
||||
# Warn user and continue at their own peril.
|
||||
MESSAGE(WARNING "OSX 10.3 and earlier not supported.")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# Set defaults for Universal Binaries. We want 32-bit Intel/PPC on 10.4
|
||||
# and 32/64-bit Intel/PPC on >= 10.5. Anything <= 10.3 doesn't support.
|
||||
# These are set the first time CMake is run, and can be changed by
|
||||
# the user at any time.
|
||||
IF(OSG_OSX_VERSION VERSION_GREATER 10.7)
|
||||
# 64 Bit Works, i386,ppc is not supported any more
|
||||
SET(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architectures for OSX")
|
||||
SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.8" CACHE STRING "Target OSX version")
|
||||
ELSEIF(OSG_OSX_VERSION VERSION_EQUAL 10.7)
|
||||
# 64 Bit Works, PPC is not supported any more
|
||||
SET(CMAKE_OSX_ARCHITECTURES "i386;x86_64" CACHE STRING "Build architectures for OSX")
|
||||
ELSEIF(OSG_OSX_VERSION VERSION_GREATER 10.4)
|
||||
# 64-bit compiles are not supported with Carbon.
|
||||
SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX")
|
||||
SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.5" CACHE STRING "Target OSX version")
|
||||
ELSEIF(OSG_OSX_VERSION VERSION_EQUAL 10.4)
|
||||
# 64-bit compiles are not supported with Carbon.
|
||||
SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX")
|
||||
ELSE()
|
||||
# No Universal Binary support and SDK detection is too unreliable.
|
||||
# Warn user and continue at their own peril.
|
||||
MESSAGE(WARNING "OSX 10.3 and earlier not supported.")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ELSE()
|
||||
SET(OSG_WINDOWING_SYSTEM "X11" CACHE STRING "Windowing system type for graphics window creation; options: X11 or None.")
|
||||
ENDIF()
|
||||
|
||||
PROJECT(OpenSceneGraph)
|
||||
IF(OSG_WINDOWING_SYSTEM STREQUAL "None")
|
||||
SET(OSG_WINDOWING_SYSTEM_NONE ON INTERNAL "No windowing system")
|
||||
ENDIF()
|
||||
|
||||
SET(OPENSCENEGRAPH_VERSION ${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION})
|
||||
|
||||
@@ -218,40 +233,15 @@ ENDIF(OSG_MAINTAINER)
|
||||
|
||||
IF(NOT ANDROID)
|
||||
IF(APPLE)
|
||||
# Trying to get CMake to generate an XCode IPhone project, current efforts are to get iphoneos sdk 3.1 working
|
||||
# Added option which needs manually setting to select the IPhone SDK for building. We can only have one of the below
|
||||
# set to true. Should really have an OSG_BUILD_PLATFORM variable that we set to our desired platform
|
||||
OPTION(OSG_BUILD_PLATFORM_IPHONE "Enable IPhoneSDK Device support" OFF)
|
||||
OPTION(OSG_BUILD_PLATFORM_IPHONE_SIMULATOR "Enable IPhoneSDK Simulator support" OFF)
|
||||
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE)
|
||||
|
||||
#you need to manually set the default sdk version here
|
||||
SET (IPHONE_SDKVER "10.2" CACHE STRING "IOS SDK-Version")
|
||||
SET (IPHONE_VERSION_MIN "7.0" CACHE STRING "IOS minimum os version, use 7.0 or greater to get 64bit support")
|
||||
# set the sdk path as our sysroot, if we set this before the project is defined cmake fails to build its test program
|
||||
SET(CMAKE_OSX_SYSROOT "${IPHONE_SDKROOT}" CACHE STRING "System root for iOS" FORCE)
|
||||
|
||||
#the below is taken from ogre, it states the gcc stuff needs to happen before PROJECT() is called. I've no clue if we even need it
|
||||
# Force gcc <= 4.2 on iPhone
|
||||
IF(IPHONE_VERSION_MIN LESS "6.0")
|
||||
include(CMakeForceCompiler)
|
||||
CMAKE_FORCE_C_COMPILER(llvm-gcc-4.2 GNU)
|
||||
CMAKE_FORCE_CXX_COMPILER(llvm-gcc-4.2 GNU)
|
||||
SET(GCC_THUMB_SUPPORT NO)
|
||||
ENDIF()
|
||||
# Set the path to OpenGL library
|
||||
SET(OPENGL_gl_LIBRARY "${IPHONE_SDKROOT}/System/Library/Frameworks/OpenGLES.framework")
|
||||
|
||||
#set either the device sdk or the simulator sdk. Can't find away to separate these in the same project
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE)
|
||||
SET (IPHONE_DEVROOT "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer")
|
||||
SET (IPHONE_SDKROOT "${IPHONE_DEVROOT}/SDKs/iPhoneOS${IPHONE_SDKVER}.sdk")
|
||||
ELSE()
|
||||
SET (IPHONE_DEVROOT "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer")
|
||||
SET (IPHONE_SDKROOT "${IPHONE_DEVROOT}/SDKs/iPhoneSimulator${IPHONE_SDKVER}.sdk")
|
||||
ENDIF()
|
||||
|
||||
SET (IPHONE_ENABLE_BITCODE "NO" CACHE STRING "IOS Enable Bitcode")
|
||||
|
||||
# Apple iOS: Find OpenGLES
|
||||
FIND_LIBRARY(OPENGLES_LIBRARY OpenGLES)
|
||||
ELSE ()
|
||||
FIND_LIBRARY(CARBON_LIBRARY Carbon)
|
||||
FIND_LIBRARY(COCOA_LIBRARY Cocoa)
|
||||
@@ -369,7 +359,9 @@ IF(WIN32 AND NOT ANDROID)
|
||||
OPTION(MSVC_DISABLE_CHECKED_ITERATORS "Set to ON to disable Visual C++ checked iterators. If you do this you must ensure that every other project in your solution and all dependencies are compiled with _SECURE_SCL=0." OFF)
|
||||
MARK_AS_ADVANCED(MSVC_DISABLE_CHECKED_ITERATORS)
|
||||
IF(MSVC_DISABLE_CHECKED_ITERATORS)
|
||||
ADD_DEFINITIONS(-D_ITERATOR_DEBUG_LEVEL=0) # this supercedes _SECURE_SCL and _HAS_ITERATOR_DEBUGGING in VS2010 and forward
|
||||
ADD_DEFINITIONS(-D_SECURE_SCL=0)
|
||||
ADD_DEFINITIONS(-D_HAS_ITERATOR_DEBUGGING=0)
|
||||
ENDIF(MSVC_DISABLE_CHECKED_ITERATORS)
|
||||
|
||||
OPTION(MSVC_USE_DEFAULT_STACK_SIZE "Set to ON to use the default Visual C++ stack size. CMake forces a high stack size by default, which can cause problems for applications with large number of threads." OFF)
|
||||
@@ -454,6 +446,9 @@ MARK_AS_ADVANCED(OSG_USE_FLOAT_BOUNDINGSPHERE)
|
||||
OPTION(OSG_USE_FLOAT_BOUNDINGBOX "Set to ON to build OpenSceneGraph with float BoundingBox instead of double." ON)
|
||||
MARK_AS_ADVANCED(OSG_USE_FLOAT_BOUNDINGBOX)
|
||||
|
||||
OPTION(OSG_USE_FLOAT_QUAT "Set to ON to build OpenSceneGraph with float Quat instead of double." OFF)
|
||||
MARK_AS_ADVANCED(OSG_USE_FLOAT_QUAT)
|
||||
|
||||
IF (WIN32)
|
||||
OPTION(OSG_USE_UTF8_FILENAME "Set to ON to use a UTF8 locale for filenames instead of the default locale." OFF)
|
||||
MARK_AS_ADVANCED(OSG_USE_UTF8_FILENAME)
|
||||
@@ -515,6 +510,12 @@ ENDIF()
|
||||
|
||||
OPTION(OSG_GL_LIBRARY_STATIC "Set to ON to statically link with OpenGL/GLES library." OFF)
|
||||
|
||||
IF (OSG_BUILD_PLATFORM_IPHONE OR ANDROID)
|
||||
OPTION(OSG_TEXT_USE_FONTCONFIG "Set to ON to enable attempt to use FontConfig in osgText." OFF)
|
||||
ELSE ()
|
||||
OPTION(OSG_TEXT_USE_FONTCONFIG "Set to OFF to disable attempt to use FontConfig in osgText." ON)
|
||||
ENDIF ()
|
||||
|
||||
# Map the OSG_GL*_AVAILABLE settings to OSG_GL_* settings
|
||||
IF (OSG_GLES2_AVAILABLE OR OSG_GLES3_AVAILABLE OR OSG_GL3_AVAILABLE)
|
||||
OPTION(OSG_GL_DISPLAYLISTS_AVAILABLE "Set to OFF to disable use of OpenGL display lists." OFF)
|
||||
@@ -542,12 +543,12 @@ ELSE()
|
||||
OPTION(OSG_CPP_EXCEPTIONS_AVAILABLE "Set to OFF to disable compile of OSG components that use C++ exceptions." ON)
|
||||
ENDIF()
|
||||
|
||||
SET(OSG_GL_CONTEXT_VERSION "1.0" CACHE STRING "GL Context String to pass when creaing graphics contexts")
|
||||
|
||||
# Map the OSG_GL*_AVAILABLE settings to OpenGL header settings
|
||||
SET(DEFAULT_GL_CONTEXT_VERSION "1.0")
|
||||
IF (OSG_GL3_AVAILABLE)
|
||||
|
||||
SET(OSG_GL_CONTEXT_VERSION "3.3")
|
||||
SET(DEFAULT_GL_CONTEXT_VERSION "3.3")
|
||||
|
||||
IF (APPLE)
|
||||
SET(OPENGL_HEADER1 "#include <OpenGL/gl.h>" CACHE STRING "#include<> line for OpenGL Header")
|
||||
@@ -600,6 +601,8 @@ ELSE()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
SET(OSG_GL_CONTEXT_VERSION ${DEFAULT_GL_CONTEXT_VERSION} CACHE STRING "GL Context String to pass when creaing graphics contexts")
|
||||
|
||||
IF (OSG_GL1_AVAILABLE)
|
||||
SET(OSG_GL1_FEATURES 1)
|
||||
ELSE()
|
||||
@@ -728,7 +731,9 @@ OPTION(BUILD_OSG_PLUGINS "Build OSG Plugins - Disable for compile testing exampl
|
||||
mark_as_advanced(BUILD_OSG_PLUGINS)
|
||||
################################################################################
|
||||
# 3rd Party Dependency Stuff
|
||||
IF(WIN32 AND NOT ANDROID)
|
||||
OPTION(OSG_FIND_3RD_PARTY_DEPS "Enable to search for Android or Windows dependencies in ./3rdparty" ON)
|
||||
|
||||
IF(WIN32 AND NOT ANDROID AND OSG_FIND_3RD_PARTY_DEPS)
|
||||
INCLUDE(Find3rdPartyDependencies)
|
||||
ENDIF()
|
||||
|
||||
@@ -739,7 +744,7 @@ OPTION(OSG_USE_LOCAL_LUA_SOURCE "Enable to use local Lua source when building th
|
||||
# you can use the following style of command line option when invoking Cmake (here illustrating ignoring PythonLibs) :
|
||||
# cmake -DCMAKE_DISABLE_FIND_PACKAGE_PythonLibs=1 .
|
||||
#
|
||||
IF(ANDROID)
|
||||
IF(ANDROID AND OSG_FIND_3RD_PARTY_DEPS)
|
||||
ANDROID_3RD_PARTY()
|
||||
ELSE()
|
||||
# Common to all platforms except android:
|
||||
@@ -752,7 +757,6 @@ ELSE()
|
||||
FIND_PACKAGE(COLLADA)
|
||||
FIND_PACKAGE(FBX)
|
||||
FIND_PACKAGE(ZLIB)
|
||||
FIND_PACKAGE(OpenVRML)
|
||||
FIND_PACKAGE(GDAL)
|
||||
FIND_PACKAGE(GTA)
|
||||
FIND_PACKAGE(CURL)
|
||||
@@ -798,9 +802,7 @@ IF (BUILD_OSG_EXAMPLES AND NOT ANDROID)
|
||||
|
||||
FIND_PACKAGE(FLTK)
|
||||
FIND_PACKAGE(FOX)
|
||||
|
||||
SET(wxWidgets_USE_LIBS base core gl net)
|
||||
FIND_PACKAGE(wxWidgets)
|
||||
FIND_PACKAGE(wxWidgets COMPONENTS base core gl net)
|
||||
|
||||
ENDIF(BUILD_OSG_EXAMPLES AND NOT ANDROID)
|
||||
|
||||
@@ -819,7 +821,7 @@ ENDIF(BUILD_OSG_EXAMPLES AND NOT ANDROID)
|
||||
|
||||
# Image readers/writers depend on 3rd party libraries except for OS X which
|
||||
# can use Quicktime.
|
||||
IF(NOT ANDROID)
|
||||
IF(NOT (ANDROID AND OSG_FIND_3RD_PARTY_DEPS))
|
||||
IF(NOT APPLE)
|
||||
FIND_PACKAGE(GIFLIB)
|
||||
FIND_PACKAGE(JPEG)
|
||||
@@ -891,10 +893,26 @@ IF(CYGWIN)
|
||||
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG")
|
||||
ENDIF()
|
||||
|
||||
IF(UNIX AND NOT WIN32 AND NOT APPLE)
|
||||
IF(CMAKE_SIZEOF_VOID_P MATCHES "8")
|
||||
SET(LIB_POSTFIX "64" CACHE STRING "suffix for 32/64 dir placement")
|
||||
MARK_AS_ADVANCED(LIB_POSTFIX)
|
||||
# Set OSG_INSTALL_LIBDIR to specify the installation directories of object code libraries
|
||||
IF(DEFINED LIB_POSTFIX)
|
||||
# Use LIB_POSTFIX if defined
|
||||
SET(OSG_INSTALL_LIBDIR lib${LIB_POSTFIX})
|
||||
ELSE()
|
||||
IF(CMAKE_VERSION VERSION_LESS "2.8.5")
|
||||
IF(UNIX AND NOT WIN32 AND NOT APPLE)
|
||||
IF(CMAKE_SIZEOF_VOID_P MATCHES "8")
|
||||
SET(LIB_POSTFIX "64" CACHE STRING "suffix for 32/64 dir placement")
|
||||
MARK_AS_ADVANCED(LIB_POSTFIX)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
IF(NOT DEFINED LIB_POSTFIX)
|
||||
SET(LIB_POSTFIX "")
|
||||
ENDIF()
|
||||
SET(OSG_INSTALL_LIBDIR lib${LIB_POSTFIX})
|
||||
ELSE()
|
||||
# Use the GNU standard installation directories for CMake >= 2.8.5
|
||||
INCLUDE(GNUInstallDirs)
|
||||
SET(OSG_INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
IF(NOT DEFINED LIB_POSTFIX)
|
||||
@@ -1105,41 +1123,15 @@ ENDIF()
|
||||
|
||||
IF(APPLE AND NOT ANDROID)
|
||||
|
||||
#Here we check if the user specified IPhone SDK
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE)
|
||||
|
||||
#set iphone arch and flags taken from http://sites.google.com/site/michaelsafyan/coding/resources/how-to-guides/cross-compile-for-the-iphone/how-to-cross-compile-for-the-iphone-using-cmake
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE)
|
||||
IF(${IPHONE_VERSION_MIN} LESS "7.0")
|
||||
SET(CMAKE_OSX_ARCHITECTURES "armv6;armv7" CACHE STRING "Build architectures for iOS" FORCE)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mno-thumb -pipe -no-cpp-precomp" CACHE STRING "Flags used by the compiler during all build types." FORCE)
|
||||
ELSE()
|
||||
SET(CMAKE_OSX_ARCHITECTURES "armv7;armv7s;arm64" CACHE STRING "Build architectures for iOS" FORCE)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -no-cpp-precomp" CACHE STRING "Flags used by the compiler during all build types." FORCE)
|
||||
ENDIF()
|
||||
# set osg window system to iOS
|
||||
SET(OSG_WINDOWING_SYSTEM "IOS" CACHE STRING "Windowing system type for graphics window creation, options only IOS." FORCE)
|
||||
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -miphoneos-version-min=${IPHONE_VERSION_MIN}" FORCE)
|
||||
|
||||
ELSE()
|
||||
#simulator uses i386 and x86_64 architectures
|
||||
SET(CMAKE_OSX_ARCHITECTURES "i386;x86_64" CACHE STRING "Build architectures for iOS Simulator" FORCE)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mno-thumb -pipe -no-cpp-precomp" CACHE STRING "Flags used by the compiler during all build types." FORCE)
|
||||
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mios-simulator-version-min=${IPHONE_VERSION_MIN}" FORCE)
|
||||
|
||||
ENDIF()
|
||||
|
||||
#here we set the specific iphone sdk version. We can only set either device or simulator sdk. So if you want both you currently have to have two separate projects
|
||||
SET(CMAKE_OSX_SYSROOT "${IPHONE_SDKROOT}" CACHE STRING "System root for iOS" FORCE)
|
||||
|
||||
#hack, force link to opengles
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-framework Foundation -framework OpenGLES")
|
||||
|
||||
#use the IPhone windowing system
|
||||
SET(OSG_WINDOWING_SYSTEM "IOS" CACHE STRING "Forced IPhone windowing system on iOS" FORCE)
|
||||
# set osg default image plugin
|
||||
SET(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX "imageio" CACHE STRING "Forced imageio default image plugin for iOS" FORCE)
|
||||
|
||||
#I think this or similar will be required for IPhone apps
|
||||
# ensure app bundles for example app
|
||||
OPTION(OSG_BUILD_APPLICATION_BUNDLES "Enable the building of applications and examples as OSX Bundles" ON)
|
||||
|
||||
ELSE()
|
||||
@@ -1365,6 +1357,13 @@ IF(NOT OSG_CONFIG_HAS_BEEN_RUN_BEFORE)
|
||||
SET(OSG_CONFIG_HAS_BEEN_RUN_BEFORE 1 CACHE INTERNAL "Flag to track whether this is the first time running CMake or if CMake has been configured before")
|
||||
ENDIF()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# add clobber build target to clear all the non git registered files/directories
|
||||
#-----------------------------------------------------------------------------
|
||||
add_custom_target(clobber
|
||||
COMMAND git clean -d -f -x
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
### uninstall target
|
||||
#-----------------------------------------------------------------------------
|
||||
@@ -1376,4 +1375,5 @@ ADD_CUSTOM_TARGET(uninstall
|
||||
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
|
||||
|
||||
#
|
||||
|
||||
include(FeatureSummary)
|
||||
feature_summary(WHAT ALL)
|
||||
|
||||
@@ -15,8 +15,20 @@ FIND_PATH(ASIO_INCLUDE_DIR
|
||||
|
||||
SET(ASIO_FOUND "NO")
|
||||
IF(ASIO_INCLUDE_DIR)
|
||||
FIND_PACKAGE( Boost 1.37 )
|
||||
IF(Boost_FOUND)
|
||||
SET(ASIO_FOUND "YES")
|
||||
ENDIF()
|
||||
|
||||
set(ASIO_VERSION_H ${ASIO_INCLUDE_DIR}/asio/version.hpp)
|
||||
file(STRINGS ${ASIO_VERSION_H} AsioVersionLine REGEX "^#define ASIO_VERSION ")
|
||||
string(REGEX MATCHALL "[0-9]+" AsioHeaderVersionMatches "${AsioVersionLine}")
|
||||
list(GET AsioHeaderVersionMatches 0 AsioHeaderVersion)
|
||||
|
||||
# check version is less than 1.14.0 otherwise API changes break build
|
||||
if (${AsioHeaderVersion} LESS "101400")
|
||||
FIND_PACKAGE( Boost 1.37 )
|
||||
IF(Boost_FOUND)
|
||||
SET(ASIO_FOUND "YES")
|
||||
ENDIF()
|
||||
else()
|
||||
message("ASIO not compatible")
|
||||
endif()
|
||||
|
||||
ENDIF()
|
||||
|
||||
@@ -25,11 +25,14 @@ ENDIF()
|
||||
|
||||
IF(APPLE)
|
||||
SET(COLLADA_BUILDNAME "mac")
|
||||
SET(COLLADA_BOOST_BUILDNAME ${COLLADA_BUILDNAME})
|
||||
SET(COLLADA_BOOST_BUILDNAME ${COLLADA_BUILDNAME})
|
||||
ELSEIF(MINGW)
|
||||
SET(COLLADA_BUILDNAME "mingw")
|
||||
SET(COLLADA_BOOST_BUILDNAME ${COLLADA_BUILDNAME})
|
||||
ELSEIF(MSVC_VERSION EQUAL 1900 OR MSVC_VERSION EQUAL 1910 )
|
||||
SET(COLLADA_BOOST_BUILDNAME ${COLLADA_BUILDNAME})
|
||||
ELSEIF((MSVC_VERSION GREATER 1910) OR (MSVC_VERSION EQUAL 1910))
|
||||
SET(COLLADA_BUILDNAME "vc14")
|
||||
SET(COLLADA_BOOST_BUILDNAME "vc141")
|
||||
ELSEIF(MSVC_VERSION EQUAL 1900)
|
||||
SET(COLLADA_BUILDNAME "vc14")
|
||||
SET(COLLADA_BOOST_BUILDNAME "vc140")
|
||||
ELSEIF(MSVC_VERSION EQUAL 1800)
|
||||
|
||||
@@ -25,17 +25,22 @@ ELSEIF(MSVC10)
|
||||
SET(FBX_LIBDIR "vs2010")
|
||||
ELSEIF(MSVC11)
|
||||
SET(FBX_LIBDIR "vs2012")
|
||||
ELSEIF(MSVC12 OR MSVC_VERSION==1800)
|
||||
ELSEIF(MSVC_VERSION EQUAL 1800)
|
||||
SET(FBX_LIBDIR "vs2013")
|
||||
ELSEIF(MSVC14 OR MSVC_VERSION>1900)
|
||||
ELSEIF(MSVC_VERSION EQUAL 1900)
|
||||
SET(FBX_LIBDIR "vs2015")
|
||||
ELSEIF(MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1920)
|
||||
SET(FBX_LIBDIR "vs2017")
|
||||
ELSEIF(MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS 1930)
|
||||
# SET(FBX_LIBDIR "vs2019") # FBX doesn't have this yet as of version 2020.0.1
|
||||
SET(FBX_LIBDIR "vs2017") # Binary compatible with vs2019
|
||||
ENDIF()
|
||||
|
||||
IF(APPLE)
|
||||
# do nothing
|
||||
ELSEIF(CMAKE_CL_64)
|
||||
SET(FBX_LIBDIR ${FBX_LIBDIR}/x64)
|
||||
ELSEIF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
ELSEIF(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
SET(FBX_LIBDIR ${FBX_LIBDIR}/x64)
|
||||
ELSE()
|
||||
SET(FBX_LIBDIR ${FBX_LIBDIR}/x86)
|
||||
@@ -53,6 +58,10 @@ ELSE()
|
||||
SET(FBX_LIBNAME "libfbxsdk")
|
||||
ELSE()
|
||||
SET(FBX_LIBNAME "libfbxsdk-md")
|
||||
IF(WIN32)
|
||||
SET(FBX_XML2_LIBNAME "libxml2-md")
|
||||
SET(FBX_ZLIB_LIBNAME "zlib-md")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
@@ -60,16 +69,41 @@ SET(FBX_LIBNAME_DEBUG ${FBX_LIBNAME}d)
|
||||
|
||||
SET( FBX_SEARCH_PATHS
|
||||
$ENV{FBX_DIR}
|
||||
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2020.0.1"
|
||||
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2020.0.1"
|
||||
"/Applications/Autodesk/FBX SDK/2020.0.1"
|
||||
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2020.0"
|
||||
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2020.0"
|
||||
"/Applications/Autodesk/FBX SDK/2020.0"
|
||||
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2019.5"
|
||||
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2019.5"
|
||||
"/Applications/Autodesk/FBX SDK/2019.5"
|
||||
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2019.2"
|
||||
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2019.2"
|
||||
"/Applications/Autodesk/FBX SDK/2019.2"
|
||||
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2019.0"
|
||||
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2019.0"
|
||||
"/Applications/Autodesk/FBX SDK/2019.0"
|
||||
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2018.1.1"
|
||||
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2018.1.1"
|
||||
"/Applications/Autodesk/FBX\ SDK/2018.0"
|
||||
"/Applications/Autodesk/FBX SDK/2018.1.1"
|
||||
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2018.0"
|
||||
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2018.0"
|
||||
"/Applications/Autodesk/FBX SDK/2018.0"
|
||||
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2017.1"
|
||||
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2017.1"
|
||||
"/Applications/Autodesk/FBX SDK/2017.1"
|
||||
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2017.0"
|
||||
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2017.0"
|
||||
"/Applications/Autodesk/FBX SDK/2017.0"
|
||||
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2016.1.2"
|
||||
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2016.1.2"
|
||||
"/Applications/Autodesk/FBX/FBX SDK/2016.1.2"
|
||||
/Applications/Autodesk/FBXSDK201612
|
||||
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2016.1.1"
|
||||
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2016.1.1"
|
||||
"/Applications/Autodesk/FBX/FBX SDK/2016.1.1"
|
||||
/Applications/Autodesk/FBXSDK201611
|
||||
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2015.1"
|
||||
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2015.1"
|
||||
"/Applications/Autodesk/FBX/FBX SDK/2015.1"
|
||||
@@ -98,6 +132,21 @@ FIND_LIBRARY( FBX_LIBRARY_DEBUG ${FBX_LIBNAME_DEBUG}
|
||||
PATHS ${FBX_SEARCH_PATHS}
|
||||
PATH_SUFFIXES "lib/${FBX_LIBDIR}")
|
||||
|
||||
IF(WIN32)
|
||||
FIND_LIBRARY( FBX_XML2_LIBRARY ${FBX_XML2_LIBNAME}
|
||||
PATHS ${FBX_SEARCH_PATHS}
|
||||
PATH_SUFFIXES "lib/${FBX_LIBDIR}/release" "lib/${FBX_LIBDIR}")
|
||||
FIND_LIBRARY( FBX_ZLIB_LIBRARY ${FBX_ZLIB_LIBNAME}
|
||||
PATHS ${FBX_SEARCH_PATHS}
|
||||
PATH_SUFFIXES "lib/${FBX_LIBDIR}/release" "lib/${FBX_LIBDIR}")
|
||||
FIND_LIBRARY( FBX_XML2_LIBRARY_DEBUG ${FBX_XML2_LIBNAME}
|
||||
PATHS ${FBX_SEARCH_PATHS}
|
||||
PATH_SUFFIXES "lib/${FBX_LIBDIR}/debug")
|
||||
FIND_LIBRARY( FBX_ZLIB_LIBRARY_DEBUG ${FBX_ZLIB_LIBNAME}
|
||||
PATHS ${FBX_SEARCH_PATHS}
|
||||
PATH_SUFFIXES "lib/${FBX_LIBDIR}/debug")
|
||||
ENDIF()
|
||||
|
||||
IF(FBX_LIBRARY AND FBX_LIBRARY_DEBUG AND FBX_INCLUDE_DIR)
|
||||
SET(FBX_FOUND "YES")
|
||||
ELSE()
|
||||
|
||||
98
CMakeModules/FindFontconfig.cmake
Normal file
98
CMakeModules/FindFontconfig.cmake
Normal file
@@ -0,0 +1,98 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
#[[=======================================================================.rst:
|
||||
# FindFontconfig
|
||||
# --------------
|
||||
#
|
||||
# Find Fontconfig headers and library.
|
||||
#
|
||||
# Imported Targets
|
||||
# ^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# ``Fontconfig::Fontconfig``
|
||||
# The Fontconfig library, if found.
|
||||
#
|
||||
# Result Variables
|
||||
# ^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# This will define the following variables in your project:
|
||||
#
|
||||
# ``FONTCONFIG_FOUND``
|
||||
# true if (the requested version of) Fontconfig is available.
|
||||
# ``FONTCONFIG_VERSION``
|
||||
# the version of Fontconfig.
|
||||
# ``FONTCONFIG_LIBRARIES``
|
||||
# the libraries to link against to use Fontconfig.
|
||||
# ``FONTCONFIG_INCLUDE_DIRS``
|
||||
# where to find the Fontconfig headers.
|
||||
# ``FONTCONFIG_COMPILE_OPTIONS``
|
||||
# this should be passed to target_compile_options(), if the
|
||||
# target is not used for linking
|
||||
#=======================================================================]]
|
||||
|
||||
# use pkg-config to get the directories and then use these values
|
||||
# in the FIND_PATH() and FIND_LIBRARY() calls
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PKG_FONTCONFIG QUIET fontconfig)
|
||||
set(FONTCONFIG_COMPILE_OPTIONS ${PKG_FONTCONFIG_CFLAGS_OTHER})
|
||||
set(FONTCONFIG_VERSION ${PKG_FONTCONFIG_VERSION})
|
||||
|
||||
find_path( FONTCONFIG_INCLUDE_DIR
|
||||
NAMES
|
||||
fontconfig/fontconfig.h
|
||||
HINTS
|
||||
${PKG_FONTCONFIG_INCLUDE_DIRS}
|
||||
/usr/X11/include
|
||||
)
|
||||
|
||||
find_library( FONTCONFIG_LIBRARY
|
||||
NAMES
|
||||
fontconfig
|
||||
PATHS
|
||||
${PKG_FONTCONFIG_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
if (FONTCONFIG_INCLUDE_DIR AND NOT FONTCONFIG_VERSION)
|
||||
file(STRINGS ${FONTCONFIG_INCLUDE_DIR}/fontconfig/fontconfig.h _contents REGEX "^#define[ \t]+FC_[A-Z]+[ \t]+[0-9]+$")
|
||||
unset(FONTCONFIG_VERSION)
|
||||
foreach(VPART MAJOR MINOR REVISION)
|
||||
foreach(VLINE ${_contents})
|
||||
if(VLINE MATCHES "^#define[\t ]+FC_${VPART}[\t ]+([0-9]+)$")
|
||||
set(FONTCONFIG_VERSION_PART "${CMAKE_MATCH_1}")
|
||||
if(FONTCONFIG_VERSION)
|
||||
string(APPEND FONTCONFIG_VERSION ".${FONTCONFIG_VERSION_PART}")
|
||||
else()
|
||||
set(FONTCONFIG_VERSION "${FONTCONFIG_VERSION_PART}")
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
||||
endif ()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Fontconfig
|
||||
FOUND_VAR
|
||||
FONTCONFIG_FOUND
|
||||
REQUIRED_VARS
|
||||
FONTCONFIG_LIBRARY
|
||||
FONTCONFIG_INCLUDE_DIR
|
||||
VERSION_VAR
|
||||
FONTCONFIG_VERSION
|
||||
)
|
||||
|
||||
|
||||
if(FONTCONFIG_FOUND AND NOT TARGET Fontconfig::Fontconfig)
|
||||
add_library(Fontconfig::Fontconfig UNKNOWN IMPORTED)
|
||||
set_target_properties(Fontconfig::Fontconfig PROPERTIES
|
||||
IMPORTED_LOCATION "${FONTCONFIG_LIBRARY}"
|
||||
INTERFACE_COMPILE_OPTIONS "${FONTCONFIG_COMPILE_OPTIONS}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${FONTCONFIG_INCLUDE_DIR}"
|
||||
)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(FONTCONFIG_LIBRARY FONTCONFIG_INCLUDE_DIR)
|
||||
|
||||
if(FONTCONFIG_FOUND)
|
||||
set(FONTCONFIG_LIBRARIES ${FONTCONFIG_LIBRARY})
|
||||
set(FONTCONFIG_INCLUDE_DIRS ${FONTCONFIG_INCLUDE_DIR})
|
||||
endif()
|
||||
@@ -101,5 +101,8 @@ if(LIBLAS_LIBRARY AND LIBLAS_INCLUDE_DIR)
|
||||
if(Boost_FOUND)
|
||||
set(LIBLAS_LIBRARIES ${LIBLAS_LIBRARY} )
|
||||
set(LIBLAS_FOUND "YES")
|
||||
if(WIN32)
|
||||
link_directories(${Boost_LIBRARY_DIRS})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
# correspond to the ./configure --prefix=$OPENCASCADE_DIR
|
||||
# used in building OPENCASCADE.
|
||||
|
||||
FIND_PATH(OPENCASCADE_INCLUDE_DIR BRepMesh.hxx
|
||||
FIND_PATH(OPENCASCADE_INCLUDE_DIR Standard_Version.hxx
|
||||
PATHS
|
||||
${OPENCASCADE_DIR}
|
||||
$ENV{OPENCASCADE_DIR}
|
||||
@@ -98,6 +98,7 @@ FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXml TKXml)
|
||||
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXmlTObj TKXmlTObj)
|
||||
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXmlXCAF TKXmlXCAF)
|
||||
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXSBase TKXSBase)
|
||||
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXCAF TKXCAF)
|
||||
|
||||
set (OPENCASCADE_LIBRARY_TYPE_DESCR
|
||||
"Specifies the type of library to be used. 'Shared' libraries
|
||||
|
||||
@@ -34,8 +34,17 @@ INSTALL(
|
||||
|
||||
IF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
|
||||
GET_TARGET_PROPERTY(PREFIX ${LIB_NAME} PREFIX)
|
||||
INSTALL(FILES ${OUTPUT_BINDIR}/${PREFIX}${LIB_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS RelWithDebInfo)
|
||||
INSTALL(FILES ${OUTPUT_BINDIR}/${PREFIX}${LIB_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS Debug)
|
||||
IF("${PREFIX}" STREQUAL PREFIX-NOTFOUND) # Fix for PREFIX-NOTFOUND left in file names
|
||||
SET(PREFIX "")
|
||||
ENDIF()
|
||||
IF ( ${CMAKE_GENERATOR} STREQUAL "Ninja" )
|
||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PREFIX}${LIB_NAME}${CMAKE_RELEASE_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS Release)
|
||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PREFIX}${LIB_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS RelWithDebInfo)
|
||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PREFIX}${LIB_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS Debug)
|
||||
ELSE ( ${CMAKE_GENERATOR} STREQUAL "Ninja" )
|
||||
INSTALL(FILES ${OUTPUT_BINDIR}/${PREFIX}${LIB_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS RelWithDebInfo)
|
||||
INSTALL(FILES ${OUTPUT_BINDIR}/${PREFIX}${LIB_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS Debug)
|
||||
ENDIF ( ${CMAKE_GENERATOR} STREQUAL "Ninja" )
|
||||
ENDIF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
|
||||
|
||||
IF(NOT OSG_COMPILE_FRAMEWORKS)
|
||||
|
||||
@@ -225,7 +225,7 @@ MACRO(SETUP_LIBRARY LIB_NAME)
|
||||
)
|
||||
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES FOLDER "OSG Core")
|
||||
IF(APPLE)
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE)
|
||||
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE ${IPHONE_ENABLE_BITCODE})
|
||||
ENDIF()
|
||||
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
|
||||
@@ -336,21 +336,26 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES FOLDER "Plugins")
|
||||
IF(APPLE)
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE)
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE ${IPHONE_ENABLE_BITCODE})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
SETUP_LINK_LIBRARIES()
|
||||
|
||||
#the installation path are differentiated for win32 that install in bib versus other architecture that install in lib${LIB_POSTFIX}/${OSG_PLUGINS}
|
||||
#the installation path are differentiated for win32 that install in bin versus other architecture that install in lib${LIB_POSTFIX}/${OSG_PLUGINS}
|
||||
IF(WIN32)
|
||||
INSTALL(TARGETS ${TARGET_TARGETNAME}
|
||||
RUNTIME DESTINATION bin COMPONENT ${PACKAGE_COMPONENT}
|
||||
ARCHIVE DESTINATION lib/${OSG_PLUGINS} COMPONENT libopenscenegraph-dev
|
||||
LIBRARY DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT})
|
||||
IF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
|
||||
INSTALL(FILES ${OUTPUT_BINDIR}/${OSG_PLUGINS}/${TARGET_TARGETNAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT} CONFIGURATIONS RelWithDebInfo)
|
||||
INSTALL(FILES ${OUTPUT_BINDIR}/${OSG_PLUGINS}/${TARGET_TARGETNAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT} CONFIGURATIONS Debug)
|
||||
IF( ${CMAKE_GENERATOR} STREQUAL "Ninja" )
|
||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_TARGETNAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT} CONFIGURATIONS RelWithDebInfo)
|
||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_TARGETNAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT} CONFIGURATIONS Debug)
|
||||
ELSE( ${CMAKE_GENERATOR} STREQUAL "Ninja" )
|
||||
INSTALL(FILES ${OUTPUT_BINDIR}/${OSG_PLUGINS}/${TARGET_TARGETNAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT} CONFIGURATIONS RelWithDebInfo)
|
||||
INSTALL(FILES ${OUTPUT_BINDIR}/${OSG_PLUGINS}/${TARGET_TARGETNAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT} CONFIGURATIONS Debug)
|
||||
ENDIF( ${CMAKE_GENERATOR} STREQUAL "Ninja" )
|
||||
ENDIF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
|
||||
ELSE(WIN32)
|
||||
INSTALL(TARGETS ${TARGET_TARGETNAME}
|
||||
@@ -429,7 +434,7 @@ MACRO(SETUP_EXE IS_COMMANDLINE_APP)
|
||||
|
||||
IF(APPLE)
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE)
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE ${IPHONE_ENABLE_BITCODE})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
@@ -458,8 +463,8 @@ MACRO(SETUP_APPLICATION APPLICATION_NAME)
|
||||
ELSE(APPLE)
|
||||
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin COMPONENT openscenegraph )
|
||||
IF(MSVC)
|
||||
INSTALL(FILES ${CMAKE_BINARY_DIR}/bin/${TARGET_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION bin COMPONENT openscenegraph CONFIGURATIONS RelWithDebInfo)
|
||||
INSTALL(FILES ${CMAKE_BINARY_DIR}/bin/${TARGET_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION bin COMPONENT openscenegraph CONFIGURATIONS Debug)
|
||||
INSTALL(FILES ${OUTPUT_BINDIR}/${TARGET_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION bin COMPONENT openscenegraph CONFIGURATIONS RelWithDebInfo)
|
||||
INSTALL(FILES ${OUTPUT_BINDIR}/${TARGET_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION bin COMPONENT openscenegraph CONFIGURATIONS Debug)
|
||||
ENDIF(MSVC)
|
||||
ENDIF(APPLE)
|
||||
|
||||
@@ -491,8 +496,8 @@ MACRO(SETUP_EXAMPLE EXAMPLE_NAME)
|
||||
ELSE(APPLE)
|
||||
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples )
|
||||
IF(MSVC)
|
||||
INSTALL(FILES ${CMAKE_BINARY_DIR}/bin/${TARGET_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples CONFIGURATIONS RelWithDebInfo)
|
||||
INSTALL(FILES ${CMAKE_BINARY_DIR}/bin/${TARGET_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples CONFIGURATIONS Debug)
|
||||
INSTALL(FILES ${OUTPUT_BINDIR}/${TARGET_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples CONFIGURATIONS RelWithDebInfo)
|
||||
INSTALL(FILES ${OUTPUT_BINDIR}/${TARGET_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples CONFIGURATIONS Debug)
|
||||
ENDIF(MSVC)
|
||||
ENDIF(APPLE)
|
||||
|
||||
|
||||
38
README.md
38
README.md
@@ -7,13 +7,13 @@
|
||||
|
||||
Welcome to the OpenSceneGraph (OSG).
|
||||
|
||||
For up-to-date information on the project, in-depth details on how to compile and run libraries and examples, see the documentation on the OpenSceneGraph website:
|
||||
For information on the project, in-depth details on how to compile and run libraries and examples, see the documentation on the OpenSceneGraph website:
|
||||
|
||||
http://www.openscenegraph.org/index.php/documentation
|
||||
http://www.openscenegraph.org/index.php/documentation
|
||||
|
||||
For support subscribe to our public mailing list or forum, details at:
|
||||
For support please use the github OpenSceneGraph Discussions forum:
|
||||
|
||||
http://www.openscenegraph.org/index.php/support
|
||||
https://github.com/openscenegraph/OpenSceneGraph/discussions
|
||||
|
||||
For the impatient, we've included quick build instructions below, these are are broken down is three parts:
|
||||
|
||||
@@ -25,17 +25,22 @@ If details below are not sufficient then head over to the openscenegraph.org to
|
||||
|
||||
Robert Osfield.
|
||||
Project Lead.
|
||||
14th September 2018.
|
||||
31th January 2020.
|
||||
|
||||
---
|
||||
|
||||
## Section 1. How to build OpenSceneGraph
|
||||
|
||||
If you are using the [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager you can download and install OpenSceneGraph from source with CMake integration using a single command:
|
||||
```
|
||||
vcpkg install osg
|
||||
```
|
||||
|
||||
The OpenSceneGraph uses the CMake build system to generate a platform-specific build environment. CMake reads the `CMakeLists.txt` files that you'll find throughout the OpenSceneGraph directories, checks for installed dependencies and then generates files for the selected build system.
|
||||
|
||||
If you don't already have CMake installed on your system you can grab it from http://www.cmake.org, use version 2.8.0 or later. Details on the OpenSceneGraph's CMake build can be found at:
|
||||
|
||||
http://www.openscenegraph.org/projects/osg/wiki/Build/CMake
|
||||
http://www.openscenegraph.org/projects/osg/wiki/Build/CMake
|
||||
|
||||
Under Unix-like systems (i.e. Linux, IRIX, Solaris, Free-BSD, HP-UX, AIX, macOS) use the `cmake` or `ccmake` command-line utils. Note that `cmake .` defaults to building Release to ensure that you get the best performance from your final libraries/applications.
|
||||
|
||||
@@ -54,13 +59,13 @@ Alternatively, you can create an out-of-source build directory and run cmake or
|
||||
|
||||
Under Windows use the GUI tool CMakeSetup to build your VisualStudio files. The following page on our wiki dedicated to the CMake build system should help guide you through the process:
|
||||
|
||||
http://www.openscenegraph.org/index.php/documentation/platform-specifics/windows
|
||||
http://www.openscenegraph.org/index.php/documentation/platform-specifics/windows
|
||||
|
||||
Under macOS you can either use the CMake build system above, or use the Xcode projects that you will find in the OpenSceneGraph/Xcode directory. See release notes on macOS CMake build below.
|
||||
|
||||
For further details on compilation, installation and platform-specific information read "Getting Started" guide:
|
||||
|
||||
http://www.openscenegraph.org/index.php/documentation/10-getting-started
|
||||
http://www.openscenegraph.org/index.php/documentation/10-getting-started
|
||||
|
||||
|
||||
## Section 2. Release notes on macOS build, by Eric Sokolowski et al.
|
||||
@@ -88,13 +93,14 @@ Many of the example programs use command-line arguments. When double-clicking on
|
||||
|
||||
## Section 3. Release notes on iOS build, by Thomas Hogarth
|
||||
|
||||
With CMake, XCode and the iOS sdk installed you can generate an iOS XCode project using the following command line:
|
||||
With CMake 3.11, XCode 9.4 and the iOS sdk 11.4 installed you can generate an iOS XCode project using the following command line:
|
||||
|
||||
export THIRDPARTY_PATH=/path/to/my/3rdParty
|
||||
export THIRDPARTY_PATH=/path/to/3rdParty
|
||||
cmake ./ -G Xcode -DOSG_BUILD_PLATFORM_IPHONE:BOOL=ON \
|
||||
-DIPHONE_SDKVER="10.2" \
|
||||
-DIPHONE_VERSION_MIN="8.0" \
|
||||
-DOPENGL_PROFILE:STRING=GLES2 \
|
||||
-DIPHONE_SDKVER="11.4" \
|
||||
-DIPHONE_VERSION_MIN="10.0" \
|
||||
-DOPENGL_PROFILE:STRING=GLES3 \
|
||||
-DOSG_CPP_EXCEPTIONS_AVAILABLE:BOOL=ON \
|
||||
-DBUILD_OSG_APPLICATIONS:BOOL=OFF \
|
||||
-DBUILD_OSG_EXAMPLES:BOOL=ON \
|
||||
-DOSG_WINDOWING_SYSTEM:STRING=IOS \
|
||||
@@ -105,15 +111,15 @@ With CMake, XCode and the iOS sdk installed you can generate an iOS XCode projec
|
||||
-DCURL_LIBRARY:PATH="$THIRDPARTY_PATH/curl-ios-device/lib/libcurl.a" \
|
||||
-DFREETYPE_INCLUDE_DIR_freetype2:PATH="$THIRDPARTY_PATH/freetype-ios-universal/include/freetype" \
|
||||
-DFREETYPE_INCLUDE_DIR_ft2build:PATH="$THIRDPARTY_PATH/freetype-ios-universal/include" \
|
||||
-DFREETYPE_LIBRARY:PATH="$THIRDPARTY_PATH/freetype-ios-universal/lib/libFreeType_iphone_universal.a" \
|
||||
-DFREETYPE_LIBRARY:PATH="$THIRDPARTY_PATH/freetype-ios-universal/lib/libFreetype2.a" \
|
||||
-DTIFF_INCLUDE_DIR:PATH="$THIRDPARTY_PATH/tiff-ios-device/include" \
|
||||
-DTIFF_LIBRARY:PATH="$THIRDPARTY_PATH/tiff-ios-device/lib/libtiff.a" \
|
||||
-DGDAL_INCLUDE_DIR:PATH="$THIRDPARTY_PATH/gdal-ios-device/include" \
|
||||
-DGDAL_LIBRARY:PATH="$THIRDPARTY_PATH/gdal-ios-device/lib/libgdal.a"
|
||||
|
||||
|
||||
Be sure to set the THIRDPARTY_PATH to the path containing your thirdparty dependencies. Set IPHONE_SDKVER to the version of the iOS sdk you have installed, in this instance 10.2. IPHONE_VERSION_MIN controls the base sdk used by xcode, and lastly set OPENGL_PROFILE to the version of GLES you want to use.
|
||||
Be sure to set the THIRDPARTY_PATH to the path containing your thirdparty dependencies. Set IPHONE_SDKVER to the version of the iOS sdk you have installed, in this instance 11.4. IPHONE_VERSION_MIN controls the deployment sdk used by xcode, and lastly set OPENGL_PROFILE to the version of GLES you want to use.
|
||||
|
||||
Once this completes an XCode project will have been generated in the osg root folder. Open the generated Xcode project, select the example_osgViewerIPhone target. In 'General' tab set a development team. In the 'Build Settings' tab search for 'Other Linker Flags', then for each target type (debug, release etc) that you want to use open the list of arguments and delete the 'OpenGL' line and the '-framework' line above it. This is because cmake has tried to add the desktop OpenGL library which we don't want.
|
||||
Once this completes an XCode project will have been generated in the osg root folder. Open the generated Xcode project, select the example_osgViewerIPhone target. In 'General' tab set a development team.
|
||||
|
||||
Once this is done you should be able to build and deploy the `example_osgViewerIPhone` target on your device.
|
||||
|
||||
@@ -771,7 +771,7 @@ int main( int argc, char **argv )
|
||||
osgDB::Registry::instance()->getOptions()->setObjectCacheHint(osgDB::Options::CACHE_ALL);
|
||||
}
|
||||
|
||||
std::string fileNameOut("converted.osg");
|
||||
std::string fileNameOut("converted.osgt");
|
||||
if (fileNames.size()>1)
|
||||
{
|
||||
fileNameOut = fileNames.back();
|
||||
@@ -780,29 +780,66 @@ int main( int argc, char **argv )
|
||||
|
||||
osg::Timer_t startTick = osg::Timer::instance()->tick();
|
||||
|
||||
osg::ref_ptr<osg::Node> root = osgDB::readRefNodeFiles(fileNames);
|
||||
typedef std::vector< osg::ref_ptr<osg::Image> > Images;
|
||||
typedef std::vector< osg::ref_ptr<osg::Node> > Nodes;
|
||||
typedef std::vector< osg::ref_ptr<osg::Object> > Objects;
|
||||
|
||||
if (root.valid())
|
||||
Images images;
|
||||
Nodes nodes;
|
||||
Objects objects;
|
||||
|
||||
for(FileNameList::iterator itr = fileNames.begin();
|
||||
itr != fileNames.end();
|
||||
++itr)
|
||||
{
|
||||
osg::Timer_t endTick = osg::Timer::instance()->tick();
|
||||
osg::notify(osg::INFO)<<"Time to load files "<<osg::Timer::instance()->delta_m(startTick, endTick)<<" ms"<<std::endl;
|
||||
osg::ref_ptr<osg::Object> object = osgDB::readObjectFile(*itr);
|
||||
if (object.valid())
|
||||
{
|
||||
if (object->asNode()) nodes.push_back(object->asNode());
|
||||
else if (object->asImage()) images.push_back(object->asImage());
|
||||
else objects.push_back(object);
|
||||
}
|
||||
}
|
||||
|
||||
if (images.empty() && nodes.empty() && objects.empty())
|
||||
{
|
||||
osg::notify(osg::NOTICE)<<"Warning: failed to load any files"<<std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
if (pruneStateSet)
|
||||
{
|
||||
PruneStateSetVisitor pssv;
|
||||
root->accept(pssv);
|
||||
}
|
||||
osg::Timer_t endTick = osg::Timer::instance()->tick();
|
||||
osg::notify(osg::INFO)<<"Time to load files "<<osg::Timer::instance()->delta_m(startTick, endTick)<<" ms"<<std::endl;
|
||||
|
||||
if (fixTransparencyMode != FixTransparencyVisitor::NO_TRANSPARANCY_FIXING)
|
||||
osg::ref_ptr<osg::Node> root;
|
||||
|
||||
if (nodes.size()==1) root = nodes.front();
|
||||
else if (nodes.size()>1)
|
||||
{
|
||||
FixTransparencyVisitor atv(fixTransparencyMode);
|
||||
root->accept(atv);
|
||||
osg::ref_ptr<osg::Group> group = new osg::Group;
|
||||
for(Nodes::iterator itr = nodes.begin();
|
||||
itr != nodes.end();
|
||||
++itr)
|
||||
{
|
||||
group->addChild(itr->get());
|
||||
}
|
||||
|
||||
root = group;
|
||||
}
|
||||
|
||||
if ( root.valid() )
|
||||
{
|
||||
if (pruneStateSet)
|
||||
{
|
||||
PruneStateSetVisitor pssv;
|
||||
root->accept(pssv);
|
||||
}
|
||||
|
||||
if (fixTransparencyMode != FixTransparencyVisitor::NO_TRANSPARANCY_FIXING)
|
||||
{
|
||||
FixTransparencyVisitor atv(fixTransparencyMode);
|
||||
root->accept(atv);
|
||||
}
|
||||
|
||||
if (smooth)
|
||||
{
|
||||
@@ -868,6 +905,20 @@ int main( int argc, char **argv )
|
||||
osg::notify(osg::NOTICE)<<result.message()<< std::endl;
|
||||
}
|
||||
}
|
||||
else if (!images.empty())
|
||||
{
|
||||
if (images.size()>1)
|
||||
{
|
||||
OSG_NOTICE<<"Warning: osgconv does not support writing multiple to a single file."<<std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
osgDB::writeImageFile(*images.front(), fileNameOut);
|
||||
}
|
||||
else if (!objects.empty())
|
||||
{
|
||||
osgDB::writeObjectFile(*images.front(), fileNameOut);
|
||||
}
|
||||
else
|
||||
{
|
||||
osg::notify(osg::NOTICE)<<"Error no data loaded."<< std::endl;
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <osg/Plane>
|
||||
#include <osg/BoundingBox>
|
||||
#include <osg/BoundingSphere>
|
||||
#include <osg/Quat>
|
||||
|
||||
#ifdef BUILD_CONTRIBUTORS
|
||||
extern void printContributors(const std::string& changeLog, bool printNumEntries);
|
||||
@@ -40,6 +41,7 @@ int main( int argc, char** argv)
|
||||
arguments.getApplicationUsage()->addCommandLineOption("Plane::value_type", "Print the value of Plane::value_type");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("BoundingSphere::value_type", "Print the value of BoundingSphere::value_type");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("BoundingBox::value_type", "Print the value of BoundingBox::value_type");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("Quat::value_type", "Print the value of Quat::value_type");
|
||||
|
||||
#ifdef BUILD_CONTRIBUTORS
|
||||
arguments.getApplicationUsage()->addCommandLineOption("-r <file> or --read <file>", "Read the ChangeLog to generate an estimated contributors list.");
|
||||
@@ -139,6 +141,12 @@ int main( int argc, char** argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (arguments.read("Quat::value_type"))
|
||||
{
|
||||
cout << ((sizeof(osg::Quat::value_type) == 4) ? "float" : "double") << endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
cout << osgGetLibraryName() << " " << osgGetVersion() << endl << endl;
|
||||
|
||||
#ifdef BUILD_CONTRIBUTORS
|
||||
|
||||
@@ -48,6 +48,7 @@ int main(int argc, char** argv)
|
||||
arguments.getApplicationUsage()->addCommandLineOption("-p <filename>","Play specified camera path animation file, previously saved with 'z' key.");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--speed <factor>","Speed factor for animation playing (1 == normal speed).");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--device <device-name>","add named device to the viewer");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--stats","print out load and compile timing stats");
|
||||
|
||||
osgViewer::Viewer viewer(arguments);
|
||||
|
||||
@@ -71,6 +72,8 @@ int main(int argc, char** argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool printStats = arguments.read("--stats");
|
||||
|
||||
std::string url, username, password;
|
||||
while(arguments.read("--login",url, username, password))
|
||||
{
|
||||
@@ -109,7 +112,7 @@ int main(int argc, char** argv)
|
||||
while (arguments.read("-p",pathfile))
|
||||
{
|
||||
osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile);
|
||||
if (apm || !apm->valid())
|
||||
if (apm && !apm->getAnimationPath()->empty())
|
||||
{
|
||||
apm->setTimeScale(animationSpeed);
|
||||
|
||||
@@ -147,6 +150,8 @@ int main(int argc, char** argv)
|
||||
// add the screen capture handler
|
||||
viewer.addEventHandler(new osgViewer::ScreenCaptureHandler);
|
||||
|
||||
osg::ElapsedTime elapsedTime;
|
||||
|
||||
// load the data
|
||||
osg::ref_ptr<osg::Node> loadedModel = osgDB::readRefNodeFiles(arguments);
|
||||
if (!loadedModel)
|
||||
@@ -155,6 +160,15 @@ int main(int argc, char** argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (printStats)
|
||||
{
|
||||
double loadTime = elapsedTime.elapsedTime_m();
|
||||
std::cout<<"Load time "<<loadTime<<"ms"<<std::endl;
|
||||
|
||||
viewer.getStats()->collectStats("compile", true);
|
||||
}
|
||||
|
||||
|
||||
// any option left unread are converted into errors to write out later.
|
||||
arguments.reportRemainingOptionsAsUnrecognized();
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <errno.h>
|
||||
|
||||
#if !defined (WIN32) || defined(__CYGWIN__)
|
||||
#if !defined (_WIN32) || defined(__CYGWIN__)
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/socket.h>
|
||||
@@ -51,7 +51,7 @@
|
||||
#elif defined (__APPLE__)
|
||||
#include <unistd.h>
|
||||
#include <sys/sockio.h>
|
||||
#elif defined (WIN32)
|
||||
#elif defined (_WIN32)
|
||||
#include <winsock.h>
|
||||
#include <stdio.h>
|
||||
#elif defined (__hpux)
|
||||
@@ -63,7 +63,7 @@
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
||||
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||
#include <winsock.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
@@ -265,7 +265,7 @@ Receiver::Receiver( void )
|
||||
|
||||
Receiver::~Receiver( void )
|
||||
{
|
||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
||||
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||
closesocket( _so);
|
||||
#else
|
||||
close( _so );
|
||||
@@ -274,7 +274,7 @@ Receiver::~Receiver( void )
|
||||
|
||||
bool Receiver::init( void )
|
||||
{
|
||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||
WORD version = MAKEWORD(1,1);
|
||||
WSADATA wsaData;
|
||||
// First, we start up Winsock
|
||||
@@ -295,7 +295,7 @@ bool Receiver::init( void )
|
||||
|
||||
int result = 0;
|
||||
|
||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
||||
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||
// const BOOL on = TRUE;
|
||||
// setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char*) &on, sizeof(int));
|
||||
#else
|
||||
@@ -305,14 +305,14 @@ bool Receiver::init( void )
|
||||
|
||||
if (result)
|
||||
{
|
||||
OSG_NOTICE<<"Warning: Reciever::init() setsockopt(..) failed, errno="<<errno<<std::endl;
|
||||
OSG_NOTICE<<"Warning: Receiver::init() setsockopt(..) failed, errno="<<errno<<std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
// struct sockaddr_in saddr;
|
||||
saddr.sin_family = AF_INET;
|
||||
saddr.sin_port = htons( _port );
|
||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
||||
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||
saddr.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||
#else
|
||||
saddr.sin_addr.s_addr = 0;
|
||||
@@ -366,7 +366,7 @@ void Receiver::sync( void )
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 0;
|
||||
|
||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
||||
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||
// saddr.sin_port = htons( _port );
|
||||
int result = recvfrom( _so, (char *)_buffer, _buffer_size, 0, (sockaddr*)&saddr, &size );
|
||||
// recvfrom(sock_Receive, szMessage, 256, 0, (sockaddr*)&addr_Cli, &clilen)
|
||||
@@ -419,7 +419,7 @@ Broadcaster::Broadcaster( void )
|
||||
|
||||
Broadcaster::~Broadcaster( void )
|
||||
{
|
||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
||||
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||
closesocket( _so);
|
||||
#else
|
||||
close( _so );
|
||||
@@ -428,7 +428,7 @@ Broadcaster::~Broadcaster( void )
|
||||
|
||||
bool Broadcaster::init( void )
|
||||
{
|
||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
||||
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||
WORD version = MAKEWORD(1,1);
|
||||
WSADATA wsaData;
|
||||
// First, we start up Winsock
|
||||
@@ -446,7 +446,7 @@ bool Broadcaster::init( void )
|
||||
perror( "Socket" );
|
||||
return false;
|
||||
}
|
||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
||||
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||
const BOOL on = TRUE;
|
||||
#else
|
||||
int on = 1;
|
||||
@@ -454,7 +454,7 @@ bool Broadcaster::init( void )
|
||||
|
||||
int result = 0;
|
||||
|
||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
||||
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||
result = setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char *) &on, sizeof(int));
|
||||
#else
|
||||
result = setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
|
||||
@@ -466,24 +466,24 @@ bool Broadcaster::init( void )
|
||||
saddr.sin_port = htons( _port );
|
||||
if( _address == 0 )
|
||||
{
|
||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
||||
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||
result = setsockopt( _so, SOL_SOCKET, SO_BROADCAST, (const char *) &on, sizeof(int));
|
||||
#else
|
||||
result = setsockopt( _so, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on));
|
||||
#endif
|
||||
if (result) return false;
|
||||
|
||||
#if !defined (WIN32) || defined(__CYGWIN__)
|
||||
#if !defined (_WIN32) || defined(__CYGWIN__)
|
||||
struct ifreq ifr;
|
||||
#endif
|
||||
#if defined (__linux) || defined(__CYGWIN__)
|
||||
strcpy( ifr.ifr_name, "eth0" );
|
||||
#elif defined(__sun)
|
||||
strcpy( ifr.ifr_name, "hme0" );
|
||||
#elif !defined (WIN32)
|
||||
#elif !defined (_WIN32)
|
||||
strcpy( ifr.ifr_name, "ef0" );
|
||||
#endif
|
||||
#if defined (WIN32) // get the server address
|
||||
#if defined (_WIN32) // get the server address
|
||||
saddr.sin_addr.s_addr = htonl(INADDR_BROADCAST);
|
||||
}
|
||||
#else
|
||||
@@ -543,7 +543,7 @@ void Broadcaster::sync( void )
|
||||
}
|
||||
|
||||
int result = 0;
|
||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
||||
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||
unsigned int size = sizeof( SOCKADDR_IN );
|
||||
result = sendto( _so, (const char *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size );
|
||||
// int err = WSAGetLastError ();
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include <osgViewer/Viewer>
|
||||
|
||||
#if !defined(WIN32) || defined(__CYGWIN__)
|
||||
#if !defined(_WIN32) || defined(__CYGWIN__)
|
||||
#include <netinet/in.h>
|
||||
#else
|
||||
#include "winsock.h"
|
||||
@@ -51,7 +51,7 @@ class Receiver
|
||||
bool init( void );
|
||||
|
||||
private :
|
||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
||||
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||
SOCKET _so;
|
||||
SOCKADDR_IN saddr;
|
||||
#else
|
||||
@@ -94,7 +94,7 @@ class Broadcaster
|
||||
bool init( void );
|
||||
|
||||
private :
|
||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||
SOCKET _so;
|
||||
#else
|
||||
int _so;
|
||||
@@ -103,7 +103,7 @@ class Broadcaster
|
||||
short _port;
|
||||
void *_buffer;
|
||||
unsigned int _buffer_size;
|
||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||
SOCKADDR_IN saddr;
|
||||
#else
|
||||
struct sockaddr_in saddr;
|
||||
|
||||
@@ -484,7 +484,7 @@ int main( int argc, char **argv )
|
||||
while (arguments.read("-p",pathfile))
|
||||
{
|
||||
osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile);
|
||||
if (apm || !apm->valid())
|
||||
if (apm && !apm->getAnimationPath()->empty())
|
||||
{
|
||||
unsigned int num = keyswitchManipulator->getNumMatrixManipulators();
|
||||
keyswitchManipulator->addMatrixManipulator( keyForAnimationPath, "Path", apm );
|
||||
@@ -508,7 +508,7 @@ int main( int argc, char **argv )
|
||||
|
||||
viewer.addEventHandler( new osgViewer::WindowSizeHandler() );
|
||||
|
||||
// neeed to address.
|
||||
// need to address.
|
||||
// viewer.getScene()->getUpdateVisitor()->setTraversalMode(osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN);
|
||||
|
||||
|
||||
@@ -558,7 +558,7 @@ int main( int argc, char **argv )
|
||||
while (arguments.read("--loop")) loopPresentation = true;
|
||||
|
||||
{
|
||||
// set update hte default traversal mode settings for update visitor
|
||||
// set update the default traversal mode settings for update visitor
|
||||
// default to osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN.
|
||||
osg::NodeVisitor::TraversalMode updateTraversalMode = osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN; // viewer.getUpdateVisitor()->getTraversalMode();
|
||||
|
||||
@@ -690,7 +690,7 @@ int main( int argc, char **argv )
|
||||
// any option left unread are converted into errors to write out later.
|
||||
//arguments.reportRemainingOptionsAsUnrecognized();
|
||||
|
||||
// report any errors if they have ocured when parsing the program aguments.
|
||||
// report any errors if they have ocured when parsing the program arguments.
|
||||
if (arguments.errors())
|
||||
{
|
||||
arguments.writeErrorMessages(osg::notify(osg::INFO));
|
||||
|
||||
@@ -243,13 +243,11 @@ ELSE(DYNAMIC_OPENSCENEGRAPH)
|
||||
#needed on win32 or the linker get confused by _declspec declarations
|
||||
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
|
||||
|
||||
ADD_SUBDIRECTORY(osgstaticviewer)
|
||||
|
||||
# IPHONE_PORT@tom
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE)
|
||||
ADD_SUBDIRECTORY(osgviewerIPhone)
|
||||
ELSE()
|
||||
ADD_SUBDIRECTORY(osgstaticviewer)
|
||||
ENDIF()
|
||||
# IPHONE_PORT@tom
|
||||
|
||||
ENDIF(DYNAMIC_OPENSCENEGRAPH)
|
||||
|
||||
|
||||
@@ -103,7 +103,9 @@ void OsgMainApp::initOsgWindow(int x,int y,int width,int height){
|
||||
osg::notify(osg::ALWAYS)<<"Testing"<<std::endl;
|
||||
|
||||
_viewer = new osgViewer::Viewer();
|
||||
_viewer->setUpViewerAsEmbeddedInWindow(x, y, width, height);
|
||||
osgViewer::GraphicsWindowEmbedded* window = _viewer->setUpViewerAsEmbeddedInWindow(x, y, width, height);
|
||||
_viewer->getEventQueue()->setGraphicsContext(window);
|
||||
_viewer->getEventQueue()->syncWindowRectangleWithGraphicsContext();
|
||||
_viewer->setThreadingModel(osgViewer::ViewerBase::SingleThreaded);
|
||||
|
||||
_root = new osg::Group();
|
||||
|
||||
@@ -113,7 +113,7 @@ int main(int argc, char** argv)
|
||||
while (arguments.read("-p",pathfile))
|
||||
{
|
||||
osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile);
|
||||
if (apm || !apm->valid())
|
||||
if (apm && !apm->getAnimationPath()->empty())
|
||||
{
|
||||
apm->setTimeScale(animationSpeed);
|
||||
|
||||
|
||||
@@ -312,7 +312,7 @@ int main( int argc, char **argv )
|
||||
osg::CoordinateSystemNode* csn = findTopMostNodeOfType<osg::CoordinateSystemNode>(loadedModel.get());
|
||||
if(!csn) return 1;
|
||||
|
||||
// Compute eye point in world coordiantes
|
||||
// Compute eye point in world coordinates
|
||||
osg::Vec3d eye;
|
||||
csn->getEllipsoidModel()->convertLatLongHeightToXYZ(lat, lon, alt, eye.x(), eye.y(), eye.z());
|
||||
|
||||
|
||||
@@ -184,7 +184,7 @@ int main( int argc, char **argv )
|
||||
// use an ArgumentParser object to manage the program arguments.
|
||||
osg::ArgumentParser arguments(&argc,argv);
|
||||
|
||||
// set the osgDB::Registy read file callback to catch all requests for reading files.
|
||||
// set the osgDB::Registry read file callback to catch all requests for reading files.
|
||||
osgDB::Registry::instance()->setReadFileCallback(new MyReadFileCallback());
|
||||
|
||||
// initialize the viewer.
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <iostream>
|
||||
|
||||
#if !defined (WIN32) || defined(__CYGWIN__)
|
||||
#if !defined (_WIN32) || defined(__CYGWIN__)
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/socket.h>
|
||||
@@ -54,7 +54,7 @@
|
||||
#elif defined (__APPLE__)
|
||||
#include <unistd.h>
|
||||
#include <sys/sockio.h>
|
||||
#elif defined (WIN32)
|
||||
#elif defined (_WIN32)
|
||||
#include <winsock.h>
|
||||
#include <stdio.h>
|
||||
#elif defined (__hpux)
|
||||
@@ -73,7 +73,7 @@ Broadcaster::Broadcaster( void )
|
||||
_ifr_name = "eth0";
|
||||
#elif defined(__sun)
|
||||
_ifr_name = "hme0";
|
||||
#elif !defined (WIN32)
|
||||
#elif !defined (_WIN32)
|
||||
_ifr_name = "ef0";
|
||||
#endif
|
||||
_port = 0;
|
||||
@@ -84,7 +84,7 @@ Broadcaster::Broadcaster( void )
|
||||
|
||||
Broadcaster::~Broadcaster( void )
|
||||
{
|
||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
||||
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||
closesocket( _so);
|
||||
#else
|
||||
close( _so );
|
||||
@@ -93,7 +93,7 @@ Broadcaster::~Broadcaster( void )
|
||||
|
||||
bool Broadcaster::init( void )
|
||||
{
|
||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
||||
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||
WORD version = MAKEWORD(1,1);
|
||||
WSADATA wsaData;
|
||||
// First, we start up Winsock
|
||||
@@ -111,13 +111,13 @@ bool Broadcaster::init( void )
|
||||
perror( "Socket" );
|
||||
return false;
|
||||
}
|
||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
||||
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||
const BOOL on = TRUE;
|
||||
#else
|
||||
int on = 1;
|
||||
#endif
|
||||
|
||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
||||
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||
setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char *) &on, sizeof(int));
|
||||
#else
|
||||
setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
|
||||
@@ -127,17 +127,17 @@ bool Broadcaster::init( void )
|
||||
saddr.sin_port = htons( _port );
|
||||
if( _address == 0 )
|
||||
{
|
||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
||||
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||
setsockopt( _so, SOL_SOCKET, SO_BROADCAST, (const char *) &on, sizeof(int));
|
||||
#else
|
||||
setsockopt( _so, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on));
|
||||
#endif
|
||||
|
||||
#if !defined (WIN32) || defined(__CYGWIN__)
|
||||
#if !defined (_WIN32) || defined(__CYGWIN__)
|
||||
struct ifreq ifr;
|
||||
strcpy( ifr.ifr_name, _ifr_name.c_str());
|
||||
#endif
|
||||
#if defined (WIN32) // get the server address
|
||||
#if defined (_WIN32) // get the server address
|
||||
saddr.sin_addr.s_addr = htonl(INADDR_BROADCAST);
|
||||
}
|
||||
#else
|
||||
@@ -202,7 +202,7 @@ void Broadcaster::sync( void )
|
||||
return;
|
||||
}
|
||||
|
||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
||||
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||
unsigned int size = sizeof( SOCKADDR_IN );
|
||||
sendto( _so, (const char *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size );
|
||||
int err = WSAGetLastError ();
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
// Class definition for broadcasting a buffer to a LAN
|
||||
//
|
||||
|
||||
#if !defined(WIN32) || defined(__CYGWIN__)
|
||||
#if !defined(_WIN32) || defined(__CYGWIN__)
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
|
||||
@@ -65,7 +65,7 @@ class Broadcaster
|
||||
|
||||
std::string _ifr_name;
|
||||
|
||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||
SOCKET _so;
|
||||
#else
|
||||
int _so;
|
||||
@@ -74,7 +74,7 @@ class Broadcaster
|
||||
short _port;
|
||||
void *_buffer;
|
||||
unsigned int _buffer_size;
|
||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||
SOCKADDR_IN saddr;
|
||||
#else
|
||||
struct sockaddr_in saddr;
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
||||
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||
#include <winsock.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
||||
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||
#include <winsock.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
@@ -46,7 +46,7 @@ Receiver::Receiver( void )
|
||||
|
||||
Receiver::~Receiver( void )
|
||||
{
|
||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
||||
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||
closesocket( _so);
|
||||
#else
|
||||
close( _so );
|
||||
@@ -55,7 +55,7 @@ Receiver::~Receiver( void )
|
||||
|
||||
bool Receiver::init( void )
|
||||
{
|
||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||
WORD version = MAKEWORD(1,1);
|
||||
WSADATA wsaData;
|
||||
// First, we start up Winsock
|
||||
@@ -73,7 +73,7 @@ bool Receiver::init( void )
|
||||
perror( "Socket" );
|
||||
return false;
|
||||
}
|
||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
||||
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||
// const BOOL on = TRUE;
|
||||
// setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char*) &on, sizeof(int));
|
||||
#else
|
||||
@@ -84,7 +84,7 @@ bool Receiver::init( void )
|
||||
// struct sockaddr_in saddr;
|
||||
saddr.sin_family = AF_INET;
|
||||
saddr.sin_port = htons( _port );
|
||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
||||
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||
saddr.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||
#else
|
||||
saddr.sin_addr.s_addr = 0;
|
||||
@@ -137,7 +137,7 @@ unsigned int Receiver::sync( void )
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 0;
|
||||
|
||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
||||
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||
// saddr.sin_port = htons( _port );
|
||||
recvfrom( _so, (char *)_buffer, _buffer_size, 0, (sockaddr*)&saddr, &size );
|
||||
// recvfrom(sock_Receive, szMessage, 256, 0, (sockaddr*)&addr_Cli, &clilen)
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
// Class definition for the recipient of a broadcasted message
|
||||
//
|
||||
|
||||
#if !defined(WIN32) || defined(__CYGWIN__)
|
||||
#if !defined(_WIN32) || defined(__CYGWIN__)
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
|
||||
@@ -53,7 +53,7 @@ class Receiver
|
||||
bool init( void );
|
||||
|
||||
private :
|
||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
||||
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||
SOCKET _so;
|
||||
SOCKADDR_IN saddr;
|
||||
#else
|
||||
|
||||
@@ -211,7 +211,7 @@ int main( int argc, char **argv )
|
||||
|
||||
// ------------- Start of copy specific code -------------------------------------------------------
|
||||
|
||||
// do a deep copy, using MyCopyOp to reveal whats going on under the hood,
|
||||
// do a deep copy, using MyCopyOp to reveal what's going on under the hood,
|
||||
// in your own code you'd typically just use the basic osg::CopyOp something like
|
||||
osg::ref_ptr<osg::Node> mycopy = dynamic_cast<osg::Node*>(rootnode->clone(osg::CopyOp::DEEP_COPY_ALL));
|
||||
std::cout << "Doing a deep copy of scene graph"<<std::endl;
|
||||
|
||||
@@ -128,7 +128,7 @@ int main( int argc, char **argv )
|
||||
osg::ArgumentParser arguments(&argc,argv);
|
||||
|
||||
// construct the viewer.
|
||||
osgViewer::Viewer viewer;
|
||||
osgViewer::Viewer viewer(arguments);
|
||||
|
||||
// add the state manipulator
|
||||
viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) );
|
||||
|
||||
@@ -59,6 +59,7 @@ createStateSet()
|
||||
// render each instance uniquely. gl_InstanceID will be in the range
|
||||
// 0 to numInstances-1 (1023 in our case).
|
||||
std::string vertexSource =
|
||||
"#extension GL_EXT_gpu_shader4 : enable\n"
|
||||
"uniform sampler2D osgLogo; \n"
|
||||
"uniform float osg_SimulationTime; \n"
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include <osg/FragmentProgram>
|
||||
|
||||
#include <osgDB/ReadFile>
|
||||
#include <osgDB/WriteFile>
|
||||
#include <osgDB/FileUtils>
|
||||
|
||||
#include <osgUtil/LineSegmentIntersector>
|
||||
@@ -64,6 +65,18 @@ public:
|
||||
|
||||
ForestTechniqueManager() {}
|
||||
|
||||
enum Features
|
||||
{
|
||||
HUD_TEXT = 1,
|
||||
BILLBOARD_GRAPH = 2,
|
||||
X_GRAPH = 4,
|
||||
TRANSFORM_GRAPH = 8,
|
||||
SHADER_GRAPH = 16,
|
||||
GEOMETRY_SHADER_GRAPH = 32,
|
||||
TEXTURE_BUFFER_GRAPH = 64,
|
||||
ALL_FEATURES = (TEXTURE_BUFFER_GRAPH<<1)-1
|
||||
};
|
||||
|
||||
class Tree : public osg::Referenced
|
||||
{
|
||||
public:
|
||||
@@ -150,7 +163,7 @@ public:
|
||||
|
||||
osg::Node* createHUDWithText(const std::string& text);
|
||||
|
||||
osg::Node* createScene(unsigned int numTreesToCreates, unsigned int maxNumTreesPerCell);
|
||||
osg::Node* createScene(unsigned int numTreesToCreates, unsigned int maxNumTreesPerCell, unsigned int mask=ALL_FEATURES);
|
||||
|
||||
void advanceToNextTechnique(int delta=1)
|
||||
{
|
||||
@@ -803,6 +816,18 @@ class ShaderGeometry : public osg::Drawable
|
||||
|
||||
typedef std::vector<osg::Vec4> PositionSizeList;
|
||||
|
||||
virtual void resizeGLObjectBuffers(unsigned int maxSize)
|
||||
{
|
||||
osg::Drawable::resizeGLObjectBuffers(maxSize);
|
||||
if (_geometry) _geometry->resizeGLObjectBuffers(maxSize);
|
||||
}
|
||||
|
||||
virtual void releaseGLObjects(osg::State* state) const
|
||||
{
|
||||
osg::Drawable::releaseGLObjects(state);
|
||||
if (_geometry) _geometry->releaseGLObjects(state);
|
||||
}
|
||||
|
||||
virtual void drawImplementation(osg::RenderInfo& renderInfo) const
|
||||
{
|
||||
for(PositionSizeList::const_iterator itr = _trees.begin();
|
||||
@@ -1160,7 +1185,7 @@ osg::Node* ForestTechniqueManager::createHUDWithText(const std::string& str)
|
||||
return projection;
|
||||
}
|
||||
|
||||
osg::Node* ForestTechniqueManager::createScene(unsigned int numTreesToCreates, unsigned int maxNumTreesPerCell)
|
||||
osg::Node* ForestTechniqueManager::createScene(unsigned int numTreesToCreates, unsigned int maxNumTreesPerCell, unsigned int mask)
|
||||
{
|
||||
osg::Vec3 origin(0.0f,0.0f,0.0f);
|
||||
osg::Vec3 size(1000.0f,1000.0f,200.0f);
|
||||
@@ -1206,33 +1231,37 @@ osg::Node* ForestTechniqueManager::createScene(unsigned int numTreesToCreates, u
|
||||
|
||||
_techniqueSwitch = new osg::Switch;
|
||||
|
||||
if ((mask & BILLBOARD_GRAPH)!=0)
|
||||
{
|
||||
std::cout<<"Creating osg::Billboard based forest...";
|
||||
osg::Group* group = new osg::Group;
|
||||
group->addChild(createBillboardGraph(cell.get(),dstate));
|
||||
group->addChild(createHUDWithText("Using osg::Billboard's to create a forest\n\nPress left cursor key to select geometry instancing with Texture Buffer Object\nPress right cursor key to select double quad based forest"));
|
||||
if ((mask & HUD_TEXT)!=0) group->addChild(createHUDWithText("Using osg::Billboard's to create a forest\n\nPress left cursor key to select geometry instancing with Texture Buffer Object\nPress right cursor key to select double quad based forest"));
|
||||
_techniqueSwitch->addChild(group);
|
||||
std::cout<<"done."<<std::endl;
|
||||
}
|
||||
|
||||
if ((mask & X_GRAPH)!=0)
|
||||
{
|
||||
std::cout<<"Creating double quad based forest...";
|
||||
osg::Group* group = new osg::Group;
|
||||
group->addChild(createXGraph(cell.get(),dstate));
|
||||
group->addChild(createHUDWithText("Using double quads to create a forest\n\nPress left cursor key to select osg::Billboard based forest\nPress right cursor key to select osg::MatrixTransform based forest\n"));
|
||||
if ((mask & HUD_TEXT)!=0) group->addChild(createHUDWithText("Using double quads to create a forest\n\nPress left cursor key to select osg::Billboard based forest\nPress right cursor key to select osg::MatrixTransform based forest\n"));
|
||||
_techniqueSwitch->addChild(group);
|
||||
std::cout<<"done."<<std::endl;
|
||||
}
|
||||
|
||||
if ((mask & TRANSFORM_GRAPH)!=0)
|
||||
{
|
||||
std::cout<<"Creating osg::MatrixTransform based forest...";
|
||||
osg::Group* group = new osg::Group;
|
||||
group->addChild(createTransformGraph(cell.get(),dstate));
|
||||
group->addChild(createHUDWithText("Using osg::MatrixTransform's to create a forest\n\nPress left cursor key to select double quad based forest\nPress right cursor key to select osg::Vertex/FragmentProgram based forest"));
|
||||
if ((mask & HUD_TEXT)!=0) group->addChild(createHUDWithText("Using osg::MatrixTransform's to create a forest\n\nPress left cursor key to select double quad based forest\nPress right cursor key to select osg::Vertex/FragmentProgram based forest"));
|
||||
_techniqueSwitch->addChild(group);
|
||||
std::cout<<"done."<<std::endl;
|
||||
}
|
||||
|
||||
if ((mask & SHADER_GRAPH)!=0)
|
||||
{
|
||||
std::cout<<"Creating osg::Vertex/FragmentProgram based forest...";
|
||||
osg::Group* group = new osg::Group;
|
||||
@@ -1289,11 +1318,12 @@ osg::Node* ForestTechniqueManager::createScene(unsigned int numTreesToCreates, u
|
||||
}
|
||||
|
||||
group->addChild(createShaderGraph(cell.get(),stateset));
|
||||
group->addChild(createHUDWithText("Using osg::Vertex/FragmentProgram to create a forest\n\nPress left cursor key to select osg::MatrixTransform's based forest\nPress right cursor key to select OpenGL shader based forest"));
|
||||
if ((mask & HUD_TEXT)!=0) group->addChild(createHUDWithText("Using osg::Vertex/FragmentProgram to create a forest\n\nPress left cursor key to select osg::MatrixTransform's based forest\nPress right cursor key to select OpenGL shader based forest"));
|
||||
_techniqueSwitch->addChild(group);
|
||||
std::cout<<"done."<<std::endl;
|
||||
}
|
||||
|
||||
if ((mask & SHADER_GRAPH)!=0)
|
||||
{
|
||||
std::cout<<"Creating OpenGL shader based forest...";
|
||||
osg::Group* group = new osg::Group;
|
||||
@@ -1351,11 +1381,12 @@ osg::Node* ForestTechniqueManager::createScene(unsigned int numTreesToCreates, u
|
||||
}
|
||||
|
||||
group->addChild(createShaderGraph(cell.get(),stateset));
|
||||
group->addChild(createHUDWithText("Using OpenGL Shader to create a forest\n\nPress left cursor key to select osg::Vertex/FragmentProgram based forest\nPress right cursor key to select osg::Vertex/Geometry/FragmentProgram based forest"));
|
||||
if ((mask & HUD_TEXT)!=0) group->addChild(createHUDWithText("Using OpenGL Shader to create a forest\n\nPress left cursor key to select osg::Vertex/FragmentProgram based forest\nPress right cursor key to select osg::Vertex/Geometry/FragmentProgram based forest"));
|
||||
_techniqueSwitch->addChild(group);
|
||||
std::cout<<"done."<<std::endl;
|
||||
}
|
||||
|
||||
if ((mask & GEOMETRY_SHADER_GRAPH)!=0)
|
||||
{
|
||||
std::cout<<"Creating Geometry Shader based forest...";
|
||||
|
||||
@@ -1363,12 +1394,13 @@ osg::Node* ForestTechniqueManager::createScene(unsigned int numTreesToCreates, u
|
||||
|
||||
osg::Group* group = new osg::Group;
|
||||
group->addChild(createGeometryShaderGraph(cell.get(), stateset));
|
||||
group->addChild(createHUDWithText("Using osg::Vertex/Geometry/FragmentProgram to create a forest\n\nPress left cursor key to select OpenGL Shader based forest\nPress right cursor key to select geometry instancing with Texture Buffer Object"));
|
||||
if ((mask & HUD_TEXT)!=0) group->addChild(createHUDWithText("Using osg::Vertex/Geometry/FragmentProgram to create a forest\n\nPress left cursor key to select OpenGL Shader based forest\nPress right cursor key to select geometry instancing with Texture Buffer Object"));
|
||||
|
||||
_techniqueSwitch->addChild(group);
|
||||
std::cout<<"done."<<std::endl;
|
||||
}
|
||||
|
||||
if ((mask & TEXTURE_BUFFER_GRAPH)!=0)
|
||||
{
|
||||
std::cout<<"Creating forest using geometry instancing and texture buffer objects ...";
|
||||
|
||||
@@ -1430,7 +1462,7 @@ osg::Node* ForestTechniqueManager::createScene(unsigned int numTreesToCreates, u
|
||||
textureBufferGraph->setStateSet( stateset );
|
||||
osg::Group* group = new osg::Group;
|
||||
group->addChild(textureBufferGraph);
|
||||
group->addChild(createHUDWithText("Using geometry instancing to create a forest\n\nPress left cursor key to select osg::Vertex/Geometry/FragmentProgram based forest\nPress right cursor key to select osg::Billboard based forest"));
|
||||
if ((mask & HUD_TEXT)!=0) group->addChild(createHUDWithText("Using geometry instancing to create a forest\n\nPress left cursor key to select osg::Vertex/Geometry/FragmentProgram based forest\nPress right cursor key to select osg::Billboard based forest"));
|
||||
|
||||
_techniqueSwitch->addChild(group);
|
||||
|
||||
@@ -1466,6 +1498,16 @@ int main( int argc, char **argv )
|
||||
|
||||
arguments.read("--trees-per-cell",maxNumTreesPerCell);
|
||||
|
||||
|
||||
unsigned int features = ForestTechniqueManager::ALL_FEATURES;
|
||||
while(arguments.read("--features", features))
|
||||
{
|
||||
std::cout<<"features = "<<features<<std::endl;
|
||||
}
|
||||
|
||||
std::string outputFilename;
|
||||
while(arguments.read("-o", outputFilename)) {}
|
||||
|
||||
osg::ref_ptr<ForestTechniqueManager> ttm = new ForestTechniqueManager;
|
||||
|
||||
// add the stats handler
|
||||
@@ -1475,8 +1517,13 @@ int main( int argc, char **argv )
|
||||
viewer.addEventHandler(new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()));
|
||||
|
||||
// add model to viewer.
|
||||
viewer.setSceneData( ttm->createScene(numTreesToCreate, maxNumTreesPerCell) );
|
||||
viewer.setSceneData( ttm->createScene(numTreesToCreate, maxNumTreesPerCell, features) );
|
||||
|
||||
if (!outputFilename.empty())
|
||||
{
|
||||
osgDB::writeNodeFile(*viewer.getSceneData(), outputFilename);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return viewer.run();
|
||||
}
|
||||
|
||||
@@ -138,9 +138,7 @@ void getPossibleConfigs(GraphicsContext* gc, BufferConfigList& colorConfigs,
|
||||
return;
|
||||
if (ext->isMultisampleSupported)
|
||||
glGetIntegerv(GL_MAX_SAMPLES_EXT, &maxSamples);
|
||||
// isMultisampleCoverageSupported
|
||||
if (isGLExtensionSupported(contextID,
|
||||
"GL_NV_framebuffer_multisample_coverage"))
|
||||
if (ext->isRenderbufferMultisampleCoverageSupported())
|
||||
{
|
||||
glGetIntegerv(GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV,
|
||||
&coverageSampleConfigs);
|
||||
|
||||
@@ -77,7 +77,7 @@ int main( int argc, char **argv )
|
||||
arguments.getApplicationUsage()->addCommandLineOption("-o <filename>","Base output filename of the images, recommended to use something like Images/image.png");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--cs <filename>","Load pre-generated configuration file for run.");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--ouput-cs <filename>","Output configuration file with settings provided on commandline.");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("-p <filename>","Use specificied camera path file to control camera position.");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("-p <filename>","Use specified camera path file to control camera position.");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--offscreen","Use an pbuffer to render the images offscreen.");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--screen","Use an window to render the images.");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--width <width>","Window/output image width.");
|
||||
|
||||
@@ -148,7 +148,7 @@ osg::Node* createScene()
|
||||
|
||||
// create a Vec3Array and add to it all my coordinates.
|
||||
// Like all the *Array variants (see include/osg/Array) , Vec3Array is derived from both osg::Array
|
||||
// and std::vector<>. osg::Array's are reference counted and hence sharable,
|
||||
// and std::vector<>. osg::Array's are reference counted and hence shareable,
|
||||
// which std::vector<> provides all the convenience, flexibility and robustness
|
||||
// of the most popular of all STL containers.
|
||||
osg::Vec3Array* vertices = new osg::Vec3Array;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
#pragma warning( disable : 4244 )
|
||||
#endif
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
|
||||
#if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
|
||||
// disable the double to float errors.
|
||||
#pragma warning( disable : 4305 )
|
||||
#endif
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
|
||||
#if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
|
||||
// disable the double to float errors.
|
||||
#pragma warning( disable : 4305 )
|
||||
#endif
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
|
||||
#if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
|
||||
// disable the double to float errors.
|
||||
#pragma warning( disable : 4305 )
|
||||
#endif
|
||||
|
||||
@@ -64,7 +64,7 @@ void KeyboardModel::keyChange(int key, int virtualKey, int value)
|
||||
{
|
||||
osg::notify(osg::INFO) << "key value change, code="<<std::hex << key << "\t value="<< value << std::dec << std::endl;
|
||||
|
||||
// toggle the keys graphical representation on or off via osg::Swithc
|
||||
// toggle the keys graphical representation on or off via osg::Switch
|
||||
KeyModelMap::iterator itr = _keyModelMap.find(virtualKey);
|
||||
if (itr!=_keyModelMap.end())
|
||||
{
|
||||
|
||||
@@ -71,11 +71,11 @@ public:
|
||||
bool _addToModel;
|
||||
};
|
||||
|
||||
class DeleteSelectedNodesVisitor : public osg::NodeVisitor
|
||||
class SelectedNodesVisitor : public osg::NodeVisitor
|
||||
{
|
||||
public:
|
||||
|
||||
DeleteSelectedNodesVisitor():
|
||||
SelectedNodesVisitor():
|
||||
osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN)
|
||||
{
|
||||
}
|
||||
@@ -110,6 +110,23 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
osg::ref_ptr<osg::Node> createSelectedNodeSubgraph()
|
||||
{
|
||||
if (_selectedNodes.empty()) return osg::ref_ptr<osg::Node>();
|
||||
|
||||
if (_selectedNodes.size()==1) return _selectedNodes[0];
|
||||
|
||||
// note code doesn't yet handle selected nodes being nested within transforms.
|
||||
osg::ref_ptr<osg::Group> group;
|
||||
for(SelectedNodes::iterator itr = _selectedNodes.begin();
|
||||
itr != _selectedNodes.end();
|
||||
++itr)
|
||||
{
|
||||
group->addChild(*itr);
|
||||
}
|
||||
return group;
|
||||
}
|
||||
|
||||
typedef std::vector< osg::ref_ptr<osgFX::Scribe> > SelectedNodes;
|
||||
SelectedNodes _selectedNodes;
|
||||
|
||||
@@ -150,6 +167,18 @@ public:
|
||||
osg::notify(osg::NOTICE)<<"Saved model to file 'saved_model.osgt'"<<std::endl;
|
||||
osgDB::writeNodeFile(*(viewer->getSceneData()), "saved_model.osgt");
|
||||
}
|
||||
else if (ea.getKey()=='s')
|
||||
{
|
||||
SelectedNodesVisitor snv;
|
||||
viewer->getSceneData()->accept(snv);
|
||||
osg::ref_ptr<osg::Node> selected = snv.createSelectedNodeSubgraph();
|
||||
|
||||
if (selected)
|
||||
{
|
||||
osg::notify(osg::NOTICE)<<"Saved selected to file 'saved_selected.osgt'"<<std::endl;
|
||||
osgDB::writeNodeFile(*(viewer->getSceneData()), "saved_selected.osgt");
|
||||
}
|
||||
}
|
||||
else if (ea.getKey()=='p')
|
||||
{
|
||||
_usePolytopeIntersector = !_usePolytopeIntersector;
|
||||
@@ -167,7 +196,7 @@ public:
|
||||
{
|
||||
osg::notify(osg::NOTICE)<<"Using window coordinates for picking"<<std::endl;
|
||||
} else {
|
||||
osg::notify(osg::NOTICE)<<"Using projection coordiates for picking"<<std::endl;
|
||||
osg::notify(osg::NOTICE)<<"Using projection coordinates for picking"<<std::endl;
|
||||
}
|
||||
}
|
||||
else if (ea.getKey()=='a')
|
||||
@@ -177,7 +206,7 @@ public:
|
||||
else if (ea.getKey()==osgGA::GUIEventAdapter::KEY_Delete || ea.getKey()==osgGA::GUIEventAdapter::KEY_BackSpace)
|
||||
{
|
||||
osg::notify(osg::NOTICE)<<"Delete"<<std::endl;
|
||||
DeleteSelectedNodesVisitor dsnv;
|
||||
SelectedNodesVisitor dsnv;
|
||||
viewer->getSceneData()->accept(dsnv);
|
||||
dsnv.pruneSelectedNodes();
|
||||
}
|
||||
@@ -401,7 +430,7 @@ public:
|
||||
|
||||
if (cmtsv._group->getNumChildren()>0)
|
||||
{
|
||||
std::cout<<"Writing selected compoents to 'selected_model.osgt'"<<std::endl;
|
||||
std::cout<<"Writing selected components to 'selected_model.osgt'"<<std::endl;
|
||||
osgDB::writeNodeFile(*cmtsv._group, "selected_model.osgt");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -417,7 +417,7 @@ int main(int argc, char** argv)
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--shader","Use shaders to post process the video.");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--interactive","Use camera manipulator to allow movement around movie.");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--flip","Flip the movie so top becomes bottom.");
|
||||
#if defined(WIN32) || defined(__APPLE__)
|
||||
#if defined(_WIN32) || defined(__APPLE__)
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--devices","Print the Video input capability via QuickTime and exit.");
|
||||
#endif
|
||||
|
||||
@@ -433,7 +433,7 @@ int main(int argc, char** argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if defined(WIN32) || defined(__APPLE__)
|
||||
#if defined(_WIN32) || defined(__APPLE__)
|
||||
// if user requests devices video capability.
|
||||
if (arguments.read("-devices") || arguments.read("--devices"))
|
||||
{
|
||||
|
||||
@@ -175,7 +175,7 @@ int main( int argc, char** argv )
|
||||
// A floating error of delta-time should be explained here:
|
||||
// The particles emitter, program and updater all use a 'dt' to compute the time value in every frame.
|
||||
// Because the 'dt' is a double value, it is not suitable to keep three copies of it separately, which
|
||||
// is the previous implementation. The small error makes some opeartors unable to work correctly, e.g.
|
||||
// is the previous implementation. The small error makes some operators unable to work correctly, e.g.
|
||||
// the BounceOperator.
|
||||
// Now we make use of the getDeltaTime() of ParticleSystem to maintain and dispatch the delta time. But..
|
||||
// it is not the best solution so far, since there are still very few particles acting unexpectedly.
|
||||
|
||||
@@ -76,7 +76,7 @@ void computeViewMatrixOnEarth( osg::Camera* camera, osg::Node* scene,
|
||||
osg::CoordinateSystemNode* csn = findTopMostNodeOfType<osg::CoordinateSystemNode>(scene);
|
||||
if ( !csn ) return;
|
||||
|
||||
// Compute eye point in world coordiantes
|
||||
// Compute eye point in world coordinates
|
||||
osg::Vec3d eye;
|
||||
csn->getEllipsoidModel()->convertLatLongHeightToXYZ(
|
||||
latLongHeight.x(), latLongHeight.y(), latLongHeight.z(), eye.x(), eye.y(), eye.z() );
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
//
|
||||
// A simple demo demonstrating planar reflections using multiple renderings
|
||||
// of a subgraph, overriding of state attribures and use of the stencil buffer.
|
||||
// of a subgraph, overriding of state attributes and use of the stencil buffer.
|
||||
//
|
||||
// The multipass system implemented here is a variation of Mark Kilgard's
|
||||
// paper "Improving Shadows and Reflections via the Stencil Buffer" which
|
||||
|
||||
@@ -99,19 +99,19 @@ class WindowCaptureCallback : public osg::Camera::DrawCallback
|
||||
switch(_mode)
|
||||
{
|
||||
case(READ_PIXELS):
|
||||
osg::notify(osg::NOTICE)<<"Reading window usig glReadPixels, with out PixelBufferObject."<<std::endl;
|
||||
osg::notify(osg::NOTICE)<<"Reading window using glReadPixels, with out PixelBufferObject."<<std::endl;
|
||||
break;
|
||||
case(SINGLE_PBO):
|
||||
osg::notify(osg::NOTICE)<<"Reading window usig glReadPixels, with a single PixelBufferObject."<<std::endl;
|
||||
osg::notify(osg::NOTICE)<<"Reading window using glReadPixels, with a single PixelBufferObject."<<std::endl;
|
||||
_pboBuffer.push_back(0);
|
||||
break;
|
||||
case(DOUBLE_PBO):
|
||||
osg::notify(osg::NOTICE)<<"Reading window usig glReadPixels, with a double buffer PixelBufferObject."<<std::endl;
|
||||
osg::notify(osg::NOTICE)<<"Reading window using glReadPixels, with a double buffer PixelBufferObject."<<std::endl;
|
||||
_pboBuffer.push_back(0);
|
||||
_pboBuffer.push_back(0);
|
||||
break;
|
||||
case(TRIPLE_PBO):
|
||||
osg::notify(osg::NOTICE)<<"Reading window usig glReadPixels, with a triple buffer PixelBufferObject."<<std::endl;
|
||||
osg::notify(osg::NOTICE)<<"Reading window using glReadPixels, with a triple buffer PixelBufferObject."<<std::endl;
|
||||
_pboBuffer.push_back(0);
|
||||
_pboBuffer.push_back(0);
|
||||
_pboBuffer.push_back(0);
|
||||
|
||||
@@ -69,7 +69,7 @@ osg::Node* createTextGroup(const char** text)
|
||||
// loop through all children
|
||||
seq->setInterval(osg::Sequence::LOOP, 0,-1);
|
||||
|
||||
// real-time playback, repeat indefinitively
|
||||
// real-time playback, repeat indefinitely
|
||||
seq->setDuration(1.0f, -1);
|
||||
|
||||
// must be started explicitly
|
||||
@@ -157,7 +157,7 @@ osg::Sequence* createSequence(osg::ArgumentParser& arguments)
|
||||
// loop through all children
|
||||
seq->setInterval(osg::Sequence::LOOP, 0,-1);
|
||||
|
||||
// real-time playback, repeat indefinitively
|
||||
// real-time playback, repeat indefinitely
|
||||
seq->setDuration(1.0f, -1);
|
||||
|
||||
seq->setMode(osg::Sequence::START);
|
||||
@@ -244,7 +244,7 @@ int main( int argc, char **argv )
|
||||
"- is subclassed from osg::Switch",
|
||||
"- assigns a display duration to each child",
|
||||
"- can loop or swing through an interval of it's children",
|
||||
"- can repeat the interval a number of times or indefinitively",
|
||||
"- can repeat the interval a number of times or indefinitely",
|
||||
"- press 's' to start/pause/resume",
|
||||
"- press 'l' to toggle loop/swing mode",
|
||||
NULL
|
||||
|
||||
@@ -99,7 +99,7 @@ osg::Node* createOldShaderCompositionScene(osg::ArgumentParser& arguments)
|
||||
group->addChild(pat);
|
||||
}
|
||||
|
||||
// resuse the first ShaderAttribute's type and ShaderComponent, just use new uniform
|
||||
// reuse the first ShaderAttribute's type and ShaderComponent, just use new uniform
|
||||
{
|
||||
osg::PositionAttitudeTransform* pat = new osg::PositionAttitudeTransform;
|
||||
pat->setPosition(position);
|
||||
@@ -119,7 +119,7 @@ osg::Node* createOldShaderCompositionScene(osg::ArgumentParser& arguments)
|
||||
}
|
||||
|
||||
|
||||
// resuse the first ShaderAttribute's type and ShaderComponent, just use new uniform
|
||||
// reuse the first ShaderAttribute's type and ShaderComponent, just use new uniform
|
||||
{
|
||||
osg::PositionAttitudeTransform* pat = new osg::PositionAttitudeTransform;
|
||||
pat->setPosition(position);
|
||||
|
||||
@@ -314,7 +314,7 @@ int main(int, char **)
|
||||
|
||||
osg::ref_ptr<TestSupportOperation> testSupportOperation = new TestSupportOperation;
|
||||
#if 0
|
||||
// temporily commenting out as its causing the viewer to crash... no clue yet to why
|
||||
// temporarily commenting out as its causing the viewer to crash... no clue yet to why
|
||||
viewer.setRealizeOperation(testSupportOperation.get());
|
||||
#endif
|
||||
// create the windows and run the threads.
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
|
||||
#if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
|
||||
// disable the double to float errors.
|
||||
#pragma warning( disable : 4305 )
|
||||
#endif
|
||||
|
||||
@@ -158,7 +158,7 @@ If you have an external project that will depend on OSG built for OpenGL 3.x,
|
||||
you'll need to ensure your external project also uses the compiler include
|
||||
directives to find <GL3/gl3.h>.
|
||||
|
||||
To berify your application is using a pure OpenGL 3.x context, set
|
||||
To verify your application is using a pure OpenGL 3.x context, set
|
||||
OSG_NOTIFY_LEVEL=INFO in the environment and check the console output. Context
|
||||
creation displays output such as the following:
|
||||
GL3: Attempting to create OpenGL3 context.
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
|
||||
#if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Disable unavoidable warning messages:
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
#pragma warning(disable : 4103 4114 4201 4237 4251 4275 4290 4503 4335 4786)
|
||||
|
||||
#endif // WIN32
|
||||
#endif // _WIN32
|
||||
|
||||
#include <osgViewer/Viewer>
|
||||
#include <osgViewer/ViewerEventHandlers>
|
||||
|
||||
@@ -470,7 +470,7 @@ osg::Geometry *makePols (void) {
|
||||
gtess->setStateSet( stateset );
|
||||
|
||||
int nstart=0;
|
||||
// the contours accepoted are polygons; quads & tris. Trifans can bve added later.
|
||||
// the contours accepted are polygons; quads & tris. Trifans can be added later.
|
||||
gtess->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::QUADS,nstart,12));nstart+=12;
|
||||
gtess->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::QUADS,nstart,12));nstart+=12;
|
||||
gtess->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::POLYGON,nstart,16));nstart+=16;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/* A demonstration of Tessellation Shaders in OpenScenegraph.
|
||||
*
|
||||
* Instructions:
|
||||
* Press plus to increase tesselation and minus to decrease it.
|
||||
* Press right arrow to increase inner tesselation and left arrow to decrease it.
|
||||
* Press up arrow to increase outer tesselation and down arrow to decrease it.
|
||||
* Press plus to increase tessellation and minus to decrease it.
|
||||
* Press right arrow to increase inner tessellation and left arrow to decrease it.
|
||||
* Press up arrow to increase outer tessellation and down arrow to decrease it.
|
||||
*
|
||||
* Original code by Philip Rideout
|
||||
* Adapted to OpenScenegraph by John Kaniarz
|
||||
|
||||
@@ -440,7 +440,7 @@ osg::Group* create3DText(const osg::Vec3& center,float radius)
|
||||
text5->setFont("fonts/times.ttf");
|
||||
//text5->setCharacterSize(characterSize);
|
||||
text5->setCharacterSize(32.0f); // medium
|
||||
text5->setPosition(center - osg::Vec3(0.0, 0.0, 0.2));
|
||||
text5->setPosition(center - osg::Vec3(0.0, 0.0, 0.2) * radius);
|
||||
text5->setAxisAlignment(osgText::Text::SCREEN);
|
||||
text5->setCharacterSizeMode(osgText::Text::SCREEN_COORDS);
|
||||
text5->setDrawMode(osgText::Text::TEXT | osgText::Text::BOUNDINGBOX);
|
||||
@@ -451,7 +451,7 @@ osg::Group* create3DText(const osg::Vec3& center,float radius)
|
||||
text6->setColor(characterSizeModeColor);
|
||||
text6->setFont("fonts/times.ttf");
|
||||
text6->setCharacterSize(characterSize);
|
||||
text6->setPosition(center - osg::Vec3(0.0, 0.0, 0.4));
|
||||
text6->setPosition(center - osg::Vec3(0.0, 0.0, 0.4) * radius);
|
||||
text6->setAxisAlignment(osgText::Text::SCREEN);
|
||||
text6->setCharacterSizeMode(osgText::Text::OBJECT_COORDS_WITH_MAXIMUM_SCREEN_SIZE_CAPPED_BY_FONT_HEIGHT);
|
||||
text6->setText("CharacterSizeMode OBJECT_COORDS_WITH_MAXIMUM_SCREEN_SIZE_CAPPED_BY_FONT_HEIGHT");
|
||||
@@ -461,7 +461,7 @@ osg::Group* create3DText(const osg::Vec3& center,float radius)
|
||||
text7->setColor(characterSizeModeColor);
|
||||
text7->setFont("fonts/times.ttf");
|
||||
text7->setCharacterSize(characterSize);
|
||||
text7->setPosition(center - osg::Vec3(0.0, 0.0, 0.6));
|
||||
text7->setPosition(center - osg::Vec3(0.0, 0.0, 0.6) * radius);
|
||||
text7->setAxisAlignment(osgText::Text::SCREEN);
|
||||
text7->setCharacterSizeMode(osgText::Text::OBJECT_COORDS);
|
||||
text7->setText("CharacterSizeMode OBJECT_COORDS (default)");
|
||||
@@ -683,7 +683,7 @@ int main(int argc, char** argv)
|
||||
text->setFont("fonts/times.ttf");
|
||||
text->setAxisAlignment(osgText::Text::XZ_PLANE);
|
||||
text->setAlignment(osgText::Text::RIGHT_TOP);
|
||||
text->setText("Alingment\nBefore:");
|
||||
text->setText("Alignment\nBefore:");
|
||||
group->addChild(text);
|
||||
}
|
||||
|
||||
@@ -691,8 +691,8 @@ int main(int argc, char** argv)
|
||||
osg::ref_ptr<osgText::Text> text = new osgText::Text;
|
||||
text->setFont("fonts/times.ttf");
|
||||
text->setAxisAlignment(osgText::Text::XZ_PLANE);
|
||||
text->setText("Alingment\nAfter:");
|
||||
text->setAlignment(osgText::Text::RIGHT_TOP);
|
||||
text->setText("Alignment\nAfter:");
|
||||
text->setAlignment(osgText::Text::LEFT_TOP);
|
||||
group->addChild(text);
|
||||
}
|
||||
|
||||
@@ -754,7 +754,7 @@ int main(int argc, char** argv)
|
||||
{
|
||||
// prepare scene.
|
||||
osg::Vec3 center(0.0f,0.0f,0.0f);
|
||||
float radius = 1.0f;
|
||||
float radius = 100.0f;
|
||||
|
||||
// make sure the root node is group so we can add extra nodes to it.
|
||||
osg::Group* group = new osg::Group;
|
||||
|
||||
@@ -43,9 +43,15 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter&)
|
||||
virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa)
|
||||
{
|
||||
if (ea.getEventType() == osgGA::GUIEventAdapter::KEYUP)
|
||||
if (ea.getEventType() == osgGA::GUIEventAdapter::PUSH)
|
||||
{
|
||||
osgViewer::View* view = dynamic_cast<osgViewer::View*>(&aa);
|
||||
if (view) pick(view,ea);
|
||||
return false;
|
||||
}
|
||||
else if (ea.getEventType() == osgGA::GUIEventAdapter::KEYUP)
|
||||
{
|
||||
if (ea.getKey() == osgGA::GUIEventAdapter::KEY_Up)
|
||||
{
|
||||
@@ -83,6 +89,24 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
void pick(osgViewer::View* view, const osgGA::GUIEventAdapter& ea)
|
||||
{
|
||||
osgUtil::LineSegmentIntersector::Intersections intersections;
|
||||
if (view->computeIntersections(ea, intersections))
|
||||
{
|
||||
OSG_NOTICE<<"found intersections : "<<std::endl;
|
||||
for(osgUtil::LineSegmentIntersector::Intersections::iterator itr = intersections.begin();
|
||||
itr != intersections.end();
|
||||
++itr)
|
||||
{
|
||||
OSG_NOTICE<<" intersection "<<itr->localIntersectionPoint<<std::endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_NOTICE<<"failed to get intersection "<<std::endl;
|
||||
}
|
||||
}
|
||||
private:
|
||||
osgText::Text3D* m_Text3D;
|
||||
};
|
||||
|
||||
@@ -543,7 +543,7 @@ public:
|
||||
// now assign the appropriate portion data from the originalImage
|
||||
subImage->setImage(originalImage->s()/2, originalImage->t()/2, originalImage->r(), // half the width and height
|
||||
originalImage->getInternalTextureFormat(), // same internal texture format
|
||||
originalImage->getPixelFormat(),originalImage->getDataType(), // same pixel foramt and data type
|
||||
originalImage->getPixelFormat(),originalImage->getDataType(), // same pixel format and data type
|
||||
originalImage->data(originalImage->s()/4,originalImage->t()/4), // offset the start point to 1/4 into the image
|
||||
osg::Image::NO_DELETE, // don't attempt to delete the image data, leave this to the originalImage
|
||||
originalImage->getPacking(), // use the same packing
|
||||
|
||||
@@ -124,7 +124,7 @@ int main(int argc, char** argv)
|
||||
|
||||
if (arguments.argc()<=1)
|
||||
{
|
||||
std::cout<<"Please supply an image filename on the commnand line."<<std::endl;
|
||||
std::cout<<"Please supply an image filename on the command line."<<std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ std::ostream& TestContext::tout(TraceLevel tl) const
|
||||
TestContext::TraceStream::TraceStream(std::ostream& o, TraceLevel tl):
|
||||
_traceLevel(tl),
|
||||
_outputStreamPtr(&o),
|
||||
#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
|
||||
#if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
|
||||
_nullStream("nul")
|
||||
#else
|
||||
_nullStream("/dev/null")
|
||||
|
||||
@@ -215,7 +215,7 @@ void testGetQuatFromMatrix(const osg::Vec3d& scale)
|
||||
double yaw2stop = 360.0;
|
||||
double yaw2step = 20.0;
|
||||
#else
|
||||
// focussed range
|
||||
// focused range
|
||||
double rol1start = 0.0;
|
||||
double rol1stop = 0.0;
|
||||
double rol1step = 0.1;
|
||||
|
||||
@@ -27,7 +27,7 @@ SET(TARGET_ADDED_LIBRARIES ${TARGET_ADDED_LIBRARIES}
|
||||
#backup setting
|
||||
SET(TMP_OSG_BUILD_APPLICATION_BUNDLES {$OSG_BUILD_APPLICATION_BUNDLES})
|
||||
SET(OSG_BUILD_APPLICATION_BUNDLES TRUE)
|
||||
SET(MACOSX_DEPLOYMENT_TARGET, ${IPHONE_VERSION_MIN})
|
||||
#SET(MACOSX_DEPLOYMENT_TARGET, ${IPHONE_VERSION_MIN})
|
||||
SETUP_EXAMPLE(osgViewerIPhone)
|
||||
SET_TARGET_PROPERTIES(example_osgViewerIPhone PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer"
|
||||
XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET ${IPHONE_VERSION_MIN}
|
||||
@@ -35,4 +35,4 @@ SET_TARGET_PROPERTIES(example_osgViewerIPhone PROPERTIES XCODE_ATTRIBUTE_CODE_SI
|
||||
|
||||
#restore setting
|
||||
SET(OSG_BUILD_APPLICATION_BUNDLES {$TMP_OSG_BUILD_APPLICATION_BUNDLES})
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "-framework QuartzCore -framework Foundation -framework OpenGLES -framework UIKit -framework ImageIO -framework CoreImage -framework MobileCoreServices -framework CoreGraphics")
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "-framework QuartzCore -framework Foundation -framework UIKit -framework ImageIO -framework CoreImage -framework MobileCoreServices -framework CoreGraphics")
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#endif
|
||||
|
||||
// For wxCURSOR_BLANK below, but isn't used a.t.m.
|
||||
//#ifdef WIN32
|
||||
//#ifdef _WIN32
|
||||
//#include "wx/msw/wx.rc"
|
||||
//#endif
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
#include <OpenThreads/Config>
|
||||
|
||||
#ifndef WIN32
|
||||
#ifndef _WIN32
|
||||
#define OPENTHREAD_EXPORT_DIRECTIVE
|
||||
#else
|
||||
#if defined( OT_LIBRARY_STATIC )
|
||||
|
||||
@@ -109,10 +109,15 @@ public:
|
||||
|
||||
|
||||
/**
|
||||
* Return a pointer to the current running thread
|
||||
* Return a pointer to the current running thread, returns NULL for a non OpenThreads thread.
|
||||
*/
|
||||
static Thread *CurrentThread();
|
||||
|
||||
/**
|
||||
* Return the id of the current thread
|
||||
*/
|
||||
static size_t CurrentThreadId();
|
||||
|
||||
|
||||
/**
|
||||
* Initialize Threading in a program. This method must be called before
|
||||
@@ -147,7 +152,7 @@ public:
|
||||
*
|
||||
* @return a unique thread identifier
|
||||
*/
|
||||
int getThreadId();
|
||||
size_t getThreadId();
|
||||
|
||||
/**
|
||||
* Get the thread's process id. This is the pthread_t or pid_t value
|
||||
|
||||
@@ -63,6 +63,13 @@ class BoundingSphereImpl
|
||||
* otherwise. */
|
||||
inline bool valid() const { return _radius>=0.0; }
|
||||
|
||||
inline BoundingSphereImpl& operator = (const BoundingSphereImpl& rhs)
|
||||
{
|
||||
_center = rhs._center;
|
||||
_radius = rhs._radius;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline bool operator == (const BoundingSphereImpl& rhs) const { return _center==rhs._center && _radius==rhs._radius; }
|
||||
inline bool operator != (const BoundingSphereImpl& rhs) const { return _center!=rhs._center || _radius!=rhs._radius; }
|
||||
|
||||
|
||||
@@ -121,6 +121,32 @@ class OSG_EXPORT Callback : public virtual Object {
|
||||
}
|
||||
}
|
||||
|
||||
/** Convenience method to find a nested callback by type. */
|
||||
template <typename T>
|
||||
static T* findNestedCallback(osg::Callback* callback)
|
||||
{
|
||||
if (!callback)
|
||||
return NULL;
|
||||
|
||||
if (T* cb = dynamic_cast<T*>(callback))
|
||||
return cb;
|
||||
|
||||
return findNestedCallback<T>(callback->getNestedCallback());
|
||||
}
|
||||
|
||||
/** Convenience method to find a nested callback by type. */
|
||||
template <typename T>
|
||||
static const T* findNestedCallback(const osg::Callback* callback)
|
||||
{
|
||||
if (!callback)
|
||||
return NULL;
|
||||
|
||||
if (const T* cb = dynamic_cast<const T*>(callback))
|
||||
return cb;
|
||||
|
||||
return findNestedCallback<T>(callback->getNestedCallback());
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
virtual ~Callback() {}
|
||||
|
||||
@@ -599,12 +599,12 @@ class OSG_EXPORT Camera : public Transform, public CullSettings
|
||||
Callback(org, copyop) {}
|
||||
|
||||
META_Object(osg, DrawCallback);
|
||||
|
||||
|
||||
/** Functor method called by rendering thread to recursively launch operator() on _nestedcallback **/
|
||||
inline void run(osg::RenderInfo& renderInfo) const
|
||||
{
|
||||
operator () (renderInfo);
|
||||
|
||||
|
||||
if (_nestedCallback.valid())
|
||||
((const DrawCallback*)_nestedCallback.get())->run(renderInfo);
|
||||
}
|
||||
@@ -614,6 +614,23 @@ class OSG_EXPORT Camera : public Transform, public CullSettings
|
||||
|
||||
/** Functor method, provided for backwards compatibility, called by operator() (osg::RenderInfo& renderInfo) method.**/
|
||||
virtual void operator () (const osg::Camera& /*camera*/) const {}
|
||||
|
||||
/** Resize any per context GLObject buffers to specified size. */
|
||||
virtual void resizeGLObjectBuffers(unsigned int maxSize)
|
||||
{
|
||||
if (_nestedCallback.valid())
|
||||
_nestedCallback->resizeGLObjectBuffers(maxSize);
|
||||
}
|
||||
|
||||
/** If State is non-zero, this function releases any associated OpenGL objects for
|
||||
* the specified graphics context. Otherwise, releases OpenGL objexts
|
||||
* for all graphics contexts. */
|
||||
virtual void releaseGLObjects(osg::State* state = 0) const
|
||||
{
|
||||
if (_nestedCallback.valid())
|
||||
_nestedCallback->releaseGLObjects(state);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/** Set the initial draw callback for custom operations to be done before the drawing of the camera's subgraph and pre render stages.*/
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
// #define INLINE_DRAWABLE_DRAW
|
||||
#define INLINE_DRAWABLE_DRAW
|
||||
|
||||
namespace osg {
|
||||
|
||||
|
||||
@@ -304,6 +304,9 @@ class OSG_EXPORT FrameBufferAttachment
|
||||
unsigned int getTexture3DZOffset() const;
|
||||
unsigned int getTextureArrayLayer() const;
|
||||
|
||||
void resizeGLObjectBuffers(unsigned int maxSize);
|
||||
void releaseGLObjects(osg::State* = 0) const;
|
||||
|
||||
private:
|
||||
// use the Pimpl idiom to avoid dependency from
|
||||
// all Texture* headers
|
||||
|
||||
@@ -149,6 +149,15 @@ class VertexAttribAlias
|
||||
_osgName(osgName),
|
||||
_declaration(declaration) {}
|
||||
|
||||
VertexAttribAlias& operator = (const VertexAttribAlias& rhs)
|
||||
{
|
||||
_location = rhs._location;
|
||||
_glName = rhs._glName;
|
||||
_osgName = rhs._osgName;
|
||||
_declaration = rhs._declaration;
|
||||
return *this;
|
||||
}
|
||||
|
||||
GLuint _location;
|
||||
std::string _glName;
|
||||
std::string _osgName;
|
||||
@@ -521,6 +530,7 @@ class OSG_EXPORT GLExtensions : public osg::Referenced
|
||||
bool isTextureCompressionETC2Supported;
|
||||
bool isTextureCompressionRGTCSupported;
|
||||
bool isTextureCompressionPVRTCSupported;
|
||||
bool isTextureCompressionASTCSupported;
|
||||
bool isTextureMirroredRepeatSupported;
|
||||
bool isTextureEdgeClampSupported;
|
||||
bool isTextureBorderClampSupported;
|
||||
@@ -530,6 +540,7 @@ class OSG_EXPORT GLExtensions : public osg::Referenced
|
||||
bool isShadowSupported;
|
||||
bool isShadowAmbientSupported;
|
||||
bool isTextureMaxLevelSupported;
|
||||
bool isTextureLODBiasSupported;
|
||||
GLint maxTextureSize;
|
||||
bool isClientStorageSupported;
|
||||
bool isTextureIntegerEXTSupported;
|
||||
@@ -656,6 +667,9 @@ class OSG_EXPORT GLExtensions : public osg::Referenced
|
||||
// FrameBuferObject
|
||||
bool isFrameBufferObjectSupported;
|
||||
bool isPackedDepthStencilSupported;
|
||||
bool isMultisampledRenderToTextureSupported;
|
||||
bool isInvalidateFramebufferSupported;
|
||||
|
||||
bool isRenderbufferMultisampleSupported() const { return glRenderbufferStorageMultisample != 0; }
|
||||
bool isRenderbufferMultisampleCoverageSupported() const { return glRenderbufferStorageMultisampleCoverageNV != 0; }
|
||||
|
||||
@@ -672,6 +686,7 @@ class OSG_EXPORT GLExtensions : public osg::Referenced
|
||||
|
||||
void (GL_APIENTRY * glFramebufferTexture1D) (GLenum, GLenum, GLenum, GLuint, GLint);
|
||||
void (GL_APIENTRY * glFramebufferTexture2D) (GLenum, GLenum, GLenum, GLuint, GLint);
|
||||
void (GL_APIENTRY * glFramebufferTexture2DMultisample) (GLenum, GLenum, GLenum, GLuint, GLint, GLsizei);
|
||||
void (GL_APIENTRY * glFramebufferTexture3D) (GLenum, GLenum, GLenum, GLuint, GLint, GLint);
|
||||
void (GL_APIENTRY * glFramebufferTexture) (GLenum, GLenum, GLint, GLint);
|
||||
void (GL_APIENTRY * glFramebufferTextureLayer) (GLenum, GLenum, GLuint, GLint, GLint);
|
||||
@@ -680,6 +695,7 @@ class OSG_EXPORT GLExtensions : public osg::Referenced
|
||||
|
||||
void (GL_APIENTRY * glGenerateMipmap) (GLenum);
|
||||
void (GL_APIENTRY * glBlitFramebuffer) (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum);
|
||||
void (GL_APIENTRY * glInvalidateFramebuffer) (GLenum, GLsizei, const GLenum*); // GL_ARB_invalidate_subdata or GL 4.3 or GLES 3
|
||||
void (GL_APIENTRY * glGetRenderbufferParameteriv) (GLenum, GLenum, GLint*);
|
||||
|
||||
//ARB_framebuffer_no_attachments
|
||||
@@ -813,6 +829,9 @@ class OSG_EXPORT GLExtensions : public osg::Referenced
|
||||
|
||||
/** convenience wrapper around glObjectLabel that calls glObjectLabel if it's supported and using std::string as a label parameter.*/
|
||||
void debugObjectLabel(GLenum identifier, GLuint name, const std::string& label) const { if (glObjectLabel && !label.empty()) glObjectLabel(identifier, name, label.size(), label.c_str()); }
|
||||
|
||||
protected:
|
||||
virtual ~GLExtensions();
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -390,7 +390,7 @@ class OSG_EXPORT GraphicsContext : public Object
|
||||
bool releaseContext();
|
||||
|
||||
/** Return true if the current thread has this OpenGL graphics context.*/
|
||||
inline bool isCurrent() const { return _threadOfLastMakeCurrent == OpenThreads::Thread::CurrentThread(); }
|
||||
inline bool isCurrent() const { return _threadOfLastMakeCurrent == OpenThreads::Thread::CurrentThreadId(); }
|
||||
|
||||
/** Bind the graphics context to associated texture.*/
|
||||
inline void bindPBufferToTexture(GLenum buffer) { bindPBufferToTextureImplementation(buffer); }
|
||||
@@ -547,7 +547,7 @@ class OSG_EXPORT GraphicsContext : public Object
|
||||
Vec4 _clearColor;
|
||||
GLbitfield _clearMask;
|
||||
|
||||
OpenThreads::Thread* _threadOfLastMakeCurrent;
|
||||
size_t _threadOfLastMakeCurrent;
|
||||
|
||||
OpenThreads::Mutex _operationsMutex;
|
||||
osg::ref_ptr<osg::RefBlock> _operationsBlock;
|
||||
|
||||
@@ -42,6 +42,14 @@ struct OSG_EXPORT GraphicsOperation : public Operation
|
||||
virtual void operator () (Object* object);
|
||||
|
||||
virtual void operator () (GraphicsContext* context) = 0;
|
||||
|
||||
/** Resize any per context GLObject buffers to specified size. */
|
||||
virtual void resizeGLObjectBuffers(unsigned int /*maxSize*/) {}
|
||||
|
||||
/** If State is non-zero, this function releases any associated OpenGL objects for
|
||||
* the specified graphics context. Otherwise, releases OpenGL objects
|
||||
* for all graphics contexts. */
|
||||
virtual void releaseGLObjects(osg::State* = 0) const {}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ public:
|
||||
void notify(osg::NotifySeverity severity, const char *message);
|
||||
};
|
||||
|
||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||
|
||||
/** Redirects notification stream to windows debugger with use of
|
||||
* OuputDebugString functions.
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
namespace osg {
|
||||
|
||||
// forward declare
|
||||
class State;
|
||||
class UserDataContainer;
|
||||
class Node;
|
||||
class NodeVisitor;
|
||||
|
||||
@@ -72,7 +72,19 @@ public:
|
||||
|
||||
virtual void drawImplementation( osg::RenderInfo& renderInfo ) const;
|
||||
|
||||
unsigned int getNumPixels( const osg::Camera* cam );
|
||||
struct QueryResult
|
||||
{
|
||||
QueryResult() : valid(false), numPixels(0) {}
|
||||
QueryResult(bool v, unsigned int p) : valid(v), numPixels(p) {}
|
||||
|
||||
bool valid;
|
||||
unsigned int numPixels;
|
||||
};
|
||||
|
||||
/** return a QueryResult for specified Camera, where the QueryResult.valid is true when query results are available, and in which case the QueryResult.numPixels provides the num of pixels in the query result.*/
|
||||
QueryResult getQueryResult( const osg::Camera* cam ) const;
|
||||
|
||||
unsigned int getNumPixels( const osg::Camera* cam ) const;
|
||||
|
||||
virtual void releaseGLObjects( osg::State* state = 0 ) const;
|
||||
|
||||
@@ -125,6 +137,11 @@ public:
|
||||
void setQueryFrameCount( unsigned int frames ) { _queryFrameCount = frames; }
|
||||
unsigned int getQueryFrameCount() const { return _queryFrameCount; }
|
||||
|
||||
// Resets the queries. The next frame will issue a new query.
|
||||
// This is useful for big view changes, if it shouldn't be waited for
|
||||
// '_queryFrameCount' till the frame contents change.
|
||||
void resetQueries();
|
||||
|
||||
// Indicate whether or not the bounding box used in the occlusion query test
|
||||
// should be rendered. Handy for debugging and development.
|
||||
// Should only be called outside of cull/draw. No thread issues.
|
||||
@@ -141,8 +158,11 @@ public:
|
||||
osg::StateSet* getQueryStateSet();
|
||||
const osg::StateSet* getQueryStateSet() const;
|
||||
|
||||
// Get the QueryGeometry object used for occlusion query. Returns 0 if no QueryGeometry is created.
|
||||
osg::QueryGeometry* getQueryGeometry();
|
||||
// Set and get the QueryGeometry object used for the occlusion query.
|
||||
// By default an axis aligned box is used as the query geometry.
|
||||
// Resetting to the default query geometry is done by setting it to 0.
|
||||
// Returns 0 if no QueryGeometry is created.
|
||||
void setQueryGeometry( osg::QueryGeometry* geom );
|
||||
const osg::QueryGeometry* getQueryGeometry() const;
|
||||
|
||||
// Set and get the StateSet used by the OcclusionQueryNode
|
||||
@@ -172,15 +192,31 @@ public:
|
||||
static void discardDeletedQueryObjects( unsigned int contextID );
|
||||
|
||||
protected:
|
||||
enum QueryGeometryState {
|
||||
INVALID,
|
||||
VALID,
|
||||
USER_DEFINED
|
||||
};
|
||||
|
||||
virtual ~OcclusionQueryNode();
|
||||
|
||||
virtual void createSupportNodes();
|
||||
|
||||
bool isQueryGeometryValid() const { return _queryGeometryState != INVALID; }
|
||||
|
||||
void setQueryGeometryInternal( osg::QueryGeometry* queryGeom,
|
||||
osg::Geometry* debugQueryGeom,
|
||||
QueryGeometryState state );
|
||||
|
||||
void updateDefaultQueryGeometry();
|
||||
|
||||
osg::ref_ptr< osg::Geode > _queryGeode;
|
||||
osg::ref_ptr< osg::Geode > _debugGeode;
|
||||
|
||||
bool _enabled;
|
||||
|
||||
mutable QueryGeometryState _queryGeometryState;
|
||||
|
||||
// Tracks the last frame number that we performed a query.
|
||||
// User can set how many times (See setQueryFrameCount).
|
||||
typedef std::map< const osg::Camera*, unsigned int > FrameCountMap;
|
||||
|
||||
@@ -32,7 +32,11 @@ class OSG_EXPORT Quat
|
||||
public:
|
||||
|
||||
/** Data type of vector components.*/
|
||||
#ifdef OSG_USE_FLOAT_QUAT
|
||||
typedef float value_type;
|
||||
#else
|
||||
typedef double value_type;
|
||||
#endif
|
||||
|
||||
/** Number of vector components. */
|
||||
enum { num_components = 4 };
|
||||
@@ -49,6 +53,14 @@ class OSG_EXPORT Quat
|
||||
_v[3]=w;
|
||||
}
|
||||
|
||||
inline Quat( const Quat& rhs )
|
||||
{
|
||||
_v[0]=rhs._v[0];
|
||||
_v[1]=rhs._v[1];
|
||||
_v[2]=rhs._v[2];
|
||||
_v[3]=rhs._v[3];
|
||||
}
|
||||
|
||||
inline Quat( const Vec4f& v )
|
||||
{
|
||||
_v[0]=v.x();
|
||||
|
||||
@@ -30,6 +30,7 @@ namespace osg {
|
||||
class DeleteHandler;
|
||||
class Observer;
|
||||
class ObserverSet;
|
||||
class State;
|
||||
|
||||
/** template class to help enforce static initialization order. */
|
||||
template <typename T, T M()>
|
||||
@@ -114,8 +115,16 @@ class OSG_EXPORT Referenced
|
||||
|
||||
/** Remove Observer that is observing this object.*/
|
||||
void removeObserver(Observer* observer) const;
|
||||
#if 0
|
||||
/** Resize any per context GLObject buffers to specified size. */
|
||||
virtual void resizeGLObjectBuffers(unsigned int /*maxSize*/) {}
|
||||
|
||||
public:
|
||||
/** If State is non-zero, this function releases any associated OpenGL objects for
|
||||
* the specified graphics context. Otherwise, releases OpenGL objects
|
||||
* for all graphics contexts. */
|
||||
virtual void releaseGLObjects(osg::State* = 0) const {}
|
||||
#endif
|
||||
public:
|
||||
|
||||
friend class DeleteHandler;
|
||||
|
||||
|
||||
@@ -549,6 +549,13 @@ class OSG_EXPORT State : public Referenced
|
||||
/** Set the getCurrentVertexArrayState to the GlobalVertexArrayState.*/
|
||||
void setCurrentToGlobalVertexArrayState() { _vas = _globalVertexArrayState.get(); }
|
||||
|
||||
/** Reset the CurrentVertexArrayState/VertexArrayObject if it's value matches the specificied vas - use when deleting a vas.*/
|
||||
void resetCurrentVertexArrayStateOnMatch(VertexArrayState* vas)
|
||||
{
|
||||
if (vas->getVertexArrayObject()== _currentVAO) _currentVAO = 0;
|
||||
if (_vas==vas) _vas = _globalVertexArrayState.get();
|
||||
}
|
||||
|
||||
|
||||
/** disable the vertex, normal, color, tex coords, secondary color, fog coord and index arrays.*/
|
||||
void disableAllVertexArrays();
|
||||
@@ -1321,12 +1328,12 @@ class OSG_EXPORT State : public Referenced
|
||||
inline void popModeList(ModeMap& modeMap,const StateSet::ModeList& modeList);
|
||||
inline void popAttributeList(AttributeMap& attributeMap,const StateSet::AttributeList& attributeList);
|
||||
inline void popUniformList(UniformMap& uniformMap,const StateSet::UniformList& uniformList);
|
||||
inline void popDefineList(DefineMap& uniformMap,const StateSet::DefineList& defineList);
|
||||
inline void popDefineList(DefineMap& defineMap,const StateSet::DefineList& defineList);
|
||||
|
||||
inline void applyModeList(ModeMap& modeMap,const StateSet::ModeList& modeList);
|
||||
inline void applyAttributeList(AttributeMap& attributeMap,const StateSet::AttributeList& attributeList);
|
||||
inline void applyUniformList(UniformMap& uniformMap,const StateSet::UniformList& uniformList);
|
||||
inline void applyDefineList(DefineMap& uniformMap,const StateSet::DefineList& defineList);
|
||||
inline void applyDefineList(DefineMap& defineMap,const StateSet::DefineList& defineList);
|
||||
|
||||
inline void applyModeMap(ModeMap& modeMap);
|
||||
inline void applyAttributeMap(AttributeMap& attributeMap);
|
||||
|
||||
@@ -90,7 +90,7 @@ public:
|
||||
unsigned int pos=first;
|
||||
for(GLsizei i=3;i<count;i+=2,pos+=2)
|
||||
{
|
||||
this->operator()(pos,pos+1,pos+2,pos+3);
|
||||
this->operator()(pos,pos+1,pos+3,pos+2);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -187,7 +187,7 @@ public:
|
||||
IndexPointer iptr = indices;
|
||||
for(GLsizei i=3;i<count;i+=2,iptr+=2)
|
||||
{
|
||||
this->operator()(*(iptr),*(iptr+1),*(iptr+2),*(iptr+3));
|
||||
this->operator()(*(iptr),*(iptr+1),*(iptr+3),*(iptr+2));
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -283,7 +283,7 @@ public:
|
||||
IndexPointer iptr = indices;
|
||||
for(GLsizei i=3;i<count;i+=2,iptr+=2)
|
||||
{
|
||||
this->operator()(*(iptr),*(iptr+1),*(iptr+2),*(iptr+3));
|
||||
this->operator()(*(iptr),*(iptr+1),*(iptr+3),*(iptr+2));
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -378,7 +378,7 @@ public:
|
||||
IndexPointer iptr = indices;
|
||||
for(GLsizei i=3;i<count;i+=2,iptr+=2)
|
||||
{
|
||||
this->operator()(*(iptr),*(iptr+1),*(iptr+2),*(iptr+3));
|
||||
this->operator()(*(iptr),*(iptr+1),*(iptr+3),*(iptr+2));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -62,6 +62,10 @@
|
||||
#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
|
||||
#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
|
||||
#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
|
||||
#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C
|
||||
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D
|
||||
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E
|
||||
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_texture_compression_rgtc
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
namespace osg {
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
typedef unsigned __int64 Timer_t;
|
||||
#else
|
||||
typedef unsigned long long Timer_t;
|
||||
|
||||
@@ -182,10 +182,12 @@ class OSG_EXPORT VertexArrayState : public osg::Referenced
|
||||
|
||||
public:
|
||||
|
||||
virtual ~VertexArrayState();
|
||||
|
||||
// osg::GLBufferObject* getGLBufferObject(osg::Array* array);
|
||||
|
||||
osg::State* _state;
|
||||
osg::ref_ptr<ObserverSet> _stateObserverSet;
|
||||
osg::ref_ptr<osg::GLExtensions> _ext;
|
||||
|
||||
bool _isVertexBufferObjectSupported;
|
||||
|
||||
@@ -161,6 +161,9 @@ class OSG_EXPORT View : public virtual osg::Object
|
||||
|
||||
void updateSlaves();
|
||||
|
||||
virtual void resizeGLObjectBuffers(unsigned int maxSize);
|
||||
virtual void releaseGLObjects(osg::State* = 0) const;
|
||||
|
||||
protected :
|
||||
|
||||
virtual ~View();
|
||||
|
||||
@@ -66,7 +66,6 @@ class MakeString
|
||||
inline operator std::string () const { return sstream.str(); }
|
||||
|
||||
inline std::string str() const { return sstream.str(); }
|
||||
inline const char* c_str() const { return sstream.str().c_str(); }
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -36,6 +36,9 @@ class ref_ptr
|
||||
ref_ptr() : _ptr(0) {}
|
||||
ref_ptr(T* ptr) : _ptr(ptr) { if (_ptr) _ptr->ref(); }
|
||||
ref_ptr(const ref_ptr& rp) : _ptr(rp._ptr) { if (_ptr) _ptr->ref(); }
|
||||
#if __cplusplus >= 201103L
|
||||
ref_ptr(ref_ptr&& rp) noexcept : _ptr(rp._ptr) { rp._ptr = 0; }
|
||||
#endif
|
||||
template<class Other> ref_ptr(const ref_ptr<Other>& rp) : _ptr(rp._ptr) { if (_ptr) _ptr->ref(); }
|
||||
ref_ptr(observer_ptr<T>& optr) : _ptr(0) { optr.lock(*this); }
|
||||
~ref_ptr() { if (_ptr) _ptr->unref(); _ptr = 0; }
|
||||
@@ -52,6 +55,17 @@ class ref_ptr
|
||||
return *this;
|
||||
}
|
||||
|
||||
#if __cplusplus >= 201103L
|
||||
template<class Other> ref_ptr& operator = (ref_ptr<Other>&& rp)
|
||||
{
|
||||
if (_ptr == rp._ptr) return *this;
|
||||
if (_ptr != nullptr) _ptr->unref();
|
||||
_ptr = rp._ptr;
|
||||
rp._ptr = nullptr;
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
|
||||
inline ref_ptr& operator = (T* ptr)
|
||||
{
|
||||
if (_ptr==ptr) return *this;
|
||||
|
||||
@@ -105,12 +105,12 @@ namespace osgAnimation
|
||||
// 2. build deduplicated list of keyframes
|
||||
unsigned int cumul = 0;
|
||||
VectorType deduplicated;
|
||||
for(std::vector<unsigned int>::iterator iterator = intervalSizes.begin() ; iterator != intervalSizes.end() ; ++ iterator) {
|
||||
for(std::vector<unsigned int>::iterator it = intervalSizes.begin() ; it != intervalSizes.end() ; ++ it) {
|
||||
deduplicated.push_back((*this)[cumul]);
|
||||
if(*iterator > 1) {
|
||||
deduplicated.push_back((*this)[cumul + (*iterator) - 1]);
|
||||
if(*it > 1) {
|
||||
deduplicated.push_back((*this)[cumul + (*it) - 1]);
|
||||
}
|
||||
cumul += *iterator;
|
||||
cumul += *it;
|
||||
}
|
||||
|
||||
unsigned int count = size() - deduplicated.size();
|
||||
|
||||
@@ -120,6 +120,8 @@ class OSGDB_EXPORT ImageOptions : public osgDB::Options
|
||||
}
|
||||
|
||||
double _x,_y,_w,_h;
|
||||
protected:
|
||||
virtual ~TexCoordRange() {}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -55,10 +55,10 @@ class OSGDB_EXPORT ObjectCache : public osg::Referenced
|
||||
/** Remove Object from cache.*/
|
||||
void removeFromObjectCache(const std::string& fileName, const Options *options = NULL);
|
||||
|
||||
/** Get an Object from the object cache*/
|
||||
/** Deprecated, the getFromObjectCache() returns a C pointer that is not thread safe when using database paging, please use the thread safe getRefFromObjectCache() method instead. */
|
||||
osg::Object* getFromObjectCache(const std::string& fileName, const Options *options = NULL);
|
||||
|
||||
/** Get an ref_ptr<Object> from the object cache*/
|
||||
/** Get a thread safe ref_ptr<Object> from the object cache*/
|
||||
osg::ref_ptr<osg::Object> getRefFromObjectCache(const std::string& fileName, const Options *options = NULL);
|
||||
|
||||
/** call rleaseGLObjects on all objects attached to the object cache.*/
|
||||
|
||||
@@ -40,6 +40,7 @@ class ReaderWriterInfo : public osg::Referenced
|
||||
ReaderWriter::FormatDescriptionMap protocols;
|
||||
ReaderWriter::FormatDescriptionMap extensions;
|
||||
ReaderWriter::FormatDescriptionMap options;
|
||||
ReaderWriter::FormatDescriptionMap environment;
|
||||
ReaderWriter::Features features;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -63,6 +63,9 @@ class OSGDB_EXPORT ReaderWriter : public osg::Object
|
||||
/** Return which list of file extensions supported by ReaderWriter. */
|
||||
virtual const FormatDescriptionMap& supportedOptions() const { return _supportedOptions; }
|
||||
|
||||
/** Return which list of file environment variables supported by ReaderWriter. */
|
||||
virtual const FormatDescriptionMap& supportedEnvironment() const { return _supportedEnvironment; }
|
||||
|
||||
/** Return true if ReaderWriter accepts specified file extension.*/
|
||||
virtual bool acceptsExtension(const std::string& /*extension*/) const;
|
||||
|
||||
@@ -282,11 +285,15 @@ class OSGDB_EXPORT ReaderWriter : public osg::Object
|
||||
* Please note, this should usually only be used internally by subclasses of ReaderWriter. */
|
||||
void supportsOption(const std::string& opt, const std::string& description);
|
||||
|
||||
/** Specify env string as a supported environment string. */
|
||||
void supportsEnvironment(const std::string& opt, const std::string& description);
|
||||
|
||||
protected:
|
||||
|
||||
FormatDescriptionMap _supportedProtocols;
|
||||
FormatDescriptionMap _supportedExtensions;
|
||||
FormatDescriptionMap _supportedOptions;
|
||||
FormatDescriptionMap _supportedEnvironment;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -50,7 +50,8 @@ namespace osgDB {
|
||||
The RegisterReaderWriterProxy can be used to automatically
|
||||
register at runtime a reader/writer with the Registry.
|
||||
*/
|
||||
class OSGDB_EXPORT Registry : public osg::Referenced
|
||||
class OSGDB_EXPORT Registry : osg::depends_on<OpenThreads::Mutex*, osg::Referenced::getGlobalReferencedMutex>,
|
||||
public osg::Referenced
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
@@ -62,8 +62,9 @@ protected:
|
||||
// Return true if the manipulator is std::endl
|
||||
bool isEndl( std::ostream& (*fn)(std::ostream&) )
|
||||
{
|
||||
#ifdef __sun
|
||||
#if defined (__sun) || (defined _WIN32 && !defined OSG_LIBRARY_STATIC)
|
||||
// What a mess, but solaris does not like taking the address below
|
||||
// windows std::endl is a template with different adresses in different dll's
|
||||
std::stringstream ss;
|
||||
ss << fn;
|
||||
std::string s = ss.str();
|
||||
|
||||
@@ -119,6 +119,9 @@ namespace osgFX
|
||||
/** default traversal */
|
||||
inline void inherited_traverse(osg::NodeVisitor& nv);
|
||||
|
||||
virtual void resizeGLObjectBuffers(unsigned int maxSize);
|
||||
virtual void releaseGLObjects(osg::State* state = 0) const;
|
||||
|
||||
protected:
|
||||
virtual ~Effect();
|
||||
Effect &operator=(const Effect &) { return *this; }
|
||||
|
||||
@@ -42,6 +42,21 @@ namespace osgParticle
|
||||
return y1 + (y2 - y1) * t;
|
||||
}
|
||||
|
||||
virtual osg::Vec2 interpolate(float t, const osg::Vec2& y1, const osg::Vec2& y2) const
|
||||
{
|
||||
return y1 + (y2 - y1) * t;
|
||||
}
|
||||
|
||||
virtual osg::Vec3 interpolate(float t, const osg::Vec3& y1, const osg::Vec3& y2) const
|
||||
{
|
||||
return y1 + (y2 - y1) * t;
|
||||
}
|
||||
|
||||
virtual osg::Vec4 interpolate(float t, const osg::Vec4& y1, const osg::Vec4& y2) const
|
||||
{
|
||||
return y1 + (y2 - y1) * t;
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual ~LinearInterpolator() {}
|
||||
};
|
||||
|
||||
@@ -265,7 +265,7 @@ namespace osgParticle
|
||||
* for all graphics contexts. */
|
||||
virtual void releaseGLObjects(osg::State* state=0) const;
|
||||
|
||||
virtual osg::VertexArrayState* createVertexArrayStateImplemenation(osg::RenderInfo& renderInfo) const;
|
||||
virtual osg::VertexArrayState* createVertexArrayStateImplementation(osg::RenderInfo& renderInfo) const;
|
||||
|
||||
void adjustEstimatedMaxNumOfParticles(int delta) { _estimatedMaxNumOfParticles += delta; }
|
||||
|
||||
|
||||
@@ -37,8 +37,10 @@ namespace osgParticle
|
||||
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const PrecipitationEffect*>(obj) != 0; }
|
||||
virtual void accept(osg::NodeVisitor& nv) { if (nv.validNodeMask(*this)) { nv.pushOntoNodePath(this); nv.apply(*this); nv.popFromNodePath(); } }
|
||||
|
||||
virtual void traverse(osg::NodeVisitor& nv);
|
||||
virtual void resizeGLObjectBuffers(unsigned int maxSize);
|
||||
virtual void releaseGLObjects(osg::State* state = 0) const;
|
||||
|
||||
virtual void traverse(osg::NodeVisitor& nv);
|
||||
|
||||
/** Set all the parameters to create an rain effect of specified intensity.*/
|
||||
void rain(float intensity);
|
||||
@@ -117,6 +119,9 @@ namespace osgParticle
|
||||
void setNumberOfVertices(unsigned int numVertices) { _numberOfVertices = numVertices; }
|
||||
unsigned int getNumberOfVertices() const { return _numberOfVertices; }
|
||||
|
||||
virtual void resizeGLObjectBuffers(unsigned int maxSize);
|
||||
virtual void releaseGLObjects(osg::State* state) const;
|
||||
|
||||
virtual void drawImplementation(osg::RenderInfo& renderInfo) const;
|
||||
|
||||
struct Cell
|
||||
@@ -174,7 +179,7 @@ namespace osgParticle
|
||||
|
||||
protected:
|
||||
|
||||
virtual ~PrecipitationDrawable() {}
|
||||
virtual ~PrecipitationDrawable();
|
||||
|
||||
bool _requiresPreviousMatrix;
|
||||
|
||||
|
||||
@@ -240,6 +240,10 @@ public:
|
||||
/** recompute the primitives rendering meshes/lines thtat represent the sphere segment.*/
|
||||
void updatePrimitives();
|
||||
|
||||
|
||||
virtual void resizeGLObjectBuffers(unsigned int maxSize);
|
||||
virtual void releaseGLObjects(osg::State* state = 0) const;
|
||||
|
||||
virtual osg::BoundingSphere computeBound() const;
|
||||
|
||||
private:
|
||||
|
||||
@@ -83,7 +83,7 @@ public:
|
||||
|
||||
virtual std::string getFileName() const;
|
||||
|
||||
static osg::ref_ptr<Font>& getDefaultFont();
|
||||
static osg::ref_ptr<Font> getDefaultFont();
|
||||
|
||||
typedef std::vector< osg::ref_ptr<osg::StateSet> > StateSets;
|
||||
StateSets& getCachedStateSets() { return _statesets; }
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user