Commit Graph

3380 Commits

Author SHA1 Message Date
Robert Osfield
26a9e499a4 Fixed crash 2010-02-16 14:05:49 +00:00
Robert Osfield
a8e26f3a0c Threads safety fixes based on suggestions from Tim Moore. 2010-02-16 11:10:49 +00:00
Cedric Pinson
63064c64cb From Jeremy Moles, add new EaseMotion and add example osganimationeasemotion to demonstrate them 2010-02-15 23:47:12 +00:00
Robert Osfield
ff38da1290 Refactor various NodeTracker and MatrixManipulator classes to use the osg::ObserverNodePath and osg::oberserver_ptr<> classes 2010-02-15 20:15:32 +00:00
Robert Osfield
4a567d9954 Introduced new osg::ObserverNodePath class that robustly manages a NodePath in a thread safe manner,
making it easier for users to track a NodePath even when nodes in the path get deleted.
2010-02-15 20:14:32 +00:00
Robert Osfield
644b2e15d1 Refactored the osg::Observer to introduce a new bool Observer::objectUnreferenced(void*) method that adds
the extra capability of making it possible for Observers to assume ownership of a object that would otherwsie be deleted.

Added a thread safe ref_ptr<T> observer_ptr<T>::lock() method for robust access to an observed object.  This
makes observer_ptr<> more equivilant to boosts weak_ptr.
2010-02-15 20:12:53 +00:00
Robert Osfield
d6179e7eb5 Added osg:: qualifyer to OSG_NOTIFY macro 2010-02-15 11:36:05 +00:00
Robert Osfield
a673abac3d Introduced OSG_WARN, OSG_NOTICE, OSG_INFO, OSG_DEBUG convinience macros that map to OSG_NOTIFY(osg::WARN) etc.
Introduced the OSG_NOTIFY_DISABLE Cmake variable + include/osg/Config #define to control whether the OpenSceneGraph build
should disable the notification system completely.  By setting OSG_NOTIFY_DISABLE to ON in CMake and then rebuilding the
the OSG you can get a slightly smaller (~1%) and more slightly efficient library which can be good for shipping applications,
but with downside of reduced ability to detect runtime problems and their causes.
2010-02-12 11:45:00 +00:00
Robert Osfield
5b1ca779e4 Added OutputStream::writeSize and InputStream::readSize methods to help out with ensure that 32bit and 64bit builds all
use the same 32bit type for sizes.
2010-02-10 17:03:09 +00:00
Robert Osfield
f3ee7fa6ba Fixed automatic loading of plugins 2010-02-10 16:23:27 +00:00
Robert Osfield
c5d0ff600b Fixed typo 2010-02-10 12:48:21 +00:00
Robert Osfield
f17e401347 Convert NOTIFY to OSG_NOTIFY to avoid problems with polution of users apps with the NOTIFY macro 2010-02-10 12:44:59 +00:00
Robert Osfield
6ab51c7c47 Added pruning of requests that haven't been reissued since the last frame. 2010-02-10 11:21:45 +00:00
Robert Osfield
5792bc6d99 Introduced NOTIFY macro to help out with avoiding using of streams with notification level is below the user defined cutoff. This addition has been introduced to help out with avoid threading performance issues with the Microsoft ostream implementation. 2010-02-09 17:39:43 +00:00
Robert Osfield
be46c61eb1 Added extra elaspedTime_*() methods to help with reporting times in milliseconds etc. 2010-02-09 17:38:02 +00:00
Robert Osfield
7103707815 From Wang Rui, "I also did a small fix to the ObjectWrapper header, to add a
OSGDB_EXPORT macro to RegisterCompressorProxy, and modified the
findCompressor() method to look for custom compressors in libraries
such like osgdb_compressor_name.so, which was described in the wiki
page chapter 2.4."
2010-02-04 10:20:17 +00:00
Robert Osfield
f3575e6a40 Added #defines for GL3 build 2010-02-03 09:35:05 +00:00
Robert Osfield
380fb17fa9 Build fixes for build without ref_ptr<> automatic type conversion 2010-01-31 18:24:01 +00:00
Robert Osfield
874296cbb3 Changed GeometryTechnique::private to protected, updated wrappers 2010-01-29 17:20:58 +00:00
Robert Osfield
2af633352b Fom Sukender, "Added copyFile() and comments in FileUtils."
From Robert Osfield, build fix for linux/gcc and reformating to keep coding style consistent with rest of OSG
2010-01-28 10:45:40 +00:00
Robert Osfield
0a9263d50e From Wang Rui, "Changes:
1. Rewrite the reading/writing exception handlers to work like the ive
plugin exceptions.
2. Write a header writing/checking function in ReaderWriterOSG2.cpp,
which may help decide if the stream is ascii or binary. The
readInputIterator() function will return null pointer if the input
file is nither osgb nor osgt format, which indicates that the old .osg
format could be used here, in case we've merged the two plugins
together.
3. Add a new ForceReadingImage option in the InputStream, which will
allocate an empty image object with the filename if specifed external
image file is missed. It may be useful for format converting in some
cases.
4. Add new osgParticle wrappers, as well as some modification to the
osgParticle headers, for instance, change isEnabled() to getEnabled().
5. Some fixes to the osg serialization wrappers."
2010-01-27 17:09:05 +00:00
Robert Osfield
00c17c6cff From Trajce Nikolov, improvements to osgWidget::Input including selection support 2010-01-27 16:31:34 +00:00
Cedric Pinson
d730a6bdb5 From Cedric Pinson, remove unused file, fix crash for old files 2010-01-27 15:37:45 +00:00
Robert Osfield
db4d58b01d From Cedric Pinson, "Here a list of changes:
Bone now inherit from MatrixTransform. It simplify a lot the update of
Bone matrix. It helps to have the bone system more generic. eg it's now
possible to have animation data with precomputed bind matrix. The other
benefit, is now the collada plugin will be able to use osgAnimation to
display skinned mesh. Michael Plating did a great work to improve this
aspect, he is working on the collada plugin and should be able to submit
a new version soon.
The RigGeometry has been refactored so now it works when you save and
reload RigGeometry because the source is not touched anymore. The
benefit with this update is that it should be now possible to use a
MorphGeometry as source for a RigGeometry.

The bad news is that the format has changed, so i have rebuild osg-data
related to osgAnimation data, updated the blender exporter to export to
the new format.
The fbx plugin could be touched about this commit, i dont compile it so
i can't give more information about it.
The bvh plugin has been updated by Wang rui so this one is fixed with
the new code of osgAnimation.
The examples has been updated to work with the new code too...

The example osg-data/example.osg should be remove, it's an old example
that does not work.

For people using blender the blender exporter up to date is here:
http://hg.plopbyte.net/osgexport2/
it will be merge to http://hg.plopbyte.net/osgexport/ as soon as the
modification will be push in the trunk.
"
2010-01-27 12:24:55 +00:00
Robert Osfield
bad5a4d43a From Trajce Nikolov, various improvements of the workings of osgWidget::Input. 2010-01-26 16:59:17 +00:00
Robert Osfield
921d8b5a02 From Juan Hernando, fixed typo in handling of RGBA and BGRA data 2010-01-26 16:50:26 +00:00
Robert Osfield
6a30b04dd9 From Tony Horrobin, "This fix just makes a couple of calls to ref_ptr<>::get() to satisfy the compiler.
The changes make the build successful under Windows 7/VC2005 and Ubuntu 9.10 with OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION set to OFF.
"
2010-01-26 16:30:48 +00:00
Robert Osfield
56b384d880 From Jan Peciva, "I am sending one more improvement (separately from Inventor plugin).
I found very useful to have a control whether osgView::setCameraManipulator does or does not reset camera to home position.

I extended method signature as follows:
void setCameraManipulator(osgGA::MatrixManipulator* manipulator, bool resetPosition = true);

