Commit Graph

3631 Commits

Author SHA1 Message Date
Robert Osfield
6a00d7d356 Added #define for Windows build 2010-10-06 18:29:23 +00:00
Robert Osfield
29bc5995e7 Added #define's and local include<osg/Image> to fix Windows GL 1.1 build against 2010-10-06 16:36:30 +00:00
Robert Osfield
8a6b0f0cef From Jean-Sebasien Guay, fix windows compile error 2010-10-06 16:29:16 +00:00
Robert Osfield
89f7726383 Copied libutil and libtess implementations in form Mesa 7.9/src/glu into the src/osg/glu,
changed extensions from .c to .cpp and got compiling as C files as part of the osg core library.

Updated and cleaned up the rest of the OSG to use the new internal GLU.
2010-10-06 14:44:52 +00:00
Robert Osfield
6df7dbf626 Improved the handling of matrices in serialization so that it's more reliable,
change was to use doubles for reading and writing matrices regardless of type of Matrix
being serialized.

Change does break backwards compatibility though, so code
path supporting original format has been left in for the
time being.  However, this code is not reliable enough and
is over complicated compared to the simplified handling.   Once
the new code has been bedded down for a while I'll remove this code block.
2010-10-04 15:23:19 +00:00
Robert Osfield
c294814e95 2010-10-01 17:07:27 +00:00
Robert Osfield
8f2497e21d From Wojciech Lewandowski,"These are our changes to DatabasePager. To check if parent PLOD is registered, I resurrected PagedLODList::containsPagedLOD() method. This method was available some time ago, but got removed and was not currently present in trunk. To add this method I had to also modify the DatabasePager header. " 2010-10-01 15:37:35 +00:00
Robert Osfield
e5bc43f04c From Magnus Kessler, "After a closer look at this particular issue, I used some grep and sed magic
to fix all occurrences of "macro's" and "paramter".
"
2010-09-30 16:57:02 +00:00
Robert Osfield
34fa992ff5 From Chuck Seberino, "Here is a small optimization in osgDB/Serializer that only uses a single accessor call when retrieving serializable values during writing. This is a sizable win for some of my code since the getter() methods are non-trivial. I also removed some explicit namespace qualifiers to be consistent with the rest of the codebase." 2010-09-30 16:03:04 +00:00
Robert Osfield
0eded3efbe From WojciechLewandowski, Added DispaySettings::SwapMethod and support for it in GraphicsContext::Traits 2010-09-30 14:25:27 +00:00
Robert Osfield
ab1920c427 From Wang Rui, "I've fixed the problem that osgx format doesn't read the Font property and wrapped string correctly. The first problem happened because the matchString() made a mistake in comparing two strings with the same start but different size. The second just needs complete rewriting of writeWrappedString() and readWrappedString() in src/osgPlugins/osg/XmlStreamOperator.h
I also fixed a possible bug in osgDB::XmlParser that doesn't handle control characters (like &quot; to ") when reading node attributes, because the writeWrappedString() and readWrappedString() now depend heavily on control characters. An additional improvement is that osgx now supports comments."
2010-09-30 09:34:41 +00:00
Robert Osfield
dab1c79127 Moved handling of character aspect ratio into osgText::Style. 2010-09-29 12:45:35 +00:00
Robert Osfield
b40acacf53 Moved set/getFont from Text/Text3D into TextBase 2010-09-29 11:34:55 +00:00
Robert Osfield
e942cc770a Removed getScale() parameter from osgText::Font 2010-09-29 11:09:32 +00:00
Robert Osfield
5af4884558 Moved Text3D across to using Style for character thickness.
Quitened down debug messages in 3D text geometry creation.
Improved the Text3D implementation of the new 3D text geometry.
2010-09-27 17:11:12 +00:00
Robert Osfield
f8b44c3b33 Added support for osgText::Style into osgText::Text3D.
Refactored Text3D implementation to use new GlyphGeometry class.
Implemented GlyphGeometry backend and cleaned up Glyph3D interface.
2010-09-27 16:18:20 +00:00
Robert Osfield
fdfad4848b Added include<osg/Geode> to fix compile error 2010-09-26 11:02:03 +00:00
Robert Osfield
f6517d2f8b From Alexander Wiebel, "I did some spell checking in my spare time. Here come 20 files." 2010-09-24 14:53:10 +00:00
Robert Osfield
73a4e775c0 From Jean-Sebastien Guay, "Changeset 10833 renames discardAllDeletedGLObjects() to discardAllGLObjects() in src/osg/GLObjects.cpp, but the declaration of the function in include/osg/GLObjects remained. So an app using an old version of OSG that called this function would now fail with a linker error instead of a compile error as it should.
Removed the declaration. Also fixed a small typo in the following doxygen comment."
2010-09-24 14:40:56 +00:00
Robert Osfield
eb3d76f291 From Mikhail Izmestev, "This patch fixes operator >> used with std::istream without std::ios::skipws flag. This allow using boost::lexical_cast with osg vectors types, because boost's lexical_cast disable std::ios::skipws flag of std::istream before using operator >>.
"
2010-09-24 14:38:01 +00:00
Robert Osfield
c006c75615 Moved Style and Bevel classes out into their own include/osgText/Style header.
Introduced GlyphGeometry class for handling the geometry data for rendering 3D text
2010-09-24 12:57:55 +00:00
Robert Osfield
d9a133476a Refactored the handling of readImage/writeImage/readObject/writeObject to avoid double setting of unique ID's, fixing the problem in reading/writing files with images 2010-09-23 16:12:05 +00:00
Robert Osfield
915b38dc25 Added deprecated notices. 2010-09-22 09:50:07 +00:00
Robert Osfield
0d347352cf From David Guthrie, "The cocoa version of the window for Mac OS X doesn't implement the requestWarpPointer function, but it turns out that the code from the Carbon version of the window is the same because it uses the windowing interface, so it this version, based on 2.8.3 GraphicsWindowCocoa, I copied the function over. The trunk version it also missing the function and the code looks to be very similar, so I assume it will transfer simply enough.
"
2010-09-21 10:28:50 +00:00
Robert Osfield
5ecc2b9880 From Wang Rui, reverted changes to osgPartcile that caused problems with osgparticleeffects. 2010-09-20 11:50:24 +00:00
Robert Osfield
fc82c9cde8 Add clamping of the maximum number of particles per frame to avoid too many particles being introduced at once when the particle system comes back on screen. 2010-09-17 15:39:53 +00:00
Robert Osfield
b0db0382f5 Reverted changes from Vivien Delage as there were some regressions discovered. Will need to revist this code to deal with bugs that Vivien was tackling. 2010-09-17 13:09:23 +00:00
Robert Osfield
93ad63405f From Alexander Wiebel, "I came across some functions in Vec* that I thought could benefit from some
doxygen documentation. Additionally, I made the comment on value_type more
meaningful (in my opinion)."
2010-09-16 10:33:51 +00:00
Robert Osfield
c6a1b7e97f From Magnus Kessler, "I'm resubmitting a slightly different version of the changes you left out for
osg/Camera. The ::glName issue masked the fact that the "(..)" isn't handled
well in doxygen and leads to "(." in the generated files.

I'm also submitting a minor documentation fix to osgGA/DriveManipulator to get
it out of my patch queue ;)"
2010-09-16 09:49:22 +00:00
Robert Osfield
b4fda3a6da From March Sciabica, "Here is the solution I coded up over the weekend. For improved
performance option, I added a flag to control whether the depth writing
pass is performed.

Since text is alpha-blended when rendering, it is placed in the
transparent bin and rendered back to front. Writing to the depth buffer
should therefore be unnecessary. Indeed, rendering something behind text
(or any blended object) after that object is drawn will give incorrect
results whether the depth buffer is written or not. I therefore think it
is safe to keep this option off by default. Users can turn it on for any
special needs they have.

I did not fix the existing backdrop implementations to work with the new
code since this new method of rendering intrinsically handles backdrops
correctly. Its results are more accurate than all of the existing
backdrop implementations. Its only downside is that it requires two
passes if depth buffer updates are desired, whereas DEPTH_RANGE and
POLYGON_OFFSET achieve their (less accurate) results in one pass. The
NO_DEPTH_BUFFER method also only uses one pass, but it disables depth
tests and not depth writes so will have serious problems if anything is
drawn in front of the text before OR after the text is drawn.

