Commit Graph

2918 Commits

Author SHA1 Message Date
Robert Osfield
a50f0ccfaf Introduce new run frame rate management support to allow control of maximum frame rate and to support on demand rendering of frames 2009-04-24 16:20:50 +00:00
Robert Osfield
7b16ff5ae1 From Mathias Froehlich, Changed osg::TextureRectangle to use osg::Texutre::applyTexParameters() to take advantage of texture shadow extension settings for texture rectangle 2009-04-24 09:07:22 +00:00
Robert Osfield
c3e9f27f35 Updated version numbers in prep for 2.9.4 dev release 2009-04-22 16:33:24 +00:00
Robert Osfield
777b00353a From Mathias Froehlich, "attached is a change to TexGenNode rev 10060 that removes a private member
variable that is only initialized and copied by never used seriously.
"
2009-04-22 13:07:02 +00:00
Robert Osfield
616a96343c From Neil Hughes, "Please find attached two files that I've amended to add the IDC_HAND cursor for the windows platform." 2009-04-22 11:20:19 +00:00
Robert Osfield
b6182a1239 From Peter Amstutz, "Here is a simple change to osgViewer::GraphicsWindowWin32 to add a flag to WindowData to specify that the graphics window should not install an event handler of its own, per this discussion thread:
http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg23734.html

The change is source compatible with current osg code and will not affect current users, it simply adds an additional parameter to the GraphicsWindowWin32::WindowData struct constructor and defaults to the current behavior.

Attached are the files "include/osgViewer/api/Win32/GraphicsWindowWin32" and "src/osgViewer/GraphicsWindowWin32.cpp" with my changes, based on svn revision 10045.  In addition, I have provided an svn patch file with the same changes for your convenience.

I have discussed the matter with my supervisor, and agreed that my company makes no copyright claim over this extremely trivial change (or to put it another way, we assign copyright to the open scene graph community.)"
2009-04-22 11:12:03 +00:00
Robert Osfield
9407def083 Changed parameter for T* to const T*. 2009-04-22 10:46:12 +00:00
Robert Osfield
a551c4864d From Neil Hughes, "please find attached a new version of the ReaderWriter header file. This has additional functions to mimic the setPluginData functions for string data." 2009-04-21 11:48:08 +00:00
Robert Osfield
655f7df28e From Chris Hanson, "Fixed case of morphTarget argument in Doxygen comments." 2009-04-21 10:46:45 +00:00
Cedric Pinson
bc39983030 From Cedric Pinson, remove unsused method in Bone class\nadd namespace osgAnimation for Timeline constructors\nadd OSGANIMATION_EXPORT on VertexInfluence and Timeline class 2009-04-10 15:30:02 +00:00
Robert Osfield
c949789ac7 Updated version info for 2.9.3 dev release, fixed typo and updated wrappers 2009-04-10 11:00:54 +00:00
Robert Osfield
57f6f9f6df Added typedef and updated wrappers 2009-04-10 10:07:13 +00:00
Robert Osfield
c7b981f0d6 From Romain Charbit, "added a getConnectedSelections(Dragger&) method, so we can get which selections are connected to a dragger without make our own multimap, copying the existing _draggerSelectionMap (which is protected with no accessors) ." 2009-04-10 09:56:04 +00:00
Robert Osfield
4f72be65dc From Cory Riddell, "I added an _allowThrow bool and get / set accessors to
TrackballManipulator. The purpose of this is to disable throwing when
you release the mouse button while moving the mouse. The default
settings is true (ie, allow throw). The two source files are attached.
"
2009-04-09 14:31:15 +00:00
Robert Osfield
38b02a26a9 From Glenn Waldron, "Here is a first cut at the mime-type support we discussed a little while ago
(http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg23098.html)

Background: when you access a file over HTTP, you cannot rely on a file extension being present; instead the file's mime-type is conveyed in the HTTP Content-Type response header. This facility adds a mime-type-to-extension map to the registry to handle this.

There are two new osgDB::Registry functions which are pretty self-explanatory:

void addMimeTypeExtensionMapping( mime-type, extension )
ReaderWriter* getReaderWriterForMimeType( mime-type )