keeping the current usage intact (default parameter), while enabling user to disable the position reset. That can be useful in the situation when manipulator position was already loaded, for example from a file (user specification), or defined any other way, while we do not want to be reset to home position. Other usability is usage of two manipulators in a modeling program (orbiting around the model, walking on the model) and changing between them while we want to preserve the position of a camera in the change. Games may benefit from it as well when we change from user-defined helicopter manipulator to soldier manipulator because the user escaped the helicopter. The camera will change manipulator but the position is expected to be kept in the transition (provided that user makes the state transition between the two manipulators himself).
"
2010-01-26 15:08:25 +00:00
Robert Osfield
cb7181b7a5 Removal of redundant spaces at ends of lines 2010-01-26 14:57:44 +00:00
Robert Osfield
144d3e7af3 From Lars Nilsson, "Attached is a small program doing intersection calculations, both with and without KdTree. The geometry is a TRIANGLE_STRIP consisting of five vertices, all with the same rather high Z-value. If the intersection calculation uses KdTree, it fails. When I changed osg::Vec3 to osg::Vec3d in a few places in osg::KdTree it finds the correct intersection point."
From Robert Osfield, I didn't merge the change of parameter type of IntersectKdTree::intersect() as the internal maths is all done in Vec3s. Keeping Vec3 here hasn't effected the test results.
2010-01-26 13:05:05 +00:00
Robert Osfield
5f223bec89 Changed doxygen comments to signal deprecation of this old IO classes 2010-01-26 10:37:38 +00:00
Robert Osfield
d90523e904 Removed inapprorpiate OSGDB_EXPORT 2010-01-25 18:08:15 +00:00
Robert Osfield
27c99ff0c8 Refactored the DotOsgWrapper support in osgDB::Registry so it's now provided by the osgDB::DeprecatedDotOsgWrapperManager. 2010-01-25 17:07:25 +00:00
Robert Osfield
65127f5b34 Moved the declaration of osgDB::Field, FieldReader and FieldReaderIterator into include/osg/Input to centralise all the deprecated .osg parsing code into one place. 2010-01-25 15:24:47 +00:00
Robert Osfield
e17ba0a68f Added back in StreamOperation with executation bit disabled 2010-01-25 11:40:18 +00:00
Robert Osfield
9214241fba Temporily removed StreamOperation as it had execution bit enable for it. 2010-01-25 11:39:42 +00:00
Robert Osfield
a520e8b6bd From Wang Rui, refactored the InputStream/OutputStream operations so that the binar/ascii foramts are implemented via subclasses. 2010-01-25 11:03:21 +00:00
Robert Osfield
f8fc4f66a8 Added RequestQueue destructor and DatabaseRequest::invalidate() and valid() methods to allow the
destruction of RequestQueue to remove any pointers held in DatabaseRequest attached to the scene graph, and to
prevent their subsequent use in cases where the scene graph is attached to a new DatabasePager.
2010-01-22 20:47:39 +00:00
Robert Osfield
7ab759c97f Renamed ObjectRegistry to ObjectWrapperManager, and replaced it's instance() method usage with assigning a ObjectWrapperManager
to the osgDB::Registry.  Added a osgDB::Registry::getObjectWrapperManager() for access of this object wrapper manager.  This
change centralises the singleton management in osgDB.

Merged the osgDB::GlobalLookUpTable functionality into ObjectWrapperManger to keep down the number of singletons in use.
2010-01-22 15:16:22 +00:00
Robert Osfield
8839736818 Added extra export for windows build 2010-01-21 16:26:48 +00:00
Robert Osfield
f795770fed Added support for passing on slave Camera's StateSet's to the rendering backend. 2010-01-21 10:24:48 +00:00
Robert Osfield
f1bd2eaf04 From Wang Rui, added exports for windows build 2010-01-21 09:25:45 +00:00
Robert Osfield
219696f1ee From Wang Rui, new native binary/ascii format infrastructure and wrappers.
From Robert Osfield, refactor of Wang Rui's original osg2 into 3 parts - parts placed into osgDB, the ReaderWriter placed into src/osg/Plugin/osg and wrappers into src/osgWrappers/serializers/osg
2010-01-20 20:13:33 +00:00
Robert Osfield
6f3966038f From Serge Lages, "Here is a patch to allow setting an audio volume with the AudioSink interface, I've also modified the ffmpeg plugin code to implement the ImageStream's setVolume method with its AudioSink." 2010-01-18 12:43:02 +00:00
Robert Osfield
5a37ed8a9f Removed the old style Serializer, moving it back into VirtuaLPlanetBuilder to make way for the new Serializer that exists in support for the new binary/ascii format. 2010-01-15 15:34:17 +00:00
Robert Osfield
8f6db66e59 Added setting of the charcode during construction of osgText::Font::Glyph() 2010-01-14 15:15:42 +00:00
Robert Osfield
f53c3c1036 Updated so version 2010-01-14 15:15:08 +00:00
Robert Osfield
8541761fe7 For backwards compatiblity add a staic void BufferObject::deleteBufferObject(unsigned int contextID,GLuint globj) method. 2010-01-13 18:46:52 +00:00
Robert Osfield
c541781ca5 Moved dispatch/recieve methods into public scope to allow easier custom usage. 2010-01-13 14:16:33 +00:00
Robert Osfield
d891a56e8d From Wang Rui, "Attached are two simple modifications of osg::Sequence and
osg::Texture1D classes, for the reason of implementing the I/O
serialization feature. In the Sequence header, I've added some more
convenient functions: setTimeList/getTimeList,
setLoopMode/getLoopMode, setBegin/getBegin, setEnd/getEnd,
setSpeed/getSpeed and setNumRepeats/getNumRepeats.

In the Texture1D header, fixed:

inline void setTextureWidth(int width) const ...

to:

inline void setTextureWidth(int width) ..."

Notes from Robert Osfield, have gone a little further with these changes and have removed some of the original get methods that were out of step with the way the rest of the OSG manages the set/get property pairs.
2010-01-13 13:30:14 +00:00
Robert Osfield
cbd9a1370e From Jean-Sebastien Guay, "OK, so here are new changes.
1. The node type will be set to ATOM on read of <tag prop="..." ... /> type tags.
2. GROUP and NODE are now written using the same code (and not just duplicated code). Also NODE will not be written as an ATOM if it has no children or contents, so you need to set the type to ATOM if you want the <tag ... /> style.
3. You had put the write of "/>" for ATOM after the "return true", so it had no effect... Moved to before the return.
4. ATOM did not write its properties correctly, fixed.
5. As an added bonus, I made the write() method indent the output so it's more readable. It brings a small public interface change but the indent argument has a default value so client code doesn't need to change (if there even is any).
6. Another added bonus, I've simplified the write() method a bit by factoring out the write for children and properties into protected methods."
2010-01-11 17:36:03 +00:00
Robert Osfield
28723e6fef From Jean-Sebastien Guay, "was testing an osgWidget-based test app I have and noticed that I couldn't move the windows/frames around on the screen anymore. Turns out that the virtual methods' interface changed in the EventInterface base class, the third argument to mouseDrag() is now const, but it was not changed in the derived classes, so it still compiled but the derived-class version was not being called because its arguments differed.
Here are the changes that fix it.
"
2010-01-08 11:40:43 +00:00
Robert Osfield
a31aa512d7 From Rob Radtke, "I recently ran into some issues trying to save/load a scene graph as a .ive file. The problems came about because the scene graph contained depth textures in it. I have attached a patch (against the current revision: 10919) that fixes the issues that I encountered. Both attachments contain the same patch--one is a .zip file that contains the modified files and the other is a text patch file. Here is a summary of the changes I made:
1) Add getShadowComparison() accessor function to osg::Texture class
2) Modify ReaderWriterTiff::writeTifStream() and _readColor() (in Image.cpp) to handle pixelFormat==GL_DEPTH_COMPONENT as if it were GL_LUMINANCE
3) Modify the Texture classes of the ive and osg plug-ins so that they save/load the following Texture members: _use_shadow_comparison, _shadow_compare_func and _shadow_texture_mode
"
2010-01-08 11:32:55 +00:00
Robert Osfield
a0479bdb21 From Chuck Seberino, (submitted by Stephan Huber) Chuck's original message : "I have a patch to submit that fixes the following error when building against OSX 10.6.2." 2010-01-07 17:20:55 +00:00
Robert Osfield
248a0813db From Lilith Bryant, "As discussed previously on the users list. Fixes the redundant calls to
glActiveTexture on every State::apply after more than one texunits have been
used.

This is against 2.9.6 (I think SVN head is the same)

Quick Synopsis:

New functions:

State::applyModeOnTexUnit
State::applyAttributeOnTexUnit
State::applyModeMapOnTexUnit
State::applyAttributeMapOnTexUnit
State::applyModeListOnTexUnit
State::applyAttributeListOnTexUnit

All copies of the normal versions, but they also set the active tex unit if
absolutely necessary (i.e. only if they call something OpenGL).

State::apply (*2)
State::applyTextureAttribute

Changed to call the above functions and no longer call setActiveTextureUnit
themselves.

State::setActiveTextureUnit