Given the better all-around behavior of the new method, I believe the
other backdrop implementations can be safely removed. Code that adjusts
the backdrop implementation will of course be broken if the member
functions are removed. For this reason I left them in, but set the new
rendering method as the default backdrop implementation. At the very
least I think the old backdrop implementations should be deprecated and
removed at a later date.
"

Note from Robert Osfield, testing this submission with osgtext I found that the
text would not render correctly when different text labels were overlapping
in deth and screen space.  I change _enableDepthWrites to default to true and
found the that which artifacts still occurred around the alpha blended edges
the artifacts where better than issue with occlusion of nearer pixels that was
happening with _enableDepthWrites set to false.I therefore set the
_enableDepthWrites to true as I feel it's the lesser of the two artefacts.
2010-09-16 09:09:43 +00:00
Robert Osfield
cc471b1103 From Magnus Kessler, "Attached are a number of files where I have tried to fix up some of the
documentation. I have accumulated them over some time, but rebased onto the
subversion trunk."
2010-09-15 12:00:12 +00:00
Robert Osfield
df7df0739a From Lukasz Izdebski, "I made some changes in OcclusionQueryNode file.
I move declaration of classes TestResult, QueryGeometry from cpp to header file and made a void createSupportNodes() a virtual method.

Now is possible to inherit from class OcclusionQueryNode."
2010-09-15 11:27:31 +00:00
Robert Osfield
d044d135f5 From Jan Peciva, "please, find attached improved Stencil and StencilTwoSided classes.
Goals:
- to handle INCR_WRAP values nicely if not supported by OpenGL (old hardware)
- to support two side stenciling of OpenGL 2.0. Current implementation does not work on ATI as it uses Nvidia extension.

Ready for commit:
- Stencil and Stencil.cpp - please, review them

Ready with "hack":
- StencilTwoSided.cpp: please, see the line 113 in apply():

      glEnable(GL_STENCIL_TEST_TWO_SIDE);

This line used to be in getModeUsage() as

      usage.usesMode(GL_STENCIL_TEST_TWO_SIDE);

but it produces OpenGL errors on ATI as it is unknown value there (it is Nvidia extension).
Problems with my "glEnable" solution:
- it enables two side stenciling forever, and it will disturb any other single-side stenciling in the scene graph.
"
2010-09-15 09:56:16 +00:00
Robert Osfield
0259a340fd From Wang Rui, "I've changed it back to _alive, _current_size and _current_alpha, and placed them one by one for setTexCoordPointer() to use.
All size() methods are now renamed to volume(). At present only the CompositePlacer will use it for randomly choose a place according to the volumes of all children.
 "
2010-09-15 09:24:45 +00:00
Robert Osfield
b4789863ac Form Wang Rui, "An initial GLSL shader support of rendering particles. Only the POINT
type is supported at present. The attached osgparticleshader.cpp will
show how it works. It can also be placed in the examples folder. But I
just wonder how this example co-exists with another two (osgparticle
and osgparticleeffect)?

Member variables in Particle, including _alive, _current_size and
_current_alpha, are now merged into one Vec3 variable. Then we can
make use of the set...Pointer() methods to treat them as vertex
attribtues in GLSL. User interfaces are not changed.

Additional methods of ParticleSystem are introduced, including
setDefaultAttributesUsingShaders(), setSortMode() and
setVisibilityDistance(). You can see how they work in
osgparticleshader.cpp.

Additional user-defined particle type is introduced. Set the particle
type to USER and attach a drawable to the template. Be careful because
of possible huge memory consumption. It is highly suggested to use
display lists here.

The ParticleSystemUpdater can accepts ParticleSystem objects as child
drawables now. I myself think it is a little simpler in structure,
than creating a new geode for each particle system. Of course, the
latter is still compatible, and can be used to transform entire
particles in the world.

New particle operators: bounce, sink, damping, orbit and explosion.
The bounce and sink opeartors both use a concept of domains, and can
simulate a very basic collision of particles and objects.

New composite placer. It contains a set of placers and emit particles
from them randomly. The added virtual method size() of each placer
will help determine the probability of generating.

New virtual method operateParticles() for the Operator class. It
actually calls operate() for each particle, but can be overrode to use
speedup techniques like SSE, or even shaders in the future.

Partly fix a floating error of 'delta time' in emitter, program and
updaters. Previously they keep the _t0 variable seperately and compute
different copies of dt by themseleves, which makes some operators,
especially the BounceOperator, work incorrectly (because the dt in
operators and updaters are slightly different). Now a getDeltaTime()
method is maintained in ParticleSystem, and will return the unique dt
value (passing by reference) for use. This makes thing better, but
still very few unexpected behavours at present...

All dotosg and serialzier wrappers for functionalities above are provided.

...

According to some simple tests, the new shader support is slightly
efficient than ordinary glBegin()/end(). That means, I haven't got a
big improvement at present. I think the bottlenack here seems to be
the cull traversal time. Because operators go through the particle
list again and again (for example, the fountain in the shader example
requires 4 operators working all the time).

A really ideal solution here is to implement the particle operators in
shaders, too, and copy the results back to particle attributes. The
concept of GPGPU is good for implementing this. But in my opinion, the
Camera class seems to be too heavy for realizing such functionality in
a particle system. Myabe a light-weight ComputeDrawable class is
enough for receiving data as textures and outputting the results to
the FBO render buffer. What do you think then?

The floating error of emitters
(http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/2009-May/028435.html)
is not solved this time. But what I think is worth testing is that we
could directly compute the node path from the emitter to the particle
system rather than multiplying the worldToLocal and LocalToWorld
matrices. I'll try this idea later.
"
2010-09-14 15:47:29 +00:00
Robert Osfield
551d2b6479 From Ulrich Hertlein, "not sure how severe this is but I believe there's a bug in
Texture.cpp:applyTexImage2D_subload:

<code>
unsigned char* data = = (unsigned char*)image->data();
if (needImageRescale) {
 // allocates rescale buffer
 data = new unsigned char[newTotalSize];

 // calls gluScaleImage into the data buffer
}

const unsigned char* dataPtr = image->data();
// subloads 'dataPtr'

// deletes 'data'
</code>

In effect, the scaled data would never be used.

I've also replaced bits of duplicate code in Texture1D/2D/2DArray/3D/Cubemap/Rectangle
that checks if the texture image can/should be unref'd with common functionality in
Texture.cpp.

"
2010-09-14 13:19:55 +00:00
Robert Osfield
d55ada3790 Moved GL_RED and associated GL defines that aren't defined by GLES into the include/osg/Image to aid portability. 2010-09-14 13:19:12 +00:00
Robert Osfield
687fd9362f From Jean-Sebastien Guay, "osgWidget::WindowManager did nothing in its keyUp event, and in particular didn't call any callbacks. Since I wanted to have callbacks on keyUp, I copied what it does on keyDown, which works for me. I could have just used keyDown and saved myself the trouble, but you know me... :-)
osgWidget::Input:

[Functional changes]
- Previously, the field would be filled with spaces up to its max length, and typing would just replace the spaces. Also, there was a _textLength variable that kept track of the real length of text in the field, since the osgText::Text's length just reflected the length of spaces+text entered. This was not great, as you could still select the spaces with the mouse and it just feels hacky. So I changed it to only contain the text entered, no spaces, and _textLength was removed since it's now redundant (the osgText::Text's length is used instead).
- Fixed the selection size which (visually only) showed one more character selected than what was really selected.
- Fixed selection by dragging the mouse, it would sometimes not select the last character of the string.
- Cursor will now accurately reflect whether insert mode is activated (block cursor) or we're in normal mode (line cursor) like in most editors.
- Implemented Ctrl-X (cut)
- Added a new clear() method that allows the field to be emptied correctly. Useful for a command line interface, for example (hint, hint).
- Mouse and keyboard event handler methods would always return false, which meant selecting with the mouse would also rotate the trackball, and typing an 's' would turn on stats.

[Code cleanup]
- Renamed the (local) _selectionMin and _selectionMax variables which are used in a lot of places, as the underscores would lead to think they were members. Either I called them selection{Min|Max} or delete{Min|Max} where it made more sense.
- Fixed some indenting which was at 3 spaces (inconsistently), I'm sure I didn't catch all the lines where this was the case though.
- Put spaces between variable, operator and value where missing, especially in for()s. Again I only did this where I made changes, there are probably others left.

The result is that delete, backspace, Ctrl-X, Ctrl-C, Ctrl-V, and typing behaviour should now be consistent with text editor conventions, whether insert mode is enabled or not. I hope. :-)

