Compare commits

...

30 Commits

Author SHA1 Message Date
Robert Osfield
e5fe55956e Release OpenSceneGraph-2.6.0 2008-08-05 21:36:16 +00:00
Robert Osfield
98ce387440 Merged addition osgWidget to doxygen doc build using:
svn merge -r 8746:8747 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk .
2008-08-05 20:07:20 +00:00
Robert Osfield
744c1cc464 From Eric Sokolowski, release notes for OSX. 2008-08-05 19:57:22 +00:00
Robert Osfield
2be018230d Merged improvements to namespace doxygen comments from svn/trunk. 2008-08-05 19:23:38 +00:00
Robert Osfield
e84e2b0025 Merged in from svn/trunk of Eric Sokolowski's disabling of 64bit build under OSX. Merge command:
svn merge -r 8741:8742 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk .
2008-08-05 16:10:49 +00:00
Robert Osfield
46afd39b51 merged changes in from svn/trunk using :
svn merge -r 8736:8738 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk .
2008-08-05 15:32:03 +00:00
Robert Osfield
822fec0302 Updated READE for 2.6.0 release 2008-08-05 15:31:17 +00:00
Robert Osfield
3ae660c8eb Updated NEWS for 2.6.0 release 2008-08-05 14:05:56 +00:00
Robert Osfield
0a82439a9c Updated ChangeLog, Authors file and tweak to osgversion to prevent inappropriate class names being added to authors file 2008-08-05 13:52:51 +00:00
Robert Osfield
b2db19e976 Updated wrappers 2008-08-05 10:31:05 +00:00
Robert Osfield
5d8ec3027e Updated SO version number to reflect typo fixes changing the API 2008-08-05 10:23:31 +00:00
Robert Osfield
24b608cacb Added support for both the old autoScaleTransistionWidthRatio (note typo) and newly fixed autoScaleTransitionWidthRatio in the .osg parsing 2008-08-05 10:20:20 +00:00
Paul MELIS
af9ccc5596 - Fixes for two spelling mistakes 2008-08-05 09:58:31 +00:00
Robert Osfield
cc3d0903db Added -losgWidget to lib list, change merged in from svn trunk, using : svn merge -r 8727:8728 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk . 2008-08-04 20:50:20 +00:00
Robert Osfield
faef4cea61 From Sherman Wilcox, "Minor change to bool setGLExtensionFuncPtr(T& t, const char* str1) and
setGLExtensionFuncPtr(T& t, const char* str1, const char* str2) -
functions returned false even on success."

Note, merged from svn/trunk using:

  svn merge -r 8725:8726 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk .
2008-08-04 17:10:20 +00:00
Robert Osfield
c3e42eda62 Updated ChangeLog for 2.6.0-rc2 2008-08-04 15:30:07 +00:00
Robert Osfield
62ed1a838b Updated NEWS and AUTHORS for 2.6.0-rc2 from osg trunk, using "svn merge -r 8719:8722 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk ." 2008-08-04 15:21:32 +00:00
Robert Osfield
a0e4779d76 merged Philip Pulman's Centos 5 compile fix from trunk using : svn merge -r 8717:8718 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk . 2008-08-04 14:04:14 +00:00
Robert Osfield
c3e394ba3e Merged multi-threaded crash fix to PrecipitationEffect, using "svn merge -r 8715:8716 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk ." 2008-08-04 12:48:31 +00:00
Robert Osfield
5c312685cd Merged from svn/trunk the removal of debugging info 2008-08-04 12:39:59 +00:00
Robert Osfield
d801620b6c Merged LineSegment and Quicktime fixes from svn/trunk, using : merge -r 8709:8712 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk . 2008-08-04 09:07:21 +00:00
Robert Osfield
22246158a5 Merged KdTree update from svn trunk using "svn merge -r 8706:8707 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk ." 2008-08-03 17:02:32 +00:00
Paul MARTZ
bbd40ca107 From Jean-Sebastien Guay. Fix for stuck keys problem when viewer loses focus. Equivalent to Melchior Franz's fix for the same issue in GraphicsWindowX11. When the application loses focus, all currently pressed keys are released. When it regains focus, keys are queried to see which are currently pressed and keydown messages are sent for those.
Also, from Daniel Olivier. Fix for windows based on GraphicsWindowWin32 not switching to the resize mouse cursors when the mouse goes close to window borders.
2008-07-31 17:47:09 +00:00
Paul MARTZ
2e11d93587 From Philip Lowman. #define WIN32_WINNT 0x400, consistent with other code in OpenThreads. Resolves a compile warning on mingw. 2008-07-31 14:43:16 +00:00
Paul MARTZ
48e70c0948 From Philip Lowman: The osgWidget/Window header file is missing a few export (declspec) declarations on some namespace functions. I noticed because MinGW is failing to link the osgwidgetbox example. 2008-07-30 15:45:28 +00:00
Paul MARTZ
38c14644d2 From Philip Lowman: Add #include <stdlib.h> for mingw build. 2008-07-30 15:37:50 +00:00
Paul MARTZ
1f7febfa92 From Glenn Waldron: Just downgrading a notify message in SpatializeGroupsVisitor ... one-line change. 2008-07-30 15:10:34 +00:00
Paul MARTZ
ed722b5fc7 From Glenn Waldron: The enum value for osgUtil::OptimizerOptions::FLATTEN_STATIC_TRANSFORMS_DUPLICATING_SHARED_SUBGRAPHS is set to 0x100, but it should probably be 0x10000. (From Paul Martz: changed enums to use "1 << n"-style values.) 2008-07-30 15:03:41 +00:00
Robert Osfield
f9fda5d081 Made 2.6 branch 2008-07-25 21:16:14 +00:00
Robert Osfield
97cb28ea8e Release OpenSceneGraph-2.6.0-rc1 2008-07-25 21:14:22 +00:00
43 changed files with 649 additions and 263 deletions

View File

@@ -1,6 +1,6 @@
OpenSceneGraph Library 2.6.0
323 Contributors:
324 Contributors:
Firstname Surname
-----------------
@@ -21,8 +21,8 @@ Ulrich Hertlein
Martin Lavery
David Callu
Tree
Luigi Calori
Jean-Sebastien Guay
Luigi Calori
Trajce Nikolov
Mike Wittman
Pavel Moloshtan
@@ -42,21 +42,21 @@ Olaf Flebbe
Gideon May
Don Tidrow
Romano Jos<6F> Magacho da Silva
Philip Lowman
Paul Melis
Michael Platings
Michael Gronager
Daniel Sj<53>lie
Chris Hanson
Adrian Egli
Sherman Wilcox
Per Fahlberg
J.P. Delport
David Spilling
Sherman Wilcox
Melchior Franz
Joran Jessurun
Joakim Simonsson
Jason Beverage
Philip Lowman
Jason Daly
Frederic Marmond
David Fries
@@ -69,6 +69,7 @@ Rune Schmidt Jensen
Rainer Oder
Mike Connell
Mathieu Marache
Glenn Waldron
Carlo Camporesi
Ben Discoe
Andreas Ekstrand
@@ -97,7 +98,6 @@ Mihai Radu
Michael Hartman
Luc Frauciel
Laurens Voerman
Glenn Waldron
David Guthrie
Corbin Holtz
Cedric Pinson
@@ -298,6 +298,7 @@ Dean Iverson
David Jung
David Gurhrie
Daniel Stien
Daniel Olivier
Dan Minor
Cyril Brulebois
Clay Fowler

View File

@@ -26,7 +26,7 @@ PROJECT(OpenSceneGraph)
SET(OPENSCENEGRAPH_MAJOR_VERSION 2)
SET(OPENSCENEGRAPH_MINOR_VERSION 6)
SET(OPENSCENEGRAPH_PATCH_VERSION 0)
SET(OPENSCENEGRAPH_SOVERSION 43)
SET(OPENSCENEGRAPH_SOVERSION 44)
SET(OPENSCENEGRAPH_VERSION ${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION})
@@ -529,7 +529,11 @@ IF(APPLE)
# independently of OS X versions.)
# It does look like CMake handles the CMAKE_OSX_SYSROOT automatically.
IF(EXISTS /Developer/SDKs/MacOSX10.5.sdk)
SET(CMAKE_OSX_ARCHITECTURES "ppc;i386;ppc64;x86_64" CACHE STRING "Build architectures for OSX" FORCE)
# 64-bit compiles are not supported with Carbon. We should enable
# 64-bit compilation by default once osgviewer has been
# rewritten with Cocoa.
#SET(CMAKE_OSX_ARCHITECTURES "ppc;i386;ppc64;x86_64" CACHE STRING "Build architectures for OSX" FORCE)
SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX" FORCE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.5 -ftree-vectorize -fvisibility-inlines-hidden" CACHE STRING "Flags used by the compiler during all build types." FORCE)
ELSE(EXISTS /Developer/SDKs/MacOSX10.5.sdk)
IF(EXISTS /Developer/SDKs/MacOSX10.4u.sdk)

125
ChangeLog
View File

