Compare commits
385 Commits
OpenSceneG
...
OpenSceneG
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
d011ca4e8d | ||
|
|
3a6b13c46e | ||
|
|
88afccd85e | ||
|
|
d6d6c3cda2 | ||
|
|
ca134dca2d | ||
|
|
66246703bf | ||
|
|
fb09be05a9 | ||
|
|
41fa8fecd1 | ||
|
|
2213011caa | ||
|
|
c2f0da31f2 | ||
|
|
2e14bd52bf | ||
|
|
4ea833cc6b | ||
|
|
7fae3b67cd | ||
|
|
8780347f2f | ||
|
|
22e6f6038f | ||
|
|
385cfa0cbf | ||
|
|
960f4d1ef2 | ||
|
|
257c2deb86 | ||
|
|
4dc6a6c4cd | ||
|
|
2e38e4751c | ||
|
|
dfdb946d60 | ||
|
|
2f056dcaa9 | ||
|
|
d07fe93f34 | ||
|
|
05297f439c | ||
|
|
34d58d447d | ||
|
|
637e1cc33b | ||
|
|
5d6ab3e6b7 | ||
|
|
69667a478f | ||
|
|
f00b7180cb | ||
|
|
6ae1139630 | ||
|
|
a06fcbe5d9 | ||
|
|
5f9c6a0170 | ||
|
|
2a4dd6e03b | ||
|
|
afe5644b9f | ||
|
|
ae3133522d | ||
|
|
5040c583b4 | ||
|
|
61967a7d1a | ||
|
|
bcba3928e6 | ||
|
|
006ca64f4b | ||
|
|
77fd07eaa9 | ||
|
|
8b8c427afe | ||
|
|
f55b864d59 | ||
|
|
d18c498322 | ||
|
|
4f7f34a6b0 | ||
|
|
29789f898b | ||
|
|
dd9312ae35 | ||
|
|
78e050db43 | ||
|
|
250dcc5b6c | ||
|
|
f2dfd78914 | ||
|
|
1819bb32ae | ||
|
|
e043c3db33 | ||
|
|
587e65e674 | ||
|
|
274b6894af | ||
|
|
29e87780f5 | ||
|
|
58a51cbc41 | ||
|
|
7ae7a994b4 | ||
|
|
3808b298d1 | ||
|
|
ed13576d03 | ||
|
|
15f2ae8d15 | ||
|
|
9ab5aafd02 | ||
|
|
2e0e78144f | ||
|
|
ffb68bec7c | ||
|
|
79bc4c3843 | ||
|
|
a7747972dc | ||
|
|
467baa8c00 | ||
|
|
4d6c4a7f1f | ||
|
|
fb40a0d1db | ||
|
|
975b62c735 | ||
|
|
dff2faa63b | ||
|
|
500d3947ef | ||
|
|
2b7b051421 | ||
|
|
8a05850048 | ||
|
|
469d743bec | ||
|
|
c1dfc39706 | ||
|
|
aa5e25db8d | ||
|
|
33cb2e6f70 | ||
|
|
11e4a995c4 | ||
|
|
27fc282bb5 | ||
|
|
9d897c2555 | ||
|
|
cbcf7015bb | ||
|
|
4d5c1ff14e | ||
|
|
d01edcb540 | ||
|
|
bfa8d157c1 | ||
|
|
44b3bcc3fc | ||
|
|
89e186014e | ||
|
|
40bde873bc | ||
|
|
12db2f8011 | ||
|
|
e18a03abc3 | ||
|
|
2205506aa3 | ||
|
|
15c6b7a196 | ||
|
|
9171f12069 | ||
|
|
acf359777e | ||
|
|
a9f91a875b | ||
|
|
4665a2f033 | ||
|
|
673292b995 | ||
|
|
b1d64ee476 | ||
|
|
5fb1e9c120 | ||
|
|
801069d4cc | ||
|
|
d3706a24e4 | ||
|
|
0a4a31d17b | ||
|
|
3838267770 | ||
|
|
2c39714dff | ||
|
|
4291636619 | ||
|
|
189e4e3a64 | ||
|
|
a6ef1cd66b | ||
|
|
f2012eeeb8 | ||
|
|
e2aeab2b60 | ||
|
|
dce4b81728 | ||
|
|
e4adb509e0 | ||
|
|
eae5f9b958 | ||
|
|
9c6951e4ba | ||
|
|
dce6684c59 | ||
|
|
43058ac1d5 | ||
|
|
55c0afbe3a | ||
|
|
b34461febe | ||
|
|
e3c47b60e0 | ||
|
|
7602b868f4 | ||
|
|
880a100a60 | ||
|
|
3b563ab21b | ||
|
|
a86c6dc2c6 | ||
|
|
1476f829c4 | ||
|
|
26acc9a6b1 | ||
|
|
510a231e14 | ||
|
|
3bbbbd07ea | ||
|
|
640b03b671 | ||
|
|
7a3e0445ba | ||
|
|
00a946bc2e | ||
|
|
66251abd38 | ||
|
|
312ce9ad05 | ||
|
|
362e355db2 | ||
|
|
cf2e3227cc | ||
|
|
01f69e6b10 | ||
|
|
a211ea4e68 | ||
|
|
fcde92ad89 | ||
|
|
0fc7aa8cc0 | ||
|
|
be363ef8d4 | ||
|
|
b1daa6a693 | ||
|
|
05793cb104 | ||
|
|
a5c421863e | ||
|
|
e79edabf98 | ||
|
|
d95993554e | ||
|
|
f49e1d32c9 | ||
|
|
a15d4532fa | ||
|
|
27955ae8e9 | ||
|
|
c078968f66 | ||
|
|
f90edd0d9f | ||
|
|
62a9f87f45 | ||
|
|
f510613d55 | ||
|
|
645704dfd3 | ||
|
|
13d56b8b37 | ||
|
|
c5990c4f65 | ||
|
|
94c4baccad | ||
|
|
bb1e208d30 | ||
|
|
fce55993bc | ||
|
|
31c9dbc881 | ||
|
|
c9b0fcaa32 | ||
|
|
37a63d37e2 | ||
|
|
1daacced5a | ||
|
|
cea33e40df | ||
|
|
2b3ac015bb | ||
|
|
1aa0a80de7 | ||
|
|
4dd1156444 | ||
|
|
c10f298dc6 | ||
|
|
e8c0033f5f | ||
|
|
31c29f4318 | ||
|
|
e0be94389e | ||
|
|
d660b29ef0 | ||
|
|
490d3a8f21 | ||
|
|
02c310982e | ||
|
|
c3008512f1 | ||
|
|
22d2fae30c | ||
|
|
dac9ed17f1 | ||
|
|
709194c88c | ||
|
|
8de8af6850 | ||
|
|
7bda8083fb | ||
|
|
a082b57c3f | ||
|
|
547340659f | ||
|
|
29d12ddcbc | ||
|
|
f95fdd4d4e | ||
|
|
bf6db4eee7 | ||
|
|
fe39589771 | ||
|
|
d88f0c4cd1 | ||
|
|
a2a026e116 | ||
|
|
38ad6ed3b3 | ||
|
|
9d72bf4712 | ||
|
|
15429198b8 |
11
.gitignore
vendored
11
.gitignore
vendored
@@ -6,6 +6,10 @@ doc/openthreads.doxyfile
|
|||||||
|
|
||||||
doc/OpenSceneGraphReferenceDocs/
|
doc/OpenSceneGraphReferenceDocs/
|
||||||
doc/OpenThreadsReferenceDocs/
|
doc/OpenThreadsReferenceDocs/
|
||||||
|
doc/*.chm
|
||||||
|
|
||||||
|
CMakeDoxyfile.in
|
||||||
|
CMakeDoxygenDefaults.cmake
|
||||||
|
|
||||||
cmake_uninstall.cmake
|
cmake_uninstall.cmake
|
||||||
|
|
||||||
@@ -59,6 +63,10 @@ install_manifest*.txt
|
|||||||
*.out
|
*.out
|
||||||
*.app
|
*.app
|
||||||
|
|
||||||
|
# Automatically generated Package files
|
||||||
|
packaging/cmake/*
|
||||||
|
configure/*
|
||||||
|
|
||||||
# Platform Specifics - auto generated files
|
# Platform Specifics - auto generated files
|
||||||
PlatformSpecifics/Windows/*.rc
|
PlatformSpecifics/Windows/*.rc
|
||||||
|
|
||||||
@@ -79,6 +87,9 @@ PlatformSpecifics/Windows/*.rc
|
|||||||
*.sdf
|
*.sdf
|
||||||
*.opensdf
|
*.opensdf
|
||||||
|
|
||||||
|
# Visual Studio - Cache/Options Directory
|
||||||
|
.vs/
|
||||||
|
|
||||||
#osx xcode
|
#osx xcode
|
||||||
DerivedData/
|
DerivedData/
|
||||||
*.DS_Store
|
*.DS_Store
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ matrix:
|
|||||||
dist: trusty
|
dist: trusty
|
||||||
language: cpp
|
language: cpp
|
||||||
env:
|
env:
|
||||||
- CMAKECMD_ARGS="-DBUILD_OSG_EXAMPLES=ON -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"
|
- CMAKECMD_ARGS="-DBUILD_OSG_EXAMPLES=OFF -DBUILD_OSG_PLUGINS_BY_DEFAULT=ON -DBUILD_OSG_APPLICATIONS=ON"
|
||||||
#- LLVM_VERSION=3.8
|
#- LLVM_VERSION=3.8
|
||||||
sudo: false
|
sudo: false
|
||||||
cache:
|
cache:
|
||||||
|
|||||||
10
AUTHORS.txt
10
AUTHORS.txt
@@ -1,6 +1,6 @@
|
|||||||
OpenSceneGraph Library 3.6.0
|
OpenSceneGraph Library 3.6.4
|
||||||
|
|
||||||
568 Contributors:
|
570 Contributors:
|
||||||
|
|
||||||
Firstname Surname
|
Firstname Surname
|
||||||
-----------------
|
-----------------
|
||||||
@@ -43,8 +43,8 @@ Chris Hanson
|
|||||||
Roland Smeenk
|
Roland Smeenk
|
||||||
Roger James
|
Roger James
|
||||||
Jeremy Moles
|
Jeremy Moles
|
||||||
J.P. Delport
|
|
||||||
Andy Skinner
|
Andy Skinner
|
||||||
|
J.P. Delport
|
||||||
Magnus Kessler
|
Magnus Kessler
|
||||||
David Fries
|
David Fries
|
||||||
Tom Jolley
|
Tom Jolley
|
||||||
@@ -232,6 +232,7 @@ Dietmar Funck
|
|||||||
Colin Cochran
|
Colin Cochran
|
||||||
Christian Ruzicka
|
Christian Ruzicka
|
||||||
Christian Buchner
|
Christian Buchner
|
||||||
|
Chris Djali
|
||||||
Charles Cole
|
Charles Cole
|
||||||
Blake Williams
|
Blake Williams
|
||||||
Bj<EFBFBD>rn Hein
|
Bj<EFBFBD>rn Hein
|
||||||
@@ -537,9 +538,10 @@ Christophe Herreman
|
|||||||
Christian Noon
|
Christian Noon
|
||||||
Christian Kaser
|
Christian Kaser
|
||||||
Christian Ehrlicher
|
Christian Ehrlicher
|
||||||
|
Chris White
|
||||||
Chris McGlone
|
Chris McGlone
|
||||||
Chris Djali
|
|
||||||
Carlos Garcea
|
Carlos Garcea
|
||||||
|
Capostrophic
|
||||||
Bryce Eldridge
|
Bryce Eldridge
|
||||||
Bruno Herbelin
|
Bruno Herbelin
|
||||||
Brian Keener
|
Brian Keener
|
||||||
|
|||||||
266
CMakeLists.txt
266
CMakeLists.txt
@@ -3,13 +3,13 @@
|
|||||||
#
|
#
|
||||||
SET(OPENSCENEGRAPH_MAJOR_VERSION 3)
|
SET(OPENSCENEGRAPH_MAJOR_VERSION 3)
|
||||||
SET(OPENSCENEGRAPH_MINOR_VERSION 6)
|
SET(OPENSCENEGRAPH_MINOR_VERSION 6)
|
||||||
SET(OPENSCENEGRAPH_PATCH_VERSION 0)
|
SET(OPENSCENEGRAPH_PATCH_VERSION 4)
|
||||||
SET(OPENSCENEGRAPH_SOVERSION 156)
|
SET(OPENSCENEGRAPH_SOVERSION 160)
|
||||||
|
|
||||||
|
|
||||||
# set to 0 when not a release candidate, non zero means that any generated
|
# set to 0 when not a release candidate, non zero means that any generated
|
||||||
# git tags will be treated as release candidates of given number
|
# git tags will be treated as release candidates of given number
|
||||||
SET(OPENSCENEGRAPH_RELEASE_CANDIDATE 0)
|
SET(OPENSCENEGRAPH_RELEASE_CANDIDATE 9)
|
||||||
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE)
|
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE)
|
||||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||||
|
|
||||||
@@ -26,25 +26,10 @@ if(COMMAND cmake_policy)
|
|||||||
|
|
||||||
# tell CMake to prefer CMake's own CMake modules when available
|
# tell CMake to prefer CMake's own CMake modules when available
|
||||||
# only available from cmake-2.8.4
|
# only available from cmake-2.8.4
|
||||||
if(${CMAKE_MAJOR_VERSION} GREATER 2 OR
|
if("${CMAKE_VERSION}" VERSION_GREATER 2.8.3)
|
||||||
(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 8) OR
|
|
||||||
(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 8 AND ${CMAKE_PATCH_VERSION} GREATER 3))
|
|
||||||
cmake_policy(SET CMP0017 NEW)
|
cmake_policy(SET CMP0017 NEW)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# cmake-2.6.1 introduces policy cmp0008 decide how to treat full path libraries that do not appear to be valid library file names
|
|
||||||
# quote from cvslog "Such libraries worked by accident in the VS IDE and Xcode generators in CMake 2.4 and below."
|
|
||||||
if(${CMAKE_MAJOR_VERSION} GREATER 2 OR
|
|
||||||
(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 6) OR
|
|
||||||
(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 6 AND ${CMAKE_PATCH_VERSION} GREATER 0))
|
|
||||||
cmake_policy(SET CMP0008 OLD)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# nicer version check - but needs at least CMake 2.6.2? Worth upgrading the requirements?
|
|
||||||
#if("${CMAKE_VERSION}" VERSION_GREATER 2.8.10)
|
|
||||||
# or even easier (available in cmake-2.6)
|
|
||||||
#if(POLICY CMPxyzw)
|
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
IF(APPLE)
|
IF(APPLE)
|
||||||
@@ -56,6 +41,8 @@ IF(APPLE)
|
|||||||
OSG_OSX_VERSION "${OSG_OSX_VERSION}")
|
OSG_OSX_VERSION "${OSG_OSX_VERSION}")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
PROJECT(OpenSceneGraph)
|
||||||
|
|
||||||
# Set OSX architecture flags here, since they must be specified before
|
# Set OSX architecture flags here, since they must be specified before
|
||||||
# creating the actual OSG project.
|
# creating the actual OSG project.
|
||||||
# Note that the CMAKE_OSX_* variables are not well documented in
|
# Note that the CMAKE_OSX_* variables are not well documented in
|
||||||
@@ -63,67 +50,73 @@ ENDIF()
|
|||||||
# See https://cmake.org/Bug/view.php?id=14695#c34953
|
# See https://cmake.org/Bug/view.php?id=14695#c34953
|
||||||
# Additionally, OSG_WINDOWING_SYSTEM is set here for OSX since its
|
# Additionally, OSG_WINDOWING_SYSTEM is set here for OSX since its
|
||||||
# value is needed to find the correct version of OpenGL (X11 or Cocoa).
|
# 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
|
IF(ANDROID)
|
||||||
# These options are formally defined later, but can also be specified
|
SET(OSG_WINDOWING_SYSTEM "None" CACHE STRING "Windowing system type for graphics window creation; options: None.")
|
||||||
# by the user at the command line using the cmake -D switch
|
ELSEIF(WIN32 OR MINGW)
|
||||||
# Note that FORCE is used since the user will likely enable IPhone
|
SET(OSG_WINDOWING_SYSTEM "Win32" CACHE STRING "Windowing system type for graphics window creation; options: Win32 or None.")
|
||||||
# build via CMake GUI after already having configured once
|
ELSEIF(APPLE)
|
||||||
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
|
# custom option to flag an iOS build
|
||||||
SET(OSG_WINDOWING_SYSTEM "IOS" CACHE STRING "Windowing system type for graphics window creation, options only IOS.")
|
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(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 sdk and min versions
|
||||||
ELSE()
|
SET (IPHONE_SDKVER "10.2" CACHE STRING "IOS SDK-Version")
|
||||||
SET(CMAKE_OSX_ARCHITECTURES "armv7;armv7s;arm64" CACHE STRING "Build architectures for iOS" FORCE)
|
SET (IPHONE_VERSION_MIN "7.0" CACHE STRING "IOS minimum os version, use 7.0 or greater to get 64bit support")
|
||||||
ENDIF()
|
|
||||||
|
# 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")
|
||||||
|
|
||||||
|
# set deployment target to min version
|
||||||
|
SET(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "${IPHONE_VERSION_MIN}" CACHE STRING "Deployment target for iOS" FORCE)
|
||||||
|
|
||||||
|
# Set standard architectures
|
||||||
|
SET(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD)")
|
||||||
|
|
||||||
ELSE()
|
ELSE()
|
||||||
#simulator uses i386 and x86_64 architectures
|
# OSX >= 10.5 uses Cocoa windowing system, otherwise Carbon
|
||||||
SET(CMAKE_OSX_ARCHITECTURES "i386;x86_64" CACHE STRING "Build architectures for iOS Simulator" FORCE)
|
IF(OSG_OSX_VERSION VERSION_LESS 10.5)
|
||||||
ENDIF()
|
SET(OSG_WINDOWING_SYSTEM "Carbon" CACHE STRING "Windowing system type for graphics window creation; options: Carbon, Cocoa, X11 or None.")
|
||||||
|
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 defaults for Universal Binaries. We want 32-bit Intel/PPC on 10.4
|
||||||
SET(CMAKE_OSX_SYSROOT "${IPHONE_SDKROOT}" CACHE STRING "System root for iOS" FORCE)
|
# 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
|
||||||
ELSE()
|
# the user at any time.
|
||||||
# OSX >= 10.5 uses Cocoa windowing system, otherwise Carbon
|
IF(OSG_OSX_VERSION VERSION_GREATER 10.7)
|
||||||
IF(OSG_OSX_VERSION VERSION_LESS 10.5)
|
# 64 Bit Works, i386,ppc is not supported any more
|
||||||
SET(OSG_WINDOWING_SYSTEM "Carbon" CACHE STRING "Windowing system type for graphics window creation, options Carbon, Cocoa or X11.")
|
SET(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architectures for OSX")
|
||||||
ELSE()
|
SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.8" CACHE STRING "Target OSX version")
|
||||||
SET(OSG_WINDOWING_SYSTEM "Cocoa" CACHE STRING "Windowing system type for graphics window creation, options Carbon, Cocoa or X11.")
|
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()
|
ENDIF()
|
||||||
|
ELSE()
|
||||||
# Set defaults for Universal Binaries. We want 32-bit Intel/PPC on 10.4
|
SET(OSG_WINDOWING_SYSTEM "X11" CACHE STRING "Windowing system type for graphics window creation; options: X11 or None.")
|
||||||
# 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()
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
PROJECT(OpenSceneGraph)
|
|
||||||
|
|
||||||
SET(OPENSCENEGRAPH_VERSION ${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION})
|
SET(OPENSCENEGRAPH_VERSION ${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION})
|
||||||
|
|
||||||
@@ -233,40 +226,15 @@ ENDIF(OSG_MAINTAINER)
|
|||||||
|
|
||||||
IF(NOT ANDROID)
|
IF(NOT ANDROID)
|
||||||
IF(APPLE)
|
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 the sdk path as our sysroot, if we set this before the project is defined cmake fails to build its test program
|
||||||
SET (IPHONE_SDKVER "10.2" CACHE STRING "IOS SDK-Version")
|
SET(CMAKE_OSX_SYSROOT "${IPHONE_SDKROOT}" CACHE STRING "System root for iOS" FORCE)
|
||||||
SET (IPHONE_VERSION_MIN "7.0" CACHE STRING "IOS minimum os version, use 7.0 or greater to get 64bit support")
|
|
||||||
|
|
||||||
#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
|
# Set the path to OpenGL library
|
||||||
# Force gcc <= 4.2 on iPhone
|
SET(OPENGL_gl_LIBRARY "${IPHONE_SDKROOT}/System/Library/Frameworks/OpenGLES.framework")
|
||||||
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 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 ()
|
ELSE ()
|
||||||
FIND_LIBRARY(CARBON_LIBRARY Carbon)
|
FIND_LIBRARY(CARBON_LIBRARY Carbon)
|
||||||
FIND_LIBRARY(COCOA_LIBRARY Cocoa)
|
FIND_LIBRARY(COCOA_LIBRARY Cocoa)
|
||||||
@@ -330,13 +298,14 @@ IF(UNIX AND NOT ANDROID)
|
|||||||
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(${OpenSceneGraph_SOURCE_DIR}/include/)
|
|
||||||
|
|
||||||
# Make the headers visible to everything
|
# Make the headers visible to everything
|
||||||
IF(NOT ${PROJECT_BINARY_DIR} EQUAL ${PROJECT_SOURCE_DIR})
|
IF(NOT ${PROJECT_BINARY_DIR} EQUAL ${PROJECT_SOURCE_DIR})
|
||||||
INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}/include)
|
INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}/include)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
INCLUDE_DIRECTORIES(${OpenSceneGraph_SOURCE_DIR}/include/)
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(SYSTEM ${OPENGL_INCLUDE_DIR})
|
INCLUDE_DIRECTORIES(SYSTEM ${OPENGL_INCLUDE_DIR})
|
||||||
|
|
||||||
# Common global definitions
|
# Common global definitions
|
||||||
@@ -468,6 +437,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)
|
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)
|
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)
|
IF (WIN32)
|
||||||
OPTION(OSG_USE_UTF8_FILENAME "Set to ON to use a UTF8 locale for filenames instead of the default locale." OFF)
|
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)
|
MARK_AS_ADVANCED(OSG_USE_UTF8_FILENAME)
|
||||||
@@ -529,6 +501,12 @@ ENDIF()
|
|||||||
|
|
||||||
OPTION(OSG_GL_LIBRARY_STATIC "Set to ON to statically link with OpenGL/GLES library." OFF)
|
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
|
# Map the OSG_GL*_AVAILABLE settings to OSG_GL_* settings
|
||||||
IF (OSG_GLES2_AVAILABLE OR OSG_GLES3_AVAILABLE OR OSG_GL3_AVAILABLE)
|
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)
|
OPTION(OSG_GL_DISPLAYLISTS_AVAILABLE "Set to OFF to disable use of OpenGL display lists." OFF)
|
||||||
@@ -558,7 +536,11 @@ ENDIF()
|
|||||||
|
|
||||||
|
|
||||||
# Map the OSG_GL*_AVAILABLE settings to OpenGL header settings
|
# Map the OSG_GL*_AVAILABLE settings to OpenGL header settings
|
||||||
|
SET(DEFAULT_GL_CONTEXT_VERSION "1.0")
|
||||||
IF (OSG_GL3_AVAILABLE)
|
IF (OSG_GL3_AVAILABLE)
|
||||||
|
|
||||||
|
SET(DEFAULT_GL_CONTEXT_VERSION "3.3")
|
||||||
|
|
||||||
IF (APPLE)
|
IF (APPLE)
|
||||||
SET(OPENGL_HEADER1 "#include <OpenGL/gl.h>" CACHE STRING "#include<> line for OpenGL Header")
|
SET(OPENGL_HEADER1 "#include <OpenGL/gl.h>" CACHE STRING "#include<> line for OpenGL Header")
|
||||||
SET(OPENGL_HEADER2 "#include <OpenGL/gl3.h>" CACHE STRING "#include<> line for additional OpenGL Headers if required")
|
SET(OPENGL_HEADER2 "#include <OpenGL/gl3.h>" CACHE STRING "#include<> line for additional OpenGL Headers if required")
|
||||||
@@ -571,7 +553,7 @@ IF (OSG_GL3_AVAILABLE)
|
|||||||
SET(OPENGL_HEADER1 "#include <GL/glcorearb.h>" CACHE STRING "#include<> line for OpenGL Header")
|
SET(OPENGL_HEADER1 "#include <GL/glcorearb.h>" CACHE STRING "#include<> line for OpenGL Header")
|
||||||
SET(OPENGL_HEADER2 "" CACHE STRING "#include<> line for additional OpenGL Headers if required")
|
SET(OPENGL_HEADER2 "" CACHE STRING "#include<> line for additional OpenGL Headers if required")
|
||||||
ELSE()
|
ELSE()
|
||||||
SET(OPENGL_HEADER1 "#include <GL3/gl3.h>" CACHE STRING "#include<> line for OpenGL Header")
|
SET(OPENGL_HEADER1 "#include <GL/gl.h>" CACHE STRING "#include<> line for OpenGL Header")
|
||||||
SET(OPENGL_HEADER2 "" CACHE STRING "#include<> line for additional OpenGL Headers if required")
|
SET(OPENGL_HEADER2 "" CACHE STRING "#include<> line for additional OpenGL Headers if required")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
@@ -610,6 +592,8 @@ ELSE()
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
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)
|
IF (OSG_GL1_AVAILABLE)
|
||||||
SET(OSG_GL1_FEATURES 1)
|
SET(OSG_GL1_FEATURES 1)
|
||||||
ELSE()
|
ELSE()
|
||||||
@@ -762,8 +746,6 @@ ELSE()
|
|||||||
FIND_PACKAGE(COLLADA)
|
FIND_PACKAGE(COLLADA)
|
||||||
FIND_PACKAGE(FBX)
|
FIND_PACKAGE(FBX)
|
||||||
FIND_PACKAGE(ZLIB)
|
FIND_PACKAGE(ZLIB)
|
||||||
FIND_PACKAGE(Xine)
|
|
||||||
FIND_PACKAGE(OpenVRML)
|
|
||||||
FIND_PACKAGE(GDAL)
|
FIND_PACKAGE(GDAL)
|
||||||
FIND_PACKAGE(GTA)
|
FIND_PACKAGE(GTA)
|
||||||
FIND_PACKAGE(CURL)
|
FIND_PACKAGE(CURL)
|
||||||
@@ -809,9 +791,7 @@ IF (BUILD_OSG_EXAMPLES AND NOT ANDROID)
|
|||||||
|
|
||||||
FIND_PACKAGE(FLTK)
|
FIND_PACKAGE(FLTK)
|
||||||
FIND_PACKAGE(FOX)
|
FIND_PACKAGE(FOX)
|
||||||
|
FIND_PACKAGE(wxWidgets COMPONENTS base core gl net)
|
||||||
SET(wxWidgets_USE_LIBS base core gl net)
|
|
||||||
FIND_PACKAGE(wxWidgets)
|
|
||||||
|
|
||||||
ENDIF(BUILD_OSG_EXAMPLES AND NOT ANDROID)
|
ENDIF(BUILD_OSG_EXAMPLES AND NOT ANDROID)
|
||||||
|
|
||||||
@@ -902,10 +882,26 @@ IF(CYGWIN)
|
|||||||
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG")
|
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(UNIX AND NOT WIN32 AND NOT APPLE)
|
# Set OSG_INSTALL_LIBDIR to specify the installation directories of object code libraries
|
||||||
IF(CMAKE_SIZEOF_VOID_P MATCHES "8")
|
IF(DEFINED LIB_POSTFIX)
|
||||||
SET(LIB_POSTFIX "64" CACHE STRING "suffix for 32/64 dir placement")
|
# Use LIB_POSTFIX if defined
|
||||||
MARK_AS_ADVANCED(LIB_POSTFIX)
|
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()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(NOT DEFINED LIB_POSTFIX)
|
IF(NOT DEFINED LIB_POSTFIX)
|
||||||
@@ -1116,41 +1112,15 @@ ENDIF()
|
|||||||
|
|
||||||
IF(APPLE AND NOT ANDROID)
|
IF(APPLE AND NOT ANDROID)
|
||||||
|
|
||||||
#Here we check if the user specified IPhone SDK
|
IF(OSG_BUILD_PLATFORM_IPHONE)
|
||||||
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
|
|
||||||
|
|
||||||
#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
|
# set osg window system to iOS
|
||||||
IF(OSG_BUILD_PLATFORM_IPHONE)
|
SET(OSG_WINDOWING_SYSTEM "IOS" CACHE STRING "Windowing system type for graphics window creation, options only IOS." FORCE)
|
||||||
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(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -miphoneos-version-min=${IPHONE_VERSION_MIN}" FORCE)
|
# set osg default image plugin
|
||||||
|
|
||||||
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_FOR_OSX "imageio" CACHE STRING "Forced imageio default image plugin for iOS" FORCE)
|
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)
|
OPTION(OSG_BUILD_APPLICATION_BUNDLES "Enable the building of applications and examples as OSX Bundles" ON)
|
||||||
|
|
||||||
ELSE()
|
ELSE()
|
||||||
@@ -1376,6 +1346,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")
|
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()
|
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
|
### uninstall target
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
@@ -1387,4 +1364,5 @@ ADD_CUSTOM_TARGET(uninstall
|
|||||||
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
|
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
|
||||||
|
|
||||||
#
|
#
|
||||||
|
include(FeatureSummary)
|
||||||
|
feature_summary(WHAT ALL)
|
||||||
|
|||||||
@@ -25,11 +25,14 @@ ENDIF()
|
|||||||
|
|
||||||
IF(APPLE)
|
IF(APPLE)
|
||||||
SET(COLLADA_BUILDNAME "mac")
|
SET(COLLADA_BUILDNAME "mac")
|
||||||
SET(COLLADA_BOOST_BUILDNAME ${COLLADA_BUILDNAME})
|
SET(COLLADA_BOOST_BUILDNAME ${COLLADA_BUILDNAME})
|
||||||
ELSEIF(MINGW)
|
ELSEIF(MINGW)
|
||||||
SET(COLLADA_BUILDNAME "mingw")
|
SET(COLLADA_BUILDNAME "mingw")
|
||||||
SET(COLLADA_BOOST_BUILDNAME ${COLLADA_BUILDNAME})
|
SET(COLLADA_BOOST_BUILDNAME ${COLLADA_BUILDNAME})
|
||||||
ELSEIF(MSVC_VERSION EQUAL 1900 OR MSVC_VERSION EQUAL 1910 )
|
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_BUILDNAME "vc14")
|
||||||
SET(COLLADA_BOOST_BUILDNAME "vc140")
|
SET(COLLADA_BOOST_BUILDNAME "vc140")
|
||||||
ELSEIF(MSVC_VERSION EQUAL 1800)
|
ELSEIF(MSVC_VERSION EQUAL 1800)
|
||||||
|
|||||||
@@ -60,6 +60,9 @@ SET(FBX_LIBNAME_DEBUG ${FBX_LIBNAME}d)
|
|||||||
|
|
||||||
SET( FBX_SEARCH_PATHS
|
SET( FBX_SEARCH_PATHS
|
||||||
$ENV{FBX_DIR}
|
$ENV{FBX_DIR}
|
||||||
|
"$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{ProgramW6432}/Autodesk/FBX/FBX SDK/2018.1.1"
|
||||||
"$ENV{PROGRAMFILES}/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.0"
|
||||||
|
|||||||
101
CMakeModules/FindFontconfig.cmake
Normal file
101
CMakeModules/FindFontconfig.cmake
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
# 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()
|
||||||
@@ -225,7 +225,7 @@ MACRO(SETUP_LIBRARY LIB_NAME)
|
|||||||
)
|
)
|
||||||
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES FOLDER "OSG Core")
|
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES FOLDER "OSG Core")
|
||||||
IF(APPLE)
|
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})
|
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE ${IPHONE_ENABLE_BITCODE})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
|
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
|
||||||
@@ -336,7 +336,7 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
|
|||||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES FOLDER "Plugins")
|
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES FOLDER "Plugins")
|
||||||
IF(APPLE)
|
IF(APPLE)
|
||||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
|
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})
|
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE ${IPHONE_ENABLE_BITCODE})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
@@ -429,7 +429,7 @@ MACRO(SETUP_EXE IS_COMMANDLINE_APP)
|
|||||||
|
|
||||||
IF(APPLE)
|
IF(APPLE)
|
||||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
|
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})
|
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE ${IPHONE_ENABLE_BITCODE})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|||||||
63
LICENSE.txt
63
LICENSE.txt
@@ -1,7 +1,7 @@
|
|||||||
OpenSceneGraph Public License, Version 0.0
|
OpenSceneGraph Public License, Version 1.0
|
||||||
==========================================
|
==========================================
|
||||||
|
|
||||||
Copyright (C) 2002 Robert Osfield.
|
Copyright (C) 2018 Robert Osfield.
|
||||||
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
of this licence document, but changing it is not allowed.
|
of this licence document, but changing it is not allowed.
|
||||||
@@ -13,17 +13,18 @@
|
|||||||
under the terms of the OpenSceneGraph Public License (OSGPL) version 0.0
|
under the terms of the OpenSceneGraph Public License (OSGPL) version 0.0
|
||||||
or later.
|
or later.
|
||||||
|
|
||||||
Notes: the OSGPL is based on the LGPL, with the 4 exceptions laid
|
Notes: the OSGPL is based on the LGPL-2.1-only WITH WxWindows-exception-3.1,
|
||||||
out in the wxWindows section below. The LGPL is contained in the
|
with the 4 exceptions laid out in the wxWindows section below. The LGPL is
|
||||||
final section of this license.
|
contained in the final section of this license.
|
||||||
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
wxWindows Library Licence, Version 3
|
|
||||||
====================================
|
|
||||||
|
|
||||||
Copyright (C) 1998 Julian Smart, Robert Roebling [, ...]
|
wxWindows Library Licence, Version 3.1
|
||||||
|
======================================
|
||||||
|
|
||||||
|
Copyright (c) 1998-2005 Julian Smart, Robert Roebling et al
|
||||||
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
of this licence document, but changing it is not allowed.
|
of this licence document, but changing it is not allowed.
|
||||||
@@ -43,20 +44,20 @@
|
|||||||
|
|
||||||
You should have received a copy of the GNU Library General Public Licence
|
You should have received a copy of the GNU Library General Public Licence
|
||||||
along with this software, usually in a file named COPYING.LIB. If not,
|
along with this software, usually in a file named COPYING.LIB. If not,
|
||||||
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
Boston, MA 02111-1307 USA.
|
Boston, MA 02110-1301 USA.
|
||||||
|
|
||||||
EXCEPTION NOTICE
|
EXCEPTION NOTICE
|
||||||
|
|
||||||
1. As a special exception, the copyright holders of this library give
|
1. As a special exception, the copyright holders of this library give
|
||||||
permission for additional uses of the text contained in this release of
|
permission for additional uses of the text contained in this release of
|
||||||
the library as licensed under the wxWindows Library Licence, applying
|
the library as licenced under the wxWindows Library Licence, applying
|
||||||
either version 3 of the Licence, or (at your option) any later version of
|
either version 3.1 of the Licence, or (at your option) any later version of
|
||||||
the Licence as published by the copyright holders of version 3 of the
|
the Licence as published by the copyright holders of version
|
||||||
Licence document.
|
3.1 of the Licence document.
|
||||||
|
|
||||||
2. The exception is that you may use, copy, link, modify and distribute
|
2. The exception is that you may use, copy, link, modify and distribute
|
||||||
under the user's own terms, binary object code versions of works based
|
under your own terms, binary object code versions of works based
|
||||||
on the Library.
|
on the Library.
|
||||||
|
|
||||||
3. If you copy code from files distributed under the terms of the GNU
|
3. If you copy code from files distributed under the terms of the GNU
|
||||||
@@ -73,9 +74,11 @@
|
|||||||
code and/or adjust the licensing conditions notice accordingly.
|
code and/or adjust the licensing conditions notice accordingly.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
GNU LESSER GENERAL PUBLIC LICENSE
|
|
||||||
Version 2.1, February 1999
|
GNU LESSER GENERAL PUBLIC LICENSE
|
||||||
|
Version 2.1, February 1999
|
||||||
|
|
||||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
@@ -86,7 +89,7 @@
|
|||||||
as the successor of the GNU Library Public License, version 2, hence
|
as the successor of the GNU Library Public License, version 2, hence
|
||||||
the version number 2.1.]
|
the version number 2.1.]
|
||||||
|
|
||||||
Preamble
|
Preamble
|
||||||
|
|
||||||
The licenses for most software are designed to take away your
|
The licenses for most software are designed to take away your
|
||||||
freedom to share and change it. By contrast, the GNU General Public
|
freedom to share and change it. By contrast, the GNU General Public
|
||||||
@@ -131,7 +134,7 @@ modified by someone else and passed on, the recipients should know
|
|||||||
that what they have is not the original version, so that the original
|
that what they have is not the original version, so that the original
|
||||||
author's reputation will not be affected by problems that might be
|
author's reputation will not be affected by problems that might be
|
||||||
introduced by others.
|
introduced by others.
|
||||||
|
|
||||||
Finally, software patents pose a constant threat to the existence of
|
Finally, software patents pose a constant threat to the existence of
|
||||||
any free program. We wish to make sure that a company cannot
|
any free program. We wish to make sure that a company cannot
|
||||||
effectively restrict the users of a free program by obtaining a
|
effectively restrict the users of a free program by obtaining a
|
||||||
@@ -187,8 +190,8 @@ modification follow. Pay close attention to the difference between a
|
|||||||
"work based on the library" and a "work that uses the library". The
|
"work based on the library" and a "work that uses the library". The
|
||||||
former contains code derived from the library, whereas the latter must
|
former contains code derived from the library, whereas the latter must
|
||||||
be combined with the library in order to run.
|
be combined with the library in order to run.
|
||||||
|
|
||||||
GNU LESSER GENERAL PUBLIC LICENSE
|
GNU LESSER GENERAL PUBLIC LICENSE
|
||||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||||
|
|
||||||
0. This License Agreement applies to any software library or other
|
0. This License Agreement applies to any software library or other
|
||||||
@@ -234,7 +237,7 @@ Library.
|
|||||||
You may charge a fee for the physical act of transferring a copy,
|
You may charge a fee for the physical act of transferring a copy,
|
||||||
and you may at your option offer warranty protection in exchange for a
|
and you may at your option offer warranty protection in exchange for a
|
||||||
fee.
|
fee.
|
||||||
|
|
||||||
2. You may modify your copy or copies of the Library or any portion
|
2. You may modify your copy or copies of the Library or any portion
|
||||||
of it, thus forming a work based on the Library, and copy and
|
of it, thus forming a work based on the Library, and copy and
|
||||||
distribute such modifications or work under the terms of Section 1
|
distribute such modifications or work under the terms of Section 1
|
||||||
@@ -292,7 +295,7 @@ instead of to this License. (If a newer version than version 2 of the
|
|||||||
ordinary GNU General Public License has appeared, then you can specify
|
ordinary GNU General Public License has appeared, then you can specify
|
||||||
that version instead if you wish.) Do not make any other change in
|
that version instead if you wish.) Do not make any other change in
|
||||||
these notices.
|
these notices.
|
||||||
|
|
||||||
Once this change is made in a given copy, it is irreversible for
|
Once this change is made in a given copy, it is irreversible for
|
||||||
that copy, so the ordinary GNU General Public License applies to all
|
that copy, so the ordinary GNU General Public License applies to all
|
||||||
subsequent copies and derivative works made from that copy.
|
subsequent copies and derivative works made from that copy.
|
||||||
@@ -343,7 +346,7 @@ Library will still fall under Section 6.)
|
|||||||
distribute the object code for the work under the terms of Section 6.
|
distribute the object code for the work under the terms of Section 6.
|
||||||
Any executables containing that work also fall under Section 6,
|
Any executables containing that work also fall under Section 6,
|
||||||
whether or not they are linked directly with the Library itself.
|
whether or not they are linked directly with the Library itself.
|
||||||
|
|
||||||
6. As an exception to the Sections above, you may also combine or
|
6. As an exception to the Sections above, you may also combine or
|
||||||
link a "work that uses the Library" with the Library to produce a
|
link a "work that uses the Library" with the Library to produce a
|
||||||
work containing portions of the Library, and distribute that work
|
work containing portions of the Library, and distribute that work
|
||||||
@@ -405,7 +408,7 @@ restrictions of other proprietary libraries that do not normally
|
|||||||
accompany the operating system. Such a contradiction means you cannot
|
accompany the operating system. Such a contradiction means you cannot
|
||||||
use both them and the Library together in an executable that you
|
use both them and the Library together in an executable that you
|
||||||
distribute.
|
distribute.
|
||||||
|
|
||||||
7. You may place library facilities that are a work based on the
|
7. You may place library facilities that are a work based on the
|
||||||
Library side-by-side in a single library together with other library
|
Library side-by-side in a single library together with other library
|
||||||
facilities not covered by this License, and distribute such a combined
|
facilities not covered by this License, and distribute such a combined
|
||||||
@@ -446,7 +449,7 @@ subject to these terms and conditions. You may not impose any further
|
|||||||
restrictions on the recipients' exercise of the rights granted herein.
|
restrictions on the recipients' exercise of the rights granted herein.
|
||||||
You are not responsible for enforcing compliance by third parties with
|
You are not responsible for enforcing compliance by third parties with
|
||||||
this License.
|
this License.
|
||||||
|
|
||||||
11. If, as a consequence of a court judgment or allegation of patent
|
11. If, as a consequence of a court judgment or allegation of patent
|
||||||
infringement or for any other reason (not limited to patent issues),
|
infringement or for any other reason (not limited to patent issues),
|
||||||
conditions are imposed on you (whether by court order, agreement or
|
conditions are imposed on you (whether by court order, agreement or
|
||||||
@@ -498,7 +501,7 @@ conditions either of that version or of any later version published by
|
|||||||
the Free Software Foundation. If the Library does not specify a
|
the Free Software Foundation. If the Library does not specify a
|
||||||
license version number, you may choose any version ever published by
|
license version number, you may choose any version ever published by
|
||||||
the Free Software Foundation.
|
the Free Software Foundation.
|
||||||
|
|
||||||
14. If you wish to incorporate parts of the Library into other free
|
14. If you wish to incorporate parts of the Library into other free
|
||||||
programs whose distribution conditions are incompatible with these,
|
programs whose distribution conditions are incompatible with these,
|
||||||
write to the author to ask for permission. For software which is
|
write to the author to ask for permission. For software which is
|
||||||
@@ -508,7 +511,7 @@ decision will be guided by the two goals of preserving the free status
|
|||||||
of all derivatives of our free software and of promoting the sharing
|
of all derivatives of our free software and of promoting the sharing
|
||||||
and reuse of software generally.
|
and reuse of software generally.
|
||||||
|
|
||||||
NO WARRANTY
|
NO WARRANTY
|
||||||
|
|
||||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||||
@@ -531,8 +534,8 @@ FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
|||||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||||
DAMAGES.
|
DAMAGES.
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
How to Apply These Terms to Your New Libraries
|
How to Apply These Terms to Your New Libraries
|
||||||
|
|
||||||
If you develop a new library, and you want it to be of the greatest
|
If you develop a new library, and you want it to be of the greatest
|
||||||
|
|||||||
19
README.md
19
README.md
@@ -25,7 +25,7 @@ If details below are not sufficient then head over to the openscenegraph.org to
|
|||||||
|
|
||||||
Robert Osfield.
|
Robert Osfield.
|
||||||
Project Lead.
|
Project Lead.
|
||||||
7th April 2018.
|
25th July 2019.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -88,13 +88,14 @@ Many of the example programs use command-line arguments. When double-clicking on
|
|||||||
|
|
||||||
## Section 3. Release notes on iOS build, by Thomas Hogarth
|
## 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 \
|
cmake ./ -G Xcode -DOSG_BUILD_PLATFORM_IPHONE:BOOL=ON \
|
||||||
-DIPHONE_SDKVER="10.2" \
|
-DIPHONE_SDKVER="11.4" \
|
||||||
-DIPHONE_VERSION_MIN="8.0" \
|
-DIPHONE_VERSION_MIN="10.0" \
|
||||||
-DOPENGL_PROFILE:STRING=GLES2 \
|
-DOPENGL_PROFILE:STRING=GLES3 \
|
||||||
|
-DOSG_CPP_EXCEPTIONS_AVAILABLE:BOOL=ON \
|
||||||
-DBUILD_OSG_APPLICATIONS:BOOL=OFF \
|
-DBUILD_OSG_APPLICATIONS:BOOL=OFF \
|
||||||
-DBUILD_OSG_EXAMPLES:BOOL=ON \
|
-DBUILD_OSG_EXAMPLES:BOOL=ON \
|
||||||
-DOSG_WINDOWING_SYSTEM:STRING=IOS \
|
-DOSG_WINDOWING_SYSTEM:STRING=IOS \
|
||||||
@@ -105,15 +106,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" \
|
-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_freetype2:PATH="$THIRDPARTY_PATH/freetype-ios-universal/include/freetype" \
|
||||||
-DFREETYPE_INCLUDE_DIR_ft2build:PATH="$THIRDPARTY_PATH/freetype-ios-universal/include" \
|
-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_INCLUDE_DIR:PATH="$THIRDPARTY_PATH/tiff-ios-device/include" \
|
||||||
-DTIFF_LIBRARY:PATH="$THIRDPARTY_PATH/tiff-ios-device/lib/libtiff.a" \
|
-DTIFF_LIBRARY:PATH="$THIRDPARTY_PATH/tiff-ios-device/lib/libtiff.a" \
|
||||||
-DGDAL_INCLUDE_DIR:PATH="$THIRDPARTY_PATH/gdal-ios-device/include" \
|
-DGDAL_INCLUDE_DIR:PATH="$THIRDPARTY_PATH/gdal-ios-device/include" \
|
||||||
-DGDAL_LIBRARY:PATH="$THIRDPARTY_PATH/gdal-ios-device/lib/libgdal.a"
|
-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.
|
Once this is done you should be able to build and deploy the `example_osgViewerIPhone` target on your device.
|
||||||
@@ -45,6 +45,8 @@ class MyGraphicsContext {
|
|||||||
traits->doubleBuffer = false;
|
traits->doubleBuffer = false;
|
||||||
traits->sharedContext = 0;
|
traits->sharedContext = 0;
|
||||||
traits->pbuffer = true;
|
traits->pbuffer = true;
|
||||||
|
traits->readDISPLAY();
|
||||||
|
traits->setUndefinedScreenDetailsToDefaultScreen();
|
||||||
|
|
||||||
_gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
_gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
||||||
|
|
||||||
@@ -769,7 +771,7 @@ int main( int argc, char **argv )
|
|||||||
osgDB::Registry::instance()->getOptions()->setObjectCacheHint(osgDB::Options::CACHE_ALL);
|
osgDB::Registry::instance()->getOptions()->setObjectCacheHint(osgDB::Options::CACHE_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string fileNameOut("converted.osg");
|
std::string fileNameOut("converted.osgt");
|
||||||
if (fileNames.size()>1)
|
if (fileNames.size()>1)
|
||||||
{
|
{
|
||||||
fileNameOut = fileNames.back();
|
fileNameOut = fileNames.back();
|
||||||
@@ -778,29 +780,66 @@ int main( int argc, char **argv )
|
|||||||
|
|
||||||
osg::Timer_t startTick = osg::Timer::instance()->tick();
|
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::ref_ptr<osg::Object> object = osgDB::readObjectFile(*itr);
|
||||||
osg::notify(osg::INFO)<<"Time to load files "<<osg::Timer::instance()->delta_m(startTick, endTick)<<" ms"<<std::endl;
|
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)
|
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;
|
||||||
PruneStateSetVisitor pssv;
|
|
||||||
root->accept(pssv);
|
|
||||||
}
|
|
||||||
|
|
||||||
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);
|
osg::ref_ptr<osg::Group> group = new osg::Group;
|
||||||
root->accept(atv);
|
for(Nodes::iterator itr = nodes.begin();
|
||||||
|
itr != nodes.end();
|
||||||
|
++itr)
|
||||||
|
{
|
||||||
|
group->addChild(itr->get());
|
||||||
|
}
|
||||||
|
|
||||||
|
root = group;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( root.valid() )
|
if ( root.valid() )
|
||||||
{
|
{
|
||||||
|
if (pruneStateSet)
|
||||||
|
{
|
||||||
|
PruneStateSetVisitor pssv;
|
||||||
|
root->accept(pssv);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fixTransparencyMode != FixTransparencyVisitor::NO_TRANSPARANCY_FIXING)
|
||||||
|
{
|
||||||
|
FixTransparencyVisitor atv(fixTransparencyMode);
|
||||||
|
root->accept(atv);
|
||||||
|
}
|
||||||
|
|
||||||
if (smooth)
|
if (smooth)
|
||||||
{
|
{
|
||||||
@@ -866,6 +905,20 @@ int main( int argc, char **argv )
|
|||||||
osg::notify(osg::NOTICE)<<result.message()<< std::endl;
|
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
|
else
|
||||||
{
|
{
|
||||||
osg::notify(osg::NOTICE)<<"Error no data loaded."<< std::endl;
|
osg::notify(osg::NOTICE)<<"Error no data loaded."<< std::endl;
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
#include <osg/Plane>
|
#include <osg/Plane>
|
||||||
#include <osg/BoundingBox>
|
#include <osg/BoundingBox>
|
||||||
#include <osg/BoundingSphere>
|
#include <osg/BoundingSphere>
|
||||||
|
#include <osg/Quat>
|
||||||
|
|
||||||
#ifdef BUILD_CONTRIBUTORS
|
#ifdef BUILD_CONTRIBUTORS
|
||||||
extern void printContributors(const std::string& changeLog, bool printNumEntries);
|
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("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("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("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
|
#ifdef BUILD_CONTRIBUTORS
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("-r <file> or --read <file>", "Read the ChangeLog to generate an estimated contributors list.");
|
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;
|
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;
|
cout << osgGetLibraryName() << " " << osgGetVersion() << endl << endl;
|
||||||
|
|
||||||
#ifdef BUILD_CONTRIBUTORS
|
#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("-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("--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("--device <device-name>","add named device to the viewer");
|
||||||
|
arguments.getApplicationUsage()->addCommandLineOption("--stats","print out load and compile timing stats");
|
||||||
|
|
||||||
osgViewer::Viewer viewer(arguments);
|
osgViewer::Viewer viewer(arguments);
|
||||||
|
|
||||||
@@ -71,6 +72,8 @@ int main(int argc, char** argv)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool printStats = arguments.read("--stats");
|
||||||
|
|
||||||
std::string url, username, password;
|
std::string url, username, password;
|
||||||
while(arguments.read("--login",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))
|
while (arguments.read("-p",pathfile))
|
||||||
{
|
{
|
||||||
osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile);
|
osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile);
|
||||||
if (apm || !apm->valid())
|
if (apm && !apm->getAnimationPath()->empty())
|
||||||
{
|
{
|
||||||
apm->setTimeScale(animationSpeed);
|
apm->setTimeScale(animationSpeed);
|
||||||
|
|
||||||
@@ -147,6 +150,8 @@ int main(int argc, char** argv)
|
|||||||
// add the screen capture handler
|
// add the screen capture handler
|
||||||
viewer.addEventHandler(new osgViewer::ScreenCaptureHandler);
|
viewer.addEventHandler(new osgViewer::ScreenCaptureHandler);
|
||||||
|
|
||||||
|
osg::ElapsedTime elapsedTime;
|
||||||
|
|
||||||
// load the data
|
// load the data
|
||||||
osg::ref_ptr<osg::Node> loadedModel = osgDB::readRefNodeFiles(arguments);
|
osg::ref_ptr<osg::Node> loadedModel = osgDB::readRefNodeFiles(arguments);
|
||||||
if (!loadedModel)
|
if (!loadedModel)
|
||||||
@@ -155,6 +160,15 @@ int main(int argc, char** argv)
|
|||||||
return 1;
|
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.
|
// any option left unread are converted into errors to write out later.
|
||||||
arguments.reportRemainingOptionsAsUnrecognized();
|
arguments.reportRemainingOptionsAsUnrecognized();
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
|
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||||
*
|
*
|
||||||
* This software is open source and may be redistributed and/or modified under
|
* This library is open source and may be redistributed and/or modified under
|
||||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||||
* The full license is in LICENSE.txt file included with this distribution,.
|
* (at your option) any later version. The full license is in LICENSE file
|
||||||
|
* included with this distribution, and on the openscenegraph.org website.
|
||||||
*
|
*
|
||||||
* This software is distributed in the hope that it will be useful,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* include LICENSE.txt for more details.
|
* OpenSceneGraph Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "Cluster.h"
|
#include "Cluster.h"
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
|
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||||
*
|
*
|
||||||
* This software is open source and may be redistributed and/or modified under
|
* This library is open source and may be redistributed and/or modified under
|
||||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||||
* The full license is in LICENSE.txt file included with this distribution,.
|
* (at your option) any later version. The full license is in LICENSE file
|
||||||
|
* included with this distribution, and on the openscenegraph.org website.
|
||||||
*
|
*
|
||||||
* This software is distributed in the hope that it will be useful,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* include LICENSE.txt for more details.
|
* OpenSceneGraph Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CLUSTER_H
|
#ifndef CLUSTER_H
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
|
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||||
*
|
*
|
||||||
* This software is open source and may be redistributed and/or modified under
|
* This library is open source and may be redistributed and/or modified under
|
||||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||||
* The full license is in LICENSE.txt file included with this distribution,.
|
* (at your option) any later version. The full license is in LICENSE file
|
||||||
|
* included with this distribution, and on the openscenegraph.org website.
|
||||||
*
|
*
|
||||||
* This software is distributed in the hope that it will be useful,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* include LICENSE.txt for more details.
|
* OpenSceneGraph Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ExportHTML.h"
|
#include "ExportHTML.h"
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
|
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||||
*
|
*
|
||||||
* This software is open source and may be redistributed and/or modified under
|
* This library is open source and may be redistributed and/or modified under
|
||||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||||
* The full license is in LICENSE.txt file included with this distribution,.
|
* (at your option) any later version. The full license is in LICENSE file
|
||||||
|
* included with this distribution, and on the openscenegraph.org website.
|
||||||
*
|
*
|
||||||
* This software is distributed in the hope that it will be useful,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* include LICENSE.txt for more details.
|
* OpenSceneGraph Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef EXPORTHTML_H
|
#ifndef EXPORTHTML_H
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
|
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||||
*
|
*
|
||||||
* This software is open source and may be redistributed and/or modified under
|
* This library is open source and may be redistributed and/or modified under
|
||||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||||
* The full license is in LICENSE.txt file included with this distribution,.
|
* (at your option) any later version. The full license is in LICENSE file
|
||||||
|
* included with this distribution, and on the openscenegraph.org website.
|
||||||
*
|
*
|
||||||
* This software is distributed in the hope that it will be useful,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* include LICENSE.txt for more details.
|
* OpenSceneGraph Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "PointsEventHandler.h"
|
#include "PointsEventHandler.h"
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
|
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||||
*
|
*
|
||||||
* This software is open source and may be redistributed and/or modified under
|
* This library is open source and may be redistributed and/or modified under
|
||||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||||
* The full license is in LICENSE.txt file included with this distribution,.
|
* (at your option) any later version. The full license is in LICENSE file
|
||||||
|
* included with this distribution, and on the openscenegraph.org website.
|
||||||
*
|
*
|
||||||
* This software is distributed in the hope that it will be useful,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* include LICENSE.txt for more details.
|
* OpenSceneGraph Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef POINTSEVENTHANDLER
|
#ifndef POINTSEVENTHANDLER
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
|
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||||
*
|
*
|
||||||
* This software is open source and may be redistributed and/or modified under
|
* This library is open source and may be redistributed and/or modified under
|
||||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||||
* The full license is in LICENSE.txt file included with this distribution,.
|
* (at your option) any later version. The full license is in LICENSE file
|
||||||
|
* included with this distribution, and on the openscenegraph.org website.
|
||||||
*
|
*
|
||||||
* This software is distributed in the hope that it will be useful,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* include LICENSE.txt for more details.
|
* OpenSceneGraph Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ReadShowFile.h"
|
#include "ReadShowFile.h"
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
|
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||||
*
|
*
|
||||||
* This software is open source and may be redistributed and/or modified under
|
* This library is open source and may be redistributed and/or modified under
|
||||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||||
* The full license is in LICENSE.txt file included with this distribution,.
|
* (at your option) any later version. The full license is in LICENSE file
|
||||||
|
* included with this distribution, and on the openscenegraph.org website.
|
||||||
*
|
*
|
||||||
* This software is distributed in the hope that it will be useful,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* include LICENSE.txt for more details.
|
* OpenSceneGraph Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef P3D_READFILE
|
#ifndef P3D_READFILE
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
|
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||||
*
|
*
|
||||||
* This software is open source and may be redistributed and/or modified under
|
* This library is open source and may be redistributed and/or modified under
|
||||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||||
* The full license is in LICENSE.txt file included with this distribution,.
|
* (at your option) any later version. The full license is in LICENSE file
|
||||||
|
* included with this distribution, and on the openscenegraph.org website.
|
||||||
*
|
*
|
||||||
* This software is distributed in the hope that it will be useful,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* include LICENSE.txt for more details.
|
* OpenSceneGraph Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <osgViewer/Viewer>
|
#include <osgViewer/Viewer>
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
|
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||||
*
|
*
|
||||||
* This software is open source and may be redistributed and/or modified under
|
* This library is open source and may be redistributed and/or modified under
|
||||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||||
* The full license is in LICENSE.txt file included with this distribution,.
|
* (at your option) any later version. The full license is in LICENSE file
|
||||||
|
* included with this distribution, and on the openscenegraph.org website.
|
||||||
*
|
*
|
||||||
* This software is distributed in the hope that it will be useful,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* include LICENSE.txt for more details.
|
* OpenSceneGraph Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef SDLINTEGRATION
|
#ifndef SDLINTEGRATION
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
|
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||||
*
|
*
|
||||||
* This software is open source and may be redistributed and/or modified under
|
* This library is open source and may be redistributed and/or modified under
|
||||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||||
* The full license is in LICENSE.txt file included with this distribution,.
|
* (at your option) any later version. The full license is in LICENSE file
|
||||||
|
* included with this distribution, and on the openscenegraph.org website.
|
||||||
*
|
*
|
||||||
* This software is distributed in the hope that it will be useful,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* include LICENSE.txt for more details.
|
* OpenSceneGraph Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ShowEventHandler.h"
|
#include "ShowEventHandler.h"
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
|
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||||
*
|
*
|
||||||
* This software is open source and may be redistributed and/or modified under
|
* This library is open source and may be redistributed and/or modified under
|
||||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||||
* The full license is in LICENSE.txt file included with this distribution,.
|
* (at your option) any later version. The full license is in LICENSE file
|
||||||
|
* included with this distribution, and on the openscenegraph.org website.
|
||||||
*
|
*
|
||||||
* This software is distributed in the hope that it will be useful,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* include LICENSE.txt for more details.
|
* OpenSceneGraph Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef SHOWEVENTHANDLER
|
#ifndef SHOWEVENTHANDLER
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
|
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||||
*
|
*
|
||||||
* This software is open source and may be redistributed and/or modified under
|
* This library is open source and may be redistributed and/or modified under
|
||||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||||
* The full license is in LICENSE.txt file included with this distribution,.
|
* (at your option) any later version. The full license is in LICENSE file
|
||||||
|
* included with this distribution, and on the openscenegraph.org website.
|
||||||
*
|
*
|
||||||
* This software is distributed in the hope that it will be useful,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* include LICENSE.txt for more details.
|
* OpenSceneGraph Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <osgDB/FileNameUtils>
|
#include <osgDB/FileNameUtils>
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
|
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||||
*
|
*
|
||||||
* This software is open source and may be redistributed and/or modified under
|
* This library is open source and may be redistributed and/or modified under
|
||||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||||
* The full license is in LICENSE.txt file included with this distribution,.
|
* (at your option) any later version. The full license is in LICENSE file
|
||||||
|
* included with this distribution, and on the openscenegraph.org website.
|
||||||
*
|
*
|
||||||
* This software is distributed in the hope that it will be useful,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* include LICENSE.txt for more details.
|
* OpenSceneGraph Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef SPELLCHCKER_H
|
#ifndef SPELLCHCKER_H
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
|
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||||
*
|
*
|
||||||
* This software is open source and may be redistributed and/or modified under
|
* This library is open source and may be redistributed and/or modified under
|
||||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||||
* The full license is in LICENSE.txt file included with this distribution,.
|
* (at your option) any later version. The full license is in LICENSE file
|
||||||
|
* included with this distribution, and on the openscenegraph.org website.
|
||||||
*
|
*
|
||||||
* This software is distributed in the hope that it will be useful,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* include LICENSE.txt for more details.
|
* OpenSceneGraph Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <osg/Geometry>
|
#include <osg/Geometry>
|
||||||
@@ -483,7 +484,7 @@ int main( int argc, char **argv )
|
|||||||
while (arguments.read("-p",pathfile))
|
while (arguments.read("-p",pathfile))
|
||||||
{
|
{
|
||||||
osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile);
|
osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile);
|
||||||
if (apm || !apm->valid())
|
if (apm && !apm->getAnimationPath()->empty())
|
||||||
{
|
{
|
||||||
unsigned int num = keyswitchManipulator->getNumMatrixManipulators();
|
unsigned int num = keyswitchManipulator->getNumMatrixManipulators();
|
||||||
keyswitchManipulator->addMatrixManipulator( keyForAnimationPath, "Path", apm );
|
keyswitchManipulator->addMatrixManipulator( keyForAnimationPath, "Path", apm );
|
||||||
|
|||||||
@@ -99,15 +99,16 @@ INPUT = ${OpenSceneGraph_SOURCE_DIR}/include/osg \
|
|||||||
${OpenSceneGraph_SOURCE_DIR}/include/osgGA \
|
${OpenSceneGraph_SOURCE_DIR}/include/osgGA \
|
||||||
${OpenSceneGraph_SOURCE_DIR}/include/osgManipulator \
|
${OpenSceneGraph_SOURCE_DIR}/include/osgManipulator \
|
||||||
${OpenSceneGraph_SOURCE_DIR}/include/osgParticle \
|
${OpenSceneGraph_SOURCE_DIR}/include/osgParticle \
|
||||||
|
${OpenSceneGraph_SOURCE_DIR}/include/osgPresentation \
|
||||||
${OpenSceneGraph_SOURCE_DIR}/include/osgShadow \
|
${OpenSceneGraph_SOURCE_DIR}/include/osgShadow \
|
||||||
${OpenSceneGraph_SOURCE_DIR}/include/osgSim \
|
${OpenSceneGraph_SOURCE_DIR}/include/osgSim \
|
||||||
${OpenSceneGraph_SOURCE_DIR}/include/osgTerrain \
|
${OpenSceneGraph_SOURCE_DIR}/include/osgTerrain \
|
||||||
${OpenSceneGraph_SOURCE_DIR}/include/osgText \
|
${OpenSceneGraph_SOURCE_DIR}/include/osgText \
|
||||||
|
${OpenSceneGraph_SOURCE_DIR}/include/osgUI \
|
||||||
${OpenSceneGraph_SOURCE_DIR}/include/osgUtil \
|
${OpenSceneGraph_SOURCE_DIR}/include/osgUtil \
|
||||||
${OpenSceneGraph_SOURCE_DIR}/include/osgViewer \
|
${OpenSceneGraph_SOURCE_DIR}/include/osgViewer \
|
||||||
${OpenSceneGraph_SOURCE_DIR}/include/osgVolume \
|
${OpenSceneGraph_SOURCE_DIR}/include/osgVolume \
|
||||||
${OpenSceneGraph_SOURCE_DIR}/include/osgWidget \
|
${OpenSceneGraph_SOURCE_DIR}/include/osgWidget \
|
||||||
${OpenSceneGraph_SOURCE_DIR}/include/osgQt \
|
|
||||||
${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/auto_Mainpage
|
${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/auto_Mainpage
|
||||||
INPUT_ENCODING = UTF-8
|
INPUT_ENCODING = UTF-8
|
||||||
FILE_PATTERNS = *include* \
|
FILE_PATTERNS = *include* \
|
||||||
|
|||||||
@@ -89,15 +89,16 @@ INPUT = ${OpenSceneGraph_SOURCE_DIR}/include/osg \
|
|||||||
${OpenSceneGraph_SOURCE_DIR}/include/osgGA \
|
${OpenSceneGraph_SOURCE_DIR}/include/osgGA \
|
||||||
${OpenSceneGraph_SOURCE_DIR}/include/osgManipulator \
|
${OpenSceneGraph_SOURCE_DIR}/include/osgManipulator \
|
||||||
${OpenSceneGraph_SOURCE_DIR}/include/osgParticle \
|
${OpenSceneGraph_SOURCE_DIR}/include/osgParticle \
|
||||||
|
${OpenSceneGraph_SOURCE_DIR}/include/osgPresentation \
|
||||||
${OpenSceneGraph_SOURCE_DIR}/include/osgShadow \
|
${OpenSceneGraph_SOURCE_DIR}/include/osgShadow \
|
||||||
${OpenSceneGraph_SOURCE_DIR}/include/osgSim \
|
${OpenSceneGraph_SOURCE_DIR}/include/osgSim \
|
||||||
${OpenSceneGraph_SOURCE_DIR}/include/osgTerrain \
|
${OpenSceneGraph_SOURCE_DIR}/include/osgTerrain \
|
||||||
${OpenSceneGraph_SOURCE_DIR}/include/osgText \
|
${OpenSceneGraph_SOURCE_DIR}/include/osgText \
|
||||||
|
${OpenSceneGraph_SOURCE_DIR}/include/osgUI \
|
||||||
${OpenSceneGraph_SOURCE_DIR}/include/osgUtil \
|
${OpenSceneGraph_SOURCE_DIR}/include/osgUtil \
|
||||||
${OpenSceneGraph_SOURCE_DIR}/include/osgViewer \
|
${OpenSceneGraph_SOURCE_DIR}/include/osgViewer \
|
||||||
${OpenSceneGraph_SOURCE_DIR}/include/osgVolume \
|
${OpenSceneGraph_SOURCE_DIR}/include/osgVolume \
|
||||||
${OpenSceneGraph_SOURCE_DIR}/include/osgWidget \
|
${OpenSceneGraph_SOURCE_DIR}/include/osgWidget \
|
||||||
${OpenSceneGraph_SOURCE_DIR}/include/osgQt \
|
|
||||||
${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/auto_Mainpage
|
${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/auto_Mainpage
|
||||||
INPUT_ENCODING = UTF-8
|
INPUT_ENCODING = UTF-8
|
||||||
FILE_PATTERNS = *include* \
|
FILE_PATTERNS = *include* \
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ INPUT = "${OpenSceneGraph_SOURCE_DIR}/include/osg" \
|
|||||||
"${OpenSceneGraph_SOURCE_DIR}/include/osgGA" \
|
"${OpenSceneGraph_SOURCE_DIR}/include/osgGA" \
|
||||||
"${OpenSceneGraph_SOURCE_DIR}/include/osgManipulator" \
|
"${OpenSceneGraph_SOURCE_DIR}/include/osgManipulator" \
|
||||||
"${OpenSceneGraph_SOURCE_DIR}/include/osgParticle" \
|
"${OpenSceneGraph_SOURCE_DIR}/include/osgParticle" \
|
||||||
"${OpenSceneGraph_SOURCE_DIR}/include/osgQt" \
|
"${OpenSceneGraph_SOURCE_DIR}/include/osgPresentation" \
|
||||||
"${OpenSceneGraph_SOURCE_DIR}/include/osgShadow" \
|
"${OpenSceneGraph_SOURCE_DIR}/include/osgShadow" \
|
||||||
"${OpenSceneGraph_SOURCE_DIR}/include/osgSim" \
|
"${OpenSceneGraph_SOURCE_DIR}/include/osgSim" \
|
||||||
"${OpenSceneGraph_SOURCE_DIR}/include/osgTerrain" \
|
"${OpenSceneGraph_SOURCE_DIR}/include/osgTerrain" \
|
||||||
|
|||||||
@@ -243,13 +243,11 @@ ELSE(DYNAMIC_OPENSCENEGRAPH)
|
|||||||
#needed on win32 or the linker get confused by _declspec declarations
|
#needed on win32 or the linker get confused by _declspec declarations
|
||||||
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
|
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
|
||||||
|
|
||||||
ADD_SUBDIRECTORY(osgstaticviewer)
|
IF(OSG_BUILD_PLATFORM_IPHONE)
|
||||||
|
|
||||||
# IPHONE_PORT@tom
|
|
||||||
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
|
|
||||||
ADD_SUBDIRECTORY(osgviewerIPhone)
|
ADD_SUBDIRECTORY(osgviewerIPhone)
|
||||||
|
ELSE()
|
||||||
|
ADD_SUBDIRECTORY(osgstaticviewer)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
# IPHONE_PORT@tom
|
|
||||||
|
|
||||||
ENDIF(DYNAMIC_OPENSCENEGRAPH)
|
ENDIF(DYNAMIC_OPENSCENEGRAPH)
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
android:versionCode="1"
|
android:versionCode="1"
|
||||||
android:versionName="1.0">
|
android:versionName="1.0">
|
||||||
<uses-sdk android:targetSdkVersion="8" android:minSdkVersion="8"></uses-sdk>
|
<uses-sdk android:targetSdkVersion="8" android:minSdkVersion="8"></uses-sdk>
|
||||||
<uses-feature android:glEsVersion="0x00010001"/> <!-- OpenGL min requierements (1.1) -->
|
<uses-feature android:glEsVersion="0x00010001"/> <!-- OpenGL min requirements (1.1) -->
|
||||||
<uses-permission android:name="android.permission.INTERNET"/>
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
|
|
||||||
<application android:label="@string/app_name" android:icon="@drawable/osg">
|
<application android:label="@string/app_name" android:icon="@drawable/osg">
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
android:versionCode="1"
|
android:versionCode="1"
|
||||||
android:versionName="1.0">
|
android:versionName="1.0">
|
||||||
<uses-sdk android:targetSdkVersion="8" android:minSdkVersion="8"></uses-sdk>
|
<uses-sdk android:targetSdkVersion="8" android:minSdkVersion="8"></uses-sdk>
|
||||||
<uses-feature android:glEsVersion="0x00020000"/> <!-- OpenGL min requierements (2.0) -->
|
<uses-feature android:glEsVersion="0x00020000"/> <!-- OpenGL min requirements (2.0) -->
|
||||||
<uses-permission android:name="android.permission.INTERNET"/>
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
|
|
||||||
<application android:label="@string/app_name" android:icon="@drawable/osg">
|
<application android:label="@string/app_name" android:icon="@drawable/osg">
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ int main(int argc, char** argv)
|
|||||||
while (arguments.read("-p",pathfile))
|
while (arguments.read("-p",pathfile))
|
||||||
{
|
{
|
||||||
osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile);
|
osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile);
|
||||||
if (apm || !apm->valid())
|
if (apm && !apm->getAnimationPath()->empty())
|
||||||
{
|
{
|
||||||
apm->setTimeScale(animationSpeed);
|
apm->setTimeScale(animationSpeed);
|
||||||
|
|
||||||
|
|||||||
@@ -393,8 +393,6 @@ public:
|
|||||||
while (arguments.read("--dl")) { modifyDrawableSettings = true; useDisplayLists = true; }
|
while (arguments.read("--dl")) { modifyDrawableSettings = true; useDisplayLists = true; }
|
||||||
|
|
||||||
while (arguments.read("-s", simplificatioRatio)) {}
|
while (arguments.read("-s", simplificatioRatio)) {}
|
||||||
while (arguments.read("--tristripper")) { useTriStripVisitor=true; }
|
|
||||||
while (arguments.read("--no-tristripper")) { useTriStripVisitor=false; }
|
|
||||||
while (arguments.read("--smoother")) { useSmoothingVisitor=true; }
|
while (arguments.read("--smoother")) { useSmoothingVisitor=true; }
|
||||||
while (arguments.read("--no-smoother")) { useSmoothingVisitor=false; }
|
while (arguments.read("--no-smoother")) { useSmoothingVisitor=false; }
|
||||||
|
|
||||||
@@ -426,7 +424,6 @@ public:
|
|||||||
OSG_NOTICE<<"Running simplifier with simplification ratio="<<simplificatioRatio<<std::endl;
|
OSG_NOTICE<<"Running simplifier with simplification ratio="<<simplificatioRatio<<std::endl;
|
||||||
float maxError = 4.0f;
|
float maxError = 4.0f;
|
||||||
osgUtil::Simplifier simplifier(simplificatioRatio, maxError);
|
osgUtil::Simplifier simplifier(simplificatioRatio, maxError);
|
||||||
simplifier.setDoTriStrip(useTriStripVisitor);
|
|
||||||
simplifier.setSmoothing(useSmoothingVisitor);
|
simplifier.setSmoothing(useSmoothingVisitor);
|
||||||
node->accept(simplifier);
|
node->accept(simplifier);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ struct MyRigTransformHardware : public osgAnimation::RigTransformHardware
|
|||||||
CommonProgram = new osg::Program;
|
CommonProgram = new osg::Program;
|
||||||
CommonProgram->setName("HardwareSkinning");
|
CommonProgram->setName("HardwareSkinning");
|
||||||
|
|
||||||
//set default source if _shader is not user setted
|
//set default source if _shader is not user set
|
||||||
if (!vertexshader.valid())
|
if (!vertexshader.valid())
|
||||||
{
|
{
|
||||||
vertexshader = osgDB::readRefShaderFile(osg::Shader::VERTEX,"skinning.vert");
|
vertexshader = osgDB::readRefShaderFile(osg::Shader::VERTEX,"skinning.vert");
|
||||||
|
|||||||
@@ -245,10 +245,12 @@ int main( int argc, char **argv )
|
|||||||
traits->depth = src_traits->depth;
|
traits->depth = src_traits->depth;
|
||||||
traits->pbuffer = true;
|
traits->pbuffer = true;
|
||||||
} else {
|
} else {
|
||||||
//viewer would use fullscreen size (unknown here) pbuffer will use 4096 x4096 (or best avaiable)
|
//viewer would use fullscreen size (unknown here) pbuffer will use 4096 x4096 (or best available)
|
||||||
traits->width = 1 << 12;
|
traits->width = 1 << 12;
|
||||||
traits->height = 1 << 12;
|
traits->height = 1 << 12;
|
||||||
traits->pbuffer = true;
|
traits->pbuffer = true;
|
||||||
|
traits->readDISPLAY();
|
||||||
|
traits->setUndefinedScreenDetailsToDefaultScreen();
|
||||||
}
|
}
|
||||||
osg::ref_ptr<osg::GraphicsContext> pbuffer = osg::GraphicsContext::createGraphicsContext(traits.get());
|
osg::ref_ptr<osg::GraphicsContext> pbuffer = osg::GraphicsContext::createGraphicsContext(traits.get());
|
||||||
if (pbuffer.valid())
|
if (pbuffer.valid())
|
||||||
|
|||||||
@@ -209,6 +209,8 @@ osgViewer::View* createView(osg::ref_ptr<osg::Node> scenegraph, osg::ref_ptr<osg
|
|||||||
traits->windowDecoration = true;
|
traits->windowDecoration = true;
|
||||||
traits->doubleBuffer = true;
|
traits->doubleBuffer = true;
|
||||||
traits->sharedContext = 0;
|
traits->sharedContext = 0;
|
||||||
|
traits->readDISPLAY();
|
||||||
|
traits->setUndefinedScreenDetailsToDefaultScreen();
|
||||||
|
|
||||||
gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
||||||
if (!gc)
|
if (!gc)
|
||||||
@@ -267,7 +269,11 @@ int main(int argc, char** argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
unsigned int width, height;
|
unsigned int width, height;
|
||||||
wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0), width, height);
|
osg::GraphicsContext::ScreenIdentifier main_screen_id;
|
||||||
|
|
||||||
|
main_screen_id.readDISPLAY();
|
||||||
|
main_screen_id.setUndefinedScreenDetailsToDefaultScreen();
|
||||||
|
wsi->getScreenResolution(main_screen_id, width, height);
|
||||||
|
|
||||||
unsigned int x=0, y=0;
|
unsigned int x=0, y=0;
|
||||||
while(arguments.read("--window", x, y, width, height)) {}
|
while(arguments.read("--window", x, y, width, height)) {}
|
||||||
@@ -283,6 +289,8 @@ int main(int argc, char** argv)
|
|||||||
traits->windowDecoration = true;
|
traits->windowDecoration = true;
|
||||||
traits->doubleBuffer = true;
|
traits->doubleBuffer = true;
|
||||||
traits->sharedContext = 0;
|
traits->sharedContext = 0;
|
||||||
|
traits->readDISPLAY();
|
||||||
|
traits->setUndefinedScreenDetailsToDefaultScreen();
|
||||||
|
|
||||||
gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
||||||
if (!gc)
|
if (!gc)
|
||||||
|
|||||||
@@ -83,7 +83,11 @@ void singleWindowMultipleCameras(osgViewer::Viewer& viewer)
|
|||||||
}
|
}
|
||||||
|
|
||||||
unsigned int width, height;
|
unsigned int width, height;
|
||||||
wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0), width, height);
|
osg::GraphicsContext::ScreenIdentifier main_screen_id;
|
||||||
|
|
||||||
|
main_screen_id.readDISPLAY();
|
||||||
|
main_screen_id.setUndefinedScreenDetailsToDefaultScreen();
|
||||||
|
wsi->getScreenResolution(main_screen_id, width, height);
|
||||||
|
|
||||||
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits;
|
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits;
|
||||||
traits->x = 0;
|
traits->x = 0;
|
||||||
@@ -93,6 +97,8 @@ void singleWindowMultipleCameras(osgViewer::Viewer& viewer)
|
|||||||
traits->windowDecoration = true;
|
traits->windowDecoration = true;
|
||||||
traits->doubleBuffer = true;
|
traits->doubleBuffer = true;
|
||||||
traits->sharedContext = 0;
|
traits->sharedContext = 0;
|
||||||
|
traits->readDISPLAY();
|
||||||
|
traits->setUndefinedScreenDetailsToDefaultScreen();
|
||||||
|
|
||||||
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
||||||
if (gc.valid())
|
if (gc.valid())
|
||||||
@@ -134,7 +140,11 @@ void multipleWindowMultipleCameras(osgViewer::Viewer& viewer, bool multipleScree
|
|||||||
}
|
}
|
||||||
|
|
||||||
unsigned int width, height;
|
unsigned int width, height;
|
||||||
wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0), width, height);
|
osg::GraphicsContext::ScreenIdentifier main_screen_id;
|
||||||
|
|
||||||
|
main_screen_id.readDISPLAY();
|
||||||
|
main_screen_id.setUndefinedScreenDetailsToDefaultScreen();
|
||||||
|
wsi->getScreenResolution(main_screen_id, width, height);
|
||||||
|
|
||||||
|
|
||||||
unsigned int numCameras = 6;
|
unsigned int numCameras = 6;
|
||||||
@@ -151,6 +161,8 @@ void multipleWindowMultipleCameras(osgViewer::Viewer& viewer, bool multipleScree
|
|||||||
traits->windowDecoration = true;
|
traits->windowDecoration = true;
|
||||||
traits->doubleBuffer = true;
|
traits->doubleBuffer = true;
|
||||||
traits->sharedContext = 0;
|
traits->sharedContext = 0;
|
||||||
|
traits->readDISPLAY();
|
||||||
|
traits->setUndefinedScreenDetailsToDefaultScreen();
|
||||||
|
|
||||||
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
||||||
if (gc.valid())
|
if (gc.valid())
|
||||||
|
|||||||
@@ -971,9 +971,7 @@ bool GameEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionA
|
|||||||
{
|
{
|
||||||
createNewCatchable();
|
createNewCatchable();
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
case(osgGA::GUIEventAdapter::KEYDOWN):
|
case(osgGA::GUIEventAdapter::KEYDOWN):
|
||||||
{
|
{
|
||||||
@@ -987,6 +985,7 @@ bool GameEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionA
|
|||||||
_rightKeyPressed=true;
|
_rightKeyPressed=true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case(osgGA::GUIEventAdapter::KEYUP):
|
case(osgGA::GUIEventAdapter::KEYUP):
|
||||||
{
|
{
|
||||||
@@ -1000,6 +999,7 @@ bool GameEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionA
|
|||||||
_rightKeyPressed=false;
|
_rightKeyPressed=false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case(osgGA::GUIEventAdapter::DRAG):
|
case(osgGA::GUIEventAdapter::DRAG):
|
||||||
case(osgGA::GUIEventAdapter::MOVE):
|
case(osgGA::GUIEventAdapter::MOVE):
|
||||||
|
|||||||
@@ -509,7 +509,7 @@ int main( int argc, char **argv )
|
|||||||
// any option left unread are converted into errors to write out later.
|
// any option left unread are converted into errors to write out later.
|
||||||
arguments.reportRemainingOptionsAsUnrecognized();
|
arguments.reportRemainingOptionsAsUnrecognized();
|
||||||
|
|
||||||
// report any errors if they have occurred when parsing the program aguments.
|
// report any errors if they have occurred when parsing the program arguments.
|
||||||
if (arguments.errors())
|
if (arguments.errors())
|
||||||
{
|
{
|
||||||
arguments.writeErrorMessages(std::cout);
|
arguments.writeErrorMessages(std::cout);
|
||||||
|
|||||||
@@ -289,7 +289,11 @@ int main( int argc, char **argv )
|
|||||||
}
|
}
|
||||||
|
|
||||||
unsigned int width, height;
|
unsigned int width, height;
|
||||||
wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0), width, height);
|
osg::GraphicsContext::ScreenIdentifier main_screen_id;
|
||||||
|
|
||||||
|
main_screen_id.readDISPLAY();
|
||||||
|
main_screen_id.setUndefinedScreenDetailsToDefaultScreen();
|
||||||
|
wsi->getScreenResolution(main_screen_id, width, height);
|
||||||
|
|
||||||
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits;
|
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits;
|
||||||
traits->x = 100;
|
traits->x = 100;
|
||||||
@@ -299,6 +303,8 @@ int main( int argc, char **argv )
|
|||||||
traits->windowDecoration = true;
|
traits->windowDecoration = true;
|
||||||
traits->doubleBuffer = true;
|
traits->doubleBuffer = true;
|
||||||
traits->sharedContext = 0;
|
traits->sharedContext = 0;
|
||||||
|
traits->readDISPLAY();
|
||||||
|
traits->setUndefinedScreenDetailsToDefaultScreen();
|
||||||
|
|
||||||
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
||||||
if (gc.valid())
|
if (gc.valid())
|
||||||
|
|||||||
@@ -40,33 +40,101 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
void create_specular_highlights(osg::Node *node)
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
osg::StateSet *ss = node->getOrCreateStateSet();
|
// use an ArgumentParser object to manage the program arguments.
|
||||||
|
osg::ArgumentParser arguments(&argc,argv);
|
||||||
|
|
||||||
|
// construct the viewer.
|
||||||
|
osgViewer::Viewer viewer;
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::TextureCubeMap> tcm = new osg::TextureCubeMap;
|
||||||
|
|
||||||
// create and setup the texture object
|
|
||||||
osg::TextureCubeMap *tcm = new osg::TextureCubeMap;
|
|
||||||
tcm->setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP);
|
tcm->setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP);
|
||||||
tcm->setWrap(osg::Texture::WRAP_T, osg::Texture::CLAMP);
|
tcm->setWrap(osg::Texture::WRAP_T, osg::Texture::CLAMP);
|
||||||
tcm->setWrap(osg::Texture::WRAP_R, osg::Texture::CLAMP);
|
tcm->setWrap(osg::Texture::WRAP_R, osg::Texture::CLAMP);
|
||||||
tcm->setFilter(osg::Texture::MIN_FILTER, osg::Texture::LINEAR_MIPMAP_LINEAR);
|
|
||||||
tcm->setFilter(osg::Texture::MAG_FILTER, osg::Texture::LINEAR);
|
|
||||||
|
|
||||||
// generate the six highlight map images (light direction = [1, 1, -1])
|
if (arguments.read("--no-mip-map"))
|
||||||
osgUtil::HighlightMapGenerator *mapgen = new osgUtil::HighlightMapGenerator(
|
{
|
||||||
osg::Vec3(1, 1, -1), // light direction
|
tcm->setFilter(osg::Texture::MIN_FILTER, osg::Texture::LINEAR);
|
||||||
osg::Vec4(1, 0.9f, 0.8f, 1), // light color
|
tcm->setFilter(osg::Texture::MAG_FILTER, osg::Texture::LINEAR);
|
||||||
8); // specular exponent
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tcm->setFilter(osg::Texture::MIN_FILTER, osg::Texture::LINEAR_MIPMAP_LINEAR);
|
||||||
|
tcm->setFilter(osg::Texture::MAG_FILTER, osg::Texture::LINEAR);
|
||||||
|
}
|
||||||
|
|
||||||
mapgen->generateMap();
|
if (arguments.read("--hardware-mip-map") || arguments.read("--hmp"))
|
||||||
|
{
|
||||||
|
OSG_NOTICE<<"tcm->setUseHardwareMipMapGeneration(true)"<<std::endl;
|
||||||
|
tcm->setUseHardwareMipMapGeneration(true);
|
||||||
|
}
|
||||||
|
|
||||||
// assign the six images to the texture object
|
std::string filename;
|
||||||
tcm->setImage(osg::TextureCubeMap::POSITIVE_X, mapgen->getImage(osg::TextureCubeMap::POSITIVE_X));
|
if (arguments.read("--posx", filename)) tcm->setImage(osg::TextureCubeMap::POSITIVE_X, osgDB::readImageFile(filename));
|
||||||
tcm->setImage(osg::TextureCubeMap::NEGATIVE_X, mapgen->getImage(osg::TextureCubeMap::NEGATIVE_X));
|
if (arguments.read("--negx", filename)) tcm->setImage(osg::TextureCubeMap::NEGATIVE_X, osgDB::readImageFile(filename));
|
||||||
tcm->setImage(osg::TextureCubeMap::POSITIVE_Y, mapgen->getImage(osg::TextureCubeMap::POSITIVE_Y));
|
if (arguments.read("--posy", filename)) tcm->setImage(osg::TextureCubeMap::POSITIVE_Y, osgDB::readImageFile(filename));
|
||||||
tcm->setImage(osg::TextureCubeMap::NEGATIVE_Y, mapgen->getImage(osg::TextureCubeMap::NEGATIVE_Y));
|
if (arguments.read("--negy", filename)) tcm->setImage(osg::TextureCubeMap::NEGATIVE_Y, osgDB::readImageFile(filename));
|
||||||
tcm->setImage(osg::TextureCubeMap::POSITIVE_Z, mapgen->getImage(osg::TextureCubeMap::POSITIVE_Z));
|
if (arguments.read("--posz", filename)) tcm->setImage(osg::TextureCubeMap::POSITIVE_Z, osgDB::readImageFile(filename));
|
||||||
tcm->setImage(osg::TextureCubeMap::NEGATIVE_Z, mapgen->getImage(osg::TextureCubeMap::NEGATIVE_Z));
|
if (arguments.read("--negz", filename)) tcm->setImage(osg::TextureCubeMap::NEGATIVE_Z, osgDB::readImageFile(filename));
|
||||||
|
|
||||||
|
|
||||||
|
int numValidImages = 0;
|
||||||
|
if (tcm->getImage(osg::TextureCubeMap::POSITIVE_X)) ++numValidImages;
|
||||||
|
if (tcm->getImage(osg::TextureCubeMap::NEGATIVE_X)) ++numValidImages;
|
||||||
|
if (tcm->getImage(osg::TextureCubeMap::POSITIVE_Y)) ++numValidImages;
|
||||||
|
if (tcm->getImage(osg::TextureCubeMap::NEGATIVE_Y)) ++numValidImages;
|
||||||
|
if (tcm->getImage(osg::TextureCubeMap::POSITIVE_Z)) ++numValidImages;
|
||||||
|
if (tcm->getImage(osg::TextureCubeMap::NEGATIVE_Z)) ++numValidImages;
|
||||||
|
|
||||||
|
if (numValidImages!=6)
|
||||||
|
{
|
||||||
|
// generate the six highlight map images (light direction = [1, 1, -1])
|
||||||
|
osgUtil::HighlightMapGenerator *mapgen = new osgUtil::HighlightMapGenerator(
|
||||||
|
osg::Vec3(1, 1, -1), // light direction
|
||||||
|
osg::Vec4(1, 0.9f, 0.8f, 1), // light color
|
||||||
|
8); // specular exponent
|
||||||
|
|
||||||
|
mapgen->generateMap();
|
||||||
|
|
||||||
|
// assign the six images to the texture object
|
||||||
|
if (!tcm->getImage(osg::TextureCubeMap::POSITIVE_X)) tcm->setImage(osg::TextureCubeMap::POSITIVE_X, mapgen->getImage(osg::TextureCubeMap::POSITIVE_X));
|
||||||
|
if (!tcm->getImage(osg::TextureCubeMap::NEGATIVE_X)) tcm->setImage(osg::TextureCubeMap::NEGATIVE_X, mapgen->getImage(osg::TextureCubeMap::NEGATIVE_X));
|
||||||
|
if (!tcm->getImage(osg::TextureCubeMap::POSITIVE_Y)) tcm->setImage(osg::TextureCubeMap::POSITIVE_Y, mapgen->getImage(osg::TextureCubeMap::POSITIVE_Y));
|
||||||
|
if (!tcm->getImage(osg::TextureCubeMap::NEGATIVE_Y)) tcm->setImage(osg::TextureCubeMap::NEGATIVE_Y, mapgen->getImage(osg::TextureCubeMap::NEGATIVE_Y));
|
||||||
|
if (!tcm->getImage(osg::TextureCubeMap::POSITIVE_Z)) tcm->setImage(osg::TextureCubeMap::POSITIVE_Z, mapgen->getImage(osg::TextureCubeMap::POSITIVE_Z));
|
||||||
|
if (!tcm->getImage(osg::TextureCubeMap::NEGATIVE_Z)) tcm->setImage(osg::TextureCubeMap::NEGATIVE_Z, mapgen->getImage(osg::TextureCubeMap::NEGATIVE_Z));
|
||||||
|
}
|
||||||
|
|
||||||
|
float LODBias;
|
||||||
|
if (arguments.read("--lod",LODBias))
|
||||||
|
{
|
||||||
|
tcm->setLODBias(LODBias);
|
||||||
|
}
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::Program> program = new osg::Program;
|
||||||
|
std::string shaderFilename;
|
||||||
|
while (arguments.read("-s", shaderFilename))
|
||||||
|
{
|
||||||
|
osg::ref_ptr<osg::Shader> shader = osgDB::readRefShaderFile(shaderFilename);
|
||||||
|
if (shader) program->addShader(shader);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// load the nodes from the commandline arguments.
|
||||||
|
osg::ref_ptr<osg::Node> rootnode = osgDB::readRefNodeFiles(arguments);
|
||||||
|
|
||||||
|
// if not loaded assume no arguments passed in, try use default mode instead.
|
||||||
|
if (!rootnode) rootnode = osgDB::readRefNodeFile("cessna.osgt");
|
||||||
|
|
||||||
|
if (!rootnode)
|
||||||
|
{
|
||||||
|
osg::notify(osg::NOTICE)<<"Please specify a model filename on the command line."<<std::endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
osg::StateSet *ss = rootnode->getOrCreateStateSet();
|
||||||
|
|
||||||
// enable texturing, replacing any textures in the subgraphs
|
// enable texturing, replacing any textures in the subgraphs
|
||||||
ss->setTextureAttributeAndModes(0, tcm, osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON);
|
ss->setTextureAttributeAndModes(0, tcm, osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON);
|
||||||
@@ -84,31 +152,13 @@ void create_specular_highlights(osg::Node *node)
|
|||||||
te->setSource1_RGB(osg::TexEnvCombine::PRIMARY_COLOR);
|
te->setSource1_RGB(osg::TexEnvCombine::PRIMARY_COLOR);
|
||||||
te->setOperand1_RGB(osg::TexEnvCombine::SRC_COLOR);
|
te->setOperand1_RGB(osg::TexEnvCombine::SRC_COLOR);
|
||||||
ss->setTextureAttributeAndModes(0, te, osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON);
|
ss->setTextureAttributeAndModes(0, te, osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON);
|
||||||
}
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
if (program->getNumShaders()>0)
|
||||||
{
|
|
||||||
// use an ArgumentParser object to manage the program arguments.
|
|
||||||
osg::ArgumentParser arguments(&argc,argv);
|
|
||||||
|
|
||||||
// construct the viewer.
|
|
||||||
osgViewer::Viewer viewer;
|
|
||||||
|
|
||||||
// load the nodes from the commandline arguments.
|
|
||||||
osg::ref_ptr<osg::Node> rootnode = osgDB::readRefNodeFiles(arguments);
|
|
||||||
|
|
||||||
// if not loaded assume no arguments passed in, try use default mode instead.
|
|
||||||
if (!rootnode) rootnode = osgDB::readRefNodeFile("cessna.osgt");
|
|
||||||
|
|
||||||
if (!rootnode)
|
|
||||||
{
|
{
|
||||||
osg::notify(osg::NOTICE)<<"Please specify a model filename on the command line."<<std::endl;
|
ss->setAttribute(program.get());
|
||||||
return 1;
|
ss->addUniform(new osg::Uniform("baseTexture",0));
|
||||||
}
|
}
|
||||||
|
|
||||||
// create specular highlights
|
|
||||||
create_specular_highlights(rootnode.get());
|
|
||||||
|
|
||||||
// run optimization over the scene graph
|
// run optimization over the scene graph
|
||||||
osgUtil::Optimizer optimzer;
|
osgUtil::Optimizer optimzer;
|
||||||
optimzer.optimize(rootnode);
|
optimzer.optimize(rootnode);
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ private:
|
|||||||
bool createMap(MapMode mapMode, bool first=false);
|
bool createMap(MapMode mapMode, bool first=false);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Creates a two dimensional noise map and initalizes _noiseMap with it
|
Creates a two dimensional noise map and initializes _noiseMap with it
|
||||||
*/
|
*/
|
||||||
bool createNoiseMap();
|
bool createNoiseMap();
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class DePeePass
|
|||||||
DePeePass();
|
DePeePass();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Desctructor cleans the whole depth peeling pass
|
Destructor cleans the whole depth peeling pass
|
||||||
*/
|
*/
|
||||||
~DePeePass();
|
~DePeePass();
|
||||||
|
|
||||||
|
|||||||
@@ -79,7 +79,11 @@ struct CommandLineOptions
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0), width, height);
|
osg::GraphicsContext::ScreenIdentifier main_screen_id;
|
||||||
|
|
||||||
|
main_screen_id.readDISPLAY();
|
||||||
|
main_screen_id.setUndefinedScreenDetailsToDefaultScreen();
|
||||||
|
wsi->getScreenResolution(main_screen_id, width, height);
|
||||||
distance = sqrt(sphere_radius*sphere_radius - collar_radius*collar_radius);
|
distance = sqrt(sphere_radius*sphere_radius - collar_radius*collar_radius);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -274,6 +278,8 @@ void setDomeFaces(osgViewer::Viewer& viewer, CommandLineOptions& options)
|
|||||||
traits->windowDecoration = true;
|
traits->windowDecoration = true;
|
||||||
traits->doubleBuffer = true;
|
traits->doubleBuffer = true;
|
||||||
traits->sharedContext = 0;
|
traits->sharedContext = 0;
|
||||||
|
traits->readDISPLAY();
|
||||||
|
traits->setUndefinedScreenDetailsToDefaultScreen();
|
||||||
|
|
||||||
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
||||||
if (!gc)
|
if (!gc)
|
||||||
@@ -502,6 +508,8 @@ void setDomeCorrection(osgViewer::Viewer& viewer, CommandLineOptions& options)
|
|||||||
traits->windowDecoration = false;
|
traits->windowDecoration = false;
|
||||||
traits->doubleBuffer = true;
|
traits->doubleBuffer = true;
|
||||||
traits->sharedContext = 0;
|
traits->sharedContext = 0;
|
||||||
|
traits->readDISPLAY();
|
||||||
|
traits->setUndefinedScreenDetailsToDefaultScreen();
|
||||||
|
|
||||||
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
||||||
if (!gc)
|
if (!gc)
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ createStateSet()
|
|||||||
// render each instance uniquely. gl_InstanceID will be in the range
|
// render each instance uniquely. gl_InstanceID will be in the range
|
||||||
// 0 to numInstances-1 (1023 in our case).
|
// 0 to numInstances-1 (1023 in our case).
|
||||||
std::string vertexSource =
|
std::string vertexSource =
|
||||||
|
"#extension GL_EXT_gpu_shader4 : enable\n"
|
||||||
"uniform sampler2D osgLogo; \n"
|
"uniform sampler2D osgLogo; \n"
|
||||||
"uniform float osg_SimulationTime; \n"
|
"uniform float osg_SimulationTime; \n"
|
||||||
|
|
||||||
|
|||||||
@@ -12,11 +12,6 @@
|
|||||||
|
|
||||||
void textInfo(osgText::Text* text)
|
void textInfo(osgText::Text* text)
|
||||||
{
|
{
|
||||||
const osgText::Text::TextureGlyphQuadMap& tgqm = text->getTextureGlyphQuadMap();
|
|
||||||
|
|
||||||
const osgText::Text::TextureGlyphQuadMap::const_iterator tgqmi = tgqm.begin();
|
|
||||||
|
|
||||||
|
|
||||||
osgText::String& s = text->getText();
|
osgText::String& s = text->getText();
|
||||||
|
|
||||||
for(unsigned int i = 0; i < s.size(); i++)
|
for(unsigned int i = 0; i < s.size(); i++)
|
||||||
|
|||||||
@@ -38,6 +38,7 @@
|
|||||||
#include <osg/FragmentProgram>
|
#include <osg/FragmentProgram>
|
||||||
|
|
||||||
#include <osgDB/ReadFile>
|
#include <osgDB/ReadFile>
|
||||||
|
#include <osgDB/WriteFile>
|
||||||
#include <osgDB/FileUtils>
|
#include <osgDB/FileUtils>
|
||||||
|
|
||||||
#include <osgUtil/LineSegmentIntersector>
|
#include <osgUtil/LineSegmentIntersector>
|
||||||
@@ -64,6 +65,18 @@ public:
|
|||||||
|
|
||||||
ForestTechniqueManager() {}
|
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
|
class Tree : public osg::Referenced
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -150,7 +163,7 @@ public:
|
|||||||
|
|
||||||
osg::Node* createHUDWithText(const std::string& text);
|
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)
|
void advanceToNextTechnique(int delta=1)
|
||||||
{
|
{
|
||||||
@@ -803,6 +816,18 @@ class ShaderGeometry : public osg::Drawable
|
|||||||
|
|
||||||
typedef std::vector<osg::Vec4> PositionSizeList;
|
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
|
virtual void drawImplementation(osg::RenderInfo& renderInfo) const
|
||||||
{
|
{
|
||||||
for(PositionSizeList::const_iterator itr = _trees.begin();
|
for(PositionSizeList::const_iterator itr = _trees.begin();
|
||||||
@@ -1160,7 +1185,7 @@ osg::Node* ForestTechniqueManager::createHUDWithText(const std::string& str)
|
|||||||
return projection;
|
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 origin(0.0f,0.0f,0.0f);
|
||||||
osg::Vec3 size(1000.0f,1000.0f,200.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;
|
_techniqueSwitch = new osg::Switch;
|
||||||
|
|
||||||
|
if ((mask & BILLBOARD_GRAPH)!=0)
|
||||||
{
|
{
|
||||||
std::cout<<"Creating osg::Billboard based forest...";
|
std::cout<<"Creating osg::Billboard based forest...";
|
||||||
osg::Group* group = new osg::Group;
|
osg::Group* group = new osg::Group;
|
||||||
group->addChild(createBillboardGraph(cell.get(),dstate));
|
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);
|
_techniqueSwitch->addChild(group);
|
||||||
std::cout<<"done."<<std::endl;
|
std::cout<<"done."<<std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((mask & X_GRAPH)!=0)
|
||||||
{
|
{
|
||||||
std::cout<<"Creating double quad based forest...";
|
std::cout<<"Creating double quad based forest...";
|
||||||
osg::Group* group = new osg::Group;
|
osg::Group* group = new osg::Group;
|
||||||
group->addChild(createXGraph(cell.get(),dstate));
|
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);
|
_techniqueSwitch->addChild(group);
|
||||||
std::cout<<"done."<<std::endl;
|
std::cout<<"done."<<std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((mask & TRANSFORM_GRAPH)!=0)
|
||||||
{
|
{
|
||||||
std::cout<<"Creating osg::MatrixTransform based forest...";
|
std::cout<<"Creating osg::MatrixTransform based forest...";
|
||||||
osg::Group* group = new osg::Group;
|
osg::Group* group = new osg::Group;
|
||||||
group->addChild(createTransformGraph(cell.get(),dstate));
|
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);
|
_techniqueSwitch->addChild(group);
|
||||||
std::cout<<"done."<<std::endl;
|
std::cout<<"done."<<std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((mask & SHADER_GRAPH)!=0)
|
||||||
{
|
{
|
||||||
std::cout<<"Creating osg::Vertex/FragmentProgram based forest...";
|
std::cout<<"Creating osg::Vertex/FragmentProgram based forest...";
|
||||||
osg::Group* group = new osg::Group;
|
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(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);
|
_techniqueSwitch->addChild(group);
|
||||||
std::cout<<"done."<<std::endl;
|
std::cout<<"done."<<std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((mask & SHADER_GRAPH)!=0)
|
||||||
{
|
{
|
||||||
std::cout<<"Creating OpenGL shader based forest...";
|
std::cout<<"Creating OpenGL shader based forest...";
|
||||||
osg::Group* group = new osg::Group;
|
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(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);
|
_techniqueSwitch->addChild(group);
|
||||||
std::cout<<"done."<<std::endl;
|
std::cout<<"done."<<std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((mask & GEOMETRY_SHADER_GRAPH)!=0)
|
||||||
{
|
{
|
||||||
std::cout<<"Creating Geometry Shader based forest...";
|
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;
|
osg::Group* group = new osg::Group;
|
||||||
group->addChild(createGeometryShaderGraph(cell.get(), stateset));
|
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);
|
_techniqueSwitch->addChild(group);
|
||||||
std::cout<<"done."<<std::endl;
|
std::cout<<"done."<<std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((mask & TEXTURE_BUFFER_GRAPH)!=0)
|
||||||
{
|
{
|
||||||
std::cout<<"Creating forest using geometry instancing and texture buffer objects ...";
|
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 );
|
textureBufferGraph->setStateSet( stateset );
|
||||||
osg::Group* group = new osg::Group;
|
osg::Group* group = new osg::Group;
|
||||||
group->addChild(textureBufferGraph);
|
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);
|
_techniqueSwitch->addChild(group);
|
||||||
|
|
||||||
@@ -1466,6 +1498,16 @@ int main( int argc, char **argv )
|
|||||||
|
|
||||||
arguments.read("--trees-per-cell",maxNumTreesPerCell);
|
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;
|
osg::ref_ptr<ForestTechniqueManager> ttm = new ForestTechniqueManager;
|
||||||
|
|
||||||
// add the stats handler
|
// add the stats handler
|
||||||
@@ -1475,8 +1517,13 @@ int main( int argc, char **argv )
|
|||||||
viewer.addEventHandler(new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()));
|
viewer.addEventHandler(new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()));
|
||||||
|
|
||||||
// add model to viewer.
|
// 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();
|
return viewer.run();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -381,7 +381,7 @@ AppState::AppState(osgViewer::Viewer* viewer_)
|
|||||||
textProjection = new Projection;
|
textProjection = new Projection;
|
||||||
textProjection->setMatrix(Matrix::ortho2D(0,1280,0,1024));
|
textProjection->setMatrix(Matrix::ortho2D(0,1280,0,1024));
|
||||||
textProjection->addChild(textGeode);
|
textProjection->addChild(textGeode);
|
||||||
// "texture not available" text displayed when the user trys to
|
// "texture not available" text displayed when the user tries to
|
||||||
// display the depth texture while multisampling.
|
// display the depth texture while multisampling.
|
||||||
osgText::Text* noCanDo = new osgText::Text;
|
osgText::Text* noCanDo = new osgText::Text;
|
||||||
noCanDo->setFont(fontName);
|
noCanDo->setFont(fontName);
|
||||||
@@ -722,6 +722,8 @@ GraphicsContext* setupGC(osgViewer::Viewer& viewer, ArgumentParser& arguments)
|
|||||||
traits->windowDecoration = decoration;
|
traits->windowDecoration = decoration;
|
||||||
traits->doubleBuffer = true;
|
traits->doubleBuffer = true;
|
||||||
traits->sharedContext = 0;
|
traits->sharedContext = 0;
|
||||||
|
traits->readDISPLAY();
|
||||||
|
traits->setUndefinedScreenDetailsToDefaultScreen();
|
||||||
|
|
||||||
ref_ptr<GraphicsContext> gc = GraphicsContext::createGraphicsContext(traits.get());
|
ref_ptr<GraphicsContext> gc = GraphicsContext::createGraphicsContext(traits.get());
|
||||||
osgViewer::GraphicsWindow* gw = dynamic_cast<osgViewer::GraphicsWindow*>(gc.get());
|
osgViewer::GraphicsWindow* gw = dynamic_cast<osgViewer::GraphicsWindow*>(gc.get());
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ int main( int argc, char **argv )
|
|||||||
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options]");
|
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options]");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
|
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("-i <filename>","Input scene (or presentation) filename.");
|
arguments.getApplicationUsage()->addCommandLineOption("-i <filename>","Input scene (or presentation) filename.");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("-o <filename>","Base ouput filename of the images, recommended to use something like Images/image.png");
|
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("--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("--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 specificied camera path file to control camera position.");
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ int main(int argc, char *argv[])
|
|||||||
osg::ArgumentParser arguments(&argc,argv);
|
osg::ArgumentParser arguments(&argc,argv);
|
||||||
|
|
||||||
// set up the usage document, in case we need to print out how to use this program.
|
// set up the usage document, in case we need to print out how to use this program.
|
||||||
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the example which demonstrates ping pong rendering with FBOs and mutliple rendering branches. It uses Conway's Game of Life to illustrate the concept.");
|
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the example which demonstrates ping pong rendering with FBOs and multiple rendering branches. It uses Conway's Game of Life to illustrate the concept.");
|
||||||
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] --startim start_image");
|
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] --startim start_image");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
|
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("--startim","The initial image to seed the game of life with.");
|
arguments.getApplicationUsage()->addCommandLineOption("--startim","The initial image to seed the game of life with.");
|
||||||
|
|||||||
@@ -124,7 +124,7 @@
|
|||||||
but if Robert will accept its current implementations ( I mean - primitive
|
but if Robert will accept its current implementations ( I mean - primitive
|
||||||
sets that have osg::TextureBuffer in constructor ), I may add it to
|
sets that have osg::TextureBuffer in constructor ), I may add it to
|
||||||
osg/include/PrimitiveSet header.
|
osg/include/PrimitiveSet header.
|
||||||
- I used BufferTemplate class writen and published by Aurelien in submission forum
|
- I used BufferTemplate class written and published by Aurelien in submission forum
|
||||||
some time ago. For some reason this class never got into osg/include, but is
|
some time ago. For some reason this class never got into osg/include, but is
|
||||||
really needed during creation of UBOs, TBOs, and possibly SSBOs in the future.
|
really needed during creation of UBOs, TBOs, and possibly SSBOs in the future.
|
||||||
I added std::vector specialization to that template class.
|
I added std::vector specialization to that template class.
|
||||||
@@ -1145,7 +1145,7 @@ osg::Group* createAirplane( float detailRatio, const osg::Vec4& hullColor, const
|
|||||||
return root.release();
|
return root.release();
|
||||||
}
|
}
|
||||||
|
|
||||||
// createStaticRendering() shows how to use any OSG graph ( wheter it is single osg::Geode, or sophisticated osg::PagedLOD tree covering whole earth )
|
// createStaticRendering() shows how to use any OSG graph ( whether it is single osg::Geode, or sophisticated osg::PagedLOD tree covering whole earth )
|
||||||
// as a source of instance data. This way, the OSG graph of arbitrary size is at first culled using typical OSG mechanisms, then remaining osg::Geometries
|
// as a source of instance data. This way, the OSG graph of arbitrary size is at first culled using typical OSG mechanisms, then remaining osg::Geometries
|
||||||
// are sent to cull shader ( cullProgram ). Cull shader does not draw anything to screen ( thanks to GL_RASTERIZER_DISCARD mode ), but calculates if particular
|
// are sent to cull shader ( cullProgram ). Cull shader does not draw anything to screen ( thanks to GL_RASTERIZER_DISCARD mode ), but calculates if particular
|
||||||
// instances - sourced from above mentioned osg::Geometries - are visible and what LODs for these instances should be rendered.
|
// instances - sourced from above mentioned osg::Geometries - are visible and what LODs for these instances should be rendered.
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#include <Windows.h>
|
#include <windows.h>
|
||||||
#pragma warning( disable : 4244 )
|
#pragma warning( disable : 4244 )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ int main( int argc, char **argv )
|
|||||||
osg::ArgumentParser arguments(&argc,argv);
|
osg::ArgumentParser arguments(&argc,argv);
|
||||||
|
|
||||||
// set up the usage document, in case we need to print out how to use this program.
|
// set up the usage document, in case we need to print out how to use this program.
|
||||||
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the example which demonstrates how to create a scene programatically, in this case a hang gliding flying site.");
|
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the example which demonstrates how to create a scene programmatically, in this case a hang gliding flying site.");
|
||||||
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
|
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
|
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
|
||||||
|
|
||||||
@@ -159,6 +159,8 @@ int main( int argc, char **argv )
|
|||||||
traits->windowDecoration = true;
|
traits->windowDecoration = true;
|
||||||
traits->doubleBuffer = true;
|
traits->doubleBuffer = true;
|
||||||
traits->sharedContext = 0;
|
traits->sharedContext = 0;
|
||||||
|
traits->readDISPLAY();
|
||||||
|
traits->setUndefinedScreenDetailsToDefaultScreen();
|
||||||
|
|
||||||
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
||||||
if (gc.valid())
|
if (gc.valid())
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
|
|
||||||
|
|
||||||
// callback to make the loaded model oscilate up and down.
|
// callback to make the loaded model oscillate up and down.
|
||||||
class ModelTransformCallback : public osg::NodeCallback
|
class ModelTransformCallback : public osg::NodeCallback
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -65,6 +65,8 @@ class ContextTest : public MemoryTest
|
|||||||
traits->height = _height;
|
traits->height = _height;
|
||||||
traits->windowDecoration = true;
|
traits->windowDecoration = true;
|
||||||
traits->pbuffer = _pbuffer;
|
traits->pbuffer = _pbuffer;
|
||||||
|
traits->readDISPLAY();
|
||||||
|
traits->setUndefinedScreenDetailsToDefaultScreen();
|
||||||
|
|
||||||
osg::ref_ptr<osg::GraphicsContext> window = osg::GraphicsContext::createGraphicsContext(traits.get());
|
osg::ref_ptr<osg::GraphicsContext> window = osg::GraphicsContext::createGraphicsContext(traits.get());
|
||||||
if (window.valid())
|
if (window.valid())
|
||||||
@@ -326,7 +328,7 @@ int main( int argc, char **argv )
|
|||||||
arguments.getApplicationUsage()->addCommandLineOption("--texture <width> <height> <depth>","Allocate a 3D texture of specified dimensions.");
|
arguments.getApplicationUsage()->addCommandLineOption("--texture <width> <height> <depth>","Allocate a 3D texture of specified dimensions.");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("--texture <width> <height>","Allocate a 2D texture of specified dimensions.");
|
arguments.getApplicationUsage()->addCommandLineOption("--texture <width> <height>","Allocate a 2D texture of specified dimensions.");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("--texture <width>","Allocate a 1D texture of specified dimensions.");
|
arguments.getApplicationUsage()->addCommandLineOption("--texture <width>","Allocate a 1D texture of specified dimensions.");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("--geometry <width> <height>","Allocate a osg::Geometry representing a grid of specified size, using OpenGL Dislay Lists.");
|
arguments.getApplicationUsage()->addCommandLineOption("--geometry <width> <height>","Allocate a osg::Geometry representing a grid of specified size, using OpenGL Display Lists.");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("--geometry-va <width> <height>","Allocate a osg::Geometry representing a grid of specified size, using Vertex Arrays.");
|
arguments.getApplicationUsage()->addCommandLineOption("--geometry-va <width> <height>","Allocate a osg::Geometry representing a grid of specified size, using Vertex Arrays.");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("--geometry-vbo <width> <height>","Allocate a osg::Geometry representing a grid of specified size, using Vertex Buffer Objects.");
|
arguments.getApplicationUsage()->addCommandLineOption("--geometry-vbo <width> <height>","Allocate a osg::Geometry representing a grid of specified size, using Vertex Buffer Objects.");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("--fbo <width> <height>","Allocate a FrameBufferObject of specified dimensions.");
|
arguments.getApplicationUsage()->addCommandLineOption("--fbo <width> <height>","Allocate a FrameBufferObject of specified dimensions.");
|
||||||
|
|||||||
@@ -641,7 +641,11 @@ int main(int argc, char** argv)
|
|||||||
if (wsi)
|
if (wsi)
|
||||||
{
|
{
|
||||||
unsigned int width, height;
|
unsigned int width, height;
|
||||||
wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0), width, height);
|
osg::GraphicsContext::ScreenIdentifier main_screen_id;
|
||||||
|
|
||||||
|
main_screen_id.readDISPLAY();
|
||||||
|
main_screen_id.setUndefinedScreenDetailsToDefaultScreen();
|
||||||
|
wsi->getScreenResolution(main_screen_id, width, height);
|
||||||
|
|
||||||
screenAspectRatio = float(width) / float(height);
|
screenAspectRatio = float(width) / float(height);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,7 +91,11 @@ int main( int argc, char **argv )
|
|||||||
}
|
}
|
||||||
|
|
||||||
unsigned int width, height;
|
unsigned int width, height;
|
||||||
wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0), width, height);
|
osg::GraphicsContext::ScreenIdentifier main_screen_id;
|
||||||
|
|
||||||
|
main_screen_id.readDISPLAY();
|
||||||
|
main_screen_id.setUndefinedScreenDetailsToDefaultScreen();
|
||||||
|
wsi->getScreenResolution(main_screen_id, width, height);
|
||||||
|
|
||||||
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits;
|
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits;
|
||||||
traits->x = 100;
|
traits->x = 100;
|
||||||
@@ -101,6 +105,8 @@ int main( int argc, char **argv )
|
|||||||
traits->windowDecoration = true;
|
traits->windowDecoration = true;
|
||||||
traits->doubleBuffer = true;
|
traits->doubleBuffer = true;
|
||||||
traits->sharedContext = 0;
|
traits->sharedContext = 0;
|
||||||
|
traits->readDISPLAY();
|
||||||
|
traits->setUndefinedScreenDetailsToDefaultScreen();
|
||||||
|
|
||||||
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
||||||
if (gc.valid())
|
if (gc.valid())
|
||||||
|
|||||||
@@ -290,7 +290,7 @@ int main( int argc, char **argv )
|
|||||||
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the example which demonstrates use of convex planer occluders.");
|
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the example which demonstrates use of convex planer occluders.");
|
||||||
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
|
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
|
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("-m","Mannually create occluders");
|
arguments.getApplicationUsage()->addCommandLineOption("-m","Manually create occluders");
|
||||||
|
|
||||||
// initialize the viewer.
|
// initialize the viewer.
|
||||||
osgViewer::Viewer viewer;
|
osgViewer::Viewer viewer;
|
||||||
|
|||||||
@@ -109,8 +109,9 @@ bool PickHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapte
|
|||||||
user_event->setName("osc_test_1");
|
user_event->setName("osc_test_1");
|
||||||
|
|
||||||
_device->sendEvent(*user_event);
|
_device->sendEvent(*user_event);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -443,6 +444,8 @@ int main( int argc, char **argv )
|
|||||||
traits->doubleBuffer = true;
|
traits->doubleBuffer = true;
|
||||||
traits->sharedContext = 0;
|
traits->sharedContext = 0;
|
||||||
traits->windowName = "Receiver / view two";
|
traits->windowName = "Receiver / view two";
|
||||||
|
traits->readDISPLAY();
|
||||||
|
traits->setUndefinedScreenDetailsToDefaultScreen();
|
||||||
|
|
||||||
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
||||||
|
|
||||||
@@ -509,6 +512,8 @@ int main( int argc, char **argv )
|
|||||||
traits->doubleBuffer = true;
|
traits->doubleBuffer = true;
|
||||||
traits->sharedContext = 0;
|
traits->sharedContext = 0;
|
||||||
traits->windowName = "Sender / view one";
|
traits->windowName = "Sender / view one";
|
||||||
|
traits->readDISPLAY();
|
||||||
|
traits->setUndefinedScreenDetailsToDefaultScreen();
|
||||||
|
|
||||||
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
||||||
|
|
||||||
|
|||||||
@@ -444,7 +444,7 @@ void build_world(osg::Group *root)
|
|||||||
// the second one will be a little bit more complex, showing how to
|
// the second one will be a little bit more complex, showing how to
|
||||||
// create custom operators.
|
// create custom operators.
|
||||||
// To avoid inserting too much code in a single function, we have
|
// To avoid inserting too much code in a single function, we have
|
||||||
// splitted the work into two functions which accept a Group node as
|
// split the work into two functions which accept a Group node as
|
||||||
// parameter, and return a pointer to the particle system they created.
|
// parameter, and return a pointer to the particle system they created.
|
||||||
|
|
||||||
osgParticle::ParticleSystem *ps1 = create_simple_particle_system(root);
|
osgParticle::ParticleSystem *ps1 = create_simple_particle_system(root);
|
||||||
|
|||||||
@@ -317,7 +317,7 @@ public:
|
|||||||
// insert particle effects alongside the hit node, therefore able to track that nodes movement,
|
// insert particle effects alongside the hit node, therefore able to track that nodes movement,
|
||||||
// however, this does require us to insert the ParticleSystem itself into the root of the scene graph
|
// however, this does require us to insert the ParticleSystem itself into the root of the scene graph
|
||||||
// separately from the main particle effects group which contains the emitters and programs.
|
// separately from the main particle effects group which contains the emitters and programs.
|
||||||
// the follow code block implements this, note the path for handling particle effects which arn't attached to
|
// the follow code block implements this, note the path for handling particle effects which aren't attached to
|
||||||
// moving models is easy - just a single line of code!
|
// moving models is easy - just a single line of code!
|
||||||
|
|
||||||
// tell the effects not to attach to the particle system locally for rendering, as we'll handle add it into the
|
// tell the effects not to attach to the particle system locally for rendering, as we'll handle add it into the
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ int main( int argc, char** argv )
|
|||||||
root->addChild( parent.get() );
|
root->addChild( parent.get() );
|
||||||
root->addChild( updater.get() );
|
root->addChild( updater.get() );
|
||||||
|
|
||||||
// FIXME 2010.9.19: the updater can't be a drawable; otehrwise the ParticleEffect will not work properly. why?
|
// FIXME 2010.9.19: the updater can't be a drawable; otherwise the ParticleEffect will not work properly. why?
|
||||||
updater->addParticleSystem( ps.get() );
|
updater->addParticleSystem( ps.get() );
|
||||||
|
|
||||||
osg::ref_ptr<osg::Geode> geode = new osg::Geode;
|
osg::ref_ptr<osg::Geode> geode = new osg::Geode;
|
||||||
|
|||||||
@@ -644,6 +644,7 @@ bool SlideEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIAction
|
|||||||
}
|
}
|
||||||
|
|
||||||
_album->setVisibility();
|
_album->setVisibility();
|
||||||
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -747,7 +748,7 @@ int main( int argc, char **argv )
|
|||||||
|
|
||||||
osg::ref_ptr<Album> album = new Album(arguments,width,height);
|
osg::ref_ptr<Album> album = new Album(arguments,width,height);
|
||||||
|
|
||||||
// creat the scene from the file list.
|
// create the scene from the file list.
|
||||||
osg::ref_ptr<osg::Group> rootNode = album->getScene();
|
osg::ref_ptr<osg::Group> rootNode = album->getScene();
|
||||||
|
|
||||||
if (!rootNode) return 0;
|
if (!rootNode) return 0;
|
||||||
|
|||||||
@@ -16,9 +16,7 @@
|
|||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* osgpick sample
|
/* osgpick sample - Mouse picking in a 3d scene,
|
||||||
* demonstrate use of osgUtil/PickVisitor for picking in a HUD or
|
|
||||||
* in a 3d scene,
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <osgUtil/Optimizer>
|
#include <osgUtil/Optimizer>
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ int main(int argc, char** argv)
|
|||||||
if (script.valid()) scripts.push_back(script.get());
|
if (script.valid()) scripts.push_back(script.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
// assgin script engine to scene graphs
|
// assign script engine to scene graphs
|
||||||
model->getOrCreateUserDataContainer()->addUserObject(osgDB::readFile<osg::ScriptEngine>("ScriptEngine.lua"));
|
model->getOrCreateUserDataContainer()->addUserObject(osgDB::readFile<osg::ScriptEngine>("ScriptEngine.lua"));
|
||||||
model->getOrCreateUserDataContainer()->addUserObject(osgDB::readFile<osg::ScriptEngine>("ScriptEngine.python"));
|
model->getOrCreateUserDataContainer()->addUserObject(osgDB::readFile<osg::ScriptEngine>("ScriptEngine.python"));
|
||||||
model->getOrCreateUserDataContainer()->addUserObject(osgDB::readFile<osg::ScriptEngine>("ScriptEngine.js"));
|
model->getOrCreateUserDataContainer()->addUserObject(osgDB::readFile<osg::ScriptEngine>("ScriptEngine.js"));
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ int main(int argc, char* argv[])
|
|||||||
sampler2=(osg::Sampler*)(*it)->getTextureAttribute(0, osg::StateAttribute::SAMPLER);
|
sampler2=(osg::Sampler*)(*it)->getTextureAttribute(0, osg::StateAttribute::SAMPLER);
|
||||||
}
|
}
|
||||||
if(sampler1.valid()&&sampler2.valid()){
|
if(sampler1.valid()&&sampler2.valid()){
|
||||||
OSG_WARN<<"2samplers manipulator setted"<<std::endl;
|
OSG_WARN<<"2samplers manipulator set"<<std::endl;
|
||||||
viewer.addEventHandler(new SamplersKeyboardEventHandler(sampler1.get(), sampler2.get()));
|
viewer.addEventHandler(new SamplersKeyboardEventHandler(sampler1.get(), sampler2.get()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -185,7 +185,7 @@ int main(int argc, char* argv[])
|
|||||||
im->dirty();
|
im->dirty();
|
||||||
tex2->setImage(im);
|
tex2->setImage(im);
|
||||||
}
|
}
|
||||||
///Overrided Filtering setup
|
///Overridden Filtering setup
|
||||||
tex1->setFilter(osg::Texture::MAG_FILTER,osg::Texture::NEAREST);
|
tex1->setFilter(osg::Texture::MAG_FILTER,osg::Texture::NEAREST);
|
||||||
tex1->setFilter(osg::Texture::MIN_FILTER,osg::Texture::NEAREST);
|
tex1->setFilter(osg::Texture::MIN_FILTER,osg::Texture::NEAREST);
|
||||||
|
|
||||||
|
|||||||
@@ -712,6 +712,8 @@ int main(int argc, char** argv)
|
|||||||
traits->pbuffer = true;
|
traits->pbuffer = true;
|
||||||
traits->doubleBuffer = true;
|
traits->doubleBuffer = true;
|
||||||
traits->sharedContext = 0;
|
traits->sharedContext = 0;
|
||||||
|
traits->readDISPLAY();
|
||||||
|
traits->setUndefinedScreenDetailsToDefaultScreen();
|
||||||
|
|
||||||
pbuffer = osg::GraphicsContext::createGraphicsContext(traits.get());
|
pbuffer = osg::GraphicsContext::createGraphicsContext(traits.get());
|
||||||
if (pbuffer.valid())
|
if (pbuffer.valid())
|
||||||
|
|||||||
@@ -182,7 +182,11 @@ void singleWindowSideBySideCameras(osgViewer::Viewer& viewer)
|
|||||||
}
|
}
|
||||||
|
|
||||||
unsigned int width, height;
|
unsigned int width, height;
|
||||||
wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0), width, height);
|
osg::GraphicsContext::ScreenIdentifier main_screen_id;
|
||||||
|
|
||||||
|
main_screen_id.readDISPLAY();
|
||||||
|
main_screen_id.setUndefinedScreenDetailsToDefaultScreen();
|
||||||
|
wsi->getScreenResolution(main_screen_id, width, height);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -198,6 +202,8 @@ void singleWindowSideBySideCameras(osgViewer::Viewer& viewer)
|
|||||||
traits->windowDecoration = true;
|
traits->windowDecoration = true;
|
||||||
traits->doubleBuffer = true;
|
traits->doubleBuffer = true;
|
||||||
traits->sharedContext = 0;
|
traits->sharedContext = 0;
|
||||||
|
traits->readDISPLAY();
|
||||||
|
traits->setUndefinedScreenDetailsToDefaultScreen();
|
||||||
|
|
||||||
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
||||||
if (gc.valid())
|
if (gc.valid())
|
||||||
|
|||||||
@@ -87,6 +87,8 @@ int main( int argc, char** argv )
|
|||||||
traits->windowDecoration = true;
|
traits->windowDecoration = true;
|
||||||
traits->doubleBuffer = true;
|
traits->doubleBuffer = true;
|
||||||
traits->glContextVersion = version;
|
traits->glContextVersion = version;
|
||||||
|
traits->readDISPLAY();
|
||||||
|
traits->setUndefinedScreenDetailsToDefaultScreen();
|
||||||
osg::ref_ptr< osg::GraphicsContext > gc = osg::GraphicsContext::createGraphicsContext( traits.get() );
|
osg::ref_ptr< osg::GraphicsContext > gc = osg::GraphicsContext::createGraphicsContext( traits.get() );
|
||||||
if( !gc.valid() )
|
if( !gc.valid() )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,11 +26,16 @@
|
|||||||
#include <osgDB/ReadFile>
|
#include <osgDB/ReadFile>
|
||||||
#include <osgDB/WriteFile>
|
#include <osgDB/WriteFile>
|
||||||
|
|
||||||
|
#include <osgViewer/GraphicsWindow>
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#define MIN_NEARFAROFFSET 0.1
|
#define MIN_NEARFAROFFSET 0.1
|
||||||
|
|
||||||
|
// force the WIndowingSystem to initialize to allow us to create a graphics context.
|
||||||
|
USE_GRAPHICSWINDOW()
|
||||||
|
|
||||||
class SliceProcessor
|
class SliceProcessor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -137,6 +142,8 @@ int main( int argc, char **argv )
|
|||||||
traits->doubleBuffer = true;
|
traits->doubleBuffer = true;
|
||||||
traits->sharedContext = 0;
|
traits->sharedContext = 0;
|
||||||
traits->pbuffer = false;
|
traits->pbuffer = false;
|
||||||
|
traits->readDISPLAY();
|
||||||
|
traits->setUndefinedScreenDetailsToDefaultScreen();
|
||||||
|
|
||||||
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
||||||
if (!gc || !gc->valid())
|
if (!gc || !gc->valid())
|
||||||
@@ -187,7 +194,7 @@ int main( int argc, char **argv )
|
|||||||
// pass frame stamp to the SceneView so that the update, cull and draw traversals all use the same FrameStamp
|
// pass frame stamp to the SceneView so that the update, cull and draw traversals all use the same FrameStamp
|
||||||
sceneView->setFrameStamp(frameStamp.get());
|
sceneView->setFrameStamp(frameStamp.get());
|
||||||
|
|
||||||
// update the viewport dimensions, incase the window has been resized.
|
// update the viewport dimensions, in case the window has been resized.
|
||||||
sceneView->setViewport(0,0,traits->width,traits->height);
|
sceneView->setViewport(0,0,traits->width,traits->height);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -610,7 +610,7 @@ int main( int argc, char **argv )
|
|||||||
osg::TexMat* texmatLeft = new osg::TexMat;
|
osg::TexMat* texmatLeft = new osg::TexMat;
|
||||||
osg::TexMat* texmatRight = new osg::TexMat;
|
osg::TexMat* texmatRight = new osg::TexMat;
|
||||||
|
|
||||||
// creat the scene from the file list.
|
// create the scene from the file list.
|
||||||
osg::ref_ptr<osg::Switch> rootNode;
|
osg::ref_ptr<osg::Switch> rootNode;
|
||||||
if (!onDisk) rootNode = createScene(fileList,texmatLeft,texmatRight,radius,height,length);
|
if (!onDisk) rootNode = createScene(fileList,texmatLeft,texmatRight,radius,height,length);
|
||||||
else rootNode=new osg::Switch();
|
else rootNode=new osg::Switch();
|
||||||
|
|||||||
@@ -235,7 +235,7 @@ class Teapot : public osg::Drawable
|
|||||||
// of OpenGL primitives.
|
// of OpenGL primitives.
|
||||||
virtual void drawImplementation(osg::RenderInfo&) const
|
virtual void drawImplementation(osg::RenderInfo&) const
|
||||||
{
|
{
|
||||||
// teapot(..) doens't use vertex arrays at all so we don't need to toggle their state
|
// teapot(..) doesn't use vertex arrays at all so we don't need to toggle their state
|
||||||
// if we did we'd need to something like following call
|
// if we did we'd need to something like following call
|
||||||
// state.disableAllVertexArrays(), see src/osg/Geometry.cpp for the low down.
|
// state.disableAllVertexArrays(), see src/osg/Geometry.cpp for the low down.
|
||||||
|
|
||||||
|
|||||||
@@ -379,6 +379,11 @@ int main(int argc, char** argv)
|
|||||||
terrain->setVerticalScale(verticalScale);
|
terrain->setVerticalScale(verticalScale);
|
||||||
terrain->setBlendingPolicy(blendingPolicy);
|
terrain->setBlendingPolicy(blendingPolicy);
|
||||||
|
|
||||||
|
if (arguments.read("--equalize-boundaries") || arguments.read("-e"))
|
||||||
|
{
|
||||||
|
terrain->setEqualizeBoundaries(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (useDisplacementMappingTechnique)
|
if (useDisplacementMappingTechnique)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ class /*OSGTEXT_EXPORT*/ TextTechnique : public osg::Object
|
|||||||
/// default TextTechnique implementation used if no other is specified on TextNode
|
/// default TextTechnique implementation used if no other is specified on TextNode
|
||||||
static osg::ref_ptr<TextTechnique>& getDefaultTextTechinque();
|
static osg::ref_ptr<TextTechnique>& getDefaultTextTechinque();
|
||||||
|
|
||||||
/// start building a new charater layout
|
/// start building a new character layout
|
||||||
virtual void start();
|
virtual void start();
|
||||||
|
|
||||||
/// called by Layout engine to place individual characters
|
/// called by Layout engine to place individual characters
|
||||||
@@ -70,7 +70,7 @@ class /*OSGTEXT_EXPORT*/ TextTechnique : public osg::Object
|
|||||||
/// called by Layout engine to place individual characters
|
/// called by Layout engine to place individual characters
|
||||||
virtual void addCharacter(const osg::Vec3& position, const osg::Vec3& size, Glyph3D* glyph, Style* style);
|
virtual void addCharacter(const osg::Vec3& position, const osg::Vec3& size, Glyph3D* glyph, Style* style);
|
||||||
|
|
||||||
/// finish building new charater layout
|
/// finish building new character layout
|
||||||
virtual void finish();
|
virtual void finish();
|
||||||
|
|
||||||
/// provide traversal control
|
/// provide traversal control
|
||||||
|
|||||||
@@ -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)
|
if (ea.getKey() == osgGA::GUIEventAdapter::KEY_Up)
|
||||||
{
|
{
|
||||||
@@ -83,6 +89,24 @@ public:
|
|||||||
return false;
|
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:
|
private:
|
||||||
osgText::Text3D* m_Text3D;
|
osgText::Text3D* m_Text3D;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -146,7 +146,11 @@ int main(int argc, char** argv)
|
|||||||
|
|
||||||
|
|
||||||
unsigned int width, height;
|
unsigned int width, height;
|
||||||
wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0), width, height);
|
osg::GraphicsContext::ScreenIdentifier main_screen_id;
|
||||||
|
|
||||||
|
main_screen_id.readDISPLAY();
|
||||||
|
main_screen_id.setUndefinedScreenDetailsToDefaultScreen();
|
||||||
|
wsi->getScreenResolution(main_screen_id, width, height);
|
||||||
|
|
||||||
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits;
|
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits;
|
||||||
traits->x = 0;
|
traits->x = 0;
|
||||||
@@ -155,6 +159,8 @@ int main(int argc, char** argv)
|
|||||||
traits->height = height;
|
traits->height = height;
|
||||||
traits->windowDecoration = false;
|
traits->windowDecoration = false;
|
||||||
traits->doubleBuffer = true;
|
traits->doubleBuffer = true;
|
||||||
|
traits->readDISPLAY();
|
||||||
|
traits->setUndefinedScreenDetailsToDefaultScreen();
|
||||||
|
|
||||||
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
||||||
if (!gc)
|
if (!gc)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#include <osgGA/TrackballManipulator>
|
#include <osgGA/TrackballManipulator>
|
||||||
|
|
||||||
// This is an implementation of SimpleViewer that is designed to be subclassed
|
// This is an implementation of SimpleViewer that is designed to be subclassed
|
||||||
// and used as a GtkDrawingArea in a GTK application. Because of the implemention
|
// and used as a GtkDrawingArea in a GTK application. Because of the implementation
|
||||||
// of GTK, I was unable to derive from GtkWidget and instead had to "wrap" it.
|
// of GTK, I was unable to derive from GtkWidget and instead had to "wrap" it.
|
||||||
// Conceptually, however, you can think of an OSGGTKDrawingArea as both an OSG
|
// Conceptually, however, you can think of an OSGGTKDrawingArea as both an OSG
|
||||||
// Viewer AND GtkDrawingArea.
|
// Viewer AND GtkDrawingArea.
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ SET(TARGET_ADDED_LIBRARIES ${TARGET_ADDED_LIBRARIES}
|
|||||||
#backup setting
|
#backup setting
|
||||||
SET(TMP_OSG_BUILD_APPLICATION_BUNDLES {$OSG_BUILD_APPLICATION_BUNDLES})
|
SET(TMP_OSG_BUILD_APPLICATION_BUNDLES {$OSG_BUILD_APPLICATION_BUNDLES})
|
||||||
SET(OSG_BUILD_APPLICATION_BUNDLES TRUE)
|
SET(OSG_BUILD_APPLICATION_BUNDLES TRUE)
|
||||||
SET(MACOSX_DEPLOYMENT_TARGET, ${IPHONE_VERSION_MIN})
|
#SET(MACOSX_DEPLOYMENT_TARGET, ${IPHONE_VERSION_MIN})
|
||||||
SETUP_EXAMPLE(osgViewerIPhone)
|
SETUP_EXAMPLE(osgViewerIPhone)
|
||||||
SET_TARGET_PROPERTIES(example_osgViewerIPhone PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer"
|
SET_TARGET_PROPERTIES(example_osgViewerIPhone PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer"
|
||||||
XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET ${IPHONE_VERSION_MIN}
|
XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET ${IPHONE_VERSION_MIN}
|
||||||
@@ -35,4 +35,4 @@ SET_TARGET_PROPERTIES(example_osgViewerIPhone PROPERTIES XCODE_ATTRIBUTE_CODE_SI
|
|||||||
|
|
||||||
#restore setting
|
#restore setting
|
||||||
SET(OSG_BUILD_APPLICATION_BUNDLES {$TMP_OSG_BUILD_APPLICATION_BUNDLES})
|
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")
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ void cOSG::InitCameraConfig(void)
|
|||||||
camera->setGraphicsContext(gc);
|
camera->setGraphicsContext(gc);
|
||||||
|
|
||||||
// Set the viewport for the Camera
|
// Set the viewport for the Camera
|
||||||
camera->setViewport(new osg::Viewport(traits->x, traits->y, traits->width, traits->height));
|
camera->setViewport(new osg::Viewport(0, 0, traits->width, traits->height));
|
||||||
|
|
||||||
// set the draw and read buffers up for a double buffered window with rendering going to back buffer
|
// set the draw and read buffers up for a double buffered window with rendering going to back buffer
|
||||||
camera->setDrawBuffer(GL_BACK);
|
camera->setDrawBuffer(GL_BACK);
|
||||||
|
|||||||
@@ -140,7 +140,8 @@ END_EVENT_TABLE()
|
|||||||
|
|
||||||
OSGCanvas::OSGCanvas(wxWindow *parent, wxWindowID id,
|
OSGCanvas::OSGCanvas(wxWindow *parent, wxWindowID id,
|
||||||
const wxPoint& pos, const wxSize& size, long style, const wxString& name, int *attributes)
|
const wxPoint& pos, const wxSize& size, long style, const wxString& name, int *attributes)
|
||||||
: wxGLCanvas(parent, id, pos, size, style|wxFULL_REPAINT_ON_RESIZE, name, attributes)
|
: wxGLCanvas(parent, id, attributes, pos, size, style|wxFULL_REPAINT_ON_RESIZE, name)
|
||||||
|
,_context(this)
|
||||||
{
|
{
|
||||||
// default cursor to standard
|
// default cursor to standard
|
||||||
_oldCursor = *wxSTANDARD_CURSOR;
|
_oldCursor = *wxSTANDARD_CURSOR;
|
||||||
@@ -150,6 +151,11 @@ OSGCanvas::~OSGCanvas()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OSGCanvas::SetContextCurrent()
|
||||||
|
{
|
||||||
|
_context.SetCurrent(*this);
|
||||||
|
}
|
||||||
|
|
||||||
void OSGCanvas::OnPaint( wxPaintEvent& WXUNUSED(event) )
|
void OSGCanvas::OnPaint( wxPaintEvent& WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
/* must always be here */
|
/* must always be here */
|
||||||
@@ -158,8 +164,6 @@ void OSGCanvas::OnPaint( wxPaintEvent& WXUNUSED(event) )
|
|||||||
|
|
||||||
void OSGCanvas::OnSize(wxSizeEvent& event)
|
void OSGCanvas::OnSize(wxSizeEvent& event)
|
||||||
{
|
{
|
||||||
// this is also necessary to update the context on some platforms
|
|
||||||
wxGLCanvas::OnSize(event);
|
|
||||||
|
|
||||||
// set GL viewport (not called by wxGLCanvas::OnSize on all platforms...)
|
// set GL viewport (not called by wxGLCanvas::OnSize on all platforms...)
|
||||||
int width, height;
|
int width, height;
|
||||||
@@ -337,7 +341,7 @@ void GraphicsWindowWX::useCursor(bool cursorOn)
|
|||||||
|
|
||||||
bool GraphicsWindowWX::makeCurrentImplementation()
|
bool GraphicsWindowWX::makeCurrentImplementation()
|
||||||
{
|
{
|
||||||
_canvas->SetCurrent();
|
_canvas->SetContextCurrent();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,12 +38,14 @@ public:
|
|||||||
|
|
||||||
void UseCursor(bool value);
|
void UseCursor(bool value);
|
||||||
|
|
||||||
|
void SetContextCurrent();
|
||||||
private:
|
private:
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
|
|
||||||
osg::ref_ptr<osgViewer::GraphicsWindow> _graphics_window;
|
osg::ref_ptr<osgViewer::GraphicsWindow> _graphics_window;
|
||||||
|
|
||||||
wxCursor _oldCursor;
|
wxCursor _oldCursor;
|
||||||
|
wxGLContext _context;
|
||||||
};
|
};
|
||||||
|
|
||||||
class GraphicsWindowWX : public osgViewer::GraphicsWindow
|
class GraphicsWindowWX : public osgViewer::GraphicsWindow
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ osg::Node * CreateAdvancedHierarchy( osg::Node * model )
|
|||||||
|
|
||||||
// Set default VirtualProgram in root StateSet
|
// Set default VirtualProgram in root StateSet
|
||||||
// With main vertex and main fragment shaders calling
|
// With main vertex and main fragment shaders calling
|
||||||
// lighting and texture functions defined in aditional shaders
|
// lighting and texture functions defined in additional shaders
|
||||||
// Lighting is done per vertex using simple directional light
|
// Lighting is done per vertex using simple directional light
|
||||||
// Texture uses stage 0 TexCoords and TexMap
|
// Texture uses stage 0 TexCoords and TexMap
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ class EscapeHandler : public osgGA::GUIEventHandler
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -58,6 +58,8 @@ int main( int argc, char **argv )
|
|||||||
traits->windowDecoration = true;
|
traits->windowDecoration = true;
|
||||||
traits->doubleBuffer = true;
|
traits->doubleBuffer = true;
|
||||||
traits->sharedContext = 0;
|
traits->sharedContext = 0;
|
||||||
|
traits->readDISPLAY();
|
||||||
|
traits->setUndefinedScreenDetailsToDefaultScreen();
|
||||||
|
|
||||||
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
||||||
|
|
||||||
@@ -82,6 +84,8 @@ int main( int argc, char **argv )
|
|||||||
traits->windowDecoration = true;
|
traits->windowDecoration = true;
|
||||||
traits->doubleBuffer = true;
|
traits->doubleBuffer = true;
|
||||||
traits->sharedContext = 0;
|
traits->sharedContext = 0;
|
||||||
|
traits->readDISPLAY();
|
||||||
|
traits->setUndefinedScreenDetailsToDefaultScreen();
|
||||||
|
|
||||||
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
||||||
|
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ public:
|
|||||||
Affinity& operator = (const Affinity& rhs) { if (&rhs!=this) { activeCPUs = rhs.activeCPUs; } return *this; }
|
Affinity& operator = (const Affinity& rhs) { if (&rhs!=this) { activeCPUs = rhs.activeCPUs; } return *this; }
|
||||||
|
|
||||||
|
|
||||||
/** add a specfied cpu core from the list to have affinity to. */
|
/** add a specified cpu core from the list to have affinity to. */
|
||||||
void add(unsigned int cpuNmber) { activeCPUs.insert(cpuNmber); }
|
void add(unsigned int cpuNmber) { activeCPUs.insert(cpuNmber); }
|
||||||
|
|
||||||
/** remove a specfied cpu core from the list to have affinity to. */
|
/** remove a specified cpu core from the list to have affinity to. */
|
||||||
void remove(unsigned int cpuNmber) { activeCPUs.erase(cpuNmber); }
|
void remove(unsigned int cpuNmber) { activeCPUs.erase(cpuNmber); }
|
||||||
|
|
||||||
/** return true if affinity has been provided for specific CPU cores.*/
|
/** return true if affinity has been provided for specific CPU cores.*/
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Set the thread's schedule priority. This is a complex method.
|
* Set the thread's schedule priority. This is a complex method.
|
||||||
* Beware of thread priorities when using a many-to-many kernel
|
* Beware of thread priorities when using a many-to-many kernel
|
||||||
* entity implemenation (such as IRIX pthreads). If one is not careful
|
* entity implementation (such as IRIX pthreads). If one is not careful
|
||||||
* to manage the thread priorities, a priority inversion deadlock can
|
* to manage the thread priorities, a priority inversion deadlock can
|
||||||
* easily occur (Although the OpenThreads::Mutex & OpenThreads::Barrier
|
* easily occur (Although the OpenThreads::Mutex & OpenThreads::Barrier
|
||||||
* constructs have been designed with this scenario in mind). Unless
|
* constructs have been designed with this scenario in mind). Unless
|
||||||
|
|||||||
@@ -152,6 +152,14 @@ class BufferObjectProfile
|
|||||||
class GLBufferObjectSet;
|
class GLBufferObjectSet;
|
||||||
class GLBufferObjectManager;
|
class GLBufferObjectManager;
|
||||||
|
|
||||||
|
inline unsigned int computeBufferAlignment(unsigned int pos, unsigned int bufferAlignment)
|
||||||
|
{
|
||||||
|
if (bufferAlignment<2) return pos;
|
||||||
|
if ((pos%bufferAlignment)==0) return pos;
|
||||||
|
return ((pos/bufferAlignment)+1)*bufferAlignment;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class OSG_EXPORT GLBufferObject : public GraphicsObject
|
class OSG_EXPORT GLBufferObject : public GraphicsObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -235,9 +243,7 @@ class OSG_EXPORT GLBufferObject : public GraphicsObject
|
|||||||
|
|
||||||
unsigned int computeBufferAlignment(unsigned int pos, unsigned int bufferAlignment) const
|
unsigned int computeBufferAlignment(unsigned int pos, unsigned int bufferAlignment) const
|
||||||
{
|
{
|
||||||
if (bufferAlignment<2) return pos;
|
return osg::computeBufferAlignment(pos, bufferAlignment);
|
||||||
if ((pos%bufferAlignment)==0) return pos;
|
|
||||||
return ((pos/bufferAlignment)+1)*bufferAlignment;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int _contextID;
|
unsigned int _contextID;
|
||||||
@@ -431,10 +437,10 @@ class OSG_EXPORT BufferObject : public Object
|
|||||||
const BufferObjectProfile& getProfile() const { return _profile; }
|
const BufferObjectProfile& getProfile() const { return _profile; }
|
||||||
|
|
||||||
|
|
||||||
/** Set whether the BufferObject should use a GLBufferObject just for copying the BufferData and release it immmediately so that it may be reused.*/
|
/** Set whether the BufferObject should use a GLBufferObject just for copying the BufferData and release it immediately so that it may be reused.*/
|
||||||
void setCopyDataAndReleaseGLBufferObject(bool copyAndRelease) { _copyDataAndReleaseGLBufferObject = copyAndRelease; }
|
void setCopyDataAndReleaseGLBufferObject(bool copyAndRelease) { _copyDataAndReleaseGLBufferObject = copyAndRelease; }
|
||||||
|
|
||||||
/** Get whether the BufferObject should use a GLBufferObject just for copying the BufferData and release it immmediately.*/
|
/** Get whether the BufferObject should use a GLBufferObject just for copying the BufferData and release it immediately.*/
|
||||||
bool getCopyDataAndReleaseGLBufferObject() const { return _copyDataAndReleaseGLBufferObject; }
|
bool getCopyDataAndReleaseGLBufferObject() const { return _copyDataAndReleaseGLBufferObject; }
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ public:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Convenience function for getting the CallbackObject associated with specificed name from an Object's UserDataContainer.*/
|
/** Convenience function for getting the CallbackObject associated with specified name from an Object's UserDataContainer.*/
|
||||||
inline CallbackObject* getCallbackObject(osg::Object* object, const std::string& name)
|
inline CallbackObject* getCallbackObject(osg::Object* object, const std::string& name)
|
||||||
{
|
{
|
||||||
osg::UserDataContainer* udc = object->getUserDataContainer();
|
osg::UserDataContainer* udc = object->getUserDataContainer();
|
||||||
@@ -171,7 +171,7 @@ inline CallbackObject* getCallbackObject(osg::Object* object, const std::string&
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Convenience function for getting the CallbackObject associated with specificed name from an Object's UserDataContainer.*/
|
/** Convenience function for getting the CallbackObject associated with specified name from an Object's UserDataContainer.*/
|
||||||
inline const CallbackObject* getCallbackObject(const osg::Object* object, const std::string& name)
|
inline const CallbackObject* getCallbackObject(const osg::Object* object, const std::string& name)
|
||||||
{
|
{
|
||||||
const osg::UserDataContainer* udc = object->getUserDataContainer();
|
const osg::UserDataContainer* udc = object->getUserDataContainer();
|
||||||
|
|||||||
@@ -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.**/
|
/** Functor method, provided for backwards compatibility, called by operator() (osg::RenderInfo& renderInfo) method.**/
|
||||||
virtual void operator () (const osg::Camera& /*camera*/) const {}
|
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.*/
|
/** Set the initial draw callback for custom operations to be done before the drawing of the camera's subgraph and pre render stages.*/
|
||||||
|
|||||||
@@ -270,6 +270,88 @@ class OSG_EXPORT CullSettings
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<class matrix_type, class value_type>
|
||||||
|
bool clampProjectionMatrix(matrix_type& projection, double& znear, double& zfar, value_type nearFarRatio)
|
||||||
|
{
|
||||||
|
double epsilon = 1e-6;
|
||||||
|
if (zfar<znear-epsilon)
|
||||||
|
{
|
||||||
|
if (zfar != -FLT_MAX || znear != FLT_MAX)
|
||||||
|
{
|
||||||
|
OSG_INFO<<"_clampProjectionMatrix not applied, invalid depth range, znear = "<<znear<<" zfar = "<<zfar<<std::endl;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (zfar<znear+epsilon)
|
||||||
|
{
|
||||||
|
// znear and zfar are too close together and could cause divide by zero problems
|
||||||
|
// late on in the clamping code, so move the znear and zfar apart.
|
||||||
|
double average = (znear+zfar)*0.5;
|
||||||
|
znear = average-epsilon;
|
||||||
|
zfar = average+epsilon;
|
||||||
|
// OSG_INFO << "_clampProjectionMatrix widening znear and zfar to "<<znear<<" "<<zfar<<std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fabs(projection(0,3))<epsilon && fabs(projection(1,3))<epsilon && fabs(projection(2,3))<epsilon )
|
||||||
|
{
|
||||||
|
// OSG_INFO << "Orthographic matrix before clamping"<<projection<<std::endl;
|
||||||
|
|
||||||
|
value_type delta_span = (zfar-znear)*0.02;
|
||||||
|
if (delta_span<1.0) delta_span = 1.0;
|
||||||
|
value_type desired_znear = znear - delta_span;
|
||||||
|
value_type desired_zfar = zfar + delta_span;
|
||||||
|
|
||||||
|
// assign the clamped values back to the computed values.
|
||||||
|
znear = desired_znear;
|
||||||
|
zfar = desired_zfar;
|
||||||
|
|
||||||
|
projection(2,2)=-2.0f/(desired_zfar-desired_znear);
|
||||||
|
projection(3,2)=-(desired_zfar+desired_znear)/(desired_zfar-desired_znear);
|
||||||
|
|
||||||
|
// OSG_INFO << "Orthographic matrix after clamping "<<projection<<std::endl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
// OSG_INFO << "Persepective matrix before clamping"<<projection<<std::endl;
|
||||||
|
|
||||||
|
//std::cout << "_computed_znear"<<_computed_znear<<std::endl;
|
||||||
|
//std::cout << "_computed_zfar"<<_computed_zfar<<std::endl;
|
||||||
|
|
||||||
|
value_type zfarPushRatio = 1.02;
|
||||||
|
value_type znearPullRatio = 0.98;
|
||||||
|
|
||||||
|
//znearPullRatio = 0.99;
|
||||||
|
|
||||||
|
value_type desired_znear = znear * znearPullRatio;
|
||||||
|
value_type desired_zfar = zfar * zfarPushRatio;
|
||||||
|
|
||||||
|
// near plane clamping.
|
||||||
|
double min_near_plane = zfar*nearFarRatio;
|
||||||
|
if (desired_znear<min_near_plane) desired_znear=min_near_plane;
|
||||||
|
|
||||||
|
// assign the clamped values back to the computed values.
|
||||||
|
znear = desired_znear;
|
||||||
|
zfar = desired_zfar;
|
||||||
|
|
||||||
|
value_type trans_near_plane = (-desired_znear*projection(2,2)+projection(3,2))/(-desired_znear*projection(2,3)+projection(3,3));
|
||||||
|
value_type trans_far_plane = (-desired_zfar*projection(2,2)+projection(3,2))/(-desired_zfar*projection(2,3)+projection(3,3));
|
||||||
|
|
||||||
|
value_type ratio = fabs(2.0/(trans_near_plane-trans_far_plane));
|
||||||
|
value_type center = -(trans_near_plane+trans_far_plane)/2.0;
|
||||||
|
|
||||||
|
projection.postMult(osg::Matrix(1.0f,0.0f,0.0f,0.0f,
|
||||||
|
0.0f,1.0f,0.0f,0.0f,
|
||||||
|
0.0f,0.0f,ratio,0.0f,
|
||||||
|
0.0f,0.0f,center*ratio,1.0f));
|
||||||
|
|
||||||
|
// OSG_INFO << "Persepective matrix after clamping"<<projection<<std::endl;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// #define INLINE_DRAWABLE_DRAW
|
#define INLINE_DRAWABLE_DRAW
|
||||||
|
|
||||||
namespace osg {
|
namespace osg {
|
||||||
|
|
||||||
@@ -566,7 +566,7 @@ inline void Drawable::draw(RenderInfo& renderInfo) const
|
|||||||
|
|
||||||
State::SetCurrentVertexArrayStateProxy setVASProxy(state, vas);
|
State::SetCurrentVertexArrayStateProxy setVASProxy(state, vas);
|
||||||
|
|
||||||
vas->bindVertexArrayObject();
|
state.bindVertexArrayObject(vas);
|
||||||
|
|
||||||
drawInner(renderInfo);
|
drawInner(renderInfo);
|
||||||
|
|
||||||
@@ -576,7 +576,11 @@ inline void Drawable::draw(RenderInfo& renderInfo) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO, add check against whether VAO is active and supported
|
// TODO, add check against whether VAO is active and supported
|
||||||
if (state.getCurrentVertexArrayState()) state.getCurrentVertexArrayState()->bindVertexArrayObject();
|
if (state.getCurrentVertexArrayState())
|
||||||
|
{
|
||||||
|
//OSG_NOTICE<<"state.getCurrentVertexArrayState()->getVertexArrayObject()="<< state.getCurrentVertexArrayState()->getVertexArrayObject()<<std::endl;
|
||||||
|
state.bindVertexArrayObject(state.getCurrentVertexArrayState());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef OSG_GL_DISPLAYLISTS_AVAILABLE
|
#ifdef OSG_GL_DISPLAYLISTS_AVAILABLE
|
||||||
|
|||||||
@@ -56,6 +56,13 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// helper macro's for quieten unused variable warnings
|
||||||
|
#define OSG_UNUSED(VAR) (void)(VAR)
|
||||||
|
#define OSG_UNUSED2(VAR1, VAR2) (void)(VAR1); (void)(VAR2);
|
||||||
|
#define OSG_UNUSED3(VAR1, VAR2, VAR3) (void)(VAR1); (void)(VAR2); (void)(VAR2);
|
||||||
|
#define OSG_UNUSED4(VAR1, VAR2, VAR3, VAR4) (void)(VAR1); (void)(VAR2); (void)(VAR3); (void)(VAR4);
|
||||||
|
#define OSG_UNUSED5(VAR1, VAR2, VAR3, VAR4, VAR5) (void)(VAR1); (void)(VAR2); (void)(VAR3); (void)(VAR4); (void)(VAR5);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
||||||
\namespace osg
|
\namespace osg
|
||||||
|
|||||||
@@ -304,6 +304,9 @@ class OSG_EXPORT FrameBufferAttachment
|
|||||||
unsigned int getTexture3DZOffset() const;
|
unsigned int getTexture3DZOffset() const;
|
||||||
unsigned int getTextureArrayLayer() const;
|
unsigned int getTextureArrayLayer() const;
|
||||||
|
|
||||||
|
void resizeGLObjectBuffers(unsigned int maxSize);
|
||||||
|
void releaseGLObjects(osg::State* = 0) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// use the Pimpl idiom to avoid dependency from
|
// use the Pimpl idiom to avoid dependency from
|
||||||
// all Texture* headers
|
// all Texture* headers
|
||||||
|
|||||||
@@ -365,11 +365,21 @@ class OSG_EXPORT GLExtensions : public osg::Referenced
|
|||||||
void (GL_APIENTRY * glUniformMatrix4x3dv)( GLint location, GLsizei count, GLboolean transpose, const GLdouble* value );
|
void (GL_APIENTRY * glUniformMatrix4x3dv)( GLint location, GLsizei count, GLboolean transpose, const GLdouble* value );
|
||||||
void (GL_APIENTRY * glGetActiveAtomicCounterBufferiv)( GLuint program, GLuint bufferIndex, GLenum pname, GLint* params );
|
void (GL_APIENTRY * glGetActiveAtomicCounterBufferiv)( GLuint program, GLuint bufferIndex, GLenum pname, GLint* params );
|
||||||
void (GL_APIENTRY * glDispatchCompute)( GLuint numGroupsX, GLuint numGroupsY, GLuint numGroupsZ );
|
void (GL_APIENTRY * glDispatchCompute)( GLuint numGroupsX, GLuint numGroupsY, GLuint numGroupsZ );
|
||||||
GLuint64 (GL_APIENTRY* glGetTextureHandle)(GLint texture);
|
|
||||||
void (GL_APIENTRY* glMakeTextureHandleResident)(GLuint64 handle);
|
// ARB_bindless_texture
|
||||||
void (GL_APIENTRY* glMakeTextureHandleNonResident)(GLuint64 handle);
|
GLuint64 (GL_APIENTRY* glGetTextureHandle)(GLuint texture);
|
||||||
void (GL_APIENTRY* glUniformHandleui64)(GLint location, GLuint64 handle);
|
GLuint64 (GL_APIENTRY* glGetTextureSamplerHandle)(GLuint texture, GLuint sampler);
|
||||||
GLboolean (GL_APIENTRY* glIsTextureHandleResident)(GLuint64 handle);
|
void (GL_APIENTRY* glMakeTextureHandleResident)(GLuint64 handle);
|
||||||
|
void (GL_APIENTRY* glMakeTextureHandleNonResident)(GLuint64 handle);
|
||||||
|
GLboolean (GL_APIENTRY* glIsTextureHandleResident)(GLuint64 handle);
|
||||||
|
GLuint64 (GL_APIENTRY* glGetImageHandle)(GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format);
|
||||||
|
void (GL_APIENTRY* glMakeImageHandleResident)(GLuint64 handle);
|
||||||
|
void (GL_APIENTRY* glMakeImageHandleNonResident)(GLuint64 handle);
|
||||||
|
GLboolean (GL_APIENTRY* glIsImageHandleResident)(GLuint64 handle);
|
||||||
|
void (GL_APIENTRY* glUniformHandleui64)(GLint location, GLuint64 handle);
|
||||||
|
void (GL_APIENTRY* glUniformHandleuiv64)(GLint location, GLsizei count, GLuint64 *handles);
|
||||||
|
void (GL_APIENTRY* glProgramUniformHandleui64)(GLuint program, GLint location, GLuint64 handle);
|
||||||
|
void (GL_APIENTRY* glProgramUniformHandleuiv64)(GLuint program, GLint location, GLsizei count, GLuint64 *handles);
|
||||||
|
|
||||||
// Buffer Object extensions
|
// Buffer Object extensions
|
||||||
bool isBufferObjectSupported;
|
bool isBufferObjectSupported;
|
||||||
@@ -538,7 +548,17 @@ class OSG_EXPORT GLExtensions : public osg::Referenced
|
|||||||
isNonPowerOfTwoTextureMipMappedSupported;
|
isNonPowerOfTwoTextureMipMappedSupported;
|
||||||
}
|
}
|
||||||
|
|
||||||
void (GL_APIENTRY * glTexStorage2D) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
|
///immutable texture storage and texture view
|
||||||
|
void (GL_APIENTRY * glTexStorage1D) (GLenum target, GLsizei numMipmapLevels, GLenum internalformat, GLsizei width);
|
||||||
|
void (GL_APIENTRY * glTextureStorage1D) (GLuint texture, GLsizei numMipmapLevels, GLenum internalformat, GLsizei width);
|
||||||
|
void (GL_APIENTRY * glTexStorage2D) (GLenum target, GLsizei numMipmapLevels, GLenum internalformat, GLsizei width, GLsizei height);
|
||||||
|
void (GL_APIENTRY * glTextureStorage2D) (GLuint texture, GLsizei numMipmapLevels, GLenum internalformat, GLsizei width, GLsizei height);
|
||||||
|
void (GL_APIENTRY * glTexStorage3D) ( GLenum target, GLsizei numMipmapLevels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
|
||||||
|
void (GL_APIENTRY * glTextureStorage3D) ( GLuint texture, GLsizei numMipmapLevels,GLenum internalformat,GLsizei width,GLsizei height,GLsizei depth);
|
||||||
|
void (GL_APIENTRY * glTexStorage2DMultisample) ( GLenum target, GLsizei numSamples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
|
||||||
|
void (GL_APIENTRY * glTexStorage3DMultisample) ( GLenum target, GLsizei numSamples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
|
||||||
|
void (GL_APIENTRY * glTextureView) ( GLuint texture, GLenum target, GLuint orig, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers);
|
||||||
|
|
||||||
void (GL_APIENTRY * glCompressedTexImage2D) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
|
void (GL_APIENTRY * glCompressedTexImage2D) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||||
void (GL_APIENTRY * glCompressedTexSubImage2D) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
|
void (GL_APIENTRY * glCompressedTexSubImage2D) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||||
void (GL_APIENTRY * glGetCompressedTexImage) (GLenum target, GLint level, GLvoid *data);
|
void (GL_APIENTRY * glGetCompressedTexImage) (GLenum target, GLint level, GLvoid *data);
|
||||||
@@ -557,8 +577,6 @@ class OSG_EXPORT GLExtensions : public osg::Referenced
|
|||||||
|
|
||||||
void (GL_APIENTRY * glTexImage3D) ( GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
void (GL_APIENTRY * glTexImage3D) ( GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||||
void (GL_APIENTRY * glTexSubImage3D) ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
|
void (GL_APIENTRY * glTexSubImage3D) ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
|
||||||
void (GL_APIENTRY * glTexStorage3D) ( GLenum target, GLsizei numMipmapLevels,GLenum sizedInternalFormat,GLsizei width,GLsizei height,GLsizei depth);
|
|
||||||
void (GL_APIENTRY * glTextureStorage3D) ( GLuint texture, GLsizei numMipmapLevels,GLenum sizedInternalFormat,GLsizei width,GLsizei height,GLsizei depth);
|
|
||||||
|
|
||||||
void (GL_APIENTRY * glCopyTexSubImage3D) ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height );
|
void (GL_APIENTRY * glCopyTexSubImage3D) ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height );
|
||||||
void (GL_APIENTRY * glCompressedTexImage3D) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
|
void (GL_APIENTRY * glCompressedTexImage3D) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||||
@@ -627,6 +645,7 @@ class OSG_EXPORT GLExtensions : public osg::Referenced
|
|||||||
// Point
|
// Point
|
||||||
bool isPointParametersSupported;
|
bool isPointParametersSupported;
|
||||||
bool isPointSpriteSupported;
|
bool isPointSpriteSupported;
|
||||||
|
bool isPointSpriteModeSupported;
|
||||||
bool isPointSpriteCoordOriginSupported;
|
bool isPointSpriteCoordOriginSupported;
|
||||||
|
|
||||||
void (GL_APIENTRY * glPointParameteri) (GLenum pname, GLint param);
|
void (GL_APIENTRY * glPointParameteri) (GLenum pname, GLint param);
|
||||||
@@ -794,6 +813,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.*/
|
/** 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()); }
|
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();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,14 @@ struct OSG_EXPORT GraphicsOperation : public Operation
|
|||||||
virtual void operator () (Object* object);
|
virtual void operator () (Object* object);
|
||||||
|
|
||||||
virtual void operator () (GraphicsContext* context) = 0;
|
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 {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -433,7 +433,7 @@ class OSG_EXPORT Image : public BufferData
|
|||||||
|
|
||||||
/** Ensure image dimensions are a power of two.
|
/** Ensure image dimensions are a power of two.
|
||||||
* Mipmapped textures require the image dimensions to be
|
* Mipmapped textures require the image dimensions to be
|
||||||
* power of two and are within the maxiumum texture size for
|
* power of two and are within the maximum texture size for
|
||||||
* the host machine.
|
* the host machine.
|
||||||
*/
|
*/
|
||||||
void ensureValidSizeForTexturing(GLint maxTextureSize);
|
void ensureValidSizeForTexturing(GLint maxTextureSize);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user