Note, there's a nasty const_cast in there. Why isn't osgText::Font::getGlyph() declared const?

Also, as a note, the current implementation of cut, copy and paste (in addition to being Windows only, yuck) gets and puts the data into an std::string, thus if the osgText::String in the field contains unicode characters I think it won't work correctly. Perhaps someone could implement a proper clipboard class that would be cross-platform and support osgText::String (more precisely other languages like Chinese) correctly? Cut, copy and paste are not critical to what I'm doing so I won't invest the time to do that, but I just thought I'd mention it.
"
2010-09-09 16:49:10 +00:00
Robert Osfield
78cb15fdf8 From Torben Dannhauer, "I extended the attached CMAKE module to search for the collada libraries of my VS2008 3rdParty package if no other library is found.
No CMAKE should recognize all libraries of the VS2008 3rdParty Package."
2010-09-09 10:44:11 +00:00
Robert Osfield
cbc43841e1 From Roland Smeenk, "this submission adds a "Fast Drawable" line to the camera scene statistics.
It shows the total number of sorted and unsorted drawables that use the fastpath for rendering."
2010-09-09 10:03:58 +00:00
Robert Osfield
77c35eabde From Jean-Sebastien Guay, "I've added a second ctor where no argument is optional, and documented that it's meant to be used when the InteractiveImage is going to be used in a fullscreen HUD.
"
2010-09-09 09:47:31 +00:00
Robert Osfield
4fe88ee2e4 From Jean-Sebastien Guay, build fixes for Windows 2010-09-08 08:09:01 +00:00
Robert Osfield
234cb82867 Moved Glyph and Glyph3D out of Font header/source file into their own header/source file. 2010-09-07 18:20:03 +00:00
Robert Osfield
50be800787 Moved TextNode into osgText.
Cleaned up freetype plugin so it no longer does tesselation - instead Glyph and TextNode do this.
2010-09-07 18:18:35 +00:00
Robert Osfield
a6abbb545e Further work on new 3D text support 2010-09-06 15:43:59 +00:00
Robert Osfield
ba10f56f86 Refactored to use a typedef of Font to Font3D rather than have a separate Font3D class 2010-09-03 09:08:19 +00:00
Robert Osfield
8c3e3055e7 Refactored osgText::Font so that it now supports both 2D and 3D glyphs.
Added TextNode.h and TextNode.cpp to examples/osgtext3D in prep for introducing the new node to osgText library
2010-09-03 08:26:46 +00:00
Robert Osfield
fd1493e14b Added support for controlling the number of curves samples to generate on Glyph3D's. Set via Font3D::setNumberCurveSamples(num). 2010-08-25 11:06:10 +00:00
Robert Osfield
a171c88cf1 From Lukasz Izdebski, "Texture: added support for GL_EXT_texture_compression_rgtc, I added support (read and write ) for BC4 BC5 Block Compression to dds file format." 2010-08-16 14:11:49 +00:00
Robert Osfield
fe6d590fc5 Changed setTransformation(eye, center, up) paramter ordering to match gluLookAt conventions. 2010-08-16 11:03:24 +00:00
Robert Osfield
5d48a68cba From Alexander Wiebel, "Documentation of PrimitiveSet" 2010-08-16 09:35:59 +00:00
Robert Osfield
74a9ccb49d From David Fries, merge from a series of related submission emails:
"enable thread locking in libavcodec

This is required for a multithreaded application using ffmpeg from
another thread."

"Prevent the audio from videos from hanging on exit if they are paused.
The video decoder already has similar logic."

"Add a way to retrieve the creation time for MPEG-4 files."

"fmpeg, improve wait for close logic

Both audio and video destructors have been succesfully using the logic,
if(isRunning())
{
  m_exit = true;
  join();
}
since it was introduced,

but the close routines are using,
m_exit = true;
if(isRunning() && waitForThreadToExit)
{
  while(isRunning()) { OpenThreads::Thread::YieldCurrentThread(); }
}
which not only is it doing an unnecessary busy wait, but it doesn't
guaranteed that the other thread has terminated, just that it has
progressed far enough that OpenThreads has set the thread status as
not running.  Like the destructor set the m_exit after checking
isRunning() to avoid the race condition of not getting to join()
because the thread was running, but isRunning() returns false.

Now that FFmpeg*close is fixed, call it from the destructor as well
to have that code in only one location."
2010-08-09 17:02:31 +00:00
Robert Osfield
b1aedf30e0 Aded option for doing a glFlush() after compiling texture objects, with a dedicated compile thread default to issuing the glFlush. 2010-08-09 16:19:50 +00:00
Robert Osfield
acbaf3962c Cleaned up the inline methods 2010-08-09 16:14:25 +00:00
Robert Osfield
534af3aeaf Removed the erroneous subclassing from osg::Observer 2010-08-08 15:44:03 +00:00
Robert Osfield
930f5ab620 From Jeremy Moles, "The version of GCC I use (4.4.3-4ubuntu5) gives the following warning
about the Observer header:

/home/cubicool/local/include/osg/Observer: In copy constructor
?osg::ObserverSet::ObserverSet(const osg::ObserverSet&)?:
/home/cubicool/local/include/osg/Observer:66: warning: base class ?class
osg::Referenced? should be explicitly initialized in the copy
constructor

I've been fixing this by hand by using the attached Observer header; it
does exactly what the warning requests. Purely cosmetic, I believe, but
other than that OSG seems to compile w/ -W -Wall just fine."
2010-07-31 10:22:37 +00:00
Robert Osfield
075b1b769c Beginning of crease angle support for SmoothingVisitor to all it duplicate vertices are creases
thus enabling separate normals for triangles adjacent to the creases.
2010-07-30 19:39:38 +00:00
Robert Osfield
a71877bf2f Changed emit() to emitParticles() to avoid collision with Qt. 2010-07-30 16:06:22 +00:00
Robert Osfield
777763bc55 Added raw primitive and vertex data into the osgText::Font3D and FreeTypePlugin to aid development of new 3D text functionality.
Added new test for original 3D text support and new experimental code for exploring approaches to new 3D text support.
2010-07-14 18:50:41 +00:00
Robert Osfield
64b26ebeb5 Added debug State::print(std::ostream&) method and extra debug messages in ShaderComposer and ShaderAttribute.
Added better shader composition testing in the osgshadercomposition example.
2010-07-10 17:14:59 +00:00
Robert Osfield
bc3578cf16 From Jean-Sebastien Guay and Martin Scheffler, "First are Martin's changes:
* Added support for floating windows and context menus in QMDIAreas.
* Protected the size (_width and _height) by a mutex to prevent threading problems.

Then my own:
* Made sure the embedded widget's size follows the graphicsView's size at all times so that window resizes will resize the widget as expected in fullscreen mode."
2010-07-08 10:51:37 +00:00
Robert Osfield
46b221a832 Added compile/release and resize of GL objects to ShaderAttribute.
Removed the StateAttribute::compose() method.