@@ -1,3 +1,128 @@
2008-08-05 10:31 +0000 [r8733] robert:
* Updated wrappers
2008-08-05 10:23 +0000 [r8732] robert:
* Updated SO version number to reflect typo fixes changing the API
2008-08-05 10:20 +0000 [r8731] robert:
* Added support for both the old autoScaleTransistionWidthRatio
(note typo) and newly fixed autoScaleTransitionWidthRatio in the
.osg parsing
2008-08-05 09:58 +0000 [r8730] paulmelis:
* - Fixes for two spelling mistakes
2008-08-04 20:50 +0000 [r8729] robert:
* Added -losgWidget to lib list, change merged in from svn trunk,
using : svn merge -r 8727:8728
http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk .
2008-08-04 17:10 +0000 [r8727] robert:
* From Sherman Wilcox, "Minor change to bool
setGLExtensionFuncPtr(T& t, const char* str1) and
setGLExtensionFuncPtr(T& t, const char* str1, const char* str2) -
functions returned false even on success." Note, merged from
svn/trunk using: svn merge -r 8725:8726
http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk .
2008-08-04 15:30 +0000 [r8724] robert:
* Updated ChangeLog for 2.6.0-rc2
2008-08-04 15:21 +0000 [r8723] robert:
* Updated NEWS and AUTHORS for 2.6.0-rc2 from osg trunk, using "svn
merge -r 8719:8722
http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk ."
2008-08-04 14:04 +0000 [r8719] robert:
* merged Philip Pulman's Centos 5 compile fix from trunk using :
svn merge -r 8717:8718
http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk .
2008-08-04 12:48 +0000 [r8717] robert:
* Merged multi-threaded crash fix to PrecipitationEffect, using
"svn merge -r 8715:8716
http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk ."
2008-08-04 12:39 +0000 [r8715] robert:
* Merged from svn/trunk the removal of debugging info
2008-08-04 09:07 +0000 [r8713] robert:
* Merged LineSegment and Quicktime fixes from svn/trunk, using :
merge -r 8709:8712
http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk .
2008-08-03 17:02 +0000 [r8709] robert:
* Merged KdTree update from svn trunk using "svn merge -r 8706:8707
http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk ."
2008-07-31 17:47 +0000 [r8706] paulmartz:
* From Jean-Sebastien Guay. Fix for stuck keys problem when viewer
loses focus. Equivalent to Melchior Franz's fix for the same
issue in GraphicsWindowX11. When the application loses focus, all
currently pressed keys are released. When it regains focus, keys
are queried to see which are currently pressed and keydown
messages are sent for those. Also, from Daniel Olivier. Fix for
windows based on GraphicsWindowWin32 not switching to the resize
mouse cursors when the mouse goes close to window borders.
2008-07-31 14:43 +0000 [r8705] paulmartz:
* From Philip Lowman. #define WIN32_WINNT 0x400, consistent with
other code in OpenThreads. Resolves a compile warning on mingw.
2008-07-30 15:45 +0000 [r8704] paulmartz:
* From Philip Lowman: The osgWidget/Window header file is missing a
few export (declspec) declarations on some namespace functions. I
noticed because MinGW is failing to link the osgwidgetbox
example.
2008-07-30 15:37 +0000 [r8703] paulmartz:
* From Philip Lowman: Add #include <stdlib.h> for mingw build.
2008-07-30 15:10 +0000 [r8702] paulmartz:
* From Glenn Waldron: Just downgrading a notify message in
SpatializeGroupsVisitor ... one-line change.
2008-07-30 15:03 +0000 [r8701] paulmartz:
* From Glenn Waldron: The enum value for
osgUtil::OptimizerOptions::FLATTEN_STATIC_TRANSFORMS_DUPLICATING_SHARED_SUBGRAPHS
is set to 0x100, but it should probably be 0x10000. (From Paul
Martz: changed enums to use "1 << n"-style values.)
2008-07-25 21:16 +0000 [r8698-8699] robert:
* Made 2.6 branch
* Release OpenSceneGraph-2.6.0-rc1
2008-07-25 21:09 +0000 [r8697] robert:
* Updated ChangeLog and AUTHORS.txt file for relese candidate
2008-07-25 21:01 +0000 [r8695-8696] robert:
* Updated version numbers to 2.6.0
* Updated REAME and NEWS for 2.6 branch
2008-07-25 20:50 +0000 [r8692-8694] robert:
* Updated wrappers

View File