Made inline, so the benefit of having applyModeOnTexUnit (etc) inline
is retained.
"
2010-01-07 16:49:12 +00:00
Robert Osfield
5d9bf9f4d5 Added virtual pause() method into osg::AudioSink to support pausing of a movie thread and it's associated audio.
Updated osgmovie plugin to use the pause support.
2010-01-07 14:35:17 +00:00
Robert Osfield
47af634399 Refactored the way that osg::Image/ImageSequence manages the update callback that needs to be attached to Textures to make it possible to use the Image::update() mechansim in other subclasses from osg::Image.
To enable the automatic attachment of the required update callback to call osg::Image::update(..) subclasses from osg::Image will
need to implement the osg::Image::requestUpdateCall() and return true, and implement the osg::Image::update(NodeVisitor*) method to recieve the update call during the update traversal.
2010-01-07 12:14:47 +00:00
Robert Osfield
d8cc1648ca Fixed type of index to int. 2010-01-06 10:41:14 +00:00
Robert Osfield
856c7acee5 Replaced nullptr with isNullPointer 2010-01-05 20:03:02 +00:00
Robert Osfield
bbf1ef45ee Added set/getDistance() method 2010-01-05 11:09:18 +00:00
Cedric Pinson
ceb06d7532 From Cedric Pinson, remove unused file Skinning, cleanup file Timeline.cpp 2009-12-22 14:09:46 +00:00
Robert Osfield
7a80f5bcfa Moved the supports*() method into public scope to allow external injection of supported formats. Added docs to clearly state this type of inject is not generally supported by ReaderWriters. 2009-12-16 15:48:34 +00:00
Robert Osfield
aec8c8ac10 Updated version to 2.9.7 in prep for next dev release 2009-12-15 11:47:38 +00:00
Robert Osfield
22de011107 Renamed osg::GraphicsContext::OperationQueue typedef to GraphicsOperationQueue to avoid naming conflict with osg::OperationQueue 2009-12-14 13:42:00 +00:00
Robert Osfield
b7b86ba5f4 From Stephan Huber, "attached you'll find the missing GraphicsHandleCocoa-implementation." 2009-12-10 17:52:40 +00:00
Cedric Pinson
53d5b56202 From Cedric Pinson,
Add check in RigTransformSoftware if bones are null
Indent TimelineAnimationManager
Add check for NaN in UpdateCallback.cpp
Fix TimelineAnimationManager clear target (a refactore of Timeline is require for futur)
Fix Computation of bounding box for RigGeometry
2009-12-09 18:45:46 +00:00
Robert Osfield
5f61d14dc6 Fixed support for compiling VBO's 2009-12-09 13:55:10 +00:00
Robert Osfield
6e7c02b5d8 Added a Geometry::compileGLObjects() to handle compilation of VBO + EBO's. 2009-12-09 13:51:02 +00:00
Robert Osfield
268f11c522 From Ulrich Hertlein, removed email address 2009-12-09 13:13:02 +00:00
Robert Osfield
7cf9dacc76 From Robert Milharcic, added missing OSGFX_EXPORT 2009-12-09 09:36:08 +00:00
Robert Osfield
e0154c2d28 From Ulrich Hertlein, "attached is a stencil buffer-based constant-width outline f/x with example. I've also modified osgfxbrowser to setup the stencil buffer accordingly." 2009-12-08 17:41:44 +00:00
Robert Osfield
17b8ee1508 From Thomas Halgarth, mods for Iphone GL headers 2009-12-08 17:41:18 +00:00
Robert Osfield
248386861b From Sukender, "I experienced as some users before: I tried to rescale an image without a valid rendering context... And had problems to unserstand what the "GL_OUT_OF_MEMORY" meant! So I added a few comments for future users." 2009-12-08 17:25:45 +00:00
Robert Osfield
02d0f08eb1 Added virtual declaration for a range of osg::Image method to allow easier customization. 2009-12-08 15:38:50 +00:00
Robert Osfield
3a6a756d34 Converted tabs to four spaces 2009-12-07 12:35:33 +00:00
Robert Osfield
b4af14433f Removed unimplemented updateGraph method 2009-12-05 10:02:04 +00:00
Robert Osfield
b278660799 From Nico Kruithof, "Attached is a patch that makes the spherical manipulator frame rate independent. This is similar to what Lee did for the trackball manipulator a couple of months ago." 2009-12-02 14:21:13 +00:00
Robert Osfield
36b5e59019 From Paul Martz, "This change address the following issue: an app opens a Viewer on a multidisplay system, configured to setUpViewAcrossAllDisplays, with a non-default clear mask. In this case, OSG failed to propagate the clear mask to the slave Cameras, resulting in the clear mask being ignored. To fix this issue, this revision adds a new CullSettings::VariablesMask bit, CLEAR_MASK, to explicitly control inheritance of the clear mask. This bit is set by default, which means that the clear mask now inherits by default, whereas previously it did not." 2009-11-27 15:32:43 +00:00
Robert Osfield
6ebeff658a Implement deleteAllTextureObject/BufferObjects functionality.
Cleaned up warnings.
2009-11-27 11:43:18 +00:00
Robert Osfield
ab8d93a181 Introduced preliminary osg::deleteAllGLObjects() and osg::discardAllGLObjects() functions and associated support into Texture and BufferObjects 2009-11-26 12:33:07 +00:00
Robert Osfield
a3adc3d07c From Martin Scheffler, "osgParticle: method to set start and end tile for particle texture (for animated particles). I also updated examples/osgParticle to show the feature.
The texture in data/Images should be copied to osg-data. I created the texture myself with the help of an explosion generator, so no license issues there.
"
2009-11-24 15:00:11 +00:00
Robert Osfield
6d3e7f83e2 From Terry Welsh, "As I mentioned here
http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg33967.html
, interpolating through HSV space gives a rainbow color effect which
does not mimic the simple RGB color interpolation that OpenGL does.
It's overkill and causes unexpected visual artifacts.  In the attached
files I've removed the conversion to HSV so that interpolation happens
in RGB space."
2009-11-24 14:12:54 +00:00
Robert Osfield
383a5222bd Rewrote the Vec *= Vec and Vec /= Vec implementations using inline Vec componentMultiply(Vec,Vec) and Vec componentDivide(Vec,Vec) to avoid confusion about the what the operation does. 2009-11-24 13:28:07 +00:00
Robert Osfield
3599be9708 From Wojciech Lewandowski, "I have extended a list of texture targets that can be used with shadow comparison. These targets are avaialble in in OpenGL 3.x shadow sampler variants. Changes are based on current SVN." 2009-11-24 13:24:30 +00:00
Robert Osfield
d09323f93e From Chris Hanson, " Add support for requesting and setting the current directory (a la getcwd/chdir) via a
C++-friendly string-class API.

 Prevent osgDB::concatPaths from faulting if the supplied "left" path string is empty."
2009-11-23 10:19:37 +00:00
Robert Osfield
87452fe1b9 From Chris Hanson, " Adds support for Vec /= Vec and Vec *= Vec operators to Vec2/Vec3/Vec4 double and float
classes."
2009-11-23 10:01:44 +00:00
Robert Osfield
d81d71fd97 Updated version 2009-11-23 09:54:28 +00:00
Robert Osfield
71af49f934 Added missing createContextImplementation(). 2009-11-22 17:27:13 +00:00
Robert Osfield
4759cb951e From Colin MacDonald, "In my application I have a custom graphics context class, derived from
osg::GraphicsContext, in order to give good integration with the
application's GUI toolkit.  This works really well.

However, I need to share OpenGL texture resources with the standard
osgViewer GraphicsContext implementations, in particular the
PixelBuffers.  This is essential for my application to conserve graphics
memory on low-end hardware.  Currently the standard osg implementations
will not share resources with another derived osg::GraphicsContext,
other than the pre-defined osgViewer classes e.g. PixelBufferX11 is
hardcoded to only share resources with GraphicsWindowX11 and
PixelBufferX11 objects, and no other osg::GraphicsContext object.

To address this in the cleanest way I could think of, I have moved the
OpenGL handle variables for each platform into a small utility class,
e.g. GraphicsHandleX11 for unix.  Then GraphicsWindowX11, PixelBufferX11
and any other derived osg::GraphicsContext class can inherit from
GraphicsHandleX11 to share OpenGL resources.

I have updated the X11, Win32 and Carbon implementations to use this.
The changes are minor.  I haven't touched the Cocoa implmentation as
I'm not familiar with it at all and couldn't test it - it will work
unchanged.

Without this I had some horrible hacks in my application, this greatly
simplifies things for me.  It also simplifies the osgViewer
implementations slightly.  Perhaps it may help with other users'
desires to share resources with external graphics contexts, as was
discussed on the user list recently."

Notes from Robert Osfield, adapted Colin's submission to work with the new EGL related changes.
2009-11-21 16:41:02 +00:00
Robert Osfield
40d46a8687 From Chris Hanson, " Remove vestigial (and because it was undocumented, potentially harmful) code to ignore
filenames starting with a dash "-" character from the (std::vector<std::string>&) version
of osgDB::readNodeFiles. Handling of argument strings is properly implemented in the
osgDB::readNodeFiles(osg::ArgumentParser& arguments,const Options* options)
variant, which most code uses. The (std::vector<std::string>&) version is only called by
the osgconv utility, which does its own argument handling and stripping prior to calling
readNodeFiles().

 Also, documented this behaviour in the header comments.

 I believe this code removal is a meritful change because leavign the code in causes an
unexpected and undocumented behaviour (ignoring any filename starting with a dash) that
could bite users in the future. This behaviour is not needed for existing functionality
because existing code uses other APIs to handle dash-prefixed arguments anyway.

"
2009-11-20 14:51:43 +00:00
Robert Osfield
5cd4faf05b From Jason Beverage, "I posted a question on osg users about resources not being properly released when using osgTerrain databases and multiple viewers are used a few weeks ago and I've found that at least part of the problem comes down to the fact that the nodes that are traversed by the GeometryTechnique are never actually added to the scene graph, and thus don't have releaseGLObjects called on them. I'm submitting a few changes that takes care of this by allowing the TerrainTechnique to provide a releaseGLObjects implementation. I've applied these changes in osgEarth and this example program no longer crashes on the second run, although I get corrupt geometry (see attached shot) which could be down to a driver issue. If I increment the context ID for the second viewer, I no longer get the corrupt geometry.
The attached changes are against OpenSceneGraph 2.8.2.