Fixed the default type value in ShaderAttribute
2010-07-06 12:19:26 +00:00
Robert Osfield
74ae526bb5 Added support for passing on uniforms from StateAttribute 2010-07-06 10:55:54 +00:00
Robert Osfield
751b0498fe Added basic code injection fields to osg::Shader,
creation of main shader to ShaderComposer and
collection of ShaderComponent to osg::State.
Also added very basic shader set up in osgshadecomposition example.
2010-07-05 16:32:58 +00:00
Robert Osfield
9f8670f50d Implement basic cache in ShadeComposer 2010-07-02 14:18:59 +00:00
Robert Osfield
a55c4b7d70 Added basic ShaderComponent class and beginnings osgshadercomposition example 2010-07-02 12:04:20 +00:00
Robert Osfield
9d9a36f6af From Brad Christiansen, "The small change I have made (against this morning's trunk) enables subclasses to register and unregister windows via protected methods. I need this access as I have a subclass that handles some of the oddities of mixing a native OpenGL window with Java's windowing system. I doubt there will be much general benefit of the modification but it should also not be harmful in any way to others." 2010-06-28 08:24:53 +00:00
Robert Osfield
5cac233764 Added beginnings of shader composition with the shells of the ShaderComposer and ShaderAttribute classes. This aren't
functional yet, but a useful placeholders for future fucntionality.
2010-06-24 17:15:27 +00:00
Robert Osfield
422a5e7058 Removed osgIntrospection as it's now available as a seperate osgIntrospection project that can be checked out thus:
svn co http://www.openscenegraph.org/svn/osg/osgIntrospection osgIntrospection
2010-06-23 13:28:19 +00:00
Robert Osfield
4ae8eb607f Updated version number for next dev release 2010-06-21 10:33:46 +00:00
Robert Osfield
751d7baf1c Changed the default behaviour of computeHomePosition so that it uses the bounding sphere of the model rather than computing the bounding box. 2010-06-16 15:56:42 +00:00
Robert Osfield
d3527f3830 Added timing code for helping detect deadlocks in the paging threads 2010-06-16 08:13:00 +00:00
Robert Osfield
6cbce93aa4 From Jean-Sebastien Guay, "I've been working in the last few days
to get QWidgetImage to a point where it can fill a need we have: to be
able to use Qt to make HUDs and to display widgets over / inside an OSG
scene.

---------------
Current results
---------------
I've attached what I have at this point. The modified QWidgetImage +
QGraphicsViewAdapter classes can be rendered fullscreen (i.e. the Qt
QGraphicsView's size follows the size of the OSG window) or on a quad in
the scene as before. It will let events go through to OSG if no widget
is under the mouse when they happen (useful when used as a HUD with
transparent parts - a click-focus scheme could be added later too). It
also supercedes Martin Scheffler's submission because it adds a
getter/setter for the QGraphicsViewAdapter's background color (and the
user can set their widget to be transparent using
widget->setAttribute(Qt::WA_TranslucentBackground) themselves).

The included osgQtBrowser example has been modified to serve as a test
bed for these changes. It has lots more command line arguments than
before, some of which can be removed eventually (once things are
tested). Note that it may be interesting to change its name or split it
into two examples. Though if things go well, the specific QWebViewImage
class can be removed completely and we can consolidate to using
QWidgetImage everywhere, and then a single example to demonstrate it
would make more sense, albeit not named osgQtBrowser... You can try this
path by using the --useWidgetImage --useBrowser command line arguments -
this results in an equivalent setup to QWebViewImage, but using
QWidgetImage, and doesn't work completely yet for some unknown reason,
see below.

----------------
Remaining issues
----------------
There are a few issues left to fix, and for these I request the
community's assistance. They are not blockers for me, and with my
limited Qt experience I don't feel like I'm getting any closer to fixing
them, so if someone else could pitch in and see what they can find, it
would be appreciated. It would be really nice to get them fixed, that
way we'd really have a first-class integration of Qt widgets in an OSG
scene. The issues are noted in the osgQtBrowser.cpp source file, but
here they are too:

-------------------------------------------------------------------
  QWidgetImage still has some issues, some examples are:

  1. Editing in the QTextEdit doesn't work. Also when started with
     --useBrowser, editing in the search field on YouTube doesn't
     work. But that same search field when using QWebViewImage
     works... And editing in the text field in the pop-up getInteger
     dialog works too. All these cases use QGraphicsViewAdapter
     under the hood, so why do some work and others don't?

     a) osgQtBrowser --useWidgetImage [--fullscreen] (optional)
     b) Try to click in the QTextEdit and type, or to select text
        and drag-and-drop it somewhere else in the QTextEdit. These
        don't work.
     c) osgQtBrowser --useWidgetImage --sanityCheck
     d) Try the operations in b), they all work.
     e) osgQtBrowser --useWidgetImage --useBrowser [--fullscreen]
     f) Try to click in the search field and type, it doesn't work.
     g) osgQtBrowser
     h) Try the operation in f), it works.

  2. Operations on floating windows (--numFloatingWindows 1 or more).
     Moving by dragging the titlebar, clicking the close button,
     resizing them, none of these work. I wonder if it's because the
     OS manages those functions (they're functions of the window
     decorations) so we need to do something special for that? But
     in --sanityCheck mode they work.

     a) osgQtBrowser --useWidgetImage --numFloatingWindows 1
                     [--fullscreen]
     b) Try to drag the floating window, click the close button, or
        drag its sides to resize it. None of these work.
     c) osgQtBrowser --useWidgetImage --numFloatingWindows 1
                     --sanityCheck
     d) Try the operations in b), all they work.
     e) osgQtBrowser --useWidgetImage [--fullscreen]
     f) Click the button so that the getInteger() dialog is
        displayed, then try to move that dialog or close it with the
        close button, these don't work.
     g) osgQtBrowser --useWidgetImage --sanityCheck
     h) Try the operation in f), it works.

  3. (Minor) The QGraphicsView's scrollbars don't appear when
     using QWidgetImage or QWebViewImage. QGraphicsView is a
     QAbstractScrollArea and it should display scrollbars as soon as
     the scene is too large to fit the view.

     a) osgQtBrowser --useWidgetImage --fullscreen
     b) Resize the OSG window so it's smaller than the QTextEdit.
        Scrollbars should appear but don't.
     c) osgQtBrowser --useWidgetImage --sanityCheck
     d) Try the operation in b), scrollbars appear. Even if you have
        floating windows (by clicking the button or by adding
        --numFloatingWindows 1) and move them outside the view,
        scrollbars appear too. You can't test that case in OSG for
        now because of problem 2 above, but that's pretty cool.

  4. (Minor) In sanity check mode, the widget added to the
     QGraphicsView is centered. With QGraphicsViewAdapter, it is not.

     a) osgQtBrowser --useWidgetImage [--fullscreen]
     b) The QTextEdit and button are not in the center of the image
        generated by the QGraphicsViewAdapter.
     c) osgQtBrowser --useWidgetImage --sanityCheck
     d) The QTextEdit and button are in the center of the
        QGraphicsView.
-------------------------------------------------------------------

As you can see I've put specific repro steps there too, so it's clear
what I mean by a given problem. The --sanityCheck mode is useful to see
what should happen in a "normal" Qt app that demonstrates the same
situation, so hopefully we can get to a point where it behaves the same
with --sanityCheck and without."
2010-06-15 13:57:44 +00:00
Robert Osfield
0c84f2deff From Cedric Pinson, "Here a fix about a leak in InputStream::decompress
I changed
       _in->setStream( new std::stringstream(data) );
to
       _dataDecompress = new std::stringstream(data);
       _in->setStream( _dataDecompress );

