Commit Graph

5631 Commits

Author SHA1 Message Date
Robert Osfield
72200de866 From Katharina Plugge, "I found a bug in the OpenFlight-Plugin. When exporting to OpenFlight it could happen that palettes of an external reference like the texture palette are set wrong, because they are overwritten by parent settings (userData), which actually do not refer to palette entries respectively ParentPools (happens for example if a Transform is parent of a ProxyNode). The static cast from userData to ParentPools should therefore be a dynamic cast.
---------------------------

function FltExportVisitor::writeExternalReference( const osg::ProxyNode& proxy ):

Line 423 in file expPrimaryRecords.cpp has to be changed from

const ParentPools* pp = static_cast<const ParentPools*>(proxy.getUserData() );

to

const ParentPools* pp = dynamic_cast<const ParentPools*>(proxy.getUserData() );
"
2008-10-27 15:26:53 +00:00
Robert Osfield
b28612bce2 Various warning fixes 2008-10-27 13:09:43 +00:00
Robert Osfield
e062524cb4 Updated wrappers 2008-10-27 11:49:31 +00:00
Robert Osfield
756b9c389a From Mathias Froehlich, "This change is a result of a recent thread on osg-users.
The semantic change that went into the ac loader with the past patch was
incorrect wrt the document describing the behaviour of ac files and
inconsistent with what ac3d itself displays for that files.
This attached change reverts the behaviour to the original one. The
infrastructure to change this is left in place.
The change is based on rev 9045."
2008-10-27 11:08:54 +00:00
Robert Osfield
d703c58936 From Blasius Czink, "Among other things I added support for atomic operations on BSD-like systems and additional methods (for "and", "or", "xor").
"

and a later post the same osg-submissions thread:

"it's been a while since I have made the changes but I think it was due to problems with static builds of OpenThreads on windows. I was using
OpenThreads in a communication/synchronisation library (without
OpenSceneGraph). It seems I forgot to post a small change in the CMakeLists file of OpenThreads. If a user turns DYNAMIC_OPENTHREADS to OFF (static build) OT_LIBRARY_STATIC will be defined in the Config.
Without these changes a windows user will always end up with a "__declspec(dllexport)" or "__declspec(dllimport)" which is a problem for static builds."

And another post from Blasius on this topic:

"I tested with VS2005 and VS2008. For 32 bit everything works as expected. For x64 and VS2008 I could successfully do the cmake-configure and then the compilation but I had occasional crashes of cmTryCompileExec.exe (during the cmake-configure phase) which seems to be a cmake bug. With VS2005 and 64bit cmake does not set _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED although the interlocked functionality should be there. If I place the source snippet from the CHECK_CXX_SOURCE_RUNS macro to a separate sourcefile I can compile and run the resulting executable successfully. Forcing OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED (on VS2005/x64) reveals a bug in "intrin.h" which seems to be fixed in VS2008 but not in VS2005.

In case anyone is interested the lines:
__MACHINEI(unsigned char _interlockedbittestandset(long *a, long b))
__MACHINEI(unsigned char _interlockedbittestandreset(long *a, long b))
__MACHINEX64(unsigned char _interlockedbittestandset64(__int64 *a, __int64 b))
__MACHINEX64(unsigned char _interlockedbittestandreset64(__int64 *a, __int64 b))

should be changed to:
__MACHINEI(unsigned char _interlockedbittestandset(long volatile *a, long b))
__MACHINEI(unsigned char _interlockedbittestandreset(long volatile *a, long b))
__MACHINEX64(unsigned char _interlockedbittestandset64(__int64 volatile *a, __int64 b))
__MACHINEX64(unsigned char _interlockedbittestandreset64(__int64 volatile *a, __int64 b))

The worst thing that can happen is that interlocked funtionality is not detected during cmake-configure and the mutex fallback is used.
Which reminds me another small glitch in the Atomic header so I attached a corrected version.



    Why is the OT_LIBRARY_STATIC added to the config file? It is not needed anywhere.