//Sample program.  Run against an osgEarth or VPB database based on osgTerrain.
#include <osgDB/ReadFile>
#include <osgViewer/Viewer>

int main(int argc, char** argv)
{
   osg::ArgumentParser arguments(&argc,argv);

   osgViewer::Viewer* viewer = new osgViewer::Viewer();
   viewer->setUpViewInWindow(100,
100,500,500);
   osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments);
   viewer->setSceneData( loadedModel.get() );
   viewer->run();
   delete viewer;

   viewer = new osgViewer::Viewer();
   viewer->setUpViewInWindow(100,100,500,500);
   loadedModel = osgDB::readNodeFiles(arguments);
   viewer->setSceneData( loadedModel.get() );
   viewer->run();
   delete viewer;
}"
2009-11-20 11:08:40 +00:00
Robert Osfield
f45ae6a4d8 From David Fries, "I was trying to create a lot of threads under 32 bit Linux, but could
only create 376, then the program would hang.
376 * 8MB stack per thread = 3008 MB
The stack size allocated per thread blew the process address stack.
To get more threads you have to specify a smaller per thread stack,
but while the Thread::start says it will limit the stack size to the
smallest allowable stack size, it won't let it be smaller than the
default.  I included the limits.h header to use PTHREAD_STACK_MIN as
the minimum stack size.

As for the deadlock, if the pthread_create failed, the new thread
doesn't exist and doesn't call threadStartedBlock.release(), so the
existing thread deadlocks on threadStartedBlock.block().  Only block
if the thread was started."
2009-11-20 10:27:43 +00:00
Robert Osfield
5a0186555b From Lilin Xiong, added missing OSG_EXPORT 2009-11-19 17:27:21 +00:00
Robert Osfield
e9c406a303 Fixed spacing 2009-11-19 16:53:29 +00:00
Robert Osfield
b4a5edd82e From Jean-Sebastien Guay, "I've made a change to the ScreenCaptureHandler's addCallbackToViewer method, so that it iterates over GraphicsContexts instead of GraphicsWindows. When the viewer has a pbuffer (for offscreen rendering without a window) then it wouldn't add the WindowCaptureCallback to that context since it wasn't in the list returned by ViewerBase::getWindows(). And anyways, I originally wrote the code, and I didn't see any reason why I did it with windows instead of contexts...
I've needed to run a recorded simulation offscreen and save it to a sequence of images, and the ScreenCaptureHandler seemed to be the simplest way to do that, and with this change it's possible.


Another change: I've also added the ability to specify continuous capture of all frames, or a certain number of frames. ScreenCaptureHandler now has a setFramesToCapture(int) method. The argument will be interpreted as:

0  : don't capture
<0 : capture continuously
>0 : capture that number of frames then stop

I also added startCapture() and stopCapture() methods so that user code can start capturing (either continuously or the given number of frames) at a given point in their program. setFramesToCapture() won't start capturing, you have to call startCapture() afterwards. The handler also now has another key to toggle continuous capture (defaults to 'C').

Note that continuous capture will of course only work if the CaptureOperation writes to different files (for example, a WriteToFile with SEQUENTIAL_NUMBER mode) or does something different each time... Otherwise it will just overwrite of course. :-)

I've also taken the chance to refactor the addCallbackToViewer() method a bit too, since finding the right camera is needed in two places now.

I've tested all cases (I think). If you want to try, in osgviewer.cpp and replace the line

 // add the screen capture handler
 viewer.addEventHandler(new osgViewer::ScreenCaptureHandler);

with

 // add the screen capture handler
 osgViewer::ScreenCaptureHandler* captureHandler = new
     osgViewer::ScreenCaptureHandler(
         new osgViewer::ScreenCaptureHandler::WriteToFile(
             "screenshot", "jpg",
     osgViewer::ScreenCaptureHandler::WriteToFile::SEQUENTIAL_NUMBER),
     -1);
 viewer.addEventHandler(captureHandler);
 captureHandler->startCapture();

And vary the "-1" (put 0, 10, 50) and then use the 'c' and 'C' keys and see how it reacts.
"
2009-11-19 12:01:49 +00:00
Robert Osfield
4f6be906b3 Fixed spaces at ends of lines 2009-11-19 11:54:15 +00:00
Robert Osfield
6cc2ce5e4a Form Roland Smeenk, "Attached is a small change to the osgWidget::EventInterface so it matches the NotifyWidget and NullWidget interface (added const). Due to this mismatch these widgets never received events.
I also changed the osgwidgetbox example so the ColorWidget is receiving events again."
2009-11-19 11:30:22 +00:00
Robert Osfield
c481f022e9 From Wojciech Lewandowski, "Building on earlier Paul's submission "[osg-users] Main branch MSFBO support change", I have added implicit buffer mask variables to DisplaySettings for setting global defaults for Camera FBOs. These mask variables are named after variables in Camera class. In Paul's submission they were named _renderBufferMask & _resolveBufferMask but I renamed them to _implicitBufferAttachmentRenderMask & _implicitBufferAttachmentResolveMask. DisplaySettings implementation includes reading of environment vars and command line options. Setters and getters follow typical OSG naming convention. I also updated names of ImplictBufferAttachment enum bits to match changed naming scheme.
DisplaySettings now define COLOR and DEPTH as defaults for implicit buffers. Consequently Camera by default uses the same defaults through USE_DISPLAY_SETTINGS_MASK. However, particular Camera mask can be easily overriden through Camera::setImplicitBufferAttachmentMask method. I hope, that in this way we can have global control over implicit buffer defaults, and we can still retain fine grained control at Camera level.

I have also replaced original unsigned ints used to store masks to signed ints because complier resolves enums as signed integer (I got a number of warnings with unsigned int)."
2009-11-19 10:10:50 +00:00
Robert Osfield
2191e6a48d Moved the set of include/osg/Version into Cmake 2009-11-18 16:24:01 +00:00
Robert Osfield
2f854d4978 Fixed primCount default value 2009-11-18 12:50:03 +00:00
Robert Osfield
b7cabac990 From Mathias Froechlich, "Attached the collected fixes I needed to compile with all of them.
Most notable the __hpux define stuff. The __hpux__ variant seems to be not
defined which resulted in a compile error at this time. Consequently I have
replaced all occurances of __hpux__ with __hpux. And huge surprise: now osg
plugins are found and loaded correctly ...
The next notable one is the MSVC_IDE fix which makes the nmake Makefiles cmake
generator target behave like the ide one. Showed up because I started to do
scripted builds with nmake instead of devenv...
The rest is the usual bunch of stuff that just happens during normal
coding ..."
2009-11-18 12:15:29 +00:00
Robert Osfield
4262d10217 Added osg::ShaderBinary::readShaderBinaryFile(..) static method 2009-11-18 11:25:28 +00:00
Robert Osfield
370deba546 <iterator>, <stdlib.h> and <ctype.h> includes required for QNX compiler 2009-11-17 14:06:07 +00:00
Robert Osfield
52fbe9723f Added new osg::ShaderBinary class, and support for it in osg::Shader. 2009-11-16 12:32:41 +00:00
Cedric Pinson
5842677662 From Cedric Pinson, Fix Skeleton to compute correctly bind matrix, fix compile issue on osganimationhardware after fixing Skeleton 2009-11-13 13:39:21 +00:00
Robert Osfield
6649f51ff2 From Paul Martz, osgViewer Win32 GL3 context creation support 2009-11-13 10:03:02 +00:00
Robert Osfield
8238396099 Added missing export 2009-11-13 09:56:47 +00:00
Robert Osfield
8b141567b9 Adapted GLBeginEndAdapter to use state.drawQuad(..) rather than use it's local GL_QUADS emulation.
Fixed to osg::Texture for GLES support.

Added automatic GLenum mode mappings in osg::PrimitiveSet to provide a fallback for non support glDrawArray/glDrawElement modes.

Added finer gained error checking during StateSet::compile().
2009-11-12 14:35:44 +00:00
Robert Osfield
4374ca23f9 Introduced new State::drawQuads(..) convinience method to help out with mapping GL 1.x style calls to GLES2.0 compatible calls. 2009-11-12 12:18:33 +00:00
Robert Osfield
95d54ba15c Added glContexVersion, glContextFlags and glContextProfileMask members to osg::GraphicsContext::Traits to support GL3 graphics context creation.
Moved the handling of DisplaySettings into Traits constructor.

Added support for s/getGLContextVersion(), s/getGLContextFlags() and s/getGLContextProfileMask() to osg::DisplaySettings.

Added command line and env var support for setting the GLContextVersion, GLContextFlags and GLContextProfileMask to osg::DisplaySettings.
2009-11-11 15:25:42 +00:00
Robert Osfield
b199a334d9 Introduced OSG_GL*_FEATURES macros defined in include/GL that are set to 0 or 1 according to what the assocoated version of GL is compiled against.
Removed EXT postfix of FrameBufferObject functions, and added support for checking non EXT versions frame buffer object GL functions.

Introduced usage of OSG_GL*_FEATURES to avoid some #if #else #endif code blocks.