Then when the destructor is of InputStream is called I delete the
dataDecompress stringstream.
"
2010-06-15 10:02:34 +00:00
Robert Osfield
da60a3c615 From Jan Peciva, additional comments, and standarisation of throw and handling of mouse wheel. 2010-06-14 15:20:47 +00:00
Cedric Pinson
4354c0180c From Michael Platings, The attached file fixes 2 issues:
1) some time values were passed as floats, reducing accuracy.
2) comparisons done between doubles and floats gave different results so time < endtime evaluated to false the first time it was checked (with doubles), and true the second time it was checked (with time having been converted to a float). This consequently resulted in an array-out-of-bounds crash
2010-06-09 13:09:40 +00:00
Robert Osfield
d555e727ef From Wang Rui, "Henry and Brendan just found a small bug of the ListSerializer which
will cause the writing of osg::Switch incorrectly. The original thread
was posted on osg-users. I would like to follow the suggestion of
Brendan and add a std::endl before the END_BRACKET in
ListSerializer::write().
"
2010-06-09 10:01:25 +00:00
Robert Osfield
1d401f2333 Added size() and swap() methods to provide a thread safe way to keep track of size of a RequestQueue/ReadQueue. 2010-06-07 11:28:25 +00:00
Robert Osfield
bcebc9a23f Added removeNodes method to prune any nodes that are going to be deleted from the PagedLODLists. 2010-06-07 09:05:58 +00:00
Robert Osfield
768f466365 Fixed double registeration bug. 2010-06-03 16:24:25 +00:00
Robert Osfield
3cc90b8fd3 Fixed permissions 2010-06-03 15:07:21 +00:00
Robert Osfield
2ea6aa050e Refactored the PagedLODList implementation so that it's now done via a base class that enables different implementations to be easily tried. Initial concrete PagedLODList is the SetBasedPagedLODList. 2010-06-03 14:14:40 +00:00
Robert Osfield
363736303e Added #include <QtWebKit/QtWebKit> 2010-06-02 18:09:34 +00:00
Robert Osfield
7f7f1f7d0e Changed types from unsigned int to int's to address warnings, and changed the extension requirements so the GLES2 builds with FBO's where supported 2010-06-01 18:20:38 +00:00
Robert Osfield
656a1b6da5 From Frederic Bouvier, "here is my proposal. It is supposed to be used like this :
osg::Camera* c = createCamera();
   c->attach( osg::Camera::COLOR_BUFFER0, texture3d, 0,
osg::Camera::FACE_CONTROLLED_BY_GEOMETRY_SHADER );

it works also for cubemap textures and 2d texture arrays
"
2010-06-01 14:12:03 +00:00
Robert Osfield
4a047f2a82 From Michael Platings, introduced osg::State::applyModelViewMaitrx(const osg::Matrix& matrix) method and associated osg::State::_modelViewCache to enable osgText::Text3D to be refactored in away that avoids creating/destroying matrices 2010-06-01 13:33:58 +00:00
Robert Osfield
0cb839280f Added newline to fix warnings 2010-06-01 13:32:12 +00:00
Robert Osfield
054d5606fb From Tim Moore, "This is a patch that allows a ref_ptr to be constructed using an observer_ptr argument, which is locked. This is shorthand for declaring the ref_ptr and then passing it to observer_ptr::lock().
"
2010-06-01 11:28:04 +00:00
Robert Osfield
0c6739b6dc Removed unneccessary QWebKit includes 2010-06-01 11:23:04 +00:00
Robert Osfield
6ba8341683 From Wang Rui, "The Notify header doesn't include the OSG_ALWAYS macro, which is used
in the quicktime plugin. The file attached is to fix that small
problem."
2010-06-01 09:23:21 +00:00
Robert Osfield
d8511fa5ca From Tim Moore, fixed typo and removed redundent include 2010-06-01 09:21:42 +00:00
Robert Osfield
975b95dd33 From Torben Dannhauer, "I added radial fog functionality be using the OpenGL extension 'GL_NV_fog_distance'." 2010-05-31 16:53:41 +00:00
Robert Osfield
6548e4a5a8 Added OSG_DEBUG_DP macro 2010-05-28 17:17:34 +00:00
Robert Osfield
d26a8474e7 Changed the ref_ptr<T> observer_ptr<>::lock() method to be
bool observer_ptr<>::lock(ref_ptr<T>&) to avoid the temporary ref_ptr<>'s
being created and destroyed on the stack along with the associated ref/unref() operations
2010-05-28 08:57:48 +00:00
Robert Osfield
d746f11650 Renamed osgGA::MatrixManipualtor to osgGA::CameraManipulator so its name better reflects it's function 2010-05-27 15:54:37 +00:00
Robert Osfield
2cf3224dd3 From Jan Pecvia, improvements to manipulators and added new manipulator to osgviewer 2010-05-27 13:59:34 +00:00
Robert Osfield
72663ec3df Moved across to using more flexible dirtyMark when dirtying tiles 2010-05-27 13:58:46 +00:00
Robert Osfield
db003c12c0 Fixed 3 space indenting in headers. 2010-05-25 17:02:11 +00:00
Robert Osfield
f5661e0461 Updated wrappers 2010-05-25 16:27:21 +00:00
Robert Osfield
72931ceb96 Removed export 2010-05-25 15:52:11 +00:00
Robert Osfield
d0f48a2712 From Jan Perciva with changes from Robert Osfield, "I am submitting improved osgGA camera manipulators.
Changes:
- new mouse wheel zoom/movement/center functionality
- ability to fix vertical axis (important for CAD)
- possibility to specify values as absolute values or relative to model size
- kind of backward compatibility by flags passed to constructor
- and much more
- restructuring classes to use kind of hierarchy and standard way of event processing (handle methods). This way, there is much more code reusability and it is more easy to develop new kinds of manipulators.

Briefly, the new architecture keeps MatrixManipulator as base abstract class. StandardManipulator is the feature-rich standard manipulator with two main descendant classes: OrbitManipulator and FirstPersonManipulator. OrbitManipulator is base class for all trackball style manipulators, based on center, rotation and distance from center. FirstPersonManipulator is base for walk or fly style manipulators, using position and rotation for camera manipulation.
"

Changes by Robert: Replaced osg::Vec3 by osg::Vec3d, introduced DEFAULT_SETTINGS enum and usage.  Added frame time member variables in prep for improving throw animation when vysync is off.
2010-05-25 12:05:13 +00:00
Robert Osfield
e826bfeb3c Refactored osgQt so that QWebViewImage is now entirely implementated in the header, and osgQt itself no longer compiles it,
leaving it to only applications that require it to include the header and it's implementation and with ith the QWebKit dependency.
2010-05-22 15:45:02 +00:00
Robert Osfield
0d2723b984 From Hartwig Wiesmann, "I have added some doxygen documentation to the plane class.
"
2010-05-20 17:02:45 +00:00
Robert Osfield
9cf330d7ff Introduced a alternative implementation of observer_ptr<> that uses ObserverSet rather than an local WeakReference object. 2010-05-20 13:38:28 +00:00
Robert Osfield
b979b585f2 From Tim Moore, fix for deadlock 2010-05-19 13:14:57 +00:00
Robert Osfield
62d69c686f Fixed warning 2010-05-19 08:22:10 +00:00
Robert Osfield
b3ac6484c1 From Martin Naylor, "Please find attached the modified observer_ptr include for fixing a compiler
issue for Windows and VS2008."
2010-05-19 08:08:49 +00:00
Robert Osfield
7ed822fd79 From Tim Moore, typo fix. 2010-05-18 18:01:02 +00:00
Robert Osfield
4a0c21a5fc From Wang Rui, serializers for osgSim and osgVolume 2010-05-18 11:00:06 +00:00
Robert Osfield
f5587bad3d Fixed typos in method names 2010-05-18 10:12:30 +00:00
Robert Osfield
61121daaab Updated wrappers 2010-05-17 18:37:32 +00:00
Robert Osfield
65c09c8e0d From Tim Moore, improved doxygen comments 2010-05-17 14:43:41 +00:00
Robert Osfield
ccd9f31309 Removed signalUnreffed interface 2010-05-17 14:21:53 +00:00
Robert Osfield
f832198128 From Tim Moore, refactore WeakReference/Referenced to avoid signalling the observers when do a unref_nodelete. 2010-05-17 09:03:44 +00:00
Robert Osfield
554adfc8e6 Refactored Observer/ObserverNodePath and DatabasePager to improve their robustness. 2010-05-14 12:24:13 +00:00
Robert Osfield
2b2ea4487a From Tim Moore, new more robust observer_ptr<> implementation 2010-05-14 12:14:14 +00:00
Robert Osfield
42527fe859 From Wang Rui, "I'd like to submit my inbuilt schema data support of
the OutputStream/InputStream implementations, which was just finished
last weekend with a few tests on Windows and Ubuntu. Hope it could
work and get more feedbacks soon.

I've added a new option "SchemaData" to the osg2 plugin. Developers
may test the new feature with the command line:

# osgconv cow.osg cow.osgb -O SchemaData

It will record all serializer properties used in the scene graph, at
the beginning of the generated file. And when osgviewer and user
applications is going to read the osgb file, the inbuilt data will be
automatically read and applied first, to keep backwards compatibility
partly. This will not affect osgb files generated with older versions.
"
2010-05-12 20:02:31 +00:00
Robert Osfield
cfd4c514cb Improved the indentation/replaced tabs 2010-05-12 11:58:01 +00:00
Robert Osfield
68a1ed2dcf Fixes for building OSG with OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION set to OFF.
Fixed copy and paste error in Camera::getImplicitBufferAttachmentResolveMask().
2010-05-12 11:37:27 +00:00
Robert Osfield
400aa8ebcd Added proper support for writing out Xml graph 2010-04-30 19:41:56 +00:00
Robert Osfield
7ef776ec5f Fixed warnings 2010-04-30 19:41:24 +00:00
Robert Osfield
c2a59415ce Changed DisplaySetting::instance() to return a ref_ptr<>& rathern than a raw C pointer to enable apps to delete the singleton or assign their own. 2010-04-30 11:48:30 +00:00
Robert Osfield
a6c7fee246 From Alok Priyadarshi, "1. Replaced APIENTRY to GL_APIENTRY which is used by OpenGL ES
headers. For desktop GL GL_APIENTRY has been defined as APIENTRY."
2010-04-28 21:22:44 +00:00
Robert Osfield
c019e2f76d Fixed typo 2010-04-28 21:10:29 +00:00
Robert Osfield
5435f6cf50 From Wang Rui, "Two small bugs were just found when I was writing examples for my book
in process: a wrong definition of the OSG_FATAL macro, and wrong logic
inside the KeySwitchMatrixManipulator::getDistance() function. I
believe both were slips."
2010-04-28 20:33:40 +00:00
Robert Osfield
0adf26ec6e From Wang Rui, "The osgManipulator serializers are ready now. I need to modify the
META_OSGMANIPULATOR_Object macro to ensure these classes could work
with their wrappers, and a few naming styles should be changed as
well. Fortunately everything seems to compile fine under Windows and
my new Ubuntu system.

And I finally find the problem of the
serializers/osgTerrain/Terrain.cpp, it just missed an "osg::Group"
before "osg::CoordinateSystemNode" indicator. With the small fix
attached now VPB could generate terrain with osgt/osgb formats."
2010-04-28 20:16:44 +00:00
Robert Osfield
8b8ca09ab1 Added support for passing options to the .dot plugin 2010-04-28 18:53:34 +00:00
Robert Osfield
dbbe73304a Added support for using graphviz dot for graphics visualization via <graph>filename</graph> token. 2010-04-28 14:56:38 +00:00
Robert Osfield
117d949d1f From Roland Smeenk and Robert Osfield, improvements to the indentation of comments. 2010-04-23 16:35:44 +00:00
Robert Osfield
5d0b84edd0 From Marcin Hajder, "This submission contains Texture2DMultisample osg implementation.
Texture2DMultismaple as name suggests provides means to directly access subsamples of rendered FBO target. (GLSL 1.5 texelFetch call).

Recently I was working on deferred renderer with OSG, during that I noticed there is no support for multisampled textures (GL_ARB_texture_multisample extension). After consultations with Paul Martz and Wojtek Lewandowski I added Texture2DMultisample class and made few necessary changes around osg::FrameBufferObject, osg::Texture and osgUtil::RenderStage classes."

and from follow email:

"Fixed. According to ARB_texture_multisample extension specification multisample textures  don't need TexParameters since they can only be fetched with  texelFetch."
2010-04-22 17:02:22 +00:00
Robert Osfield
9eebb2eb23 From Ulrich Hertlien with little bits from Robert Osfield and Chris Hanson, added provisionl support for controlling sync to vblank. 2010-04-21 17:16:13 +00:00
Robert Osfield
a475da35e3 From Mourad Boufarguine, "When compiling the example on VS9, the compiler complain about undefined GL_DEPTH_COMPONENT32F and GL_DEPTH_COMPONENT32F_NV. So I added them to include/osg/FrameBufferObject. The example builds fine and is working for me without crashs unless it is ran whithout argument. I added couple of lines to check for arguments number and print the example usage when needed." 2010-04-21 16:37:28 +00:00
Robert Osfield
7c38643a77 From Tim Moore, "I noticed that the "Materials" statistic in the camera scene stats display seemed to be identical to the number of drawables. In fact, it displays the nummat member of osgUtil::Statistics, but that variable has nothing to do with materials. nummat tracks the number of matrices associated with Drawable objects in a RenderBin; as I understand it, Drawables pretty much always have a model-view matrix tied to them in RenderBins, so this statistic doesn't seem very useful. So, I added statistics for the number of StateGraph objects in RenderBins and also for the number of Drawables in the "fine grain ordering" of RenderBins. The latter corresponds to the number of Drawables in the scene that are sorted by some criteria other than graphics state; usually that is distance for semi-transparent objects, though it could be traversal order. These two statistics give an idea of the number of graphic state changes happening in a visible scene: each StateGraph implies a state change, and there could be a change for each sorted object too. You can also subtract the number of sorted Drawables from the total number of Drawables and get an idea of how many Drawables are being drawn for each StateGraph.
"
2010-04-20 10:59:44 +00:00
Robert Osfield
92a6b0020d Changed the AbmientBias type from Vec2d to Vec2 as use of double is inappropriate. 2010-04-20 10:35:33 +00:00
Robert Osfield
a8c4fd8761 From Wang Rui, "The new osgShadow and osgFX serializers are attached, and some
modifications of the osgShadow header naming styles as well. The
osgDB::Serializer header is also changed to add new Vec2 serializer
macros because of the needs of osgShadow classes. It should compile
fine on both Windows and Linux. But I have only done a few tests to
generate .osgb, .osgt and .osgx formats with these new wrappers."
2010-04-20 10:29:04 +00:00
Robert Osfield
b1658ee6df From Farshid Lashkari, "I noticed that osg::State::getInitialViewMatrix returns the monocular view matrix when rendering in stereo. I've made some changes to osgUtil::RenderStage & SceneView so that it will return the correct view matrix depending on which eye is currently being rendered." & "I made a small change to the previous patch so that osg::State::getInitialViewMatrix works correctly with pre/post render stages as well." 2010-04-19 14:49:42 +00:00
Robert Osfield
a8332528f4 From Martins Innus,"Here's a fix to allow the serializer to compile on the Mac 10.4 SDK. The definition of GLint seems to be different accross the SDKs. Its defined as "long" in 10.4. I have no idea if this is the correct way to go about this, but it compiles on my end." 2010-04-19 12:09:21 +00:00
Robert Osfield
c0e9fcbb67 From Tim Moore, "This contains a couple of fixes to support changing FrameBufferObject configurations on the fly; the user changes the camera attachments and calls Renderer::setCameraRequiresSetUp(). The major part of this submission is a comprehensive example of setting up floating point depth buffers. The user can change the near plane value and cycle through the available combinations of depth format and multisample buffer formats." 2010-04-19 11:43:06 +00:00
Robert Osfield
488eac94f7 From Wang Rui, "Attached is the osgAnimation wrappers for serialize IO operations. A
few headers and the osgAnimation sources are also modified to make
everything goes well, including:

A new REGISTER_OBJECT_WRAPPER2 macro to wrap classes like
Skeleton::UpdateSkeleton.
A bug fix in the Seralizer header which avoids setting default values
to objects.
Naming style fixes in osgAnimation headers and sources, also in the
deprecated dotosg wrappers.
A bug fix for the XML support, to write char values correctly.
A small change in the osg::Geometry wrapper to ignore the
InternalGeometry property, which is used by the MorphGeometry and
should not be set by user applications.

The avatar.osg, nathan.osg and robot.osg data files all work fine with
serializers, with some 'unsupported wrapper' warnings when converting.
I'm thinking of removing these warnings by disabling related property
serializers (ComputeBoundingBoxCallback and Drawable::UpdateCallback),
which are seldom recorded by users.