I also added the file osgDB/MimeTypes.cpp which houses a hard-coded list of built-in types. I took the list from here (http://www.webmaster-toolkit.com/mime-types.shtml) and then pared it down to include mostly image and video types, editing them to map to existing plugins where possible.

In addition, I updated the CURL plugin to a) install a set of built-in mime-type mappings, and b) use them to look up an extension in the event that the target filename does not have an extension.

Here is a test case. This URL pulls down a JPEG (without a file extension):
osgviewer --image "http://us.maps3.yimg.com/aerial.maps.yimg.com/ximg?v=1.8&s=256&t=a&r=1&x=0&y=0&z=2"
"
2009-04-09 14:00:16 +00:00
Robert Osfield
306ebea772 From James Killian, "refactored the management of the object cache enabling/disabling" 2009-04-08 14:06:29 +00:00
Cedric Pinson
4738d8ea24 From Serge Lages, Elastic added to EaseMotion 2009-04-07 08:40:49 +00:00
Robert Osfield
20ad246896 Added new virtual reseveElements, setElement, getElment and addElement methods to DrawElements
to make is easier to write code that can work on DrawElementUByte, UShort or UInt.

Changed the osgTerrain::GeometryTechnique so that it automatically chooses 
the use of DrawElementUShort or DrawElementsUInt accordining to the size of the tile.
2009-03-25 11:17:21 +00:00
Robert Osfield
988c69bba3 From Csaba Halasz, "here is another division by zero fix, this should be simpler ;)
It caused problem if the stats display was popped up before the pager
had anything to do."
2009-03-23 15:47:01 +00:00
Robert Osfield
00ee3b0a20 Cleaned up interface 2009-03-23 15:38:30 +00:00
Robert Osfield
38ee2f924d Bumped version numbers in prep for 2.7.2 dev release 2009-03-23 15:21:31 +00:00
Robert Osfield
1fd5eefbcf From Maciej Krol, "As promised to Roland I assembled simple shader generator. ShaderGenVisitor converts accumulated fixed function pipeline state sets to ones with shader programs. Generated state sets are attached to geometries and stored in ShaderGenCache for reuse.
Very simple cases of state configuration are supported (all the ones I really need):
- single per pixel not attenuated non spot light source ON/OFF
- exp2 fog ON/OFF
- diffuse texture in rgb + optional specular gloss in alpha (Texture unit 0) ON/OFF
- normal map texture (Texture unit 1 and Tangent in VertexAttribArray 6) ON/OFF
- blending and alpha testing (not in shader pipeline)

To view fixed function pipeline files and paged databases simply run >osgshadergen myfile.osg"
2009-03-23 11:53:06 +00:00
Robert Osfield
e60db47c1b Inroduced simple PrintVisitor class for helping debug scene graph structures 2009-03-19 11:11:51 +00:00
Robert Osfield
7b5f3ec92a Moved IncrementalCompileOperation out of include-src/osgUtil/GLObjectVisitor into their own files.
Added support to IncrementCompileOperation for controlling how much time is alloted to compilation and flush
2009-03-12 15:21:04 +00:00
Robert Osfield
c3fc21fa82 Added support for tracking the time since the last clear() call to enable other
classes to be able to find out how long the current graphics frame has been running.
2009-03-12 15:18:51 +00:00
Robert Osfield
5a537261a6 From Michael Platings, "I've been looking at the discussion from 2006 ("[osg-users] osgDB/Reentrant Mutex not threadsafe ?") about this, and having looked closely at OpenThreads::ReentrantMutex it's still not thread safe in the following situation:
In my example case, there are 2 threads - one is a worker thread created by OpenThreads::Thread. The other thread is the main thread i.e. the thread that is intrinsically created when you execute the application. The crucial problem is that for the main thread, OpenThreads::Thread::CurrentThread() will return null.
 
I'll demonstrate this by breaking ReentrantMutex::lock() into sub-statements:
 
1.) if (_threadHoldingMutex==OpenThreads::Thread::CurrentThread())
 
2.) if (_lockCount>0){
 
3.)
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_lockCountMutex);
++_lockCount;
return 0;
 
4.)
int result = Mutex::lock();
if (result==0)
{
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_lockCountMutex);
 