Using a submissions from Paul Martz as a guide added perliminary GL3 support to a range of OSG classes
2009-11-10 17:01:08 +00:00
Robert Osfield
d0b021568e Added support for mapping GL_QUADS, GL_QUAD_STRIP and GL_POLYGONS to GL_TRIANGLE equivalents. 2009-11-10 11:36:07 +00:00
Robert Osfield
d7d6d2b215 Moved glColor/glNormal definitions for GLES1.x from include/osg/GL to src/osg/ArrayDispatchers.cpp to avoid import/export issues on functions.
Fixed typo of GLES1 in disabling the build of OpenGL1.x/2.x specific examples
2009-11-04 17:26:59 +00:00
Robert Osfield
72ff1f40f9 From Paul Martz, changes for compiling against OpenGL 3.x 2009-11-03 16:34:54 +00:00
Robert Osfield
a4639398e8 Fixed compile issue with Image.cpp and osgautocapture.cpp under GLES.
Fixed handling of EGLDisplay in EGL paths of GraphicsWindowX11
2009-11-01 09:04:41 +00:00
Robert Osfield
93d83010f8 Added EGL support into build system for GLES1 + GLES2.
Added EGL support into GraphicsWindowX11.
2009-10-30 15:17:38 +00:00
Cedric Pinson
7e0a6fa68a From Cedric Pinson, Fix warning in osgAnimation, UpdateCallback. Fix bug removing callback in Action. Fix warning Stats 2009-10-29 16:09:07 +00:00
Robert Osfield
d17d7159a1 Ported osgUtil, osgDB, osgGA, NodeKits and plugins to compile against OpenGL ES 1.1 and OpenGL ES 2.0. 2009-10-28 20:31:57 +00:00
Robert Osfield
e720a7a956 Fixed build on OpenGLES-1.1 and OpenGLES-2.0 targets 2009-10-27 18:07:12 +00:00
Cedric Pinson
8454d414a8 From Cedric Pinson, The following commit include:
* Refactore of RigGeometry to support hardware skinning
* Refactore of Timeline to split Action in differents files
* Add example how to use hardware skinning
2009-10-27 15:37:13 +00:00
Robert Osfield
37ee16403a Introduced usage of OSG_GLES*_AVAILABLE macros to headers and .cpp's to enable building against OpenGL ES 1.x and 2.x headers 2009-10-25 11:52:01 +00:00
Cedric Pinson
c837d34692 From Cedric Pinson, Simplify update callback api in osgAnimation, the decision to link is on the manager or user 2009-10-23 20:35:31 +00:00
Robert Osfield
a7cb28b166 Added includes for OpenGL ES1 and ES2. 2009-10-23 16:51:45 +00:00
Robert Osfield
327b67a305 Added CMake support for specifying what OpenGL target and features that the OpenSceneGraph build should use.
Added use of the new Cmake generated #define's for optionally compiling parts of the OpenSceneGraph's OpenGL support for the various OpenGL targets
2009-10-23 13:19:57 +00:00
Robert Osfield
bab4c272d5 Added support for Vec4ubArray colour arrays 2009-10-23 12:22:18 +00:00
Robert Osfield
d88531c099 Added #define for GL_TEXTURE0 as MS gl.h header is still stuck in the nineties.... 2009-10-22 14:40:35 +00:00
Robert Osfield
9b6e25cf62 Fixed typo and updated wrappers 2009-10-22 12:56:41 +00:00
Robert Osfield
0289e5e5a2 From Stephan Huber, compile fix to OSX. 2009-10-22 12:41:48 +00:00
Robert Osfield
b8f7310d50 Removed, now inappropriate, references to glBegin/glEnd. 2009-10-22 12:04:26 +00:00
Robert Osfield
d743412605 From Cedric Pinson, new StateAttributeCallback replacing StateAttribute::Callback 2009-10-22 12:01:06 +00:00
Robert Osfield
2d38e187fd From Cedric Pinson, "Here a patch to be able to clone stateattribute, in order to do that i
moved the StateAttribute::Callback structure to a file
StateAttributeCallback with the same behavior as NodeCallback.
"
2009-10-22 10:33:16 +00:00
Robert Osfield
cdf9c4363b Fixed type of GLBeginEndAdapter::MultiTexCoord*() and VertexAttrib*(), and fixed the internal offsets used in MultiTexCoord so it properly used the mapping texture_unit = target - GL_TEXTURE0 2009-10-22 08:51:51 +00:00
Robert Osfield
9b04a9379b Added Translatef, Scalef, Rotatef methods, and fixed Color4f method. 2009-10-21 16:42:12 +00:00
Robert Osfield
5e6415696f Removed remaining glBegin/glEnd usage 2009-10-21 16:40:45 +00:00
Cedric Pinson
4372ec3cba From Cedric Pinson, this commit contains the following change:
* Change ref_ptr to observer_ptr to avoid cross reference and leak in Skinning
* Set invalidate to true to re run the check visitor in Skeleton
* Shallow copy Sampler in channel copy constructor
* Add accessor in VertexInfluence
* Remove dead code in Timeline.cpp
* Dont force linking in Bone::UpdateBone, the decision is done by the user or the manager
* Add offset in timeline stats to display each manager on the screen
* Add a flag in animation manager base to enable or not automatic link when modifying the manager
2009-10-21 15:45:13 +00:00
Robert Osfield
2785ea4dfb Added support for automatic vertex aliasing to new ArrayDispatchers, and updated wrappers 2009-10-21 14:09:12 +00:00
Robert Osfield
9499b19b43 Moved the ArrayDispatchers management so that osg::State now has a ArrayDispatchers object that any osg::Geometry can reuse,
and optimized the implementation to reduce the CPU overhead.
2009-10-21 11:18:13 +00:00
Robert Osfield
6a56b6e6be Refactored osg::Geometry::drawImplementation(..) to use new osg::ArrayDispatchers that encapsulate the task
of dispatch osg::Array data as OpenGL attributes.
2009-10-20 19:34:24 +00:00
Robert Osfield
eb9ff0a311 Added support for multitexturing and vertex attributes to GLBeginEndAdapter 2009-10-17 19:22:14 +00:00
Robert Osfield
73ae1637c0 Fixed VS warning 2009-10-17 11:14:03 +00:00
Robert Osfield
aefd1513f4 Ported osg::Geometry across to supporting the aliasing of vertex, color and normal etc. calls to Vertex Attributes.
Added support for automatic aliasing of vertex, normal, color etc. arrays to Vertex Attribute equivelants.

Added new osg::GLBeginEndAdapter class for runtime conversion from glBegin/glEnd codes to vertex arrray equivelants.

Added automatic shader source conversion from gl_ to osg_ builtins.
2009-10-16 16:26:27 +00:00
Robert Osfield
9e2567cb88 Made the use of the new projection and modelview matrix uniforms optional 2009-10-11 06:05:19 +00:00
Robert Osfield
f479eb174c From Paul Martz, "A recent change to add the new geometry shader primitive types has broken the build on Windows. On Windows, those types are declared in the header GL2Extensions, but the PrimitiveSet header (which uses those types) fails to include that header, causing compile errors.
Attached is a version of PrimitiveSet that includes GL2Extensions."
2009-10-11 05:52:11 +00:00
Robert Osfield
3fce07e5e5 From Cesar L.B. Silveira, "I have written these few lines of code which allow setting the label
of an osgWidget::Label with an osgText::String. I had to do this on a
project I'm working on, because I needed UTF-8 strings on my labels,
and using setLabel with std::string was not working.
"
2009-10-10 11:06:30 +00:00
Robert Osfield
0ef684f6b5 To fix warning removed unncessary , from end to enum list. 2009-10-10 09:44:40 +00:00
Robert Osfield
10deffdc41 From Stephane Lamoliatte, "Here is a patch wich improves the support for geometry shaders in OpenSceneGraph.
It adds new PrimitiveSet constants for the specific geometry shader primitive types :
  - LINES_ADJACENCY
  - LINE_STRIP_ADJACENCY
  - TRIANGLES_ADJACENCY
  - TRIANGLE_STRIP_ADJACENCY