By the way, I still wonder how would we handle the C4121 problem,
discussed some days before. The /Zp compile option is set to 16 in the
attached cmake script file. And is there a better solution now?"
2010-04-19 10:35:18 +00:00
Robert Osfield
c69ddd6bd5 Added BufferData::ModifiedCallback to provide a mechanism for tracking when a osg::Image::dirty() has been called to signify that an image has been modified. 2010-04-13 18:42:58 +00:00
Robert Osfield
88f1b8f19a From Michael Platings with tweaks from Robert Osfield, added Options::s/getPrecisionHint(..) to allow apps to hint to plugins about how to handle double precision geometry data. 2010-04-13 13:06:27 +00:00
Robert Osfield
51924431cd Fixed warnings 2010-04-13 09:42:53 +00:00
Robert Osfield
fccda08491 Added corner dirty options to TerrainTechnique, added experimental code paths in GeometryTechnique for accounting for neighbouring corner tiles - optionally compiled out in this check-in.
Changed the normal computation in GeometryTechnique so that it doesn't include diagonals, thus avoid normal jumps at corners.
2010-04-09 08:52:40 +00:00
Robert Osfield
c6c26d5d44 Change Terrain so that it subclassed from CoordinateSystemNode.
Implemented new update scheme of GeometryTechnique to avoid potential threading issues.

Added Terrain support to .ive.
2010-04-03 16:21:34 +00:00
Robert Osfield
656efbf03f Removed getNeighbours() method to avoid problems with introspection wrappers 2010-04-01 21:18:39 +00:00
Robert Osfield
a8bbf0a809 Added support for boundary equalization to GeometryTechnique 2010-04-01 21:06:56 +00:00
Cedric Pinson
35fa541350 Change time type from float to double in osgAnimation 2010-03-25 17:50:29 +00:00
Robert Osfield
ecf7a7e3e4 From Stephan Huber, "attached you'll find a small enhancement for GraphicsWindowCocoa. My
submision adds a getter for the pixel-format. I need this for some
custom software so I can integrate CoreVideo-playback with osg.
"
2010-03-25 14:14:46 +00:00
Robert Osfield
304214e0df Introduced the use of linear interpolation of evelvations when sampling 2010-03-25 11:11:35 +00:00
Robert Osfield
1319e270f6 Refactored the way that the RequestQueue's are pruned and highest prioty items taken from them so the operation is
now O(n) rather than O(nlogn) where n is the number of requests.  The refactoring also cleans up the access of the
request lists so that the code is more readable/maintainable.
2010-03-24 14:27:00 +00:00
Robert Osfield
d5aea9c0f2 Updated various serialization support for .osg, .osgt/b/x and .ive. 2010-03-16 18:44:27 +00:00
Robert Osfield
c4e82f0221 Added BlendingPolicy support into osgTerrain::Terrain. 2010-03-16 18:43:59 +00:00
Robert Osfield
1537af6235 Added osgTerrain::TerrainTile::set/getBlendingPolicy(BlendingPolicy) to enable control over whether the tile should have blending enabled on it. 2010-03-16 12:05:41 +00:00
Robert Osfield
d10ce23e62 Fixed recursive call due to missing _ 2010-03-15 20:09:23 +00:00
Robert Osfield
9015ff7084 Refactored Texture::Extensions to simplify it and make it more efficient. 2010-03-15 10:32:03 +00:00
Robert Osfield
7a44b43474 From Time Moore, "This submission implements 3 optimizations for meshes. INDEX_MESH turns DrawArrays style geometry into DrawElements, uniquifying the vertices in the process. This is useful for certain loaders, like ac3d, which just spit out DrawArrays. VERTEX_POSTTRANSFORM and VERTEX_PRETRANSFORM optimize mesh triangle and vertex order for the caches on a modern GPU, using Tom Forsyth's algorithm. I describe this and the big difference it makes (38% improvement on a very large mesh) in my blog,
http://shiny-dynamics.blogspot.com/2010/03/vertex-cache-optimization-for-osg.html."
2010-03-11 18:15:20 +00:00
Robert Osfield
6c07be375c Clean up of initialization of statics/use of getenv 2010-03-11 16:46:01 +00:00
Robert Osfield
9ab856323d Added export for PerContextShader. 2010-03-11 14:48:54 +00:00
Robert Osfield
1e1c79f257 Updated version 2010-03-10 16:31:15 +00:00
Robert Osfield
950d282f55 From Vincent Bourdier, addition of out of memory read result. 2010-03-10 14:28:18 +00:00
Robert Osfield
e082b01f26 From Wang Rui, "I've initially added the XML support of the new native osg format,
using osgDB::XmlParser. The extension for XML-formatted scenes is
.osgx, corresponding to .osgb for binary and .osgt for ascii. It could
either be rendered in osgviewer or edited by common web browsers and
xml editors because of a range of changes to fit the XML syntax. For
example, the recorded class names are slight modified, from
'osg::Geode' to 'osg--Geode'.

To quickly get an XML file:
# ./osgconv cow.osg cow.osgx

The StreamOperator header, InputStreram and OutputStream classes are
modified to be more portable for triple ascii/binary/XML formats. I
also fixed a bug in readImage()/writeImage() to share image objects if
needed.

The ReaderWriterOSG2 class now supports all three formats and
reading/writing scene objects (not nodes or images), thanks to
Torben's advice before.
"
2010-03-10 13:48:41 +00:00
Robert Osfield
6da42d9cd6 From Wang Rui, QWidgetImage class that enables QWidgets to be used as an interactive osg::Image that can be assigned to textures. 2010-03-10 13:24:53 +00:00
Robert Osfield
6ae2f4c6c6 From Sukender, "Here is my proposal. I fixed what Paul said, added some doxygen comments, added the function I told about, and removed the two "find('/')"-like calls to use only one." 2010-03-10 11:40:17 +00:00
Robert Osfield
bafe1d0b94 Added automatic updating of the OpenThreads version number from the CMake version numbers 2010-03-10 09:37:04 +00:00
Robert Osfield
c765a35650 From Wojcoech Lewandowski, "Attched are aimShadowCastingCamera() call changes, I have described in former post. Basically now MinimalShadowMap overrides first variant and keeps second. So both variants of aimShadowCastingCamera are clearly defined in MinimalShadowMap::ViewData scope. This way compilers have no problem and code looks less obscure. Changes made against the trunk." 2010-03-05 16:17:12 +00:00
Robert Osfield
86f491e649 Replaced use of unsigned int/enum mask combinations with int/enum mask combinations to avoid the need for casting enums to unsigned ints,
and to avoid associated warnings.

Update wrappers to reflect these changes.
2010-03-05 12:55:08 +00:00
Robert Osfield
273420bb1c Updated version and soversion numbers 2010-03-05 12:53:08 +00:00
Robert Osfield
5383297cbe Change Shader::getPCS(..) from protected to public scope to enable isCompiled() method to be accessible in applications.
Updated wrappers
2010-03-05 11:30:50 +00:00
Robert Osfield
4282b284e5 From Mathias Froehlich, Integration of osgText::Font with QFont to enable use of Qt fonts and selectors in osgText. 2010-03-04 12:43:09 +00:00
Robert Osfield
33b28a816e Added Export for new osgQt lib 2010-03-04 12:18:04 +00:00
Robert Osfield
1a1b7bd7a1 Moved QWebViewImage and QGraphicsViewAdapter into new osgQt utility library. 2010-03-04 12:15:35 +00:00
Robert Osfield
9f8a4be2cd Refactored DatabasePager so that it nolonger takes ref_ptr<PagedLOD>, but instead uses a custom version of observer_ptr<>.
This change should make it possible to delete PagedLOD's independantly from the DatabasePager, and also prevent issues of
consistency of the pager when subgraphs when are cached elsewhere in the application such as in the Registry filecache.
2010-03-03 16:40:19 +00:00
Robert Osfield
ba3971bb45 Added a ShadowTechnique::computeOrthogonalVector(const osg::Vec3& direction) const method for helping compute an appropriate
up vector to setViewMatrixAsLookAt(..) codes in osgShadow.  This will addresses previous issues that occured when look vectors
co-incided with the hard coded up vectors.
2010-03-01 13:00:04 +00:00
Robert Osfield
42a050e87c From Wojciech Lewandowski, "Here comes a list of small fixes in StandardShadowMap and derived classes affecting LispSM techniques. Changes made against SVN trunk.
Fixes in StandardShadowMap.cpp & MinimalShadowMap.cpp were made for spotlight issues. There were cases when further located spotlights were not shadowing properly.