OT_LIBRARY_STATIC is needed if you are doing static-builds on Windows. See my previous post on that.
"
2008-10-27 10:42:58 +00:00
Robert Osfield
32907d679f From Alberto Lucas, fixed typo 2008-10-27 09:44:49 +00:00
Robert Osfield
0ff3f48693 Improved the support for no pre compile, and configuring the number of threads in the DatabasePager. 2008-10-26 22:22:38 +00:00
Robert Osfield
1cb2fc259e Improved the error reporting 2008-10-26 22:21:09 +00:00
Robert Osfield
20da8e55a8 From Jim Vaughan,
- Matrix transform nodes were stripped out, and the
vertices and normals of each node were
transposed by the modelling matrix.  My change preserves
the matrix transform nodes, so that
models can still be articulated by changing the matrices.

- Lights were copied from the COIN scenegraph to the OSG
scenegraph, but they were not associated
with a LightSource node.  My change for this creates a
Group and adds a LightSource for each Light.

- If VRML textures have names, the name is now copied to

--

Form Robert Osfild, changed SbString to std::string usage


M    Inventor/ConvertFromInventor.h
M    Inventor/ConvertFromInventor.cpp
2008-10-25 13:17:22 +00:00
Robert Osfield
48c31e5885 From Alberto Luaces, "it seems a copy-paste error is present on the OBJ loader when parsing the
options given by the user. "noTesselateLargePolygons" is being activated
instead of "noTriStripPolygons". I'm attaching the fixed file."
2008-10-24 11:38:40 +00:00
Robert Osfield
37cd3b419c Fixed typo 2008-10-24 10:02:13 +00:00
Robert Osfield
284d7c911d Add osgParticle:: qualifiers in front of Program entries to avoid issues when combining osg::Program and osgParticle::Program in a single app 2008-10-24 09:59:12 +00:00
Robert Osfield
b2ffdacd80 Changed timing stats to osg::INFO level 2008-10-24 09:49:55 +00:00
Robert Osfield
19a51b5aff Removed debugging test. 2008-10-24 08:09:36 +00:00
Robert Osfield
c1fd14fb2c Introduced new method of management the number of PagedLOD active, by using
a capping the number of PagedLOD to a sepcified maximum, with pruning of inactive
PagedLOD when the total number of inactive and active PagedLOD goes above the maximum.

To enable the mode set the env var OSG_MAX_PAGEDLOD to a value something like 1000.
2008-10-23 16:33:14 +00:00
Robert Osfield
f4f6aa288d From Panagiotis Koutsourakis, "We are using Open Scene Graph for an application and we need COLLADA
support. While testing the pluggin we found a small bug and we are
submitting a patch.

The first attachment is a small program that creates a scene with two
pyramids, transformed by two instances of
osg::PositionAttitudeTransform. One of them is rotated 90 degrees in
the X axis, and the scene is exported both in the native OSG (.osg)
and COLLADA (.dae)  formats. In the first case the rotated pyramid is
displayed correctly whereas in the second the pyramid seems not to be
rotated.

