Compare commits
32 Commits
OpenSceneG
...
OpenSceneG
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 |
@@ -1,4 +1,4 @@
|
||||
OpenSceneGraph Library 3.6.0
|
||||
OpenSceneGraph Library 3.6.2
|
||||
|
||||
568 Contributors:
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
SET(OPENSCENEGRAPH_MAJOR_VERSION 3)
|
||||
SET(OPENSCENEGRAPH_MINOR_VERSION 6)
|
||||
SET(OPENSCENEGRAPH_PATCH_VERSION 1)
|
||||
SET(OPENSCENEGRAPH_PATCH_VERSION 2)
|
||||
SET(OPENSCENEGRAPH_SOVERSION 157)
|
||||
|
||||
|
||||
@@ -561,7 +561,7 @@ IF (OSG_GL3_AVAILABLE)
|
||||
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")
|
||||
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")
|
||||
ENDIF()
|
||||
|
||||
@@ -752,7 +752,6 @@ ELSE()
|
||||
FIND_PACKAGE(COLLADA)
|
||||
FIND_PACKAGE(FBX)
|
||||
FIND_PACKAGE(ZLIB)
|
||||
FIND_PACKAGE(Xine)
|
||||
FIND_PACKAGE(OpenVRML)
|
||||
FIND_PACKAGE(GDAL)
|
||||
FIND_PACKAGE(GTA)
|
||||
|
||||
137
ChangeLog
137
ChangeLog
@@ -1,3 +1,140 @@
|
||||
Fri, 29 Jun 2018 10:56:01 +0100
|
||||
Author : Robert Osfield
|
||||
Updated date for 3.6.2 releases
|
||||
|
||||
Fri, 29 Jun 2018 10:54:13 +0100
|
||||
Author : Robert Osfield
|
||||
Updates for 3.6.2 stable release
|
||||
|
||||
Fri, 29 Jun 2018 10:53:23 +0100
|
||||
Author : Robert Osfield
|
||||
Fixed isPointSpriteModeSupported assignment bug
|
||||
|
||||
Fri, 29 Jun 2018 09:52:47 +0100
|
||||
Author : Robert Osfield
|
||||
Removed the gl3.h usage for GL3 case as these headers were replaced by glcorearb.h, it's probably better to just fallback to gl.h and have the OSG get the extentions at runtime.
|
||||
|
||||
Thu, 28 Jun 2018 07:34:49 +0100
|
||||
Author : Robert Osfield
|
||||
UPdated ChangeLog
|
||||
|
||||
Thu, 28 Jun 2018 07:06:59 +0100
|
||||
Author : Robert Osfield
|
||||
Updated for rc3
|
||||
|
||||
Wed, 27 Jun 2018 21:21:31 -0700
|
||||
Author : Larry-Hu
|
||||
Remove call to nonexistent member seekpos() of std::fpos in VS 2017 version 15.8 or later
|
||||
|
||||
Wed, 27 Jun 2018 20:59:09 +0100
|
||||
Author : OpenSceneGraph git repository
|
||||
Merge pull request #568 from emminizer/fix-flt-texture-export-gl3OpenFlight: Textures now correctly export in GLCORE mode.
|
||||
|
||||
Wed, 27 Jun 2018 12:57:20 -0400
|
||||
Author : Daniel Emminizer
|
||||
OpenFlight: Textures now correctly export in GLCORE mode.
|
||||
|
||||
Wed, 27 Jun 2018 09:17:00 +0100
|
||||
Author : Robert Osfield
|
||||
Updated for 3.6.2-rc2
|
||||
|
||||
Wed, 27 Jun 2018 09:06:58 +0100
|
||||
Author : Robert Osfield
|
||||
Fixed relaseGLObjects() calls
|
||||
|
||||
Tue, 26 Jun 2018 20:50:55 +0100
|
||||
Author : Robert Osfield
|
||||
Merge branch 'OpenSceneGraph-3.6' of https://github.com/openscenegraph/OpenSceneGraph into OpenSceneGraph-3.6
|
||||
|
||||
Tue, 26 Jun 2018 20:46:49 +0100
|
||||
Author : Robert Osfield
|
||||
Replaced creation of a temporary Settings object on the heap with creation on the stack to improve performance
|
||||
|
||||
Tue, 26 Jun 2018 20:17:07 +0100
|
||||
Author : OpenSceneGraph git repository
|
||||
Merge pull request #566 from emminizer/fix-gl_rb-in-gluscaleimageGL_RG is now a supported format in gluScaleImage().
|
||||
|
||||
Tue, 26 Jun 2018 20:10:51 +0100
|
||||
Author : Robert Osfield
|
||||
Added GLExtensions::isPointSpriteModeSupported to allow it to be enable for GL versions that support GL_POINT_SPRITE_ARB/GL_POINT_SPRITE_OES
|
||||
|
||||
Tue, 26 Jun 2018 14:44:34 -0400
|
||||
Author : Daniel Emminizer
|
||||
GL_RG is now a support format in gluScaleImage().
|
||||
|
||||
Mon, 25 Jun 2018 20:02:30 +0100
|
||||
Author : Robert Osfield
|
||||
Moved osg::clampProjectionMatrix() template from CullVisitor.cpp into include/osg/CullSettings to make it easier to implement custom clampProjectionMatrix callbacks
|
||||
|
||||
Wed, 20 Jun 2018 13:59:10 +0100
|
||||
Author : Robert Osfield
|
||||
Updates for 3.6.2-rc1
|
||||
|
||||
Tue, 19 Jun 2018 17:09:56 +0100
|
||||
Author : Calum Robinson
|
||||
Fix z near calculation for lines
|
||||
|
||||
Tue, 19 Jun 2018 11:50:38 +0100
|
||||
Author : OpenSceneGraph git repository
|
||||
Merge pull request #558 from LaurensVoerman/submit-ffmpeg3.2resolve av sync failure with ffmpeg 3.2 and up
|
||||
|
||||
Tue, 19 Jun 2018 09:21:02 +0200
|
||||
Author : Laurens Voerman
|
||||
resolve av sync failure with ffmpeg 3.2 and up
|
||||
|
||||
Tue, 19 Jun 2018 00:33:03 +0800
|
||||
Author : 弥继平
|
||||
Fixed the position of the viewport for the cameraThe position of viewport doesn't setup properly, some part of viewer is out of CMFC_OSG_MDIView, and not visible.
|
||||
|
||||
Thu, 14 Jun 2018 14:31:28 +0200
|
||||
Author : Laurens Voerman
|
||||
remove include/osgQt from doxyfiles; add osgPresentation and osgUI
|
||||
|
||||
Thu, 14 Jun 2018 14:44:16 +0100
|
||||
Author : OpenSceneGraph git repository
|
||||
Merge pull request #555 from emminizer/fix-noisy-flt-loadingFLT: Missing optional attr files on textures no longer generates a co…
|
||||
|
||||
Thu, 14 Jun 2018 07:33:08 -0400
|
||||
Author : Daniel Emminizer
|
||||
FLT: Missing optional attr files on textures no longer generates a console warning.
|
||||
|
||||
Thu, 14 Jun 2018 08:54:21 +0100
|
||||
Author : Robert Osfield
|
||||
Changed version to 3.6.2 in prep for next release
|
||||
|
||||
Thu, 14 Jun 2018 08:51:00 +0100
|
||||
Author : Robert Osfield
|
||||
To handle calling Array::setBinding() after Geometry::set*Array() call, to the Geometry::addVertexBufferObjectIfRequired(osg::Array* array) added treatment of array->getBinding()==Array::BIND_UNDEFINED as BIND_PER_VERTEX as a safe fallback.
|
||||
|
||||
Wed, 13 Jun 2018 12:23:29 +0100
|
||||
Author : Robert Osfield
|
||||
Moved Stae::setUseVertexAttributeAliasing(bool) implementation to .cpp an added call to _globalVertexArrayState->assignAllDispatchers(); to ensure state is consistent
|
||||
|
||||
Sun, 3 Jun 2018 10:27:00 +0100
|
||||
Author : Robert Osfield
|
||||
Updated LICENSE to use the WxWidgets-3.1 and updates to the LGPL-2.1-only that updates addresses and tighten up language used.Functionality the OSGPL-1.0 is the same as OSGPL-0.0, All the OpenSceneGraph users can use either OSGPL-0.0 or OSGPL-1.0.
|
||||
|
||||
|
||||
Thu, 31 May 2018 15:11:19 +0100
|
||||
Author : Robert Osfield
|
||||
Removed deprecated xine plugin to simplify licensing (xine plugin is GPL'd)
|
||||
|
||||
Thu, 31 May 2018 14:45:37 +0100
|
||||
Author : Robert Osfield
|
||||
As the author of all the files in osgPresentation and present3D have rectified the license notices to reflect their intended license rather than histoical license they had prior to being merged into the OpenSceneGraph project. OSGPL was always intended but missed during merge. Replaced the GPL notices with OSGPL usge in present3D and include/osgPresentation as this was intended when Present3D was merged back into OpenSceneGraph but missed.
|
||||
|
||||
Mon, 28 May 2018 08:58:21 +0100
|
||||
Author : Robert Osfield
|
||||
Updated for 3.6.1
|
||||
|
||||
Sun, 27 May 2018 14:21:57 +0200
|
||||
Author : Philippe Renon
|
||||
Notify: silence warning about unused argument
|
||||
|
||||
Wed, 23 May 2018 19:54:10 +0100
|
||||
Author : Robert Osfield
|
||||
Updated ChangeLog
|
||||
|
||||
Wed, 23 May 2018 19:53:12 +0100
|
||||
Author : Robert Osfield
|
||||
Updates for 3.6.1-rc7
|
||||
|
||||
75
LICENSE.txt
75
LICENSE.txt
@@ -1,8 +1,8 @@
|
||||
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
|
||||
of this licence document, but changing it is not allowed.
|
||||
|
||||
@@ -12,18 +12,19 @@
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the OpenSceneGraph Public License (OSGPL) version 0.0
|
||||
or later.
|
||||
|
||||
Notes: the OSGPL is based on the LGPL, with the 4 exceptions laid
|
||||
out in the wxWindows section below. The LGPL is contained in the
|
||||
final section of this license.
|
||||
|
||||
Notes: the OSGPL is based on the LGPL-2.1-only WITH WxWindows-exception-3.1,
|
||||
with the 4 exceptions laid out in the wxWindows section below. The LGPL is
|
||||
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
|
||||
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
|
||||
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,
|
||||
Boston, MA 02111-1307 USA.
|
||||
write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301 USA.
|
||||
|
||||
EXCEPTION NOTICE
|
||||
|
||||
1. As a special exception, the copyright holders of this library give
|
||||
permission for additional uses of the text contained in this release of
|
||||
the library as licensed under the wxWindows Library Licence, applying
|
||||
either version 3 of the Licence, or (at your option) any later version of
|
||||
the Licence as published by the copyright holders of version 3 of the
|
||||
Licence document.
|
||||
the library as licenced under the wxWindows Library Licence, applying
|
||||
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.1 of the Licence document.
|
||||
|
||||
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.
|
||||
|
||||
3. If you copy code from files distributed under the terms of the GNU
|
||||
@@ -71,11 +72,13 @@
|
||||
choice whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, you must delete the exception notice from such
|
||||
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.
|
||||
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
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
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
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
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
|
||||
former contains code derived from the library, whereas the latter must
|
||||
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
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
@@ -222,7 +225,7 @@ such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
@@ -234,7 +237,7 @@ Library.
|
||||
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
|
||||
fee.
|
||||
|
||||
|
||||
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
|
||||
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
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
|
||||
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
|
||||
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.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
|
||||
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
|
||||
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
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
|
||||
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
|
||||
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.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
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
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
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
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
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
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
|
||||
@@ -25,7 +25,7 @@ If details below are not sufficient then head over to the openscenegraph.org to
|
||||
|
||||
Robert Osfield.
|
||||
Project Lead.
|
||||
28th May 2018.
|
||||
29th June 2018.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -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
|
||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
||||
* The full license is in LICENSE.txt file included with this distribution,.
|
||||
* 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 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* include LICENSE.txt for more details.
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#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
|
||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
||||
* The full license is in LICENSE.txt file included with this distribution,.
|
||||
* 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 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* include LICENSE.txt for more details.
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#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
|
||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
||||
* The full license is in LICENSE.txt file included with this distribution,.
|
||||
* 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 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* include LICENSE.txt for more details.
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#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
|
||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
||||
* The full license is in LICENSE.txt file included with this distribution,.
|
||||
* 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 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* include LICENSE.txt for more details.
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#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
|
||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
||||
* The full license is in LICENSE.txt file included with this distribution,.
|
||||
* 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 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* include LICENSE.txt for more details.
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#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
|
||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
||||
* The full license is in LICENSE.txt file included with this distribution,.
|
||||
* 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 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* include LICENSE.txt for more details.
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#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
|
||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
||||
* The full license is in LICENSE.txt file included with this distribution,.
|
||||
* 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 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* include LICENSE.txt for more details.
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#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
|
||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
||||
* The full license is in LICENSE.txt file included with this distribution,.
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful,
|
||||
* 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
|
||||
* include LICENSE.txt for more details.
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#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
|
||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
||||
* The full license is in LICENSE.txt file included with this distribution,.
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful,
|
||||
* 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
|
||||
* include LICENSE.txt for more details.
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#include <osgViewer/Viewer>
|
||||
@@ -33,7 +34,7 @@ SDLIntegration::SDLIntegration()
|
||||
atexit(SDL_Quit);
|
||||
|
||||
int numJoysticks = SDL_NumJoysticks();
|
||||
|
||||
|
||||
if (_verbose)
|
||||
{
|
||||
std::cout<<"number of joysticks "<<numJoysticks<<std::endl;
|
||||
@@ -42,9 +43,9 @@ SDLIntegration::SDLIntegration()
|
||||
std::cout<<"Joystick name '"<<SDL_JoystickName(i)<<"'"<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
_joystick = numJoysticks>0 ? SDL_JoystickOpen(0) : 0;
|
||||
|
||||
|
||||
_numAxes = _joystick ? SDL_JoystickNumAxes(_joystick) : 0;
|
||||
_numBalls = _joystick ? SDL_JoystickNumBalls(_joystick) : 0;
|
||||
_numHats = _joystick ? SDL_JoystickNumHats(_joystick) : 0;
|
||||
@@ -57,13 +58,13 @@ SDLIntegration::SDLIntegration()
|
||||
std::cout<<"numHats = "<<_numHats<<std::endl;
|
||||
std::cout<<"numButtons = "<<_numButtons<<std::endl;
|
||||
}
|
||||
|
||||
|
||||
addMouseButtonMapping(4, 1); // left
|
||||
addMouseButtonMapping(5, 3); // right
|
||||
addMouseButtonMapping(6, 2); // middle
|
||||
|
||||
addKeyMapping(10, ' '); // R2
|
||||
|
||||
|
||||
addKeyMapping(0, '1'); // 1
|
||||
addKeyMapping(1, '2'); // 2
|
||||
addKeyMapping(2, '3'); // 3
|
||||
@@ -88,7 +89,7 @@ void SDLIntegration::capture(ValueList& axisValues, ValueList& buttonValues) con
|
||||
if (_joystick)
|
||||
{
|
||||
SDL_JoystickUpdate();
|
||||
|
||||
|
||||
axisValues.resize(_numAxes);
|
||||
for(int ai=0; ai<_numAxes; ++ai)
|
||||
{
|
||||
@@ -107,21 +108,21 @@ void SDLIntegration::update(osgViewer::Viewer& viewer)
|
||||
{
|
||||
if (_joystick)
|
||||
{
|
||||
|
||||
|
||||
ValueList newAxisValues;
|
||||
ValueList newButtonValues;
|
||||
|
||||
|
||||
capture(newAxisValues, newButtonValues);
|
||||
|
||||
|
||||
unsigned int mouseXaxis = 0;
|
||||
unsigned int mouseYaxis = 1;
|
||||
|
||||
|
||||
float prev_mx = (float)_axisValues[mouseXaxis]/32767.0f;
|
||||
float prev_my = -(float)_axisValues[mouseYaxis]/32767.0f;
|
||||
|
||||
float mx = (float)newAxisValues[mouseXaxis]/32767.0f;
|
||||
float my = -(float)newAxisValues[mouseYaxis]/32767.0f;
|
||||
|
||||
|
||||
|
||||
osgGA::EventQueue* eq = viewer.getEventQueue();
|
||||
double time = eq ? eq->getTime() : 0.0;
|
||||
@@ -145,7 +146,7 @@ void SDLIntegration::update(osgViewer::Viewer& viewer)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for(int bi=0; bi<_numButtons; ++bi)
|
||||
{
|
||||
if (newButtonValues[bi]!=_buttonValues[bi])
|
||||
@@ -171,11 +172,11 @@ void SDLIntegration::update(osgViewer::Viewer& viewer)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
_axisValues.swap(newAxisValues);
|
||||
_buttonValues.swap(newButtonValues);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
||||
* The full license is in LICENSE.txt file included with this distribution,.
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful,
|
||||
* 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
|
||||
* include LICENSE.txt for more details.
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef SDLINTEGRATION
|
||||
@@ -31,12 +32,12 @@ class SDLIntegration
|
||||
typedef std::map<int, int> ButtonMap;
|
||||
|
||||
void update(osgViewer::Viewer& viewer);
|
||||
|
||||
|
||||
void addMouseButtonMapping(int joystickButton, int mouseButton)
|
||||
{
|
||||
_mouseButtonMap[joystickButton] = mouseButton;
|
||||
}
|
||||
|
||||
|
||||
int getMouseButtonMapping(int joystickButton)
|
||||
{
|
||||
ButtonMap::const_iterator itr = _mouseButtonMap.find(joystickButton);
|
||||
@@ -48,16 +49,16 @@ class SDLIntegration
|
||||
{
|
||||
_keyMap[joystickButton] = key;
|
||||
}
|
||||
|
||||
|
||||
int getKeyMapping(int joystickButton)
|
||||
{
|
||||
ButtonMap::const_iterator itr = _keyMap.find(joystickButton);
|
||||
if (itr != _keyMap.end()) return itr->second;
|
||||
else return -1;
|
||||
}
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
void capture(ValueList& axisValues, ValueList& buttonValues) const;
|
||||
|
||||
SDL_Joystick* _joystick;
|
||||
@@ -66,7 +67,7 @@ class SDLIntegration
|
||||
int _numHats;
|
||||
int _numButtons;
|
||||
bool _verbose;
|
||||
|
||||
|
||||
ValueList _axisValues;
|
||||
ValueList _buttonValues;
|
||||
ButtonMap _mouseButtonMap;
|
||||
|
||||
@@ -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
|
||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
||||
* The full license is in LICENSE.txt file included with this distribution,.
|
||||
* 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 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* include LICENSE.txt for more details.
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#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
|
||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
||||
* The full license is in LICENSE.txt file included with this distribution,.
|
||||
* 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 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* include LICENSE.txt for more details.
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#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
|
||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
||||
* The full license is in LICENSE.txt file included with this distribution,.
|
||||
* 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 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* include LICENSE.txt for more details.
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#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
|
||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
||||
* The full license is in LICENSE.txt file included with this distribution,.
|
||||
* 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 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* include LICENSE.txt for more details.
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#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
|
||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
||||
* The full license is in LICENSE.txt file included with this distribution,.
|
||||
* 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 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* include LICENSE.txt for more details.
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#include <osg/Geometry>
|
||||
|
||||
@@ -99,15 +99,16 @@ INPUT = ${OpenSceneGraph_SOURCE_DIR}/include/osg \
|
||||
${OpenSceneGraph_SOURCE_DIR}/include/osgGA \
|
||||
${OpenSceneGraph_SOURCE_DIR}/include/osgManipulator \
|
||||
${OpenSceneGraph_SOURCE_DIR}/include/osgParticle \
|
||||
${OpenSceneGraph_SOURCE_DIR}/include/osgPresentation \
|
||||
${OpenSceneGraph_SOURCE_DIR}/include/osgShadow \
|
||||
${OpenSceneGraph_SOURCE_DIR}/include/osgSim \
|
||||
${OpenSceneGraph_SOURCE_DIR}/include/osgTerrain \
|
||||
${OpenSceneGraph_SOURCE_DIR}/include/osgText \
|
||||
${OpenSceneGraph_SOURCE_DIR}/include/osgUI \
|
||||
${OpenSceneGraph_SOURCE_DIR}/include/osgUtil \
|
||||
${OpenSceneGraph_SOURCE_DIR}/include/osgViewer \
|
||||
${OpenSceneGraph_SOURCE_DIR}/include/osgVolume \
|
||||
${OpenSceneGraph_SOURCE_DIR}/include/osgWidget \
|
||||
${OpenSceneGraph_SOURCE_DIR}/include/osgQt \
|
||||
${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/auto_Mainpage
|
||||
INPUT_ENCODING = UTF-8
|
||||
FILE_PATTERNS = *include* \
|
||||
|
||||
@@ -89,15 +89,16 @@ INPUT = ${OpenSceneGraph_SOURCE_DIR}/include/osg \
|
||||
${OpenSceneGraph_SOURCE_DIR}/include/osgGA \
|
||||
${OpenSceneGraph_SOURCE_DIR}/include/osgManipulator \
|
||||
${OpenSceneGraph_SOURCE_DIR}/include/osgParticle \
|
||||
${OpenSceneGraph_SOURCE_DIR}/include/osgPresentation \
|
||||
${OpenSceneGraph_SOURCE_DIR}/include/osgShadow \
|
||||
${OpenSceneGraph_SOURCE_DIR}/include/osgSim \
|
||||
${OpenSceneGraph_SOURCE_DIR}/include/osgTerrain \
|
||||
${OpenSceneGraph_SOURCE_DIR}/include/osgText \
|
||||
${OpenSceneGraph_SOURCE_DIR}/include/osgUI \
|
||||
${OpenSceneGraph_SOURCE_DIR}/include/osgUtil \
|
||||
${OpenSceneGraph_SOURCE_DIR}/include/osgViewer \
|
||||
${OpenSceneGraph_SOURCE_DIR}/include/osgVolume \
|
||||
${OpenSceneGraph_SOURCE_DIR}/include/osgWidget \
|
||||
${OpenSceneGraph_SOURCE_DIR}/include/osgQt \
|
||||
${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/auto_Mainpage
|
||||
INPUT_ENCODING = UTF-8
|
||||
FILE_PATTERNS = *include* \
|
||||
|
||||
@@ -90,7 +90,7 @@ INPUT = "${OpenSceneGraph_SOURCE_DIR}/include/osg" \
|
||||
"${OpenSceneGraph_SOURCE_DIR}/include/osgGA" \
|
||||
"${OpenSceneGraph_SOURCE_DIR}/include/osgManipulator" \
|
||||
"${OpenSceneGraph_SOURCE_DIR}/include/osgParticle" \
|
||||
"${OpenSceneGraph_SOURCE_DIR}/include/osgQt" \
|
||||
"${OpenSceneGraph_SOURCE_DIR}/include/osgPresentation" \
|
||||
"${OpenSceneGraph_SOURCE_DIR}/include/osgShadow" \
|
||||
"${OpenSceneGraph_SOURCE_DIR}/include/osgSim" \
|
||||
"${OpenSceneGraph_SOURCE_DIR}/include/osgTerrain" \
|
||||
|
||||
@@ -104,7 +104,7 @@ void cOSG::InitCameraConfig(void)
|
||||
camera->setGraphicsContext(gc);
|
||||
|
||||
// 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
|
||||
camera->setDrawBuffer(GL_BACK);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -627,6 +627,7 @@ class OSG_EXPORT GLExtensions : public osg::Referenced
|
||||
// Point
|
||||
bool isPointParametersSupported;
|
||||
bool isPointSpriteSupported;
|
||||
bool isPointSpriteModeSupported;
|
||||
bool isPointSpriteCoordOriginSupported;
|
||||
|
||||
void (GL_APIENTRY * glPointParameteri) (GLenum pname, GLint param);
|
||||
|
||||
@@ -252,7 +252,7 @@ class OSG_EXPORT State : public Referenced
|
||||
Polytope getViewFrustum() const;
|
||||
|
||||
|
||||
void setUseVertexAttributeAliasing(bool flag) { _useVertexAttributeAliasing = flag; }
|
||||
void setUseVertexAttributeAliasing(bool flag);
|
||||
bool getUseVertexAttributeAliasing() const { return _useVertexAttributeAliasing ; }
|
||||
|
||||
typedef std::vector<VertexAttribAlias> VertexAttribAliasList;
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2018 Robert Osfield
|
||||
*
|
||||
* This software is open source and may be redistributed and/or modified under
|
||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
||||
* The full license is in LICENSE.txt file included with this distribution,.
|
||||
* 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 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* include LICENSE.txt for more details.
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef OSG_ANIMATIONMATERIAL
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2018 Robert Osfield
|
||||
*
|
||||
* This software is open source and may be redistributed and/or modified under
|
||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
||||
* The full license is in LICENSE.txt file included with this distribution,.
|
||||
* 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 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* include LICENSE.txt for more details.
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef OSG_COMPILESLIDECALLBACK
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2018 Robert Osfield
|
||||
*
|
||||
* This software is open source and may be redistributed and/or modified under
|
||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
||||
* The full license is in LICENSE.txt file included with this distribution,.
|
||||
* 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 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* include LICENSE.txt for more details.
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef KEYEVENTHANDLER
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2018 Robert Osfield
|
||||
*
|
||||
* This software is open source and may be redistributed and/or modified under
|
||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
||||
* The full license is in LICENSE.txt file included with this distribution,.
|
||||
* 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 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* include LICENSE.txt for more details.
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef PICKEVENTHANDLER
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2018 Robert Osfield
|
||||
*
|
||||
* This software is open source and may be redistributed and/or modified under
|
||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
||||
* The full license is in LICENSE.txt file included with this distribution,.
|
||||
* 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 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* include LICENSE.txt for more details.
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef PROPERTYMANAGER
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2018 Robert Osfield
|
||||
*
|
||||
* This software is open source and may be redistributed and/or modified under
|
||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
||||
* The full license is in LICENSE.txt file included with this distribution,.
|
||||
* 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 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* include LICENSE.txt for more details.
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef SLIDEEVENTHANDLER
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2018 Robert Osfield
|
||||
*
|
||||
* This software is open source and may be redistributed and/or modified under
|
||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
||||
* The full license is in LICENSE.txt file included with this distribution,.
|
||||
* 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 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* include LICENSE.txt for more details.
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef SLIDESHOWCONSTRUCTOR
|
||||
|
||||
@@ -1054,6 +1054,9 @@ GLExtensions::GLExtensions(unsigned int in_contextID):
|
||||
|
||||
|
||||
isPointSpriteSupported = validContext && (OSG_GLES2_FEATURES || OSG_GLES3_FEATURES || OSG_GL3_FEATURES || isGLExtensionSupported(contextID, "GL_ARB_point_sprite") || isGLExtensionSupported(contextID, "GL_OES_point_sprite") || isGLExtensionSupported(contextID, "GL_NV_point_sprite"));
|
||||
|
||||
isPointSpriteModeSupported = isPointSpriteSupported && !OSG_GL3_FEATURES;
|
||||
|
||||
isPointSpriteCoordOriginSupported = validContext && (OSG_GL3_FEATURES || (glVersion >= 2.0f));
|
||||
|
||||
|
||||
|
||||
@@ -535,7 +535,7 @@ bool Geometry::getDrawElementsList(DrawElementsList& drawElementsList) const
|
||||
|
||||
void Geometry::addVertexBufferObjectIfRequired(osg::Array* array)
|
||||
{
|
||||
if (/*_useVertexBufferObjects &&*/ array->getBinding()==Array::BIND_PER_VERTEX)
|
||||
if (/*_useVertexBufferObjects &&*/ array->getBinding()==Array::BIND_PER_VERTEX || array->getBinding()==Array::BIND_UNDEFINED)
|
||||
{
|
||||
if (!array->getVertexBufferObject())
|
||||
{
|
||||
|
||||
@@ -711,13 +711,10 @@ void OcclusionQueryNode::createSupportNodes()
|
||||
|
||||
void OcclusionQueryNode::releaseGLObjects( State* state ) const
|
||||
{
|
||||
if(_queryGeode->getDrawable( 0 ) != NULL)
|
||||
{
|
||||
// Query object discard and deletion is handled by QueryGeometry support class.
|
||||
OcclusionQueryNode* nonConstThis = const_cast< OcclusionQueryNode* >( this );
|
||||
QueryGeometry* qg = static_cast< QueryGeometry* >( nonConstThis->_queryGeode->getDrawable( 0 ) );
|
||||
qg->releaseGLObjects( state );
|
||||
}
|
||||
if (_queryGeode.valid()) _queryGeode->releaseGLObjects(state);
|
||||
if (_debugGeode.valid()) _debugGeode->releaseGLObjects(state);
|
||||
|
||||
osg::Group::releaseGLObjects(state);
|
||||
}
|
||||
|
||||
void OcclusionQueryNode::flushDeletedQueryObjects( unsigned int contextID, double currentTime, double& availableTime )
|
||||
|
||||
@@ -43,7 +43,7 @@ int PointSprite::compare(const StateAttribute& sa) const
|
||||
bool PointSprite::checkValidityOfAssociatedModes(osg::State& state) const
|
||||
{
|
||||
const GLExtensions* extensions = state.get<GLExtensions>();
|
||||
bool modeValid = extensions->isPointSpriteSupported;
|
||||
bool modeValid = extensions->isPointSpriteModeSupported;
|
||||
|
||||
#if defined( OSG_GLES1_AVAILABLE ) //point sprites don't exist on es 2.0
|
||||
state.setModeValidity(GL_POINT_SPRITE_OES, modeValid);
|
||||
|
||||
@@ -170,6 +170,12 @@ State::~State()
|
||||
//_vertexAttribArrayList.clear();
|
||||
}
|
||||
|
||||
void State::setUseVertexAttributeAliasing(bool flag)
|
||||
{
|
||||
_useVertexAttributeAliasing = flag;
|
||||
if (_globalVertexArrayState.valid()) _globalVertexArrayState->assignAllDispatchers();
|
||||
}
|
||||
|
||||
void State::initializeExtensionProcs()
|
||||
{
|
||||
if (_extensionProcsInitialized) return;
|
||||
|
||||
@@ -3323,6 +3323,7 @@ static GLboolean legalFormat(GLenum format)
|
||||
case GL_RGBA:
|
||||
case GL_LUMINANCE:
|
||||
case GL_LUMINANCE_ALPHA:
|
||||
case GL_RG:
|
||||
case GL_BGR:
|
||||
case GL_BGRA:
|
||||
return GL_TRUE;
|
||||
@@ -4874,6 +4875,7 @@ static GLint elements_per_group(GLenum format, GLenum type)
|
||||
case GL_BGR:
|
||||
return 3;
|
||||
case GL_LUMINANCE_ALPHA:
|
||||
case GL_RG:
|
||||
return 2;
|
||||
case GL_RGBA:
|
||||
case GL_BGRA:
|
||||
|
||||
@@ -32,7 +32,7 @@ SET(TARGET_COMMON_LIBRARIES
|
||||
osgUtil
|
||||
)
|
||||
|
||||
OPTION(BUILD_OSG_PLUGINS_BY_DEFAULT "If set, all available plugins are built by default and each plugin can be disabled from the build by setting BUILD_OSG_PLUGIN_<PLUGINNAME> to 0. If not set, no plugins are built by default and each desired plugin must be explicitly enabled by setting BUILD_OSG_PLUGIN_<PLUGINNAME> to 1." ON)
|
||||
OPTION(BUILD_OSG_PLUGINS_BY_DEFAULT "If set, all available plugins are built by default and each plugin can be disabled from the build by setting BUILD_OSG_PLUGIN_<PLUGINNAME> to 0. If not set, no plugins are built by default and each desired plugin must be explicitly enabled by setting BUILD_OSG_PLUGIN_<PLUGINNAME> to 1." ON)
|
||||
|
||||
# Macro used for adding plugins below. By default, all plugins are built
|
||||
# but can be disabled by setting the CMake Variable BUILD_OSG_PLUGIN_<PLUGINNAME> to 0.
|
||||
@@ -213,10 +213,6 @@ IF(OSG_CPP_EXCEPTIONS_AVAILABLE)
|
||||
ADD_PLUGIN_DIRECTORY(txp)
|
||||
ENDIF()
|
||||
|
||||
IF(XINE_FOUND)
|
||||
ADD_PLUGIN_DIRECTORY(xine)
|
||||
ENDIF()
|
||||
|
||||
IF(FFMPEG_FOUND AND OSG_CPP_EXCEPTIONS_AVAILABLE)
|
||||
ADD_PLUGIN_DIRECTORY(ffmpeg)
|
||||
ENDIF()
|
||||
|
||||
@@ -344,8 +344,13 @@ protected:
|
||||
texture->setImage(image.get());
|
||||
stateset->setTextureAttributeAndModes(0, texture, osg::StateAttribute::ON);
|
||||
|
||||
// Read attribute file
|
||||
// Since the .attr file is optional according to the OpenFlight spec, check to see
|
||||
// if the file exists before reading it, to avoid printing an unnecessary warning.
|
||||
std::string attrname = filename + ".attr";
|
||||
if (!osgDB::fileExists(attrname))
|
||||
return stateset;
|
||||
|
||||
// Read optional attribute file
|
||||
osg::ref_ptr<AttrData> attr = osgDB::readRefFile<AttrData>(attrname,document.getOptions());
|
||||
if (attr.valid())
|
||||
{
|
||||
|
||||
@@ -63,7 +63,12 @@ bool
|
||||
FltExportVisitor::isTextured( int unit, const osg::Geometry& geom ) const
|
||||
{
|
||||
const osg::StateSet* ss = getCurrentStateSet();
|
||||
#ifdef OSG_GL_FIXED_FUNCTION_AVAILABLE
|
||||
bool texOn( ss->getTextureMode( unit, GL_TEXTURE_2D ) & osg::StateAttribute::ON );
|
||||
#else
|
||||
// In this mode, osg::Texture::getModeUsage() is undefined, so just detect if a texture is present
|
||||
bool texOn = (ss->getTextureAttribute(0, osg::StateAttribute::TEXTURE) != NULL);
|
||||
#endif
|
||||
bool hasCoords( geom.getTexCoordArray( unit ) != NULL );
|
||||
|
||||
return( texOn && hasCoords );
|
||||
|
||||
@@ -155,8 +155,7 @@ double FFmpegClocks::videoSynchClock(const AVFrame * const frame, const double t
|
||||
|
||||
// Update the video clock to take into account the frame delay
|
||||
|
||||
double frame_delay = time_base;
|
||||
frame_delay += frame->repeat_pict * (frame_delay * 0.5);
|
||||
double frame_delay = time_base * (1 + frame->repeat_pict);
|
||||
|
||||
m_video_clock += frame_delay;
|
||||
|
||||
|
||||
@@ -180,6 +180,8 @@ void FFmpegDecoderVideo::decodeLoop()
|
||||
// Publish the frame if we have decoded a complete frame
|
||||
if (frame_finished)
|
||||
{
|
||||
#if LIBAVCODEC_VERSION_INT <= AV_VERSION_INT(57,24,102)
|
||||
//ffmpeg-3.0 and below
|
||||
AVRational timebase;
|
||||
// Find out the frame pts
|
||||
if (m_frame->pts != int64_t(AV_NOPTS_VALUE))
|
||||
@@ -207,7 +209,29 @@ void FFmpegDecoderVideo::decodeLoop()
|
||||
|
||||
pts *= av_q2d(timebase);
|
||||
|
||||
const double synched_pts = m_clocks.videoSynchClock(m_frame.get(), av_q2d(timebase), pts);
|
||||
#else
|
||||
//above ffmpeg-3.0
|
||||
// Find out the frame pts
|
||||
if (m_frame->pts != int64_t(AV_NOPTS_VALUE))
|
||||
{
|
||||
pts = av_q2d(m_stream->time_base) * m_frame->pts;
|
||||
}
|
||||
else if (packet.packet.dts == int64_t(AV_NOPTS_VALUE) &&
|
||||
m_frame->opaque != 0 &&
|
||||
*reinterpret_cast<const int64_t*>(m_frame->opaque) != int64_t(AV_NOPTS_VALUE))
|
||||
{
|
||||
pts = av_q2d(m_stream->time_base) * *reinterpret_cast<const int64_t*>(m_frame->opaque);
|
||||
}
|
||||
else if (packet.packet.dts != int64_t(AV_NOPTS_VALUE))
|
||||
{
|
||||
pts = av_q2d(m_stream->time_base) * packet.packet.dts;
|
||||
}
|
||||
else
|
||||
{
|
||||
pts = 0;
|
||||
}
|
||||
#endif
|
||||
const double synched_pts = m_clocks.videoSynchClock(m_frame.get(), av_q2d(av_inv_q(m_context->framerate)), pts);
|
||||
const double frame_delay = m_clocks.videoRefreshSchedule(synched_pts);
|
||||
|
||||
publishFrame(frame_delay, m_clocks.audioDisabled());
|
||||
|
||||
@@ -70,10 +70,12 @@ inline std::streampos STREAM_POS( const OSGA_Archive::pos_type pos )
|
||||
|
||||
inline OSGA_Archive::pos_type ARCHIVE_POS( const std::streampos & pos )
|
||||
{
|
||||
#if defined(_CPPLIB_VER)//newer Dinkumware(eg: one included with VC++ 2003,2005)
|
||||
fpos_t position = pos.seekpos();
|
||||
#if (defined(_CPPLIB_VER) && defined(_MSC_VER) && _MSC_VER > 1914) // VC++ 2017 version 15.8 or later
|
||||
fpos_t position = pos;
|
||||
#elif (defined(_CPPLIB_VER) && defined(_MSC_VER)) // Dinkumware (eg: one included with VC++ 2003, 2005...)
|
||||
fpos_t position = pos.seekpos();
|
||||
#else // older Dinkumware (eg: one included in Win Server 2003 Platform SDK )
|
||||
fpos_t position = pos.get_fpos_t();
|
||||
fpos_t position = pos.get_fpos_t();
|
||||
#endif
|
||||
std::streamoff offset = pos.operator std::streamoff( ) - _FPOSOFF( position );
|
||||
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
INCLUDE_DIRECTORIES( ${XINE_INCLUDE_DIR} )
|
||||
|
||||
SET(TARGET_SRC
|
||||
video_out_rgb.c
|
||||
ReaderWriterXine.cpp
|
||||
)
|
||||
|
||||
SET(TARGET_LIBRARIES_VARS XINE_LIBRARY )
|
||||
|
||||
IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-declarations")
|
||||
ENDIF()
|
||||
|
||||
|
||||
#### end var setup ###
|
||||
SETUP_PLUGIN(xine)
|
||||
@@ -1,367 +0,0 @@
|
||||
// (C) Robert Osfield, Feb 2004.
|
||||
// GPL'd.
|
||||
|
||||
#include <osg/ImageStream>
|
||||
#include <osg/Notify>
|
||||
#include <osg/Geode>
|
||||
#include <osg/GL>
|
||||
#include <osg/Timer>
|
||||
|
||||
#include <osgDB/Registry>
|
||||
#include <osgDB/FileNameUtils>
|
||||
#include <osgDB/FileUtils>
|
||||
|
||||
#include <xine.h>
|
||||
#include <xine/xineutils.h>
|
||||
#include <xine/video_out.h>
|
||||
|
||||
#include "video_out_rgb.h"
|
||||
|
||||
namespace osgXine
|
||||
{
|
||||
|
||||
class XineImageStream : public osg::ImageStream
|
||||
{
|
||||
public:
|
||||
XineImageStream():
|
||||
_xine(0),
|
||||
_vo(0),
|
||||
_ao(0),
|
||||
_visual(0),
|
||||
_stream(0),
|
||||
_event_queue(0),
|
||||
_ready(false),
|
||||
_volume(-1.0)
|
||||
{
|
||||
setOrigin(osg::Image::TOP_LEFT);
|
||||
}
|
||||
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy. */
|
||||
XineImageStream(const XineImageStream& image,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
|
||||
ImageStream(image,copyop) {}
|
||||
|
||||
META_Object(osgXine,XineImageStream);
|
||||
|
||||
void setVolume(float volume)
|
||||
{
|
||||
_volume = osg::minimum(osg::maximum(volume,0.0f),1.0f);
|
||||
if (_stream)
|
||||
{
|
||||
xine_set_param(_stream, XINE_PARAM_AUDIO_VOLUME, static_cast<int>(_volume*100.0f));
|
||||
OSG_NOTICE<<"Setting volume "<<_volume<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
float getVolume() const
|
||||
{
|
||||
return _volume;
|
||||
}
|
||||
|
||||
bool open(xine_t* xine, const std::string& filename)
|
||||
{
|
||||
if (filename==getFileName()) return true;
|
||||
|
||||
_xine = xine;
|
||||
|
||||
// create visual
|
||||
rgbout_visual_info_t* visual = new rgbout_visual_info_t;
|
||||
visual->levels = PXLEVEL_ALL;
|
||||
visual->format = PX_RGB32;
|
||||
visual->user_data = this;
|
||||
visual->callback = my_render_frame;
|
||||
|
||||
// set up video driver
|
||||
_vo = xine_open_video_driver(_xine, "rgb", XINE_VISUAL_TYPE_RGBOUT, (void*)visual);
|
||||
|
||||
// set up audio driver
|
||||
char* audio_driver = getenv("OSG_XINE_AUDIO_DRIVER");
|
||||
_ao = audio_driver ? xine_open_audio_driver(_xine, audio_driver, NULL) : xine_open_audio_driver(_xine, "auto", NULL);
|
||||
|
||||
if (!_vo)
|
||||
{
|
||||
OSG_NOTICE<<"XineImageStream::open() : Failed to create video driver"<<std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// set up stream
|
||||
_stream = xine_stream_new(_xine, _ao, _vo);
|
||||
|
||||
if (_stream)
|
||||
{
|
||||
if (_volume < 0.0)
|
||||
{
|
||||
_volume = static_cast<float>(xine_get_param(_stream, XINE_PARAM_AUDIO_VOLUME))/100.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
setVolume(_volume);
|
||||
}
|
||||
}
|
||||
|
||||
_event_queue = xine_event_new_queue(_stream);
|
||||
xine_event_create_listener_thread(_event_queue, event_listener, this);
|
||||
|
||||
int result = xine_open(_stream, filename.c_str());
|
||||
|
||||
if (result==0)
|
||||
{
|
||||
OSG_INFO<<"XineImageStream::open() : Could not ready movie file."<<std::endl;
|
||||
close();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
_ready = false;
|
||||
|
||||
int width = xine_get_stream_info(_stream,XINE_STREAM_INFO_VIDEO_WIDTH);
|
||||
int height = xine_get_stream_info(_stream,XINE_STREAM_INFO_VIDEO_HEIGHT);
|
||||
allocateImage(width,height,1,GL_RGB,GL_UNSIGNED_BYTE,1);
|
||||
|
||||
OSG_INFO<<"XineImageStream::open() size "<<width<<" "<<height<<std::endl;
|
||||
|
||||
// play();
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
virtual void play()
|
||||
{
|
||||
if (_status!=PLAYING && _stream)
|
||||
{
|
||||
if (_status==PAUSED)
|
||||
{
|
||||
xine_set_param (_stream, XINE_PARAM_SPEED, XINE_SPEED_NORMAL);
|
||||
_status=PLAYING;
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_INFO<<"XineImageStream::play()"<<std::endl;
|
||||
if (xine_play(_stream, 0, 0))
|
||||
{
|
||||
while (!_ready)
|
||||
{
|
||||
OSG_INFO<<" waiting..."<<std::endl;
|
||||
OpenThreads::Thread::microSleep(10000);
|
||||
}
|
||||
|
||||
_status=PLAYING;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_NOTICE<<"Error!!!"<<std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
virtual void pause()
|
||||
{
|
||||
if (_status==PAUSED || _status==INVALID) return;
|
||||
|
||||
_status=PAUSED;
|
||||
|
||||
if (_stream)
|
||||
{
|
||||
xine_set_param (_stream, XINE_PARAM_SPEED, XINE_SPEED_PAUSE);
|
||||
}
|
||||
}
|
||||
|
||||
virtual void rewind()
|
||||
{
|
||||
if (_status==INVALID) return;
|
||||
|
||||
_status=REWINDING;
|
||||
if (_stream)
|
||||
{
|
||||
OSG_INFO<<"Warning::XineImageStream::rewind() - rewind disabled at present."<<std::endl;
|
||||
//xine_trick_mode(_stream,XINE_TRICK_MODE_FAST_REWIND,0);
|
||||
}
|
||||
}
|
||||
|
||||
virtual void quit(bool /*waitForThreadToExit*/ = true)
|
||||
{
|
||||
close();
|
||||
}
|
||||
|
||||
static void my_render_frame(uint32_t width, uint32_t height, void* data, void* userData)
|
||||
{
|
||||
XineImageStream* imageStream = (XineImageStream*) userData;
|
||||
|
||||
GLenum pixelFormat = GL_BGRA;
|
||||
|
||||
imageStream->setImage(width,height,1,
|
||||
GL_RGB,
|
||||
pixelFormat,GL_UNSIGNED_BYTE,
|
||||
(unsigned char *)data,
|
||||
osg::Image::NO_DELETE,
|
||||
1);
|
||||
|
||||
imageStream->_ready = true;
|
||||
}
|
||||
|
||||
|
||||
xine_t* _xine;
|
||||
|
||||
xine_video_port_t* _vo;
|
||||
xine_audio_port_t* _ao;
|
||||
|
||||
rgbout_visual_info_t* _visual;
|
||||
xine_stream_t* _stream;
|
||||
xine_event_queue_t* _event_queue;
|
||||
bool _ready;
|
||||
float _volume;
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
virtual ~XineImageStream()
|
||||
{
|
||||
OSG_INFO<<"Killing XineImageStream"<<std::endl;
|
||||
close();
|
||||
OSG_INFO<<"Closed XineImageStream"<<std::endl;
|
||||
}
|
||||
|
||||
void close()
|
||||
{
|
||||
|
||||
OSG_INFO<<"XineImageStream::close()"<<std::endl;
|
||||
|
||||
if (_stream)
|
||||
{
|
||||
OSG_INFO<<" Closing stream"<<std::endl;
|
||||
|
||||
xine_close(_stream);
|
||||
|
||||
OSG_INFO<<" Disposing stream"<<std::endl;
|
||||
|
||||
xine_dispose(_stream);
|
||||
_stream = 0;
|
||||
}
|
||||
|
||||
|
||||
if (_event_queue)
|
||||
{
|
||||
_event_queue = 0;
|
||||
}
|
||||
|
||||
if (_ao)
|
||||
{
|
||||
OSG_INFO<<" Closing audio driver"<<std::endl;
|
||||
|
||||
xine_close_audio_driver(_xine, _ao);
|
||||
|
||||
_ao = 0;
|
||||
}
|
||||
|
||||
if (_vo)
|
||||
{
|
||||
OSG_INFO<<" Closing video driver"<<std::endl;
|
||||
|
||||
xine_close_video_driver(_xine, _vo);
|
||||
|
||||
_vo = 0;
|
||||
}
|
||||
|
||||
OSG_INFO<<"closed XineImageStream "<<std::endl;
|
||||
|
||||
}
|
||||
|
||||
|
||||
static void event_listener(void *user_data, const xine_event_t *event)
|
||||
{
|
||||
XineImageStream* xis = reinterpret_cast<XineImageStream*>(user_data);
|
||||
switch(event->type)
|
||||
{
|
||||
case XINE_EVENT_UI_PLAYBACK_FINISHED:
|
||||
if (xis->getLoopingMode()==LOOPING)
|
||||
{
|
||||
//rewind();
|
||||
xine_play(xis->_stream, 0, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
class ReaderWriterXine : public osgDB::ReaderWriter
|
||||
{
|
||||
public:
|
||||
|
||||
ReaderWriterXine()
|
||||
{
|
||||
supportsExtension("avi","");
|
||||
supportsExtension("db","");
|
||||
supportsExtension("ogv","");
|
||||
supportsExtension("flv","");
|
||||
supportsExtension("mov","");
|
||||
supportsExtension("m4v","");
|
||||
supportsExtension("mpg","Mpeg movie format");
|
||||
supportsExtension("mpv","Mpeg movie format");
|
||||
supportsExtension("wmv","");
|
||||
supportsExtension("xine","Xine plugin Pseduo plugin");
|
||||
|
||||
_xine = xine_new();
|
||||
|
||||
const char* user_home = xine_get_homedir();
|
||||
if(user_home)
|
||||
{
|
||||
std::string configFile(std::string(user_home)+"/.xine/config");
|
||||
xine_config_load(_xine, configFile.c_str());
|
||||
}
|
||||
|
||||
xine_init(_xine);
|
||||
|
||||
register_rgbout_plugin(_xine);
|
||||
}
|
||||
|
||||
virtual ~ReaderWriterXine()
|
||||
{
|
||||
OSG_INFO<<"~ReaderWriterXine()"<<std::endl;
|
||||
|
||||
if (_xine) xine_exit(_xine);
|
||||
_xine = NULL;
|
||||
}
|
||||
|
||||
virtual const char* className() const { return "Xine ImageStream Reader"; }
|
||||
|
||||
virtual ReadResult readImage(const std::string& file, const osgDB::ReaderWriter::Options* options) const
|
||||
{
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(file);
|
||||
if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
std::string fileName;
|
||||
if (ext=="xine")
|
||||
{
|
||||
fileName = osgDB::findDataFile( osgDB::getNameLessExtension(file), options);
|
||||
OSG_INFO<<"Xine stipped filename = "<<fileName<<std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
fileName = osgDB::findDataFile( file, options );
|
||||
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
|
||||
}
|
||||
|
||||
OSG_INFO<<"ReaderWriterXine::readImage "<< file<< std::endl;
|
||||
|
||||
osg::ref_ptr<osgXine::XineImageStream> imageStream = new osgXine::XineImageStream();
|
||||
|
||||
if (!imageStream->open(_xine, fileName)) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
return imageStream.release();
|
||||
}
|
||||
|
||||
protected:
|
||||
xine_t* _xine;
|
||||
|
||||
|
||||
};
|
||||
|
||||
// now register with Registry to instantiate the above
|
||||
// reader/writer.
|
||||
REGISTER_OSGPLUGIN(xine, ReaderWriterXine)
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,191 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2000-2003 the xine project and Claudio "KLaN" Ciccani
|
||||
*
|
||||
* This file is part of xine, a free video player.
|
||||
*
|
||||
* xine is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* xine is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*
|
||||
*
|
||||
* video_out_rgb.h, data types definitions for video_out_rgb.c
|
||||
* by Claudio "KLaN" Ciccani <klan82@cheapnet.it>
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef VIDEO_OUT_RGB_H
|
||||
#define VIDEO_OUT_RGB_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t *r;
|
||||
uint8_t *g;
|
||||
uint8_t *b;
|
||||
|
||||
} rgb_planar_t;
|
||||
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
/* PX_RGB_PLANAR = 1, ? */
|
||||
PX_ARGB = 2, /* 32 bits [a:8@24, r:8@26, g:8@8, b:8@0] */
|
||||
PX_ARGB1555 = 3, /* 16 bits [a:1@15, r:5@10, g:5@5, b:5@0] */
|
||||
PX_RGB32 = 4, /* 32 bits [r:8@16, g:8@8, b:8@0] */
|
||||
PX_RGB24 = 5, /* 24 bits [r:8@16, g:8@8, b:8@0] */
|
||||
PX_RGB16 = 6, /* 16 bits [r:5@11, g:6@5, b:5@0] */
|
||||
PX_BGRA = 7, /* 32 bits [a:8@0, r:8@8, g:8@16, b:8@24] */
|
||||
PX_BGRA5551 = 8, /* 16 bits [a:1@0, r:5@1, g:5@6, b:5@11] */
|
||||
PX_BGR32 = 9, /* 32 bits [r:8@0, g:8@8, b:8@16] */
|
||||
PX_BGR24 = 10, /* 24 bits [r:8@0, g:8@8, b:8@16] */
|
||||
PX_BGR16 = 11 /* 16 bits [r:5@0, g:6@5, b:5@11] */
|
||||
|
||||
} rgb_pixel_format_t;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
PXLEVEL_NONE = 0,
|
||||
PXLEVEL_R = (1 << 0),
|
||||
PXLEVEL_G = (1 << 1),
|
||||
PXLEVEL_B = (1 << 2),
|
||||
PXLEVEL_ALL = 7 /* PX_LEVEL_R | PX_LEVEL_G | PX_LEVEL_B */
|
||||
|
||||
} rgb_pixel_levels_t;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Applications that want to use this driver must provide a
|
||||
* callabck function (eg. for rendering frames);
|
||||
* RGBout will pass it a buffer containing pixels in the format
|
||||
* specified by "format" (generally you have only to BLIT
|
||||
* the buffer if you want to display the frame).
|
||||
* "levels" selects which RGB level is visible (if you don't
|
||||
* need this feature, set it to PXLEVEL_ALL).
|
||||
*
|
||||
* N.B.: DO NOT FREE THE BUFFER
|
||||
*
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
rgb_pixel_format_t format;
|
||||
rgb_pixel_levels_t levels;
|
||||
void* user_data;
|
||||
void (*callback) (uint32_t width, uint32_t height, void* imageData, void* userData);
|
||||
|
||||
} rgbout_visual_info_t;
|
||||
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
vo_frame_t vo_frame;
|
||||
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
uint32_t pixels;
|
||||
uint32_t format;
|
||||
double ratio;
|
||||
|
||||
void* chunk[3];
|
||||
|
||||
} rgbout_frame_t;
|
||||
|
||||
|
||||
|
||||
typedef struct rgb_driver_s
|
||||
{
|
||||
vo_driver_t vo_driver;
|
||||
|
||||
config_values_t* config;
|
||||
|
||||
rgbout_frame_t* frame;
|
||||
|
||||
uint32_t frame_width;
|
||||
uint32_t frame_height;
|
||||
uint32_t lastframe_width;
|
||||
uint32_t lastframe_height;
|
||||
|
||||
rgb_planar_t buffer;
|
||||
void* outbuffer;
|
||||
|
||||
uint32_t accel;
|
||||
uint8_t cm, pm; /* conversion method, packing method */
|
||||
|
||||
uint8_t levels; /* RGB levels mask */
|
||||
void* user_data;
|
||||
|
||||
/* private functions */
|
||||
void (*convert) (uint8_t* yuv[], rgb_planar_t* rgb,
|
||||
uint32_t pitches[], uint32_t width, uint32_t height);
|
||||
void (*pack) (rgb_planar_t* rgb, void* dest, uint32_t pixels, uint32_t accel);
|
||||
void (*render) (uint32_t width, uint32_t height, void* data, void* userData);
|
||||
|
||||
/* public callback */
|
||||
int (*update_visual) (vo_driver_t* vo_driver,
|
||||
rgbout_visual_info_t* new_visual);
|
||||
|
||||
} rgbout_driver_t;
|
||||
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
video_driver_class_t driver_class;
|
||||
|
||||
} rgbout_class_t;
|
||||
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const char* name;
|
||||
uint32_t required_accel;
|
||||
|
||||
void (*convert_yuy2) (uint8_t* yuv[], rgb_planar_t* rgb,
|
||||
uint32_t pitches[], uint32_t width, uint32_t height);
|
||||
void (*convert_yv12) (uint8_t* yuv[], rgb_planar_t* rgb,
|
||||
uint32_t pitches[], uint32_t width, uint32_t height);
|
||||
|
||||
} rgbout_converter_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const char* name;
|
||||
rgb_pixel_format_t id;
|
||||
uint8_t pixelsize;
|
||||
uint8_t scratch;
|
||||
|
||||
void (*pack) (rgb_planar_t* rgb, void* dest, uint32_t pixels, uint32_t accel);
|
||||
|
||||
} rgbout_packer_t;
|
||||
|
||||
void register_rgbout_plugin(xine_t *self);
|
||||
|
||||
#define XINE_VISUAL_TYPE_RGBOUT 100
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* VIDEO_OUT_RGB_H */
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2018 Robert Osfield
|
||||
*
|
||||
* This software is open source and may be redistributed and/or modified under
|
||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
||||
* The full license is in LICENSE.txt file included with this distribution,.
|
||||
* 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 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* include LICENSE.txt for more details.
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#include <osgPresentation/AnimationMaterial>
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2018 Robert Osfield
|
||||
*
|
||||
* This software is open source and may be redistributed and/or modified under
|
||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
||||
* The full license is in LICENSE.txt file included with this distribution,.
|
||||
* 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 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* include LICENSE.txt for more details.
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#include <osgPresentation/CompileSlideCallback>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2018 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
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2018 Robert Osfield
|
||||
*
|
||||
* This software is open source and may be redistributed and/or modified under
|
||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
||||
* The full license is in LICENSE.txt file included with this distribution,.
|
||||
* 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 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* include LICENSE.txt for more details.
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#include <osgPresentation/KeyEventHandler>
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2018 Robert Osfield
|
||||
*
|
||||
* This software is open source and may be redistributed and/or modified under
|
||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
||||
* The full license is in LICENSE.txt file included with this distribution,.
|
||||
* 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 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* include LICENSE.txt for more details.
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#include <osgPresentation/PickEventHandler>
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2018 Robert Osfield
|
||||
*
|
||||
* This software is open source and may be redistributed and/or modified under
|
||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
||||
* The full license is in LICENSE.txt file included with this distribution,.
|
||||
* 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 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* include LICENSE.txt for more details.
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#include <osgPresentation/PropertyManager>
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2018 Robert Osfield
|
||||
*
|
||||
* This software is open source and may be redistributed and/or modified under
|
||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
||||
* The full license is in LICENSE.txt file included with this distribution,.
|
||||
* 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 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
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* include LICENSE.txt for more details.
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#include <osgPresentation/SlideEventHandler>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2018 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
|
||||
|
||||
@@ -252,96 +252,16 @@ void CullVisitor::popProjectionMatrix()
|
||||
CullStack::popProjectionMatrix();
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
bool CullVisitor::clampProjectionMatrixImplementation(osg::Matrixf& projection, double& znear, double& zfar) const
|
||||
{
|
||||
return _clampProjectionMatrix( projection, znear, zfar, _nearFarRatio );
|
||||
return osg::clampProjectionMatrix( projection, znear, zfar, _nearFarRatio );
|
||||
}
|
||||
|
||||
bool CullVisitor::clampProjectionMatrixImplementation(osg::Matrixd& projection, double& znear, double& zfar) const
|
||||
{
|
||||
return _clampProjectionMatrix( projection, znear, zfar, _nearFarRatio );
|
||||
return osg::clampProjectionMatrix( projection, znear, zfar, _nearFarRatio );
|
||||
}
|
||||
|
||||
template<typename Comparator>
|
||||
@@ -515,7 +435,8 @@ struct ComputeNearFarFunctor
|
||||
|
||||
n1 = distance(p1.second,_matrix);
|
||||
n2 = distance(p2.second,_matrix);
|
||||
_znear = _comparator.minimum(n1, n2);
|
||||
_znear = _comparator.minimum(_znear, n1);
|
||||
_znear = _comparator.minimum(_znear, n2);
|
||||
//OSG_NOTICE<<"Near plane updated "<<_znear<<std::endl;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ using namespace osgUtil;
|
||||
namespace LineSegmentIntersectorUtils
|
||||
{
|
||||
|
||||
struct Settings : public osg::Referenced
|
||||
struct Settings
|
||||
{
|
||||
Settings() :
|
||||
_lineSegIntersector(0),
|
||||
@@ -46,7 +46,7 @@ struct Settings : public osg::Referenced
|
||||
template<typename Vec3, typename value_type>
|
||||
struct IntersectFunctor
|
||||
{
|
||||
osg::ref_ptr<Settings> _settings;
|
||||
Settings* _settings;
|
||||
|
||||
unsigned int _primitiveIndex;
|
||||
Vec3 _start;
|
||||
@@ -518,16 +518,16 @@ void LineSegmentIntersector::intersect(osgUtil::IntersectionVisitor& iv, osg::Dr
|
||||
{
|
||||
if (reachedLimit()) return;
|
||||
|
||||
osg::ref_ptr<LineSegmentIntersectorUtils::Settings> settings = new LineSegmentIntersectorUtils::Settings;
|
||||
settings->_lineSegIntersector = this;
|
||||
settings->_iv = &iv;
|
||||
settings->_drawable = drawable;
|
||||
settings->_limitOneIntersection = (_intersectionLimit == LIMIT_ONE_PER_DRAWABLE || _intersectionLimit == LIMIT_ONE);
|
||||
LineSegmentIntersectorUtils::Settings settings;
|
||||
settings._lineSegIntersector = this;
|
||||
settings._iv = &iv;
|
||||
settings._drawable = drawable;
|
||||
settings._limitOneIntersection = (_intersectionLimit == LIMIT_ONE_PER_DRAWABLE || _intersectionLimit == LIMIT_ONE);
|
||||
|
||||
osg::Geometry* geometry = drawable->asGeometry();
|
||||
if (geometry)
|
||||
{
|
||||
settings->_vertices = dynamic_cast<osg::Vec3Array*>(geometry->getVertexArray());
|
||||
settings._vertices = dynamic_cast<osg::Vec3Array*>(geometry->getVertexArray());
|
||||
}
|
||||
|
||||
osg::KdTree* kdTree = iv.getUseKdTreeWhenAvailable() ? dynamic_cast<osg::KdTree*>(drawable->getShape()) : 0;
|
||||
@@ -535,7 +535,7 @@ void LineSegmentIntersector::intersect(osgUtil::IntersectionVisitor& iv, osg::Dr
|
||||
if (getPrecisionHint()==USE_DOUBLE_CALCULATIONS)
|
||||
{
|
||||
osg::TemplatePrimitiveFunctor<LineSegmentIntersectorUtils::IntersectFunctor<osg::Vec3d, double> > intersector;
|
||||
intersector.set(s,e, settings.get());
|
||||
intersector.set(s,e, &settings);
|
||||
|
||||
if (kdTree) kdTree->intersect(intersector, kdTree->getNode(0));
|
||||
else drawable->accept(intersector);
|
||||
@@ -543,7 +543,7 @@ void LineSegmentIntersector::intersect(osgUtil::IntersectionVisitor& iv, osg::Dr
|
||||
else
|
||||
{
|
||||
osg::TemplatePrimitiveFunctor<LineSegmentIntersectorUtils::IntersectFunctor<osg::Vec3f, float> > intersector;
|
||||
intersector.set(s,e, settings.get());
|
||||
intersector.set(s,e, &settings);
|
||||
|
||||
if (kdTree) kdTree->intersect(intersector, kdTree->getNode(0));
|
||||
else drawable->accept(intersector);
|
||||
|
||||
Reference in New Issue
Block a user