It also adds some missing features to the glsl reader plug'in.
"
2009-10-10 09:41:28 +00:00
Robert Osfield
f6166d1119 Introduced new uniforms for tracking the modelview and project matrices in shaders using non built-ins. 2009-10-09 13:39:11 +00:00
Robert Osfield
68b661c93b Cleaned up the #define's for when GLU is not available 2009-10-08 09:27:54 +00:00
Robert Osfield
2d26cbe7ab Introduced optional build against the GLU library, using optional compile paths to enable/disable GLU related function.
To toggle the use of the GLU library adjust the OSG_GLU_AVAILABLE variable via ccmake . or CMakeSetup.
2009-10-07 19:42:32 +00:00
Robert Osfield
ae7dfc5796 Fixed warnigns 2009-10-07 09:39:45 +00:00
Robert Osfield
69557c060b Fixed the TextureObject's + GLBufferObject reassignment to a new set.
Disabled the unref after apply for a Texture classes when the texture pool is enabled
2009-10-06 13:42:12 +00:00
Robert Osfield
5d3b8fe2b0 Added missing export 2009-10-04 08:52:01 +00:00
Robert Osfield
32b21dbb89 Introduced new GLBufferObject pool for managing the memory footprint taken up by VertexBufferObejct, ElementBufferObject and PixelBufferObject. 2009-10-03 09:25:23 +00:00
Robert Osfield
f75013d534 Introduced new BufferObject design + implementation in preperation of implementing a pool system for buffer objects 2009-10-01 20:19:42 +00:00
Cedric Pinson
cfac6a7809 From Michael Platings, In Target, the default constructor is explicitly called on _target. This is necessary for FloatTarget and DoubleTarget so that _target is initialised to 0, otherwise you get a junk value. In MorphGeometry.cpp, UpdateMorph::link now links channels of the same index to the same target. Previously a new FloatTarget was created for each channel, so multiple animations didn't work. 2009-10-01 17:08:16 +00:00
Robert Osfield
1fce3c0ad1 Added handling of resetting of the texture object format 2009-09-27 15:14:57 +00:00
Robert Osfield
4d75729650 Added stats collection to new Texture Pool code, and improved TexturePool implementation.
The Texture Pool can be enabled by setting the env var OSG_TEXTURE_POOL_SIZE=size_in_bytes.
Note, setting a size of 1 will result in the TexturePool allocating the minimum number of
textures it can without having to reuse TextureObjects from within the same frame.
2009-09-25 18:05:54 +00:00
Robert Osfield
6bc9c626f4 Fixed warning 2009-09-25 18:03:49 +00:00
Robert Osfield
216849f73a From Jean-Sebastien Guay, fixed Widows build and updated the SO version 2009-09-23 15:16:34 +00:00
Robert Osfield
d56499025b Introduced memory pool size management 2009-09-23 13:51:20 +00:00
Robert Osfield
3d75054e2c Preliminary work on support for a texture object pool that is designed to help manage resources down the GPU more tightly. 2009-09-22 18:45:24 +00:00
Cedric Pinson
2b3d76aade From Cedric Pinson, Fix createKeyframeContainerFromTargetValue to recreate its sampler from scratch to not change keyframe container of another sampler 2009-09-09 18:13:24 +00:00
Cedric Pinson
d28b052fb7 From Cedric Pinson, remove unsused files include/osgAnimation/AnimationManager and src/osgAnimation/AnimationManager.cpp 2009-09-09 09:54:29 +00:00
Cedric Pinson
9b95a78e5d From Michael Platings, I have removed Target::normalize() as calling it was incorrect - the interpolation is already done in such a way that the Target's value is always normalized.
Finally, I have fixed TemplateTarget<osg::Quat>::lerp() as it was giving incorrect results when interpolating between some small rotations.
From Cedric Pinson, i renamed the method in channel to be more general. Adjusted the CubicBezier key constructor to use a single value as input.
2009-09-09 09:52:54 +00:00
Robert Osfield
fa84f280f6 Renamed the osgVolume::Layer/ImageDetails parameters RescaleIntercept and RescaleSlope to more general TexelOffset and TexelScale, and changed type to Vec4.
Refactored the transfer function set up in RayTracedTechnique to prepare for new scale and offset uniforms.

Updated wrappers
2009-09-03 13:40:50 +00:00
Robert Osfield
43e3089417 Added support for recording the RescaleIntecept and RescaleSlope from the dicome files and passing these values onto osgVolume::ImageLayer 2009-09-01 10:48:32 +00:00
Cedric Pinson
641769a681 From Cedric Pinson, add missing files 2009-08-31 10:37:44 +00:00
Cedric Pinson
b6ab5bbe27 From Cedric Pinson, The following modification are
Update Timeline.cpp to add current layer to the ActionVisitor, use correctly the priority
Add accessors in Action.cpp to retrieve protected data
Split files and rename them to classname
Change de default color of UpdateMaterial to FFOOFF to detect unset value
Add accessors in LinkVisitor instead of accessing data directly
Update osganimationtimeline example to fit the api callback
2009-08-31 09:40:56 +00:00
Robert Osfield
ca78f3a6bc Added support to .p3d format's volume tag for the properties:
region="xmin ymin zmin xmax ymax zmax"
   alpha="float_value"
   cutoff="float_value"
   sampleDenstiy="float_value"
2009-08-27 16:42:47 +00:00
Cedric Pinson
3f9216800d From Michael Platings, I've moved the matrix updating from UpdateSkeleton to UpdateBone. UpdateSkeleton now merely checks that Bones appear before other children and issues a warning if this isn't the case 2009-08-27 16:21:01 +00:00
Cedric Pinson
729d5205ef From Michael Platings, I've just added a few simple accessors I found necessary 2009-08-26 16:39:53 +00:00
Cedric Pinson
3c45fb1e6c From Michael Platings,
- Animations with equal priority are now weighted correctly relative to each other
- (minor) Channels no longer store their weight as the only time it's used is in update() when Animation can pass in the weight directly
From Cedric Pinson,
- I adjusted the quaternion blending to keep the commutativy property
2009-08-26 09:24:02 +00:00
Robert Osfield
c56dd6faa5 From Michael Platings, "the DAE importer was crashing when calling osg::Object::setName with a null pointer argument. Rather than trying to fix all the places this might happen and probably missing a few, I thought it would be better to trivially validate the input in setName. With this fix if setName is called with a null pointer then the name is cleared." 2009-08-22 17:13:19 +00:00
Robert Osfield
fd299b5f65 From Magnus Kessler, "At the end of the void function
osg::Animation::TemplateStepInterpolator::getValue the code tries to return
the result rather than assigning it to the result parameter reference.

The following patch fixes this."
2009-08-21 11:31:10 +00:00
Robert Osfield
aa85f18bbc From Stephane Lamoliatte, "I just add the a missing getView() function to the WindowManager." 2009-08-21 09:54:45 +00:00
Robert Osfield
3f65f4f80b From Wojciech Lewandowski, support for FBO's without colour or depth attachments.
Note from Robert Osfield, I've temporarily re-enabled the old focing of of color and depth attachment to avoid regressions on some OpenGL driver.  We'll revist this once
we have a mechanism for controlling this override at runtime.

#define FORCE_COLOR_ATTACHMENT  1
#define FORCE_DEPTH_ATTACHMENT  1
2009-08-21 09:34:48 +00:00
Robert Osfield
65352c8533 From Magnus Kessler, "osgAnimation/Interpolator includes itself. The following patch removes the
superfluous include"
2009-08-20 16:39:14 +00:00
Robert Osfield
a2a2740a23 From Ronald van Maarseveen and Robert Osfield, changed compute of up vector and localToWorld transform so that it takes in to account the geographic latitude. 2009-08-20 14:19:10 +00:00
Robert Osfield
850ea3de9f Added support for trimming the contents of parsed Xml graph 2009-08-19 15:36:23 +00:00
Cedric Pinson
2916d9b7ea From Michael Platings,
Changes to allow osgAnimation::*CubicBezierChannel to be used
Added TemplateStepInterpolator class
2009-08-06 12:40:06 +00:00
Robert Osfield
589629cab8 Introduced TabBoxTrackballDragger 2009-08-05 16:02:44 +00:00
Robert Osfield
93996e6133 Added support for volume tags with properties:
dragger="box" or dragger="trackball"

and

    technique="light" or technique="isosurface" or technique="iso" or technique="mip"

and

    tf="transferfunctionfile.tf"

i.e.

         <volume dragger="box">CardiacCT</volume>
         <volume tf="colour.tf">CardiacCT</volume>
         <volume technique="isosurface">CardiacCT</volume>
2009-08-05 14:37:56 +00:00
Robert Osfield
df9385ac19 Moved the updating and expiry of the Registry object cache from DatabasePager into osgViewer::Viewer/CompositeViewer. 2009-08-05 11:06:53 +00:00
Cedric Pinson
d2af7efc61 From Cedric Pinson, Add UpdateMaterial callback to animate material\nUpdate LinkVisitor to traverse stateset\nUpdate ReaderWriter to read osgAnimation::UpdateMaterial Callback\nUpdate nathan.osg data file to demonstrate the MaterialAnimation 2009-08-03 09:48:12 +00:00
Robert Osfield
239aed9a88 Tweak of NodeMask docs 2009-07-28 06:00:23 +00:00
Robert Osfield
35962ab099 From Lee Butler and Robert Osfield, doxygen comment explaining role of NodeMask 2009-07-24 15:30:13 +00:00
Robert Osfield
31a947fda6 From Terry Welsh, "Okay, here are the mods I wrote for drawing a filled bounding box
behind osgText::Text.  I made it so the box would get drawn using
whichever BackdropImplementation was selected.  However, I did not
implement STENCIL_BUFFER.  In that case it defaults to drawing the
bounding box using POLYGON_OFFSET instead.

Also made it so the BOUNDINGBOX and FILLEDBOUNDINGBOX are drawn with a
settable color and margin size.