Small tweak in DebugShadowMap & StandardShadowMap.cpp to not limit shadow maps to texture2D (which should also allow texture2D arrays and cube maps). I simply replaced ptr to osg::Texture2D with pointer to osg::Texture. Interpretation of this member could be now changed with change of shaders in derived classes. This may be useful for guys who override LispSM or MinimalBoundsShadowMaps techniques. Could be useful for implementation of PerspectiveCascadedShadowMaps technique for example.

ConvexPolyhedron.cpp & DebugShadowMap.cpp contain debug HUD tweaks.

Change in ConvexPolyhedron.cpp overcomes the regression problem with color per primitive binding which caused that shadow volume outlines stopped to draw. I simply changed PER_PRIMITIVE to PER_PRIMITIVE_SET and it works again.

Other adition is dump method I added to DebugShadowMap which can be used in shadow debugging mode to dump current frame shadow volumes & scene to osg file. It could be then loaded into viewer and freely examined from different angles (which is difficult inside the application if shadow adopts to view and projection). "
2010-03-01 11:52:44 +00:00
Robert Osfield
56c54958a3 Added spaces between < > template parts of macros to prevent compile problems when templates as use as macro parameters 2010-02-26 15:54:37 +00:00
Robert Osfield
bbca791251 From Michael Platings, "Here's the all-new, all-dancing DAE plugin, with support for reading
osgAnimation. It's been tested with the majority of the samples in the
COLLADA test repository and works with all of them either as well as, or
better than, the version of the plugin currently in SVN.

Known issue: vertex animation (AKA morphing) doesn't work at present,
but that's a relatively unpopular method of animating so it's not high
on my priority list."

Follow up email:
"I've been informed that the previous DAE submission didn't build on
unix, so here's the submission again with the fixes.  Thanks to Gregory Potdevin and Benjamin Bozou.
Also, my apologies to Roland for not crediting his part in making DAE
animation happen, my work was indeed built on top of his work. Thanks
also to Marius Heise and of course Cedric Pinson."

Changes by Robert Osfield, fixed compile issues when compile without C* automatic conversion enabled in ref_ptr<>
and constructor initialization fixes to address some warnings under gcc.
2010-02-26 14:41:50 +00:00
Robert Osfield
d50eacd07e From Paul Martz, "The changes are very similar to Magne's, except they now take the near plane into account. The changes are:
* Change OcclusionQueryNode::getPassed to take a NodeVisitor rather than the distance from BS center to the eye point. Change where CullVisitor calls this method to use the new parameters.
 * getPassed now exits early and returns true to avoid blinking / blink-in of geometry for the first frame or for out-of-range LOD children coming back into view.
 * getPassed now considers the distance from the near plane to the bounding sphere (rather than eye point to bounding sphere) when determining if the viewer is "inside" the bounding sphere or not."
2010-02-26 10:13:28 +00:00
Robert Osfield
8059c4a745 From Chris Hanson, comment fix. 2010-02-25 18:03:14 +00:00
Robert Osfield
605ad76691 From Wang Rui, "Attached is the osgTerrain wrappers, based on the latest SVN version
of OSG. I modified the osgDB::InputStream and OutputStream and the
PagedLOD wrapper as well. Now all seems to work fine with paged
scenes. I've tested with the puget terrain data and the osgdem
application from VPB:
# osgdem --xx 10 --yy 10 -t ps_texture_4k.tif --xx 10 --yy 10 -d
ps_height_4k.tif -l 8 -v 0.1 -o puget.osgb

As the ive plugin does, The PagedLOD wrapper now automatically add the
latest file path to PagedLODs' databasePath member, to help them find
correct child positions. I also changed the image storage strategy of
the OutputStream class, to store them inline by default. The osgt
extension should also work, in case the image files are also written
to the disk.
"
2010-02-25 17:53:51 +00:00
Robert Osfield
590bf9070d From Michael Platings, "There is a function, convertStringFromCurrentCodePageToUTF8() that would be useful outside the FBX plugin so it belongs in osgDB. I've attached ConvertUTF and ConvertUTF.cpp with the function added for you to commit at your convenience.
"
2010-02-25 17:07:34 +00:00
Robert Osfield
9a45538db9 Added an empty() method 2010-02-22 17:41:35 +00:00
Robert Osfield
c16d55fa9b From Trajce Nicklov, fixes to warnings 2010-02-22 09:50:37 +00:00
Robert Osfield
bb21136d92 Added missing _ptr = rp._ptr to constructor. 2010-02-22 08:39:33 +00:00
Robert Osfield
7f454bef3e Converted View across to use ObserverNodePath. 2010-02-20 17:36:55 +00:00
Robert Osfield
b1001c2a9c Moved implementation of Observer destructor and constructor from header into .cpp to avoid possible issues with imports/exports under Windows build. 2010-02-19 20:18:48 +00:00
Robert Osfield
8b67830f6e Added check against OSG_GL3_AVAILABLE to avoid issues with GL3 build under linux 2010-02-19 20:14:12 +00:00
Robert Osfield
eca4361c4a Clean up observer_ptr<> and removed the eronous casting of ptr in objectDeleted. 2010-02-19 19:50:55 +00:00
Robert Osfield
43f9b13199 Removed the uncessary subclassing from osg::Object as this base class is already pullled via ViewerBase 2010-02-19 18:56:21 +00:00
Robert Osfield
b807fc83fe Added mutex lock to destructor. 2010-02-19 16:04:33 +00:00
Robert Osfield
8f11af8d3e Replaced local mutex with getObserverMutex(). 2010-02-19 15:41:42 +00:00
Robert Osfield
88474271e3 From Fabien Lavignotte, "In order to compile on Windows with Wrappers ON, some exports are still missing on osgPresentation::AnimationMaterialCallback and osgUtil::IncrementalCompileOperation::CompileSet." 2010-02-19 14:30:01 +00:00
Robert Osfield
dc728aa184 Removed no longer defined methods and updated wrappers 2010-02-19 14:05:49 +00:00
Robert Osfield
530c947c94 Added an InitGlobalMutexes to enforce early construction and hence late destruction of singleton mutexes. 2010-02-19 09:02:24 +00:00
Robert Osfield
b5c5ae7185 Added newline. 2010-02-18 22:53:15 +00:00
Robert Osfield
bff9b565df Completed usage of ObserverNodePath to fix longstanding crash that occurred when nodes in parental chain of a newly loaded node had been deleted. 2010-02-18 21:21:59 +00:00
Robert Osfield
b09757bdb8 Refactored the osg::Referenced observerset code so that it now uses a dedicated ObserverSet class,
which utilises a global recursive mutex that is dedicated to manage Observer and ObserverSet.

The new global mutex for observers avoids problems with deadlocks that were occurring previously when
an osg::Refenced object was being deleted at the same time as on osg::ObserverNodePath.
2010-02-18 21:21:12 +00:00
Robert Osfield
6196652ef0 Replaced use of observer_ptr<> with straight C pointer to avoid thrashing of an observer_ptr<> every frame.
Changed include to point to new Observer header
2010-02-18 21:18:49 +00:00
Robert Osfield
649319ccaa Added className() to assist with debugging 2010-02-18 21:17:36 +00:00
Robert Osfield
787daeeb93 Refactored the ReentrantMutex support so that it utilises the underling thread implementation for recusive mutex support. 2010-02-18 20:14:41 +00:00
Robert Osfield
ab66740fb0 Added new setNodePathTo() method 2010-02-18 09:00:37 +00:00
Robert Osfield
9404abfef5 Added className() implementation to help wiht debugging. 2010-02-16 17:38:49 +00:00
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