@@ -3,20 +3,39 @@ OSG News
= !OpenSceneGraph 2.6 release adds osgWidget library, KdTree intersections, Anti-aliased FBOsand much more. =
PERTHSHIRE, Scotland - 25th July 2008 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.6, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 2.6 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 2.6 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems.
PERTHSHIRE, Scotland - 5th August 2008 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.6, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 2.6 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 2.6 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems.
=== Open-source development delivers industry-leading features and performance ===
The !OpenSceneGraph 2.6 release is the culmination of 9 years of work by the lead developers and the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs.
=== Updates include: ===
* New osgWidget library (still in beta status)
* New KdTree support, with automatic building of KdTrees and intersections with them for high performance intersection testing
* New Anti-aliased FrameBufferObject support
* Improved precision of intersections and camera manipulation
* Improved Alias Wavefront .obj support
* A wide range of build and bug fixes
* New osgWidget library for scene graph based graphics user interface elements (beta release).
* KdTree support, with automatic KdTree generation on load and use of KdTree during line intersections which massively improves intersection speeds.
* Precision improvements to line intersections, provide accurate whole earth intersection.
* OpenGL Multi-sample FrameBufferObject support.
* New osg::ImageSequence class for doing texture animation of a series of image files.
* New database optimizer that is able to remove static transforms by duplicating shared geometries.
* Use glGenerateMipmap to speed up mipmap generation in non power-of-two textures.
* New osgViewer::ScreenCaptureHandler for adding screen shot support to osgViewer applications.
* New osgscreencapture example that demonstrates use of double buffer PixelBufferObject's for streaming of imagery from the screen.
* New utility application osgfilecache which can be used to populate the local cache for given lat/lon ranges and levels.
* Rewritten DatabasePager that now supports multiple database reading threads. This includes handling of HTTP requests via a separate reading thread, vastly improving the speed of updates when handling HTTP hosted databases that have already partially been downloaded to local file cache.
* Support for a file cache for locally caching paged databases hosted over HTTP.
* Support for http authentication in osgDB and the libcurl plugin
* New osgconv --format <fmt>, --formats and --plugins command line options for listing available plugins and the file formats/options they support.
* Performance improvements in handling TerraPage.
* Animated GIF support.
* New SVG image loader.
* Improvements to the .obj loader to support a wider range of .obj files and material properties.
* Support for thread safe Atomic reference counting.
* Support for COLLADA DOM 2.x
* Support for Philips WOWvx 3D auto-stereoscopic displays
* New include/osg/Config and include/OpenThreads/Config configuration files, that are automatically generated by CMake, which make more straight forward to build end users applications against OpenSceneGraph versions built with non default build options.
* Support for CMake 2.6
* A wide range of build and bug fixes
=== Downloads and Licensing ===
!OpenSceneGraph is open-source so full source code is provided, and can be copied, modified and used free of charge for commercial and non-commercial use. Access to the source allows end users greater flexibility in how they develop, debug and deploy their applications. They gain productivity and freedom by being able to leverage the tool chain in accordance with their own release cycles. Downloads of binaries and source can be found in the [http://www.openscenegraph.org/projects/osg/wiki/Downloads Downloads] section of the openscenegraph.org website.
@@ -37,7 +56,7 @@ The !OpenSceneGraph Quick Start Guide is now available in Chinese as well as Eng
=== Community support and contributions ===
The diverse and growing community of over 1900 developers is centred around the public osg-users mailing list, where members discuss how best to use !OpenSceneGraph, provide mutual support, and coordinate development of new features and bug fixes. Members of this community come from many different countries with backgrounds ranging from some of the world's largest aerospace companies, game companies, and visual simulation specialists to university researchers, students and hobbyists.
The !OpenSceneGraph project owes a great deal to the community for its development and support, in particular we wish to thank the [http://www.openscenegraph.org/projects/osg/wiki/Support/Contributors/TwoPointFour 306 individuals] from around the world that have directly contributed to the development and refinement of the !OpenSceneGraph code base.
The !OpenSceneGraph project owes a great deal to the community for its development and support, in particular we wish to thank the [http://www.openscenegraph.org/projects/osg/wiki/Support/Contributors/TwoPointSix 324 individuals] from around the world that have directly contributed to the development and refinement of the !OpenSceneGraph code base.
----

View File

@@ -15,7 +15,7 @@ subscribe to our public mailing list:
Robert Osfield.
Project Lead.
25th July 2008.
5th August 2008.
--
@@ -66,9 +66,82 @@ system should help guide you through the process:
Under OSX you can either use the CMake build system above, or use the
Xcode projects that you will find in the OpenSceneGraph/Xcode
directory.
directory. See release notes on OSX CMake build below.
For further details on compilation, installation and platform-specific
information read "Getting Started" guide:
http://www.openscenegraph.org/projects/osg/wiki/Support/GettingStarted
-- Release notes on OSX build, by Eric Sokolowsky, August 5, 2008
There are several ways to compile OpenSceneGraph under OSX. The
recommended way is to use CMake 2.6 to generate Xcode projects, then use
Xcode to build the library. The default project will be able to build
Debug or Release libraries, examples, and sample applications. Here are
some key settings to consider when using CMake:
BUILD_OSG_EXAMPLES - By default this is turned off. Turn this setting on
to compile many great example programs.
CMAKE_OSX_ARCHITECTURES - Xcode can create applications, executables,
libraries, and frameworks that can be run on more than one architecture.
Use this setting to indicate the architectures on which to build OSG.
Possibilities include ppc, ppc64, i386, and x86_64. Building OSG using
either of the 64-bit options (ppc64 and x86_64) has its own caveats
below.
OSG_BUILD_APPLICATION_BUNDLES - Normally only executable binaries are
created for the examples and sample applications. Turn this option on if
you want to create real OSX .app bundles. There are caveats to creating
.app bundles, see below.
OSG_WINDOWING_SYSTEM - You have the choice to use Carbon or X11 when
building applications on OSX. Under Leopard and later, X11 applications,
when started, will automatically launch X11 when needed. However,
full-screen X11 applications will still show the menu bar at the top of
the screen. Since many parts of the Carbon user interface are not
64-bit, X11 is the only supported option for OSX applications compiled
for ppc64 or x86_64.
There is an Xcode directory in the base of the OSG software
distribution, but its future is limited, and will be discontinued once
the CMake project generator completely implements its functionality.
APPLICATION BUNDLES (.app bundles)
The example programs when built as application bundles only contain the
executable file. They do not contain the dependent libraries as would a
normal bundle, so they are not generally portable to other machines.
They also do not know where to find plugins. An environmental variable
OSG_LIBRARY_PATH may be set to point to the location where the plugin
.so files are located. OSG_FILE_PATH may be set to point to the location
where data files are located. Setting OSG_FILE_PATH to the
OpenSceneGraph-Data directory is very useful when testing OSG by running
the example programs.
Many of the example programs use command-line arguments. When
double-clicking on an application (or using the equivalent "open"
command on the command line) only those examples and applications that
do not require command-line arguments will successfully run. The
executable file within the .app bundle can be run from the command-line
if command-line arguments are needed.
64-BIT APPLICATION SUPPORT
OpenSceneGraph will not compile successfully when OSG_WINDOWING_SYSTEM is
Carbon and either x86_64 or ppc64 is selected under CMAKE_OSX_ARCHITECTURES,
as Carbon is a 32bit only API. A version of the osgviewer library written in
Cocoa is needed. However, OSG may be compiled under 64-bits if the X11
windowing system is selected. However, Two parts of the OSG default
distribution will not work with 64-bit X11: the osgviewerWX example
program and the osgdb_qt (Quicktime) plugin. These must be removed from
the Xcode project after Cmake generates it in order to compile with
64-bit architectures. The lack of the latter means that images such as
jpeg, tiff, png, and gif will not work, nor will animations dependent on
Quicktime. A new ImageIO-based plugin is being developed to handle the
still images, and a QTKit plugin will need to be developed to handle
animations.

View File

@@ -219,6 +219,8 @@ bool validName(const std::string& first)
if (first=="LightPointNode") return false;
if (first=="GeometryTechnique") return false;
if (first=="GeoemtryTechnique") return false;
if (first=="KdTree") return false;
if (first=="LineSegment") return false;
return true;
}

View File

@@ -323,6 +323,7 @@ INPUT = $(OSGHOME)/include/osg \
$(OSGHOME)/include/osgIntrospection \
$(OSGHOME)/include/osgParticle \
$(OSGHOME)/include/osgViewer \
$(OSGHOME)/include/osgWidget \
$(OSGHOME)/include/osgShadow \
$(OSGHOME)/include/osgManipulator \
$(OSGHOME)/include/osgSim \

View File

@@ -398,6 +398,7 @@ INPUT = $(OSGHOME)/include/osg \
$(OSGHOME)/include/osgIntrospection \
$(OSGHOME)/include/osgParticle \
$(OSGHOME)/include/osgViewer \
$(OSGHOME)/include/osgWidget \
$(OSGHOME)/include/osgManipulator \
$(OSGHOME)/include/osgShadow \
$(OSGHOME)/include/osgSim \

View File

@@ -398,6 +398,7 @@ INPUT = ${OpenSceneGraph_SOURCE_DIR}/include/osg \
${OpenSceneGraph_SOURCE_DIR}/include/osgIntrospection \
${OpenSceneGraph_SOURCE_DIR}/include/osgParticle \
${OpenSceneGraph_SOURCE_DIR}/include/osgViewer \
${OpenSceneGraph_SOURCE_DIR}/include/osgWidget \
${OpenSceneGraph_SOURCE_DIR}/include/osgManipulator \
${OpenSceneGraph_SOURCE_DIR}/include/osgShadow \
${OpenSceneGraph_SOURCE_DIR}/include/osgSim \

View File

@@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@@ -29,7 +29,7 @@ class OSG_EXPORT AutoTransform : public Transform
public :
AutoTransform();
AutoTransform(const AutoTransform& pat,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
AutoTransform(const AutoTransform& pat,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
virtual osg::Object* cloneType() const { return new AutoTransform (); }
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new AutoTransform (*this,copyop); }
@@ -48,12 +48,12 @@ class OSG_EXPORT AutoTransform : public Transform
inline void setRotation(const Quat& quat) { _rotation = quat; _matrixDirty=true; dirtyBound(); }
inline const Quat& getRotation() const { return _rotation; }
inline void setScale(float scale) { setScale(osg::Vec3(scale,scale,scale)); }
void setScale(const Vec3& scale);
inline const Vec3& getScale() const { return _scale; }
void setMinimumScale(float minimumScale) { _minimumScale = minimumScale; }
float getMinimumScale() const { return _minimumScale; }
@@ -62,7 +62,7 @@ class OSG_EXPORT AutoTransform : public Transform
inline void setPivotPoint(const Vec3& pivot) { _pivotPoint = pivot; _matrixDirty=true; dirtyBound(); }
inline const Vec3& getPivotPoint() const { return _pivotPoint; }
void setAutoUpdateEyeMovementTolerance(float tolerance) { _autoUpdateEyeMovementTolerance = tolerance; }
float getAutoUpdateEyeMovementTolerance() const { return _autoUpdateEyeMovementTolerance; }
@@ -74,7 +74,7 @@ class OSG_EXPORT AutoTransform : public Transform
ROTATE_TO_SCREEN,
ROTATE_TO_CAMERA
};
void setAutoRotateMode(AutoRotateMode mode) { _autoRotateMode = mode; _firstTimeToInitEyePoint = true; }
AutoRotateMode getAutoRotateMode() const { return _autoRotateMode; }
@@ -83,8 +83,8 @@ class OSG_EXPORT AutoTransform : public Transform
bool getAutoScaleToScreen() const { return _autoScaleToScreen; }
void setAutoScaleTransistionWidthRatio(float ratio) { _autoScaleTransitionWidthRatio = ratio; }
float getAutoScaleTransistionWidthRatio() const { return _autoScaleTransitionWidthRatio; }
void setAutoScaleTransitionWidthRatio(float ratio) { _autoScaleTransitionWidthRatio = ratio; }
float getAutoScaleTransitionWidthRatio() const { return _autoScaleTransitionWidthRatio; }
virtual bool computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor* nv) const;
@@ -95,7 +95,7 @@ class OSG_EXPORT AutoTransform : public Transform
protected :
virtual ~AutoTransform() {}
Vec3 _position;
@@ -105,17 +105,17 @@ class OSG_EXPORT AutoTransform : public Transform
AutoRotateMode _autoRotateMode;
bool _autoScaleToScreen;
mutable Quat _rotation;
mutable Vec3 _scale;
mutable bool _firstTimeToInitEyePoint;
mutable osg::Vec3 _previousEyePoint;
mutable osg::Vec3 _previousLocalUp;
mutable Viewport::value_type _previousWidth;
mutable Viewport::value_type _previousHeight;
mutable Viewport::value_type _previousHeight;
mutable osg::Matrix _previousProjection;
mutable osg::Vec3 _previousPosition;
float _minimumScale;
float _maximumScale;
float _autoScaleTransitionWidthRatio;

View File

@@ -94,6 +94,12 @@
#define GL_MAX_SAMPLES_EXT 0x8D57
#endif
#ifndef GL_MAX_SAMPLES_EXT
// Workaround for Centos 5 and other distros that define
// GL_EXT_framebuffer_multisample but not GL_MAX_SAMPLES_EXT
#define GL_MAX_SAMPLES_EXT 0x8D57
#endif
#ifndef GL_NV_framebuffer_multisample_coverage
#define GL_NV_framebuffer_multisample_coverage 1
#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB

View File

@@ -80,7 +80,7 @@ bool setGLExtensionFuncPtr(T& t, const char* str1)
if (data)
{
memcpy(&t, &data, sizeof(T));
return false;
return true;
}
else
{
@@ -96,7 +96,7 @@ bool setGLExtensionFuncPtr(T& t, const char* str1, const char* str2)
if (data)
{
memcpy(&t, &data, sizeof(T));
return false;
return true;
}
else
{

View File

@@ -22,7 +22,7 @@ extern "C" {
#define OPENSCENEGRAPH_MAJOR_VERSION 2
#define OPENSCENEGRAPH_MINOR_VERSION 6
#define OPENSCENEGRAPH_PATCH_VERSION 0
#define OPENSCENEGRAPH_SOVERSION 43
#define OPENSCENEGRAPH_SOVERSION 44
/**
* osgGetVersion() returns the library version number.

View File

@@ -31,7 +31,7 @@
\namespace osgFX
The osgFX is a NodeKit library that extends the core scene graph to provide a special effects framework.
The osgFX library is a NodeKit that extends the core scene graph to provide a special effects framework.
osgFX's framework allows multiple rendering techniques to be provide for each effect, thereby provide the use
appropriate rendering techniques for each different class of graphics hardware, i.e. support for both modern
programmable graphics hardware and still have standard OpenGL 1.1 support as a fallback.

View File

@@ -60,4 +60,12 @@ automatically generated by parsing header files via gen_wrapper utility. All th
core OpenSceneGraph libraries have pre built wrappers available for you use.
*/
/**
\namespace Properties
Properties is a set of helper definations used by the osgIntrospectoin wrappers.
*/
#endif

View File

@@ -27,4 +27,11 @@
# define OSGMANIPULATOR_EXPORT
#endif
/**
\namespace osgManipulator
The osgManipulator library is a NodeKit that extends the core scene graph to support 3D interactive manipulators.
*/
#endif

View File

@@ -42,7 +42,7 @@
\namespace osgParticle
The osgParticle is a NodeKit library that extends the core scene graph to support particle effects.
The osgParticle library is a NodeKit that extends the core scene graph to support particle effects.
*/

View File

@@ -41,7 +41,7 @@
\namespace osgShadow
The osgShadow is a NodeKit library that extends the core scene graph to add support for a range of shadow techniques.
The osgShadow library is a NodeKit that extends the core scene graph to add support for a range of shadow techniques.
*/
#endif

View File

@@ -1,29 +1,29 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
/* ParallelSplitShadowMap written by Adrian Egli
/* ParallelSplitShadowMap written by Adrian Egli
*
* this version has still a bug in mutli-thread application (flickering problem)
* to avoid the flickering problem try osgShadow --pssm --SingleThreaded your_scene.ive
*
* The Parallel Split Shadow Map only supports directional light for simulating the shadow.
* It's one of the most robust algorithm for huge terrain sun light's shadow simulation, if
* you need to shadow a terrain, or another huge scene, you should use Parallel Split Shadow Map
* or at least test it against your scene. Have fun.
* The Parallel Split Shadow Map only supports directional light for simulating the shadow.
* It's one of the most robust algorithm for huge terrain sun light's shadow simulation, if
* you need to shadow a terrain, or another huge scene, you should use Parallel Split Shadow Map
* or at least test it against your scene. Have fun.
*
*/
#ifndef OSGSHADOW_ParallelSplitShadowMap
#ifndef OSGSHADOW_ParallelSplitShadowMap
#define OSGSHADOW_ParallelSplitShadowMap 1
#include <osg/Camera>
@@ -35,16 +35,16 @@
namespace osgShadow {
class OSGSHADOW_EXPORT ParallelSplitShadowMap : public ShadowTechnique
class OSGSHADOW_EXPORT ParallelSplitShadowMap : public ShadowTechnique
{
public:
ParallelSplitShadowMap(osg::Geode** debugGroup=NULL, int icountplanes=3);
ParallelSplitShadowMap(const ParallelSplitShadowMap& es, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
META_Object(osgShadow, ParallelSplitShadowMap);
/** Initialize the ShadowedScene and local cached data structures.*/
virtual void init();
@@ -69,21 +69,21 @@ class OSGSHADOW_EXPORT ParallelSplitShadowMap : public ShadowTechnique
/** Set the texture resolution */
inline void setTextureResolution(unsigned int resolution) { _resolution = resolution; }
/** Set the max far distance */
/** Set the max far distance */
inline void setMaxFarDistance(double farDist) { _setMaxFarDistance = farDist; _isSetMaxFarDistance = true; }
/** Set the factor for moving the virtual camera behind the real camera*/
inline void setMoveVCamBehindRCamFactor(double distFactor ) { _move_vcam_behind_rcam_factor = distFactor; }
/** Set min near distance for splits */
/** Set min near distance for splits */
inline void setMinNearDistanceForSplits(double nd){ _split_min_near_dist=nd; }
/** set a user defined light for shadow simulation (sun light, ... )
* when this light get passed to pssm, the scene's light are no longer collected
* and simulated. just this user passed light, it needs to be a directional light.
/** set a user defined light for shadow simulation (sun light, ... )
* when this light get passed to pssm, the scene's light are no longer collected
* and simulated. just this user passed light, it needs to be a directional light.
*/
inline void setUserLight(osg::Light* light) { _userLight = light; }
/** Set the values for the ambient bias the shader will use.*/
void setAmbientBias(const osg::Vec2& ambientBias );
@@ -92,32 +92,32 @@ class OSGSHADOW_EXPORT ParallelSplitShadowMap : public ShadowTechnique
*/
class OSGSHADOW_EXPORT FragmentShaderGenerator : public osg::Referenced {
public:
/**
* generate the GLSL fragement shader
/**
* generate the GLSL fragement shader
*/
virtual std::string generateGLSL_FragmentShader_BaseTex(bool debug, unsigned int splitCount,double textureRes, bool filtered, unsigned int nbrSplits,unsigned int textureOffset);
};
/** set fragment shader generator */
inline void setFragmentShaderGenerator(FragmentShaderGenerator* fsw) { _FragmentShaderGenerator = fsw;}
/** enable / disable shadow filtering */
inline void enableShadowGLSLFiltering(bool filtering = true) { _GLSL_shadow_filtered = filtering; }
enum SplitCalcMode {
SPLIT_LINEAR,
SPLIT_EXP
};
/** set split calculation mode */
inline void setSplitCalculationMode(SplitCalcMode scm=SPLIT_EXP) { _SplitCalcMode = scm; }
protected :
virtual ~ParallelSplitShadowMap() {}
struct PSSMShadowSplitTexture {
// RTT
osg::ref_ptr<osg::Camera> _camera;
@@ -157,7 +157,7 @@ class OSGSHADOW_EXPORT ParallelSplitShadowMap : public ShadowTechnique
private:
void calculateFrustumCorners(PSSMShadowSplitTexture &pssmShadowSplitTexture,osg::Vec3d *frustumCorners);
void calculateLightInitalPosition(PSSMShadowSplitTexture &pssmShadowSplitTexture,osg::Vec3d *frustumCorners);
void calculateLightInitialPosition(PSSMShadowSplitTexture &pssmShadowSplitTexture,osg::Vec3d *frustumCorners);
void calculateLightNearFarFormFrustum(PSSMShadowSplitTexture &pssmShadowSplitTexture,osg::Vec3d *frustumCorners);
void calculateLightViewProjectionFormFrustum(PSSMShadowSplitTexture &pssmShadowSplitTexture,osg::Vec3d *frustumCorners);
@@ -180,13 +180,13 @@ class OSGSHADOW_EXPORT ParallelSplitShadowMap : public ShadowTechnique
double _split_min_near_dist;
double _move_vcam_behind_rcam_factor;
osg::ref_ptr<osg::Light> _userLight;
osg::ref_ptr<FragmentShaderGenerator> _FragmentShaderGenerator;
bool _GLSL_shadow_filtered;
SplitCalcMode _SplitCalcMode;
osg::Uniform* _ambientBiasUniform;
osg::Vec2d _ambientBias;

View File

@@ -50,7 +50,7 @@
\namespace osgSim
The osgSim is a NodeKit library that extends the core scene graph to support nodes and drawables that specific to the visual simulation, such
The osgSim library is a NodeKit that extends the core scene graph to support nodes and drawables that specific to the visual simulation, such
a navigational light point support and OpenFlight style degrees of freedom transform.
*/

View File

@@ -41,11 +41,7 @@
\namespace osgTerrain
The osgTerrain is a utility library that provides geospecifc terrain database generation support.
The osgTerrain library is typically invoked by the osgdem utlitly application that users can use to build paged terrain databases
from geospecific imagery and digial elevation maps (DEM's). osgTerrain may also be used directly in your own applications to generate
databases. Note, osgTerrain is not presently written for run-time rendering of terrain, and is just focused on database
generation, these generated databases then can used used in standard OpenSceneGraph application which do not need to link osgTerrain..
The osgTerrain library is a NodeKit that provides geospecifc terrain rendering support.
*/
#endif

View File

@@ -41,7 +41,7 @@
\namespace osgText
The osgText is a NodeKit library that extends the core scene graph to support high quality text.
The osgText library is a NodeKit that extends the core scene graph to support high quality text.
*/
#endif

View File

@@ -67,23 +67,23 @@ class OSGUTIL_EXPORT Optimizer
enum OptimizationOptions
{
FLATTEN_STATIC_TRANSFORMS = 0x001,
REMOVE_REDUNDANT_NODES = 0x002,
REMOVE_LOADED_PROXY_NODES = 0x004,
COMBINE_ADJACENT_LODS = 0x008,
SHARE_DUPLICATE_STATE = 0x010,
MERGE_GEOMETRY = 0x020,
CHECK_GEOMETRY = 0x040,
SPATIALIZE_GROUPS = 0x080,
COPY_SHARED_NODES = 0x100,
TRISTRIP_GEOMETRY = 0x200,
TESSELLATE_GEOMETRY = 0x400,
OPTIMIZE_TEXTURE_SETTINGS = 0x800,
MERGE_GEODES = 0x1000,
FLATTEN_BILLBOARDS = 0x2000,
TEXTURE_ATLAS_BUILDER = 0x4000,
STATIC_OBJECT_DETECTION = 0x8000,
FLATTEN_STATIC_TRANSFORMS_DUPLICATING_SHARED_SUBGRAPHS = 0x100,
FLATTEN_STATIC_TRANSFORMS = (1 << 0),
REMOVE_REDUNDANT_NODES = (1 << 1),
REMOVE_LOADED_PROXY_NODES = (1 << 2),
COMBINE_ADJACENT_LODS = (1 << 3),
SHARE_DUPLICATE_STATE = (1 << 4),
MERGE_GEOMETRY = (1 << 5),
CHECK_GEOMETRY = (1 << 6),
SPATIALIZE_GROUPS = (1 << 7),
COPY_SHARED_NODES = (1 << 8),
TRISTRIP_GEOMETRY = (1 << 9),
TESSELLATE_GEOMETRY = (1 << 10),
OPTIMIZE_TEXTURE_SETTINGS = (1 << 11),
MERGE_GEODES = (1 << 12),
FLATTEN_BILLBOARDS = (1 << 13),
TEXTURE_ATLAS_BUILDER = (1 << 14),
STATIC_OBJECT_DETECTION = (1 << 15),
FLATTEN_STATIC_TRANSFORMS_DUPLICATING_SHARED_SUBGRAPHS = (1 << 16),
DEFAULT_OPTIMIZATIONS = FLATTEN_STATIC_TRANSFORMS |
REMOVE_REDUNDANT_NODES |
REMOVE_LOADED_PROXY_NODES |

View File

@@ -174,8 +174,14 @@ class OSGVIEWER_EXPORT GraphicsWindowWin32 : public osgViewer::GraphicsWindow
bool _destroying;
MouseCursor _mouseCursor;
/// Persist which mouse cursor was used before switching to the resize cursors.
MouseCursor _appMouseCursor;
std::map<MouseCursor,HCURSOR> _mouseCursorMap;
std::map<int, bool> _keyMap;
};
}

View File

@@ -39,9 +39,9 @@
/**
\namespace osgWidet
\namespace osgWidget
The osgWidget is a NodeKit library that extends the core scene graph to support 3D widget set.
The osgWidget library is a NodeKit that extends the core scene graph to support 3D GUI widget set.
*/
#endif

View File

@@ -29,13 +29,13 @@ namespace osgWidget {
// These are helper callbacks you can attach to Windows that will make them moveable,
// rotatable, and scalable respectively.
bool callbackWindowMove (Event&);
bool callbackWindowRotate (Event&);
bool callbackWindowScale (Event&);
bool OSGWIDGET_EXPORT callbackWindowMove (Event&);
bool OSGWIDGET_EXPORT callbackWindowRotate (Event&);
bool OSGWIDGET_EXPORT callbackWindowScale (Event&);
// These are helper callbacks you can attach to Windows to that will make various
// keyboard events behave as you might imagine.
bool callbackWindowTabFocus(Event&);
bool OSGWIDGET_EXPORT callbackWindowTabFocus(Event&);
class OSGWIDGET_EXPORT Window:
public osg::MatrixTransform,

View File

@@ -10,5 +10,5 @@ Description: 3D scenegraph
Version: 2.6.0
Requires: openthreads
Conflicts:
Libs: -L${libdir} -losg -losgDB -losgFX -losgGA -losgParticle -losgSim -losgText -losgUtil -losgTerrain -losgManipulator -losgViewer
Libs: -L${libdir} -losg -losgDB -losgFX -losgGA -losgParticle -losgSim -losgText -losgUtil -losgTerrain -losgManipulator -losgViewer -losgWidget
Cflags: -I${includedir}

View File

@@ -21,6 +21,7 @@
#ifndef _WINDOWS_
#define WIN32_LEAN_AND_MEAN
#define _WIN32_WINNT 0x0400
#include <windows.h>
#endif

View File

@@ -19,6 +19,7 @@
#include <string>
#include <iostream>
#include <process.h>
#include <stdlib.h>
#if defined(_MSC_VER) && (_MSC_VER < 1300)
#ifdef __SGI_STL

View File

@@ -226,6 +226,10 @@ int BuildKdTree::divide(KdTree::BuildOptions& options, osg::BoundingBox& bb, int
node.bb.expandBy(v1);
node.bb.expandBy(v2);
}
if (node.bb.valid())
{
float epsilon = 1e-6;
node.bb._min.x() -= epsilon;
node.bb._min.y() -= epsilon;
@@ -234,7 +238,7 @@ int BuildKdTree::divide(KdTree::BuildOptions& options, osg::BoundingBox& bb, int
node.bb._max.y() += epsilon;
node.bb._max.z() += epsilon;
}
#ifdef VERBOSE_OUTPUT
if (!node.bb.valid())
{

View File

@@ -93,10 +93,22 @@ class NullStreamBuffer : public std::streambuf
}
};
struct NullStream : public std::ostream
{
NullStream():
std::ostream(new NullStreamBuffer) {}
virtual ~NullStream()
{
delete rdbuf();
rdbuf(0);
}
};
std::ostream& osg::notify(const osg::NotifySeverity severity)
{
// set up global notify null stream for inline notify
static std::ostream s_NotifyNulStream(new NullStreamBuffer());
static NullStream s_NotifyNulStream;
static bool initialized = false;
if (!initialized)

View File

@@ -361,14 +361,12 @@ void Texture3D::applyTexImage3D(GLenum target, Image* image, State& state, GLsiz
if (!compressed_image)
{
notify(WARN)<<"glTexImage3D '"<<image->getFileName()<<"' data="<<(void*)image->data()<<std::endl;
extensions->glTexImage3D( target, 0, _internalFormat,
inwidth, inheight, indepth,
_borderWidth,
(GLenum)image->getPixelFormat(),
(GLenum)image->getDataType(),
image->data() );
notify(WARN)<<"done glTexImage3D"<<std::endl;
}
else if (extensions->isCompressedTexImage3DSupported())
{

View File

@@ -475,22 +475,34 @@ bool TerrainManipulator::calcMovement()
CoordinateFrame coordinateFrame = getCoordinateFrame(_center);
// need to reintersect with the terrain
double distance = _node->getBound().radius()*0.1f;
osg::Vec3d start_segment = _center + getUpVector(coordinateFrame) * distance;
osg::Vec3d end_segment = start_segment - getUpVector(coordinateFrame) * (2.0f*distance);
osg::notify(INFO)<<"start="<<start_segment<<"\tend="<<end_segment<<"\tupVector="<<getUpVector(coordinateFrame)<<std::endl;
osg::Vec3d ip;
if (intersect(start_segment,end_segment, ip))
double distance = _node->getBound().radius()*0.25f;
osg::Vec3d ip1;
osg::Vec3d ip2;
bool hit_ip1 = intersect(_center, _center + getUpVector(coordinateFrame) * distance, ip1);
bool hit_ip2 = intersect(_center, _center - getUpVector(coordinateFrame) * distance, ip2);
if (hit_ip1)
{
notify(INFO) << "Hit terrain ok"<< std::endl;
_center = ip;
if (hit_ip2)
{
_center = (_center-ip1).length2() < (_center-ip2).length2() ?
ip1 :
ip2;
hitFound = true;
}
else
{
_center = ip1;
hitFound = true;
}
}
else if (hit_ip2)
{
_center = ip2;
hitFound = true;
}
if (!hitFound)
{
// ??

View File

@@ -244,27 +244,27 @@ void PrecipitationEffect::traverse(osg::NodeVisitor& nv)
{
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
precipitationDrawableSet = &(_viewDrawableMap[viewIndentifier]);
}
if (!precipitationDrawableSet->_quadPrecipitationDrawable)
{
precipitationDrawableSet->_quadPrecipitationDrawable = new PrecipitationDrawable;
precipitationDrawableSet->_quadPrecipitationDrawable->setRequiresPreviousMatrix(true);
precipitationDrawableSet->_quadPrecipitationDrawable->setGeometry(_quadGeometry.get());
precipitationDrawableSet->_quadPrecipitationDrawable->setStateSet(_quadStateSet.get());
precipitationDrawableSet->_quadPrecipitationDrawable->setDrawType(GL_QUADS);
precipitationDrawableSet->_linePrecipitationDrawable = new PrecipitationDrawable;
precipitationDrawableSet->_linePrecipitationDrawable->setRequiresPreviousMatrix(true);
precipitationDrawableSet->_linePrecipitationDrawable->setGeometry(_lineGeometry.get());
precipitationDrawableSet->_linePrecipitationDrawable->setStateSet(_lineStateSet.get());
precipitationDrawableSet->_linePrecipitationDrawable->setDrawType(GL_LINES);
if (!precipitationDrawableSet->_quadPrecipitationDrawable)
{
precipitationDrawableSet->_quadPrecipitationDrawable = new PrecipitationDrawable;
precipitationDrawableSet->_quadPrecipitationDrawable->setRequiresPreviousMatrix(true);
precipitationDrawableSet->_quadPrecipitationDrawable->setGeometry(_quadGeometry.get());
precipitationDrawableSet->_quadPrecipitationDrawable->setStateSet(_quadStateSet.get());
precipitationDrawableSet->_quadPrecipitationDrawable->setDrawType(GL_QUADS);
precipitationDrawableSet->_pointPrecipitationDrawable = new PrecipitationDrawable;
precipitationDrawableSet->_pointPrecipitationDrawable->setRequiresPreviousMatrix(false);
precipitationDrawableSet->_pointPrecipitationDrawable->setGeometry(_pointGeometry.get());
precipitationDrawableSet->_pointPrecipitationDrawable->setStateSet(_pointStateSet.get());
precipitationDrawableSet->_pointPrecipitationDrawable->setDrawType(GL_POINTS);
precipitationDrawableSet->_linePrecipitationDrawable = new PrecipitationDrawable;
precipitationDrawableSet->_linePrecipitationDrawable->setRequiresPreviousMatrix(true);
precipitationDrawableSet->_linePrecipitationDrawable->setGeometry(_lineGeometry.get());
precipitationDrawableSet->_linePrecipitationDrawable->setStateSet(_lineStateSet.get());
precipitationDrawableSet->_linePrecipitationDrawable->setDrawType(GL_LINES);
precipitationDrawableSet->_pointPrecipitationDrawable = new PrecipitationDrawable;
precipitationDrawableSet->_pointPrecipitationDrawable->setRequiresPreviousMatrix(false);
precipitationDrawableSet->_pointPrecipitationDrawable->setGeometry(_pointGeometry.get());
precipitationDrawableSet->_pointPrecipitationDrawable->setStateSet(_pointStateSet.get());
precipitationDrawableSet->_pointPrecipitationDrawable->setDrawType(GL_POINTS);
}
}
cull(*precipitationDrawableSet, cv);

View File

@@ -41,7 +41,7 @@ void AutoTransform::write(DataOutputStream* out){
{
out->writeFloat(getMinimumScale());
out->writeFloat(getMaximumScale());
out->writeFloat(getAutoScaleTransistionWidthRatio());
out->writeFloat(getAutoScaleTransitionWidthRatio());
}
out->writeQuat(getRotation());
@@ -76,7 +76,7 @@ void AutoTransform::read(DataInputStream* in){
{
setMinimumScale(in->readFloat());
setMaximumScale(in->readFloat());
setAutoScaleTransistionWidthRatio(in->readFloat());
setAutoScaleTransitionWidthRatio(in->readFloat());
}
setRotation(in->readQuat());

View File

@@ -140,12 +140,13 @@ bool AutoTransform_readLocalData(Object& obj, Input& fr)
iteratorAdvanced = true;
}
if (fr.matchSequence("autoScaleTransistionWidthRatio %f"))
if (fr.matchSequence("autoScaleTransistionWidthRatio %f") ||
fr.matchSequence("autoScaleTransitionWidthRatio %f"))
{
float ratio;
fr[1].getFloat(ratio);
transform.setAutoScaleTransistionWidthRatio(ratio);
transform.setAutoScaleTransitionWidthRatio(ratio);
fr += 2;
iteratorAdvanced = true;
@@ -181,9 +182,9 @@ bool AutoTransform_writeLocalData(const Object& obj, Output& fw)
fw.indent()<<"autoScaleToScreen "<<(transform.getAutoScaleToScreen()?"TRUE":"FALSE")<<std::endl;
if (transform.getAutoScaleTransistionWidthRatio()!=0.25)
if (transform.getAutoScaleTransitionWidthRatio()!=0.25)
{
fw.indent()<<"autoScaleTransistionWidthRatio "<<transform.getAutoScaleTransistionWidthRatio()<<std::endl;
fw.indent()<<"autoScaleTransitionWidthRatio "<<transform.getAutoScaleTransitionWidthRatio()<<std::endl;
}
return true;

View File

@@ -247,10 +247,11 @@ Handle getPtrDataRef(unsigned char *data, unsigned int size, const std::string &
// Convert From CString in filename to a PascalString in pstr
if (filename.length() > 255) {
CopyCStringToPascal(filename.c_str(), pstr);
//hmm...not good, pascal string limit is 255!
//do some error handling maybe?!
throw QTImportExportException(0, "filename length limit exceeded");
}
CopyCStringToPascal(filename.c_str(), pstr);
// Add filename extension
/*err = */PtrToHand(pstr, &fileNameHandle, filename.length() + 1);
@@ -282,7 +283,7 @@ osg::Image* QuicktimeImportExport::doImport(unsigned char* data, unsigned int si
ImageDescriptionHandle desc = 0;
int depth = 32;
unsigned int xsize, ysize;
unsigned char* imageData;
unsigned char* imageData = 0;
// Data Handle for file data ( & load data from file )
Handle dataRef = getPtrDataRef(data, sizeData, fileTypeHint);
@@ -359,7 +360,7 @@ osg::Image* QuicktimeImportExport::doImport(unsigned char* data, unsigned int si
DisposeHandle(reinterpret_cast<char **>(desc));
DisposeHandle(dataRef);
}
catch (QTImportExportException e)
catch (QTImportExportException& e)
{
setError(e.what());
@@ -383,9 +384,9 @@ osg::Image* QuicktimeImportExport::doImport(unsigned char* data, unsigned int si
unsigned int bytesPerPixel = depth / 8;
unsigned int glpixelFormat;
switch(depth >> 3) {
switch(bytesPerPixel) {
case 3 :
glpixelFormat = GL_RGB;
break;
@@ -393,20 +394,20 @@ osg::Image* QuicktimeImportExport::doImport(unsigned char* data, unsigned int si
glpixelFormat = GL_RGBA;
break;
default :
delete imageData;
delete[] imageData;
setError("unknown pixelformat");
return NULL;
break;
}
unsigned char* swizzled = pepareBufferForOSG(imageData, depth >> 3, xsize, ysize);
unsigned char* swizzled = pepareBufferForOSG(imageData, bytesPerPixel, xsize, ysize);
delete[] imageData;
osg::Image* image = new osg::Image();
image->setFileName(fileTypeHint.c_str());
image->setImage(xsize,ysize,1,
depth >> 3,
bytesPerPixel,
glpixelFormat,
GL_UNSIGNED_BYTE,
swizzled,
@@ -510,7 +511,7 @@ osg::Image* QuicktimeImportExport::doImport(unsigned char* data, unsigned int si
}
catch (QTImportExportException e)
catch (QTImportExportException& e)
{
setError(e.what());

View File

@@ -53,9 +53,9 @@ using namespace osgShadow;
#define TEXTURE_RESOLUTION 1024
#define ZNEAR_MIN_FROM_LIGHT_SOURCE 5.0
#define ZNEAR_MIN_FROM_LIGHT_SOURCE 5.0
#define MOVE_VIRTUAL_CAMERA_BEHIND_REAL_CAMERA_FACTOR 0.0
//#define SHOW_SHADOW_TEXTURE_DEBUG // DEPTH instead of color for debug information texture display in a rectangle
@@ -64,19 +64,19 @@ using namespace osgShadow;
#ifndef SHADOW_TEXTURE_DEBUG
#define SHADOW_TEXTURE_GLSL
#endif
//////////////////////////////////////////////////////////////////////////
// FragmentShaderGenerator
std::string ParallelSplitShadowMap::FragmentShaderGenerator::generateGLSL_FragmentShader_BaseTex(
bool debug,
bool debug,
unsigned int splitCount,
double textureRes,
bool filtered,
bool filtered,
unsigned int nbrSplits,
unsigned int textureOffset
) {
std::stringstream sstr;
/// base texture
sstr << "uniform sampler2D baseTexture; " << std::endl;
sstr << "uniform float enableBaseTexture; " << std::endl;
@@ -88,7 +88,7 @@ std::string ParallelSplitShadowMap::FragmentShaderGenerator::generateGLSL_Fragme
}
sstr << "void main(void)" << std::endl;
sstr << "{" << std::endl;
@@ -101,15 +101,15 @@ std::string ParallelSplitShadowMap::FragmentShaderGenerator::generateGLSL_Fragme
sstr << "float map" << i << " = step(zShadow"<<i-1<<",testZ)*step(testZ, zShadow"<<i<<");"<< std::endl;//DEBUG
}
if (filtered) {
if (filtered) {
sstr << " float fTexelSize="<< (sqrt(2.0) / textureRes ) <<";" << std::endl;
}
for (unsigned int i=0;i<nbrSplits;i++) {
if (!filtered) {
if (!filtered) {
sstr << " float shadow" << i <<" = shadow2DProj( shadowTexture" << i <<",gl_TexCoord[" << (i+textureOffset) <<"]).r;" << std::endl;
} else {
// filter the shadow (look up)
sstr << " float shadowOrg" << i <<" = shadow2DProj( shadowTexture" << i <<",gl_TexCoord[" << (i+textureOffset) <<"]).r;" << std::endl;
sstr << " float shadow0" << i <<" = shadow2DProj( shadowTexture" << i <<",gl_TexCoord[" << (i+textureOffset) <<"]+vec4(-fTexelSize,-fTexelSize,0,0) ).r;" << std::endl;
@@ -125,11 +125,11 @@ std::string ParallelSplitShadowMap::FragmentShaderGenerator::generateGLSL_Fragme
}
sstr << " shadow" << i <<" = step(0.25,shadow" << i <<");" << std::endl; // reduce shadow artefacts
}
sstr << " float term0 = (1.0-shadow0)*map0; " << std::endl;
for (unsigned int i=1;i<nbrSplits;i++) {
sstr << " float term" << i << " = map"<< i << "*(1.0-shadow"<<i<<");"<< std::endl;
sstr << " float term" << i << " = map"<< i << "*(1.0-shadow"<<i<<");"<< std::endl;
}
@@ -163,7 +163,7 @@ std::string ParallelSplitShadowMap::FragmentShaderGenerator::generateGLSL_Fragme
sstr << " vec4 color = gl_Color*( 1.0 - sumTerm ) + (sumTerm)* gl_Color*vec4(c0,(1.0-c0)*c1,(1.0-c0)*(1.0-c1)*c2,1.0); " << std::endl;
switch(nbrSplits){
case 1: sstr << " color = color*0.75 + vec4(map0,0,0,1.0)*0.25; " << std::endl;break;
case 2: sstr << " color = color*0.75 + vec4(map0,map1,0,1.0)*0.25; " << std::endl;break;
@@ -173,13 +173,13 @@ std::string ParallelSplitShadowMap::FragmentShaderGenerator::generateGLSL_Fragme
case 6: sstr << " color = color*0.75 + vec4(map0+map3+map5,map1+map3+map4,map2+map4+map5,1.0)*0.25; " << std::endl; break;
default: break;
}
} else {
sstr << " vec4 color = gl_Color; "<< std::endl;
}
@@ -194,7 +194,7 @@ std::string ParallelSplitShadowMap::FragmentShaderGenerator::generateGLSL_Fragme
sstr << " gl_FragColor.a = (color*(1.0-enableBaseTextureFilter) + colorTex*enableBaseTextureFilter).a; "<< std::endl;
sstr << "}"<< std::endl;
//std::cout << sstr.str() << std::endl;
@@ -344,7 +344,7 @@ void ParallelSplitShadowMap::init(){
osg::StateSet* stateset = pssmShadowSplitTexture._camera->getOrCreateStateSet();
//////////////////////////////////////////////////////////////////////////
float factor = _polgyonOffset.x();
float units = _polgyonOffset.y();
@@ -356,7 +356,7 @@ void ParallelSplitShadowMap::init(){
//////////////////////////////////////////////////////////////////////////
if ( ! _GLSL_shadow_filtered ) {
if ( ! _GLSL_shadow_filtered ) {
// if not glsl filtering enabled then we should force front face culling to reduce the number of shadow artefacts.
osg::ref_ptr<osg::CullFace> cull_face = new osg::CullFace;
cull_face->setMode(osg::CullFace::FRONT);
@@ -396,7 +396,7 @@ void ParallelSplitShadowMap::init(){
//////////////////////////////////////////////////////////////////////////
// GLSL PROGRAMS
osg::Shader* fragment_shader = new osg::Shader(osg::Shader::FRAGMENT,
osg::Shader* fragment_shader = new osg::Shader(osg::Shader::FRAGMENT,
_FragmentShaderGenerator->generateGLSL_FragmentShader_BaseTex(
_debug_color_in_GLSL,
iCameras,
@@ -407,7 +407,7 @@ void ParallelSplitShadowMap::init(){
).c_str());
program->addShader(fragment_shader);
//////////////////////////////////////////////////////////////////////////
// UNIFORMS
std::stringstream strST; strST << "shadowTexture" << (pssmShadowSplitTexture._textureUnit-_textureUnitOffset);
@@ -419,7 +419,7 @@ void ParallelSplitShadowMap::init(){
_ambientBiasUniform = new osg::Uniform("ambientBias",_ambientBias);
pssmShadowSplitTexture._stateset->addUniform(_ambientBiasUniform);
}
std::stringstream strzShadow; strzShadow << "zShadow" << (pssmShadowSplitTexture._textureUnit-_textureUnitOffset);
pssmShadowSplitTexture._farDistanceSplit = new osg::Uniform(strzShadow.str().c_str(),1.0f);
@@ -571,7 +571,7 @@ void ParallelSplitShadowMap::cull(osgUtil::CullVisitor& cv){
//////////////////////////////////////////////////////////////////////////
const osg::Light* selectLight = 0;
/// light pos and light direction
/// light pos and light direction
osg::Vec4 lightpos;
osg::Vec3 lightDirection;
@@ -605,7 +605,7 @@ void ParallelSplitShadowMap::cull(osgUtil::CullVisitor& cv){
lightpos = _userLight->getPosition();
lightDirection = _userLight->getDirection();
selectLight = _userLight.get();
}
}
if (selectLight)
{
@@ -617,7 +617,7 @@ void ParallelSplitShadowMap::cull(osgUtil::CullVisitor& cv){
{
PSSMShadowSplitTexture pssmShadowSplitTexture = it->second;
//////////////////////////////////////////////////////////////////////////
// SETUP pssmShadowSplitTexture for rendering
//
@@ -641,7 +641,7 @@ void ParallelSplitShadowMap::cull(osgUtil::CullVisitor& cv){
// Init Light (Directional Light)
//
calculateLightInitalPosition(pssmShadowSplitTexture,pCorners);
calculateLightInitialPosition(pssmShadowSplitTexture,pCorners);
// Calculate near and far for light view
//
@@ -682,7 +682,7 @@ void ParallelSplitShadowMap::cull(osgUtil::CullVisitor& cv){
// do RTT camera traversal
pssmShadowSplitTexture._camera->accept(cv);
//////////////////////////////////////////////////////////////////////////
// DEBUG
if ( _displayTexturesGroupingNode ) {
@@ -781,11 +781,11 @@ void ParallelSplitShadowMap::calculateFrustumCorners(
delete[] pSplitDistances;
}
pssmShadowSplitTexture._split_far = camFar;
//////////////////////////////////////////////////////////////////////////
/// TRANSFORM frustum corners (Optimized for Orthogonal)
@@ -805,7 +805,7 @@ void ParallelSplitShadowMap::calculateFrustumCorners(
frustumCorners[4] = const_pointFarTL * invProjViewMat;
frustumCorners[5] = const_pointFarBL * invProjViewMat;
frustumCorners[6] = const_pointNearBL* invProjViewMat;
frustumCorners[7] = const_pointNearTL* invProjViewMat;
frustumCorners[7] = const_pointNearTL* invProjViewMat;
//std::cout << "camFar : "<<pssmShadowSplitTexture._splitID << " / " << camNear << "," << camFar << std::endl;
}
@@ -813,14 +813,14 @@ void ParallelSplitShadowMap::calculateFrustumCorners(
//////////////////////////////////////////////////////////////////////////
//
// compute directional light initial position;
void ParallelSplitShadowMap::calculateLightInitalPosition(PSSMShadowSplitTexture &pssmShadowSplitTexture,osg::Vec3d *frustumCorners){
void ParallelSplitShadowMap::calculateLightInitialPosition(PSSMShadowSplitTexture &pssmShadowSplitTexture,osg::Vec3d *frustumCorners){
pssmShadowSplitTexture._frustumSplitCenter = frustumCorners[0];
for(int i=1;i<8;i++) {
pssmShadowSplitTexture._frustumSplitCenter +=frustumCorners[i];
}
pssmShadowSplitTexture._frustumSplitCenter /= 8.0;
//
// To avoid edge problems, scale the frustum so
// that it's at least a few pixels larger
@@ -830,7 +830,7 @@ void ParallelSplitShadowMap::calculateLightInitalPosition(PSSMShadowSplitTexture
// scale by adding offset from center
frustumCorners[i]+=(frustumCorners[i]-pssmShadowSplitTexture._frustumSplitCenter)*(0.75);
}
}
void ParallelSplitShadowMap::calculateLightNearFarFormFrustum(
@@ -845,20 +845,20 @@ void ParallelSplitShadowMap::calculateLightNearFarFormFrustum(
for(int i=0;i<8;i++) {
double dist_z_from_light = fabs(pssmShadowSplitTexture._lightDirection*(frustumCorners[i] - pssmShadowSplitTexture._frustumSplitCenter));
if ( zFar < dist_z_from_light ) zFar = dist_z_from_light;
}
}
// update camera position and look at center
pssmShadowSplitTexture._lightCameraSource = pssmShadowSplitTexture._frustumSplitCenter - pssmShadowSplitTexture._lightDirection*(zFar+_split_min_near_dist);
pssmShadowSplitTexture._lightCameraTarget = pssmShadowSplitTexture._frustumSplitCenter + pssmShadowSplitTexture._lightDirection*(zFar);
// calculate [zNear,zFar]
// calculate [zNear,zFar]
zFar = (-DBL_MAX);
double zNear(DBL_MAX);
for(int i=0;i<8;i++) {
double dist_z_from_light = fabs(pssmShadowSplitTexture._lightDirection*(frustumCorners[i] - pssmShadowSplitTexture._lightCameraSource));
if ( zFar < dist_z_from_light ) zFar = dist_z_from_light;
if ( zNear > dist_z_from_light ) zNear = dist_z_from_light;
}
}
// update near - far plane
pssmShadowSplitTexture._lightNear = max(zNear - _split_min_near_dist - 0.01,0.01);
pssmShadowSplitTexture._lightFar = zFar;
@@ -874,37 +874,37 @@ void ParallelSplitShadowMap::calculateLightViewProjectionFormFrustum(PSSMShadowS
// calculate the camera's coordinate system
osg::Vec3d camEye,camCenter,camUp;
pssmShadowSplitTexture._cameraView.getLookAt(camEye,camCenter,camUp);
osg::Vec3d viewDir(camCenter-camEye);
osg::Vec3d viewDir(camCenter-camEye);
osg::Vec3d camRight(camUp^viewDir);
// we force to have normalized vectors (camera's view)
camUp.normalize();
viewDir.normalize();
camRight.normalize();
// use quaternion -> numerical more robust
osg::Quat qRot;
qRot.makeRotate(viewDir,pssmShadowSplitTexture._lightDirection);
osg::Vec3d top = qRot * camUp;
osg::Vec3d right = qRot * camRight;
// calculate the camera's frustum right,right,bottom,top parameters
double maxRight(-DBL_MAX),maxTop(-DBL_MAX);
double minRight(DBL_MAX),minTop(DBL_MAX);
for(int i(0); i < 8; i++)
{
{
osg::Vec3d diffCorner(pssmShadowSplitTexture._lightCameraSource - frustumCorners[i]);
double lright(diffCorner*right);
double lTop(diffCorner*top);
double lright(diffCorner*right);
double lTop(diffCorner*top);
if ( lright > maxRight ) maxRight = lright;
if ( lTop > maxTop ) maxTop = lTop;
if ( lright < minRight ) minRight = lright;
if ( lTop < minTop ) minTop = lTop;
}
}
// make the camera view matrix
pssmShadowSplitTexture._camera->setViewMatrixAsLookAt(pssmShadowSplitTexture._lightCameraSource,pssmShadowSplitTexture._lightCameraTarget,top);
@@ -918,7 +918,7 @@ void ParallelSplitShadowMap::calculateLightViewProjectionFormFrustum(PSSMShadowS
osg::Vec3d vProjCamFraValue = (camEye + viewDir * pssmShadowSplitTexture._split_far) * (pssmShadowSplitTexture._cameraView * pssmShadowSplitTexture._cameraProj);
pssmShadowSplitTexture._farDistanceSplit->set((float)vProjCamFraValue.z());
#endif
}

View File

@@ -287,16 +287,6 @@ void LineSegmentIntersector::intersect(osgUtil::IntersectionVisitor& iv, osg::Dr
if (iv.getDoDummyTraversal()) return;
double epsilon = 1e-8;
if ((s-e).length()<epsilon)
{
osg::Vec3d delta_e_end = _end - e;
osg::Vec3d delta_s_start = _start - s;
double scale = 0.001;
s += (delta_s_start * scale);
e += (delta_e_end * scale);
}
osg::KdTree* kdTree = iv.getUseKdTreeWhenAvailable() ? dynamic_cast<osg::KdTree*>(drawable->getShape()) : 0;
if (kdTree)
{
@@ -460,43 +450,56 @@ bool LineSegmentIntersector::intersects(const osg::BoundingSphere& bs)
return true;
}
bool LineSegmentIntersector::intersectAndClip(osg::Vec3d& s, osg::Vec3d& e,const osg::BoundingBox& bb)
bool LineSegmentIntersector::intersectAndClip(osg::Vec3d& s, osg::Vec3d& e,const osg::BoundingBox& bbInput)
{
osg::Vec3d bb_min(bbInput._min);
osg::Vec3d bb_max(bbInput._max);
#if 1
double epsilon = 1e-4;
bb_min.x() -= epsilon;
bb_min.y() -= epsilon;
bb_min.z() -= epsilon;
bb_max.x() += epsilon;
bb_max.y() += epsilon;
bb_max.z() += epsilon;
#endif
// compate s and e against the xMin to xMax range of bb.
if (s.x()<=e.x())
{
// trivial reject of segment wholely outside.
if (e.x()<bb.xMin()) return false;
if (s.x()>bb.xMax()) return false;
if (e.x()<bb_min.x()) return false;
if (s.x()>bb_max.x()) return false;
if (s.x()<bb.xMin())
if (s.x()<bb_min.x())
{
// clip s to xMin.
s = s+(e-s)*(bb.xMin()-s.x())/(e.x()-s.x());
s = s+(e-s)*(bb_min.x()-s.x())/(e.x()-s.x());
}
if (e.x()>bb.xMax())
if (e.x()>bb_max.x())
{
// clip e to xMax.
e = s+(e-s)*(bb.xMax()-s.x())/(e.x()-s.x());
e = s+(e-s)*(bb_max.x()-s.x())/(e.x()-s.x());
}
}
else
{
if (s.x()<bb.xMin()) return false;
if (e.x()>bb.xMax()) return false;
if (s.x()<bb_min.x()) return false;
if (e.x()>bb_max.x()) return false;
if (e.x()<bb.xMin())
if (e.x()<bb_min.x())
{
// clip s to xMin.
e = s+(e-s)*(bb.xMin()-s.x())/(e.x()-s.x());
e = s+(e-s)*(bb_min.x()-s.x())/(e.x()-s.x());
}
if (s.x()>bb.xMax())
if (s.x()>bb_max.x())
{
// clip e to xMax.
s = s+(e-s)*(bb.xMax()-s.x())/(e.x()-s.x());
s = s+(e-s)*(bb_max.x()-s.x())/(e.x()-s.x());
}
}
@@ -505,36 +508,36 @@ bool LineSegmentIntersector::intersectAndClip(osg::Vec3d& s, osg::Vec3d& e,const
{
// trivial reject of segment wholely outside.
if (e.y()<bb.yMin()) return false;
if (s.y()>bb.yMax()) return false;
if (e.y()<bb_min.y()) return false;
if (s.y()>bb_max.y()) return false;
if (s.y()<bb.yMin())
if (s.y()<bb_min.y())
{
// clip s to yMin.
s = s+(e-s)*(bb.yMin()-s.y())/(e.y()-s.y());
s = s+(e-s)*(bb_min.y()-s.y())/(e.y()-s.y());
}
if (e.y()>bb.yMax())
if (e.y()>bb_max.y())
{
// clip e to yMax.
e = s+(e-s)*(bb.yMax()-s.y())/(e.y()-s.y());
e = s+(e-s)*(bb_max.y()-s.y())/(e.y()-s.y());
}
}
else
{
if (s.y()<bb.yMin()) return false;
if (e.y()>bb.yMax()) return false;
if (s.y()<bb_min.y()) return false;
if (e.y()>bb_max.y()) return false;
if (e.y()<bb.yMin())
if (e.y()<bb_min.y())
{
// clip s to yMin.
e = s+(e-s)*(bb.yMin()-s.y())/(e.y()-s.y());
e = s+(e-s)*(bb_min.y()-s.y())/(e.y()-s.y());
}
if (s.y()>bb.yMax())
if (s.y()>bb_max.y())
{
// clip e to yMax.
s = s+(e-s)*(bb.yMax()-s.y())/(e.y()-s.y());
s = s+(e-s)*(bb_max.y()-s.y())/(e.y()-s.y());
}
}
@@ -543,36 +546,36 @@ bool LineSegmentIntersector::intersectAndClip(osg::Vec3d& s, osg::Vec3d& e,const
{
// trivial reject of segment wholely outside.
if (e.z()<bb.zMin()) return false;
if (s.z()>bb.zMax()) return false;
if (e.z()<bb_min.z()) return false;
if (s.z()>bb_max.z()) return false;
if (s.z()<bb.zMin())
if (s.z()<bb_min.z())
{
// clip s to zMin.
s = s+(e-s)*(bb.zMin()-s.z())/(e.z()-s.z());
s = s+(e-s)*(bb_min.z()-s.z())/(e.z()-s.z());
}
if (e.z()>bb.zMax())
if (e.z()>bb_max.z())
{
// clip e to zMax.
e = s+(e-s)*(bb.zMax()-s.z())/(e.z()-s.z());
e = s+(e-s)*(bb_max.z()-s.z())/(e.z()-s.z());
}
}
else
{
if (s.z()<bb.zMin()) return false;
if (e.z()>bb.zMax()) return false;
if (s.z()<bb_min.z()) return false;
if (e.z()>bb_max.z()) return false;
if (e.z()<bb.zMin())
if (e.z()<bb_min.z())
{
// clip s to zMin.
e = s+(e-s)*(bb.zMin()-s.z())/(e.z()-s.z());
e = s+(e-s)*(bb_min.z()-s.z())/(e.z()-s.z());
}
if (s.z()>bb.zMax())
if (s.z()>bb_max.z())
{
// clip e to zMax.
s = s+(e-s)*(bb.zMax()-s.z())/(e.z()-s.z());
s = s+(e-s)*(bb_max.z()-s.z())/(e.z()-s.z());
}
}

View File

@@ -2770,7 +2770,7 @@ bool Optimizer::SpatializeGroupsVisitor::divide(osg::Geode* geode, unsigned int
bool yAxis = (bb.yMax()-bb.yMin())>divide_distance;
bool zAxis = (bb.zMax()-bb.zMin())>divide_distance;
osg::notify(osg::NOTICE)<<"INFO "<<geode->className()<<" num drawables = "<<geode->getNumDrawables()<<" xAxis="<<xAxis<<" yAxis="<<yAxis<<" zAxis="<<zAxis<<std::endl;
osg::notify(osg::INFO)<<"INFO "<<geode->className()<<" num drawables = "<<geode->getNumDrawables()<<" xAxis="<<xAxis<<" yAxis="<<yAxis<<" zAxis="<<zAxis<<std::endl;
if (!xAxis && !yAxis && !zAxis)
{

View File

@@ -35,6 +35,7 @@ SET(LIB_COMMON_FILES
ViewerEventHandlers.cpp
)
SET(LIB_EXTRA_LIBS)
IF(WIN32)
@@ -89,9 +90,26 @@ ELSE(WIN32)
PKG_CHECK_MODULES(XRANDR REQUIRED xrandr)
ADD_DEFINITIONS(-DOSGVIEWER_USE_XRANDR)
SET(LIB_PUBLIC_HEADERS ${LIB_PUBLIC_HEADERS} ${XRANDR_INCLUDE_DIRS})
LINK_LIBRARIES(Xrandr)
LINK_LIBRARIES(Xrandr)
ENDIF(OSGVIEWER_USE_XRANDR)
# X11 on Apple requires X11 library plus OpenGL linking hack on Leopard
IF(APPLE)
# Find GL/glx.h
IF(EXISTS ${CMAKE_OSX_SYSROOT}/usr/X11/include/GL/glx.h)
SET(OPENGL_INCLUDE_DIR /usr/X11/include)
SET(OPENGL_LIBRARIES /usr/X11/lib/libGL.dylib)
ELSEIF(EXISTS ${CMAKE_OSX_SYSROOT}/usr/X11R6/include/GL/glx.h)
SET(OPENGL_INCLUDE_DIR /usr/X11R6/include)
SET(OPENGL_LIBRARIES /usr/X11R6/lib/libGL.dylib)
ENDIF(EXISTS ${CMAKE_OSX_SYSROOT}/usr/X11/include/GL/glx.h)
INCLUDE_DIRECTORIES(BEFORE SYSTEM ${OPENGL_INCLUDE_DIR})
SET(LIB_EXTRA_LIBS ${X11_X11_LIB} ${OPENGL_LIBRARIES} ${LIB_EXTRA_LIBS})
SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:${CMAKE_OSX_SYSROOT}/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
ENDIF(APPLE)
ENDIF(${OSG_WINDOWING_SYSTEM} STREQUAL "Carbon")
ENDIF(WIN32)
@@ -112,6 +130,7 @@ LINK_INTERNAL(${LIB_NAME}
osgUtil
osg
OpenThreads
${LIB_EXTRA_LIBS}
)
LINK_CORELIB_DEFAULT(${LIB_NAME})

View File

@@ -477,7 +477,7 @@ class Win32KeyboardMap
KeyMap::const_iterator map = _keymap.find(key);
return map==_keymap.end() ? key : map->second;
}
protected:
typedef std::map<int, int> KeyMap;
@@ -977,7 +977,8 @@ GraphicsWindowWin32::GraphicsWindowWin32( osg::GraphicsContext::Traits* traits )
_ownsWindow(true),
_closeWindow(false),
_destroyWindow(false),
_destroying(false)
_destroying(false),
_appMouseCursor(LeftArrowCursor)
{
_traits = traits;
if (_traits->useCursor) setCursor(LeftArrowCursor);
@@ -1866,6 +1867,16 @@ void GraphicsWindowWin32::useCursor( bool cursorOn )
void GraphicsWindowWin32::setCursor( MouseCursor mouseCursor )
{
if (mouseCursor != LeftRightCursor &&
mouseCursor != UpDownCursor &&
mouseCursor != TopLeftCorner &&
mouseCursor != TopRightCorner &&
mouseCursor != BottomLeftCorner &&
mouseCursor != BottomRightCorner)
{
_appMouseCursor = mouseCursor;
}
_mouseCursor = mouseCursor;
HCURSOR newCursor = getOrCreateCursor( mouseCursor);
if (newCursor == _currentCursor) return;
@@ -2183,6 +2194,7 @@ LRESULT GraphicsWindowWin32::handleNativeWindowingEvent( HWND hwnd, UINT uMsg, W
int keySymbol = 0;
unsigned int modifierMask = 0;
adaptKey(wParam, lParam, keySymbol, modifierMask);
_keyMap[keySymbol] = true;
//getEventQueue()->getCurrentEventState()->setModKeyMask(modifierMask);
getEventQueue()->keyPress(keySymbol, eventTime);
}
@@ -2197,6 +2209,7 @@ LRESULT GraphicsWindowWin32::handleNativeWindowingEvent( HWND hwnd, UINT uMsg, W
int keySymbol = 0;
unsigned int modifierMask = 0;
adaptKey(wParam, lParam, keySymbol, modifierMask);
_keyMap[keySymbol] = false;
//getEventQueue()->getCurrentEventState()->setModKeyMask(modifierMask);
getEventQueue()->keyRelease(keySymbol, eventTime);
}
@@ -2217,6 +2230,77 @@ LRESULT GraphicsWindowWin32::handleNativeWindowingEvent( HWND hwnd, UINT uMsg, W
}
break;
///////////////////
case WM_SETFOCUS :
///////////////////
// Check keys and send a message if the key is pressed when the
// focus comes back to the window.
// I don't really like this hard-coded loop, but the key codes
// (VK_* constants) seem to go from 0x08 to 0xFE so it should be
// ok. See winuser.h for the key codes.
for (unsigned int i = 0x08; i < 0xFF; i++)
{
if ((::GetAsyncKeyState(i) & 0x8000) != 0)
::SendMessage(hwnd, WM_KEYDOWN, i, 0);
}
break;
///////////////////
case WM_KILLFOCUS :
///////////////////
// Release all keys that were pressed when the window lost focus.
for (std::map<int, bool>::iterator key = _keyMap.begin();
key != _keyMap.end(); ++key)
{
if (key->second)
{
getEventQueue()->keyRelease(key->first);
key->second = false;
}
}
break;
///////////////////
case WM_NCHITTEST :
///////////////////
{
LONG_PTR result = _windowProcedure==0 ? ::DefWindowProc(hwnd, uMsg, wParam, lParam) :
::CallWindowProc(_windowProcedure, hwnd, uMsg, wParam, lParam);
switch(result)
{
case HTLEFT:
case HTRIGHT:
setCursor(LeftRightCursor);
break;
case HTTOP:
case HTBOTTOM:
setCursor(UpDownCursor);
break;
case HTTOPLEFT:
setCursor(TopLeftCorner);
break;
case HTTOPRIGHT:
setCursor(TopRightCorner);
break;
case HTBOTTOMLEFT:
setCursor(BottomLeftCorner);
break;
case HTBOTTOMRIGHT:
case HTGROWBOX:
setCursor(BottomRightCorner);
break;
default:
if (_traits->useCursor && _appMouseCursor != InheritCursor)
setCursor(LeftArrowCursor);
break;
}
return result;
}
break;
/////////////////
case WM_CLOSE :
/////////////////

View File

@@ -179,14 +179,14 @@ BEGIN_OBJECT_REFLECTOR(osg::AutoTransform)
__bool__getAutoScaleToScreen,
"",
"");
I_Method1(void, setAutoScaleTransistionWidthRatio, IN, float, ratio,
I_Method1(void, setAutoScaleTransitionWidthRatio, IN, float, ratio,
Properties::NON_VIRTUAL,
__void__setAutoScaleTransistionWidthRatio__float,
__void__setAutoScaleTransitionWidthRatio__float,
"",
"");
I_Method0(float, getAutoScaleTransistionWidthRatio,
I_Method0(float, getAutoScaleTransitionWidthRatio,
Properties::NON_VIRTUAL,
__float__getAutoScaleTransistionWidthRatio,
__float__getAutoScaleTransitionWidthRatio,
"",
"");
I_Method2(bool, computeLocalToWorldMatrix, IN, osg::Matrix &, matrix, IN, osg::NodeVisitor *, nv,
@@ -216,9 +216,9 @@ BEGIN_OBJECT_REFLECTOR(osg::AutoTransform)
I_SimpleProperty(bool, AutoScaleToScreen,
__bool__getAutoScaleToScreen,
__void__setAutoScaleToScreen__bool);
I_SimpleProperty(float, AutoScaleTransistionWidthRatio,
__float__getAutoScaleTransistionWidthRatio,
__void__setAutoScaleTransistionWidthRatio__float);
I_SimpleProperty(float, AutoScaleTransitionWidthRatio,
__float__getAutoScaleTransitionWidthRatio,
__void__setAutoScaleTransitionWidthRatio__float);
I_SimpleProperty(float, AutoUpdateEyeMovementTolerance,
__float__getAutoUpdateEyeMovementTolerance,
__void__setAutoUpdateEyeMovementTolerance__float);