While I was at it I tightened up the values applied with DEPTH_RANGE
and POLYGON_OFFSET, not just for drawing the bounding box but also for
drawing backdrop text (these values must be coupled since the bounding
box has to be drawn deeper in Z than the backdrop text).  The values
in use before seemed like overkill and I was seeing some z-clipping
with my background scenery in the case of DEPTH_RANGE.  If there was a
good reason for the large values please let me know...."
2009-07-24 14:59:51 +00:00
Robert Osfield
773ae51a45 From Chris Hanson, typo and comment clean ups 2009-07-24 14:45:44 +00:00
Robert Osfield
2e0f1dc0d1 From Chris Hanson, added EllipsoidModel::isWGS84() method and clean up on comments. 2009-07-24 14:25:34 +00:00
Cedric Pinson
5a73834cbe From Cedric Pinson, Store the linkvisitor to be able to configure it by user, like changing the nodemaskoverride, or use a custom LinkVisitor 2009-07-23 12:42:01 +00:00
Robert Osfield
5496e91f87 Added the ability to turn off the external paging in of PagedLOD children. 2009-07-16 10:13:41 +00:00
Cedric Pinson
a13b32a124 From Cedric Pinson, add accessors to osgAnimation ActionCallback 2009-07-15 20:52:51 +00:00
Robert Osfield
c47c0c2a26 From Stephan Huber, "ttached you'll find a small fix for the
GraphicsWindowCocoa-implementation, which enhances multithreaded
stability, it ensures that modifications to the size of an openglcontext
is done only from one thread.
"
2009-07-13 08:30:20 +00:00
Robert Osfield
6e6a7c960e Added Dragger::s/getActivationModKeyMask(..) and Dragger::s/getActivationKeyEvent(...) methods to make it possible to have draggers that only respond when you press a specified modified key or standard key.
Changed the optional dragger in osgvolume to require the shift key to be pressed for the dragger to become active.
2009-07-03 19:16:53 +00:00
Robert Osfield
11d7d98e79 Updated version numbers for 2.9.6 release 2009-07-03 10:33:51 +00:00
Robert Osfield
b37e871cec Added callback to locator in support of interactive updating of the volume extents 2009-07-03 05:54:02 +00:00
Robert Osfield
78229df14a Added setUpGeometry to Dragger base class to make it easier to use draggers interchangably. 2009-07-03 05:52:52 +00:00
Robert Osfield
a4dedc227b Refactored RayTracedTechnique to allow the position of the rendered part of the volume to be decoupled from the image data. 2009-07-02 18:49:59 +00:00
Robert Osfield
a7f0f3f49d Added constructor and destructor body 2009-07-01 14:49:30 +00:00
Robert Osfield
2525bb5d06 Completed refactor of osgManipulator, key changes are:
Selection is now just a typedef of osg::MatrixTransform, and is deprecated

   CommandManager is shell class that just sets values directly on Dragger, and is deprecated

   Dragger now has list of DraggerCallback that takes over the roll of tracking changes to the Dragger, and
   allows users to track the dragger in any way they wish.

   Dragger now has a convinience method making MatrixTransforms track a dragger.

   Selection and CommandManager are no longer required for use of osgManipulator and are kept around for backwards compatibility.
2009-07-01 14:01:09 +00:00
Robert Osfield
7904fe71a5 Simplified Command and CommandManager 2009-06-30 13:00:58 +00:00
Cedric Pinson
2c012faee4 From Cedric Pinson, Traverse StripAction instead of applying, this fix the execution of FrameCallback in BlendIn, BlendOut and AnimationAction\nFix warning of osgAnimation::StatsHandler\nFix crash when running example osganimationtimeline without nathan.osg in OSG_FILE_PATH or with bad file 2009-06-30 11:55:49 +00:00
Robert Osfield
a2ae370c8e Refactored osgManipulator so that CommandManager is no longer required, instead Dragger directly manages Constaints and associate Selections. 2009-06-30 11:39:39 +00:00
Robert Osfield
e30e4df30c Introduced event handling directly into osgManipulator::Dragger to allow it be used with a global event handler passing in events. 2009-06-29 21:32:10 +00:00
Robert Osfield
214e1b81ed Simplified throw rate code, and add throw rate compensation into zoom in/out code. 2009-06-25 18:31:43 +00:00
Robert Osfield
b1a99ba25f From Lee Bulter, "I noticed that when "throwing" things the rate of motion once thrown was
dependent on the complexity of the geometry. For complex scenes this
meant that it looked like you were "throwing" the display into molasses.
For simple geometry things get over-excited once thrown.

The fix is to factor in the frame rendering time to the caluclated
motion. I've implemented this for rotation and panning.

Now when things are thrown they maintain a rate very close to what was
happening when the mouse button was released."
2009-06-25 18:11:29 +00:00
Robert Osfield
b1f4a81606 From Mathias Froehlich, "Fix possible problem with aliasing rules.. and fix a gcc warning :)Use a union to determine if we are on a little endian or big endian machine." 2009-06-25 13:26:26 +00:00
Robert Osfield
3aded84015 From Cory Riddell, "I added an _allowThrow boolean along with a getter and setter to the
spherical manipulator. The default value is true.

This is very similar to the flag in trackball."
2009-06-25 09:14:47 +00:00
Robert Osfield
5eed82e32e Added export 2009-06-25 08:23:21 +00:00
Robert Osfield
95355c2a49 Refactored preset3D/p3d plugin so that common scene graph extensions and classes now live in a separate osgPresenttation NodeKit. 2009-06-24 16:03:49 +00:00
Cedric Pinson
51579cf436 From Cedric Pinson, Fix the drop of the first frame of action when adding action with addActionNow\nReport stats only for active animations\nAdd priority to RunAction callback 2009-06-24 10:10:09 +00:00
Cedric Pinson
658d96aa64 From Cedric Pinson, fix constructors for cloning osgAnimation objects 2009-06-22 14:24:59 +00:00
Robert Osfield
79b0060703 From Tom Jolly, "A new compiler and a new warning.
Enclosed is include/osgParticle/Particle.  I removed the const from the
return type of getSTexCoord.  I also changed the name on the next
function to getTTexCoord so it is consistent with getSTexCoord.  If you
prefer to change getSTexCoord to getSCoord you will need to change it in
ConnectedParticleSystem.cpp."
2009-06-19 13:09:31 +00:00
Robert Osfield
85bb6b327d From Wojciech Lewandowski, "Here are my changes:
- osg::Texture sets GL_MAX_TEXTURE_LEVEL if image uses fewer mipmaps than
number from computeNumberOfMipmaps (and it works!)
- DDS fix to read only available mipmaps
- DDS fixes to read / save 3D textures with mipmaps ( packing == 1 is
required)
- Few cosmetic DDS modifications and comments to make code cleaner (I hope)

Added _isTextureMaxLevelSupported variable to texture extensions. It
could be removed if OSG requires OpenGL version 1.2 by default.

Added simple ComputeImageSizeInBytes function in DDSReaderWrites. In
my opinion it would be better if similar static method was defined for
Image. Then it could be used not only in DDS but other modules as well (I
noticed that Texture/Texture2D do similar computations).

Also attached is an example test.osg model with DDS without last mipmaps to
demonstrate the problem. When loaded into Viewer with current code and moved
far away, so that cube occupies 4 pixels, cube becomes red due to the issue
I described in earlier post. When you patch DDS reader writer with attched
code but no osg::Texture yet, cube becomes blank (at least on my
Windows/NVidia)  When you also merge osg::Texture patch cube will look right
and mipmaps will be correct."
2009-06-19 11:55:52 +00:00
Robert Osfield
82b329b0a7 Added append() method 2009-06-19 11:04:48 +00:00
Robert Osfield
1523032d2b From Cedric Pinson and Robert Osfield, addition of NodeCallbacks to osg::CopyOp and osg::Node copy constructor. 2009-06-18 10:01:39 +00:00
Robert Osfield
1e45b24a7f Added exports 2009-06-18 08:29:20 +00:00
Robert Osfield
73b423ad85 Replaced forward declarations 2009-06-17 16:54:39 +00:00
Robert Osfield
acf07b5b22 Made method names consistent with each other 2009-06-17 15:12:50 +00:00
Robert Osfield
ad8f2d8974 Changed build OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION to ON and then fixed all the resulting build errors. 2009-06-17 10:39:39 +00:00
Robert Osfield
7c4225e574 Fixed error in DisplaySettings::setNumOfHttpDatabaseThreadsHint 2009-06-17 08:56:11 +00:00
Cedric Pinson
c4c5ca7566 From Cedric Pinson, split timeline classes in differents files, cleanup and add a statshandler to visualize current action in timeline 2009-06-15 14:48:37 +00:00
Cedric Pinson
b2943aa50a From Cedric Pinson, fix copy constructor for clone operation for Bone, add a missing contructor with quaternion for Target 2009-06-14 23:30:47 +00:00
Robert Osfield
d60801be3f From Mathias Froehlich, "attached is a change to the ProxyNode that also includes ProxyNode local
database options like recently added to PagedLOD.

Also there is a change to the traverse method:
The previous ProxyNode checks the VisitorType to be a CULL_VISITOR and the
presence of a request handler to submit a database request.
In contrast to that PagedLOD uses the request handler if it is there - even if
the visitor type is not a cull visitor.
The change removes the cull visitor test from the ProxyNode so that it behaves
like the PagedLOD.
I believe that the presence of a request handler in a visitor might be
sufficient to trigger the requests as this is done in the PagedLOD anyway.