5.)
_threadHoldingMutex = OpenThreads::Thread::CurrentThread();
_lockCount = 1;
return result;
 
 
An error will occur in the following case:
1) The worker thread calls lock(), it gets to the start of statement 5.
2) The main thread calls lock(). Statement 1 is evaluated as true as _threadHoldingMutex is null, and OpenThreads::Thread::CurrentThread() returns null.
3) The worker thread executes statement 5.
4) The main thread executes statement 2 and evaluates it as true, because the worker thread has set _lockCount to 1. The main thread executes statement 3, and now can access the mutexed-data at the same time as the worker thread!
 
The simple solution to this is to always protect access to _lockCount and _threadHoldingMutex using _lockCountMutex. I have done this in the file I am submitting."
2009-03-12 10:12:42 +00:00
Robert Osfield
73cffacf09 Added docs on getPixelAspectRatio and corrected usage of getPixelAspection in osgmovie.cpp 2009-03-11 17:57:33 +00:00
Robert Osfield
b6bffdd02f From Tanguy Fautre,
Clean up of the FFmpeg plugin's class API/AudioStream API. 
Implementation of isImageTransparent().
Implementation of Image:g/setPixelAspectRatio()
2009-03-11 15:12:46 +00:00
Robert Osfield
998cfec137 Added View::removeEventHandler(..) method and added check into addEventHandler() to prevent handlers being added twice. 2009-03-11 14:18:30 +00:00
Robert Osfield
ec63cfd930 From Mathias Froehlich, "small addition to osg::Texture to include all possible depth test variants for
the shadow depth comparison."
2009-03-11 13:08:12 +00:00
Robert Osfield
771f3a3238 From Stephan Huber, files were are missed by Robert in check in of changes to GraphicsWindowCarbon.cpp 2009-03-11 12:55:20 +00:00
Robert Osfield
31608b2559 From David Callu, "osgManipulator Object have not META_Object macro call in class definition.
> I add META_OSGMANIPULATOR_Object macro which define className, libraryName,
> isSameKindAs methods.
> Clone method is not appropriate for osgManipulator Object."
2009-03-11 11:29:00 +00:00
Robert Osfield
06ef559d91 From Martin Beckett, added get/setScrollWheelZoomDelta() support for controlling the mouse scroll wheel zoom delta. 2009-03-11 10:50:03 +00:00
Robert Osfield
a0a06c8b2a Completed support for automatic detection of plugin features.
Cleaned up debug out of various plugins to ensure a clean osgconv --formats.
2009-03-10 17:27:39 +00:00
Robert Osfield
c0863e96ca Made bool isImageTranslucent() const virtual to allow subclasses to provide their own implementation 2009-03-10 16:52:18 +00:00
Robert Osfield
287ff37b34 From Ralf Habacker, "The appended patch fixes this issue by adding a virtual method named supportedFeatures() to the class ReaderWriter, which could be overriden by a specific plugin to adjust the set of features.
Single features are implemented as bits asother enums in ReaderWriter class already does, so that combinations are possible and fast comparison operations are possible

By default all features are enabled.

I have added this virtual method to the dot plugin to get an idea how to use these features.

With this patch osgconv --formats shows an additional line 'features' for each plugin"
2009-03-10 15:00:39 +00:00
Robert Osfield
0669107287 From Roland Smeenk, "While working on the Collada plugin I noticed that all geometry created by the dae reader result in slow path geometry.
Because there already exists the option to convert slow path geometry to the fast path by computing an internal fast path alternative, I added a new optimizer option that automatically does this. To check the results I also made some changes to the statistics gathering and rendering.

Somewhat unrelated, but also part of the optimizer I disabled removal of CameraView nodes during RemoveRedundantNodes optimization.
As discussed on the ML, CameraViews were removed from the scenegraph. This solves that issue.

Summary:
-Geometry::areFastPathsUsed now also looks at internalOptimizedGeometry
-Added Optimize option to make all slow path geometry compute their internal fast path alternative
-Added fast geometry counter to the statistics
-Disabled removel of CameraViews in optimizer
"
2009-03-10 14:15:59 +00:00
Robert Osfield
b5a15fb5b4 From Stephan Huber,
"Attached you'll find a proposal for using different
protocols. The idea behind the new code is:

1.) plugins/apps register protocols which they can handle. This is done
via osgDB::Registry::registerProtocol(aProtocolName). Plugins register
supported protocols as usual via ReaderWriter::supportsProtocol(..), the
Registry is updated accordingly.

2.) osgDB::containsServerAddress checks first for an appearance of "://"
in the filename and then checks the protocol against the set of
registered protocols via Registry::isProtocolRegistered(aProtocollName)

3.) the other getServer*-functions changed as well, there's even a
getServerProtocol-function


With these changes filenames/Urls get routed to loaded plugins even with
different protocols than 'http'."
2009-03-10 12:21:13 +00:00
Robert Osfield
199067d150 From Martin Spott, compile fixes for IBM AIX. 2009-03-10 11:14:56 +00:00
Robert Osfield
9643c15346 From David Callu, "Problem:
osgText::Text and osgText::Text3D use the same font file.
     The first really load the file and obtain an osgText::Font object,
     the second use the cache created during the first load of the
     font file, and so obtain an osgText::Font object instead of
     osgText::Font3D object. To obtain an osgText::Font3D object,
     osgText::Text3D call osgDB::readObjectFile(...) with an option
     to specify the plugin we want an osgText::Font3D instead of
     osgText::Font.

Generalised Problem:
    In osgDB::Registry, loaded file cache is referenced by the name
    of this file, so if I load a file with some options, and the cache
    already contain object for this filename, I obtain an object
    potentially not loaded with my options.

Behaviours:
    Cache management is delegate to osgDB::Registry, but cache
    coherence (load a file with option then reuse it, deactivate the
    cache when load a specific file or don't cached the loaded file)
    is user's responsibility.

Text3D solution:
    Postfix the font file name by .text3d or something similar and then have the freetype plugin return
    osgText::Font3D when it detects this.
    This operation is done by osgText::readFont3DFile() which unsure the filename have .text3d as extension.
    This is totaly transparent for user, and backward compatible.


BTW, I fix the bug about the Normal of 3D text. Currently, the front and wall face have
the same normal (0,0,1) in the Text3D object coordinate. Now the wall face have its own
normal array computed by the plugin.

BTW 2, I implement
- void Text3D::accept(osg::Drawable::ConstAttributeFunctor& af) const
- void Text3D::accept(osg::PrimitiveFunctor& pf) const
so now statistics are well reported.
"
2009-03-10 10:56:00 +00:00
Robert Osfield
5059aa808b From Stephan Huber, support for Cocoa windowing under OSX. 2009-03-10 10:13:20 +00:00
Robert Osfield
22c7ff353b Fixed osgWrappers for osgAnimation library 2009-03-09 23:11:23 +00:00
Robert Osfield
ae50d8d956 From Roland Smeenk & Cedric Pinson,
"Summary of changes:
From Roland
-Added MorphGeometry
-Bone Bindmatrix is only calculated if needed
-osgAnimation plugin now supports all available channel types (before only linear vec3 or quat channels)
-osgAnimation plugin now supports MorphGeometry
-osgAnimation plugin now supports animation and channel weights, animation playmode, duration and starttime
-removed osgAnimationManager.cpp from CMakeList

From Cedric
-fixed the last_update field (it was only updated at the first update) in BasicAnimationManager.cpp
- Refactore some part of MorphGeometry minor changes
- Add osganimationmorph as example
"
2009-03-09 17:38:39 +00:00
Robert Osfield
99477fa422 Tweaked API to get wrappers to build 2009-03-09 16:53:57 +00:00
Robert Osfield
173357252b Further work on IncrementalCompileOperation 2009-03-09 14:56:20 +00:00
Robert Osfield
7473b06275 Preliminary work on general purpose incremental compile support in osgViewer. 2009-03-08 12:00:36 +00:00
Robert Osfield
43a081ee98 Updated wrappers and dev release version numbers 2009-03-05 15:31:03 +00:00
Robert Osfield
d2099da5cb Fixed indentation 2009-03-04 16:15:05 +00:00
Robert Osfield
e035decd95 Introduce FFmpegAudioStream implementation 2009-03-03 16:51:01 +00:00
Robert Osfield
4ebd316130 Introduced osg::AudioStream class to help manage audio streams coming in from movie reading plugins 2009-02-27 20:16:08 +00:00