In the COLLADA 1.4.1 specification (found at
http://www.khronos.org/collada/) it is specified that
"The <rotate> element contains a list of four floating-point values
[...] followed by an angle in degrees" but the plugin seems to write
the value in radians.

The problem seems to be in the method daeWriter::apply() that seems to
be writing the angle value in radians to the COLLADA file. The patch
can be found in the second attachment and is simply a call to
RadiansToDegrees wrapped around the angle.
"
2008-10-21 16:39:24 +00:00
Robert Osfield
fd5f9741d3 From Wojciech Lewandowski, "I made a minor tweak in StandardShadowMap.cpp. As agreed with J-S I have added AlphaFunc/AlphaTest to shadow camera stateset to make sure transparent objects will not cast blocky solid shadows." 2008-10-21 16:32:55 +00:00
Robert Osfield
3b5f9f1e5d From Chris Denham, "However, just spotted another inconsistency between UFOManipulator::getMatrix() and UFOManipulator::getInverseMatrix()
It assumes that inverse(_inverseMatrix * _offset) = _offset * _matrix
This is only true when _offset=identity, so I think it should be inverse(_offset) * _matrix
This inconsistency can cause problems when switching from UFO to other manipulators, because the UFO:Manipulator::getMatrix function is not necessarily returning a correct inverse of the currently set ModelViewTransform.
It was tempting to change the name of the _offset member to _inverseOffset, or to maintain both variables, but in the end went for the minimal change."
2008-10-21 16:31:01 +00:00
Robert Osfield
144e44a749 From Per Fahlberg, "I ran into a problem when using another library that implemented the same functions as the osg jpeg plugin, i guess they both originated from the same example code :) As a solution I added a namespace in ReaderWriterJPEG.cpp around the functions.
"
2008-10-21 16:27:22 +00:00
Robert Osfield
01593240ed #if'd out an premature StateSet optimization that was causing problems with datasets that mixed multi-texture coord geometry with single texture coord geometries in a single scene graph. 2008-10-21 15:51:56 +00:00
Robert Osfield
f058fc299e Updated wrappers 2008-10-21 09:50:07 +00:00
Robert Osfield
24eb2f6c43 Introduce osgDB::FileCache, and updated osgfilecache and DatabasePager to use it. 2008-10-20 16:24:57 +00:00
Robert Osfield
10186190f6 Introduced support for controlling mipmapping of osgTerrain::ImageLayer and compression of osgTerrain::HeightFieldLayer. 2008-10-20 08:43:25 +00:00
Robert Osfield
61bd2b825f From Chris Denham, "I noticed that UFOManipulator _matrix and _inverseMatrix may be inconsistently set due to typo in
UFOManipulator::home().
I assume the intention is that _matrix and _inverseMatrix are kept consistent, so corrected file attached.

///////////// OSG 2.6 //////////////////
  _inverseMatrix.makeLookAt( _homeEye, _homeCenter, _homeUp );
  _matrix.invert( _matrix );
///////////// after typo correction /////////////////
 _inverseMatrix.makeLookAt( _homeEye, _homeCenter, _homeUp );
  _matrix.invert( _inverseMatrix );
///////////////////////////////////////"
2008-10-15 10:07:21 +00:00
Robert Osfield
f66a285b01 Changed erroneous ZLIB_INCLUDE_DIRS to ZLIB_INCLUDE_DIR 2008-10-14 17:20:58 +00:00
Robert Osfield
1bbab1fcc7 From Jason Beverage, "Here is a small change to the CURL plugin to distinguish between a 400 level error and a 500 level error.
If a 400 level error occurs, a FILE_NOT_FOUND ReadResult is appropriate.

If a 500 level error occurs (such a 503, Service unavailable), the application might want to try to load the file again in a few seconds/minutes.  This submission returns ERROR_IN_READING_FILE if a 500 level error occurs so that clients can easily distinguish between the errors.

The actual error code is also added to the "message" of the ReadResult so if a client needs more information, they can just parse the message to retrieve the error code."
2008-10-14 16:57:37 +00:00
Robert Osfield
ec797b3a81 From Ricard Schmidt, dot writer plugin. 2008-10-14 16:35:03 +00:00
Robert Osfield
78d731a316 Added zlib support to curl and ive plugins 2008-10-14 14:37:11 +00:00
Robert Osfield
ad78c21e07 Added debug timing code 2008-10-14 14:36:24 +00:00
Robert Osfield
ac975bf79a Added a Refrenced::getGlobalReferencedMutex, and OpenThreads::ScopedPointerLock() and use of this in add/removeParent() codes
to avoid threading problems when using atomic ref counting.
2008-10-14 14:27:41 +00:00
Robert Osfield
d8525815fd Moved compress/uncompress code across to using gzip compatible methods 2008-10-10 12:01:54 +00:00
Robert Osfield
46172c931e Added initial cut of gz compress/uncompress plugin 2008-10-09 18:46:49 +00:00
Robert Osfield
ab3ecd129d Initial cut of zlib based compress/uncompress plugin 2008-10-09 17:02:16 +00:00
Robert Osfield
c3af8b1c8e Fixed the frame rate reporting so that it handles the case when animation is slowed or speeded up 2008-10-09 08:52:14 +00:00
Robert Osfield
9cd739d45c Updated wrappers 2008-10-08 12:54:45 +00:00
Robert Osfield
5e95d6e3b5 Added Texture1D(Image*) and Texture3D(Image*) constructors 2008-10-08 11:30:18 +00:00
Robert Osfield
a4aa8fbcd2 Replaced std::vector::insert with std::copy + back_inserter to avoid member template problems with sunos. 2008-10-08 10:55:20 +00:00
Robert Osfield
29c0e913d7 From Mathias Froehlich, fixes for HP-UX, SGI and Solaris build 2008-10-08 10:10:34 +00:00
Robert Osfield
91d20fb3ec Moved OSG_FORCE_QUERY_RESULT_AVAILABLE_BEFORE_RETRIEVAL into src/osg/CMakeLists.txt 2008-10-07 15:59:10 +00:00
Robert Osfield
9b83cad247 Made line graph solid (alpha = 1.0) 2008-10-07 15:58:07 +00:00
Robert Osfield
4f684d16f2 From Jean-Sebastien Guay and Robert Osfield, added setDataVariance(osg::DYNAMIC) to avoid problems to optimization. 2008-10-07 15:41:47 +00:00
Robert Osfield
8ea9fad93a Added osgText to link line 2008-10-07 15:21:12 +00:00
Robert Osfield
c569b8a1f3 Restoring Roger's original 2.0 factor as on review the later orthographic projection code
doesn't require the position to be far out from the center to simulate an infinite light.
2008-10-07 15:19:48 +00:00
Robert Osfield
ad72dc66ce From Roger James, "The light position is incorrectly calculated for shadow casting scenes whose bounding box centre is not the origin. This is a one line fix.
"
2008-10-07 15:16:37 +00:00
Robert Osfield
09e6261e9a From Wojciech Lewandowski and Robert Osfield, add CMake build option for controlling the Windows/NVidia multi-monitor workaround. 2008-10-07 14:36:46 +00:00
Robert Osfield
0daf1f007a Updated wrappers 2008-10-07 14:25:09 +00:00
Robert Osfield
b7fa3f6f3c Replaced IntersectVisitor usage with IntersectionVisitor 2008-10-07 14:19:28 +00:00
Robert Osfield
ed2bbbf23b From Jean-Sebastirn Guay, "Inspired by the latest additions to the StatsHandler, here is my own addition. It's a graph that helps show the variation of the various stats over time. It's clearer than just having bars for the last 10 frames or so, IMHO, since 10 frames go by pretty fast...
The graph is displayed "under" (behind) the normal bar chart you get when you press 's' twice. It doesn't hide the normal stats, you can still read them without any trouble, and that way, it doesn't take any more screen space. It starts from the left, and will scroll left when there is enough data to fill the screen width. The graph lines have the same colors we're used to (except I made the event color a bit bluer, so it's not exactly the same as the update color). A screen shot is attached.