Based on rev 10332."
2009-06-12 10:08:15 +00:00
Robert Osfield
27cf68b22d Replaced frame delta computation that was originally based on a local static variable, replacing it with member variable to tracking the previous frame time. This fixes a bug in the wind computation when multiple PrecipitaionEffects are in the scene. 2009-06-11 14:56:54 +00:00
Robert Osfield
3171be0ff7 From Gustav Haapalahti and Robert Osfield,
First Submission email from Gustav:
"This submission adds a --cache option to osgconv and osgviewer that enables setObjectCacheHint(osgDB::Options::CACHE_ALL); It greatly reduces memory usage when a .osg file has lots of external references with ProxyNode:s that points to the same file.

Options are also added to the osg plugin. The code was already mostly implemented but there was no way to change the options.
includeExternalReferences
writeExternalReferenceFiles
A counter is added to keep track if an external file has already been written down to avoid writing the same file over and over again. If it has already been written once then it is not written again.
The counter is added to the Output class in osgDB.
"

Second Submission email from Gustav:
"This is a continuation to my previous submission.
I noticed that the same problem that I fixed in ProxyNode.cpp for the osg plugin (external files being written over and over again) also existed in the ive plugin. I attached a submission where the ive plugin remembers which external files that have already been written and do not write them again."


Changes to the above done by Robert Osfield,

    changed command line parameter to --enable-object-cache
    changed set/get methods in osgDB::Output and ive/DataOutputStream.cpp to be s/getExternalFileWritten(const std::string&)
    cleaned up set up of osgDB::Options.
2009-06-08 16:50:50 +00:00
Robert Osfield
58184612d4 From Konstantin Sinitsyn, support for GL_EXT_blend_equation_separate extension like in osg::BlendEquation. 2009-06-08 13:46:39 +00:00
Robert Osfield
a09353f931 Fixed doc message 2009-06-08 12:44:23 +00:00
Robert Osfield
aa69137fb8 Added collateReferencesToDependentCameras() and clearReferencesToDependentCameras() methods into RenderStage and SceneView, and use
of these methods in src/osgViewer/Renderer.cpp to make sure that the draw thread keeps references to all in scene graph Cameras
that are being used by the drawing threads, to keep the Camera's alive even when the main thread removes these Cameras from the scene graph.
2009-06-05 19:05:37 +00:00
Robert Osfield
482a18b9f2 Added depends_on template and usage in RenderBin to help with static variable destruction ordering 2009-06-05 11:48:35 +00:00
Robert Osfield
40155d59b4 Implemented updating of revision files as new data is writing to the FileCache 2009-06-04 14:07:12 +00:00
Robert Osfield
1f878303b4 Implemented DatabasePath in DatabaseBase revision classes 2009-06-02 16:54:34 +00:00
Robert Osfield
986fc05ac1 Added revisions plugin in support of paged database revisions. 2009-05-29 18:24:47 +00:00
Robert Osfield
23c7646702 Introduced first iterations of DatabaseRevision classes for managing the revisioning of http hosted databases 2009-05-29 08:24:11 +00:00
Robert Osfield
45ec1a163c Added support for RenderBin::SortMode::TRAVERSAL_ORDER to enable rendering of scene graph drawables in the order that they were traversed in. 2009-05-27 09:54:17 +00:00
Robert Osfield
4a823acce0 Changed Status enums to ActionStatus and TimelineStatus to avoid X11 problems 2009-05-25 12:04:29 +00:00
Robert Osfield
56c32eb131 Changed TerrainManipulator to use HEADING rather than AZIM to keep it consistent with SphericalManipulator 2009-05-20 11:08:57 +00:00
Robert Osfield
cd18dc01da Converted SphericalManipulator to use Elevation and Heading rather than Zenith and Azimuth. 2009-05-20 10:58:29 +00:00
Robert Osfield
323deba59c From Martin Beckett, "In MatrixManipulator can we have computeHomePosition() use _homeUp rather than the hardcoded (0,0,1).
This makes it possible to redefine the viewing direction of 'home' in the other manipulator - so home in a GIS app could be a plan view.
Since _homeUp is set to (0,0,1) and no current code changes it there shouldn't be any difference for current users."
2009-05-19 14:03:09 +00:00
Robert Osfield
4d9d02e880 Changed the default home position so that it's consistent with other OSG manipulators. Added setter of properties of the SphericalManipualtor, moved across to using doubles internally 2009-05-19 12:21:42 +00:00
Robert Osfield
22fa18d585 From Mojtaba Fathi, "I've developed a new manipulator which uses azimuth and zenith angles to rotate scene and so avoids Roll angle rotation, such that scene is always seen as Z upward." 2009-05-19 11:18:03 +00:00
Robert Osfield
d38fb904d3 From Maciej Krol,"With advent of GUI applications in OSG there is a growing need to redirect notification messages to third party systems. For example windows applications do not have console output, it would be appropriate to redirect notifications to GUI widget or debug output. I have revamped notification system to fit this need. New notification stream is using NotifyHandler as a message sink. Handler is called whenever stream is synchronized (i.e. after <<std::endl). Standard streams std::cout and std::cerr are no longer used although by default StandardNotifyHandler is a message sink. Custom notification handler can be set with osg::setNotifyHandler(NotifyHandler *) function.
Two implementations of NotifyHandler are currently available:
- StandardNotifyHandler, calls fputs(message, stderr) for severity <= WARN and fputs(message, stdout) for severity > WARN
- WinDebugNotifyHandler, windows users can redirect notifications to windows debug output, notifications can be viewed in output window of the debugger i.e. MSVC or DebugView (http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx) (see screenshot).

I have seen on osg-users that some people do std::cerr.rdbuf(otherStream.rdbuf()) to redirect notifications. This trick will no longer work since osg::notify() returns internal osg::NotifyStream not std::cout or std::cerr. You can use osg::notify().rdbuf(otherStream.rdbuf()) to do this instead.

Additionally I've made some minor fixes:
- Minor imrovements to osg::notify documentation
- NullStream could crash by deleting stream buffer other than default NullStreamBuffer in the destructor i.e. after osg::notify(osg::DEBUG_FP).rdbuf(otherStream.rdbuf())"
2009-05-18 12:04:07 +00:00
Robert Osfield
7dead3f52d From Paul Obermeier, "Please find enclosed some changed OSG header files.
The changes are more or less just beautifications
(when looked at them from the C++ view), but make
wrapping OSG with SWIG easier.
I have tested the changes with both 2.8.1-rc4 and the
current head and would appreciate to incorporate the
changes in both branches.

Here is a description of the changes:

osg/BoundingSphere:
   Use the following typedef (like used in BoundingBox)
       typedef typename VT::value_type value_type;
   instead of
       typedef typename vec_type::value_type value_type;

   SWIG reports errors on the latter construct.
   Also makes it consistent with BoundingBox.


osg/Vec4ub:
   Consistent use of "value_type" throughout the file.


osg/Vec?b:
   Consistent use of "value_type" throughout the files.

   Also changed
       typedef char value_type;
   to
       typedef signed char value_type;

   In the case of a simple "char", SWIG assumes a string.
   Using "signed char" instead of "char" does not change
   the behaviour of the class.
"
2009-05-18 10:37:03 +00:00
Robert Osfield
47c922b0e5 Minor tweaks to avoid warnings when generating wrappers/doxygen documentation 2009-05-18 10:28:14 +00:00
Robert Osfield
6bcc1c527c From Ulrich Hertlein, "please find attached a patch for TrackballManipulator to fix zooming using the MBP touchpad. The old code would always zoom-in even when using the gesture to zoom-out.
Also attached are some code and documentation cleanups for GUIEventAdapter that collect related values (e.g. scrolling, tablet pen) in a struct.
"
2009-05-14 16:08:12 +00:00
Robert Osfield
6a269e24e5 From Stephan Huber, "attached you'll find some bugfixes and enhancements for the Cocoa
implementation of GraoicsWindowCocoa:

Enhancements/Bugfixes:

+ now it's possible to integrate osgViewer better into existing
cocoa-applications:
* create one or more NSOpenGLView(s) and add these to your window(s)
* create one or more NSWindows
* disable the integrated event-polling of osgViewer, and let the work be
done by Cocoa / NSApplicationRun. You'll have to run the osgViewer's
runloop in a separate thread

+ missing menu-event-handling implemented

+ added NSAutoReleasePools where necessary, this fixes some memory-leaks
+ fixed some crashes and thread-issues"
2009-05-14 15:34:15 +00:00
Robert Osfield
122ee0a001 Added ReaderWriter::fileExists() method to help enable querrying of existing of files on servers using the curl plugin 2009-05-13 19:46:16 +00:00
Robert Osfield
078fe9e84c Added support for Object, Image, HeightField and Shaders in FileCache 2009-05-13 19:44:27 +00:00
Robert Osfield
2e73fb2131 Fixed handling of space after = in options set up. 2009-05-13 15:05:23 +00:00
Robert Osfield
8138a7698f Moved getAttributeVec into public: to allow 3rd party code to access without having to subclass 2009-05-12 05:49:36 +00:00