The lines get a bit confused when they're all overlapping at the bottom of the graph, but I think that's the least of our concerns (if they're all at the bottom of the graph - except FPS of course - then great!).

The only thing I'm not very keen about is that to make things simple, I clamp the values to a given maximum. Right now, the maximums I have set are:

* Frame rate: 100 fps (people have 60, 75, 85Hz refresh rates, so there's no one right value, but I think 100 is OK)
* Stats: 0.016 seconds (what you need to get 60Hz minimum)

This could be changed so that the scale of the graph changes according to the maximum value in the last screenful of the graph instead of clamping values. We would then need to display the scale for each value on the side of the graph, because if the scale changes, you need to know what it is at this moment.

I tried to make things easy to change, so for example if you don't like that the graph is in the same space as the normal stats bars, it's easy to move it anywhere else, and make it have other dimensions. The maximums and colors are also easy to change.

The impact on performance should be minimal, since it's one vertex per graph line that's added per frame, and vertices are removed when they scroll off the screen, so you'll never have more than say 1280 * (3 + ncameras) vertices on the screen at one time. No polygons, I used line strips. The scrolling is done with a MatrixTransform."
2008-10-07 13:37:04 +00:00
Robert Osfield
af30f0769a From Colin McDonald, "Attached is an update to the dxf plugin which adds rudimentary support for
text entities.
"
2008-10-07 13:06:53 +00:00
Robert Osfield
ff8c6aa32b From Mathias Froehlich, build fixes 2008-10-07 12:31:42 +00:00