set to "SCENE" in the file header. But if the file is stored and
then extracted again from an osga archive this header info is lost,
and the resulting file is just an "OBJECT". Possibly other plugin
operations would have the same effect. The osgt/osgb plugin won't
then return the scenegraph contents.
I have updated the osgt/osgb plugin to return a node from an "OBJECT"
file."
But the nested stream implementation for osga archive files doesn't
support seeking. So osgb files can't currently be used in an osga
archive e.g. if osgdem is used to output a osgb format database it
can't be packaged in an archive file, in the same manner that ive
files could.
I've added seek support to the osga nested stream implementation."
* fixed a bug with multi-touch and touch-id-generation on iOS and OS X. (will fix a bug reported by Colin Cochran, without ditching the existing logic)
* removed unnecessary warning-flagss when generating xcode-projects via cmake, will enable the usage of OSG_AGGRESSIVE_WARNING_FLAGS
* added support for 10.9 (OS X)
* new cmake-variable: IPHONE_VERSION_MIN, this will set the deployment-target (previously hard-coded) If you set the IPHONE_VERSION_MIN to something like 7.0 osg gets compiled also for 64bit (amd64)
* cmake defaults now to the clang compiler if IPHONE_VERSION_MIN > 4.2
* cmake now sets some xcode-settings so the compiler uses the c++98-standard (clang defaults to c++11, w/o this I got a lot of linking errors)
* removed include-dir for avfoundation-plugin as not needed on OSX/IOS.
* enhanced the ios-example, will now show multitouch-information on a hud (similar to the osgmultitouch-example), and more importantly, will compile + link out of the box
* small enhancements for the osc-device-plugin (send only one msg for MOVE/DRAG, even if multiple msgs/event is enabled)
* better memory-handling for the zeroconf-plugin
* fixed a possible bug in the rest-http-plugin when receiving mouse-events.
* incorporated a fix from Colin Cochran "forwarded touch events are not transformed into the GL UIView“
"
required to build newever OSG on this OS. Also corrects file name
in the error message - I was confused not to find OSCHostEndianness.h
after I've got this error.
Tested by successfully building OSG 3.2.0 with this patch on FreeBSD
9.1."
loading multiple VRML files in parallel. Christopher R. Baker has
detected this bug and crafted a patch. In addition, libcoin has to be
also built with the "--enable-threadsafe" option.
I copy here his report, extracted from
(https://bugs.launchpad.net/ubuntu/+source/openscenegraph/+bug/1211993)
and attach his fix. All credit is due to him:
«
There are three instances of a classical method-local-static
multithreaded initialization bug in the Inventor plugin for OSG that
trigger various memory faults when reading multiple VRML files in
parallel via osgDB::readNodeFile. These bugs are of the form:
static std::map<Stuff,OtherStuff> myHandyMap;
static bool once = true;
if(once) { ...fill myHandyMap; once = false }
... use myHandyMap;
To repeat: try loading multiple VRML files from multiple threads. The
liklihood of the bug depends on many factors, but my application, which
parallel-loads some dozens of small (<100K) VRML files on startup,
triggers this problem 25% of the time or more.
The attached patch (inventor-plugin-multithread.patch) rectifies this
problem by:
1 - Inheriting MyHandyMap from std::map, then
2 - Moving the map initialization into the derived constructor, which
3 - Is intrinsically protected from multithread issues by g++ (and is
part of the C++ standard), unless you pass -fno-threadsafe-statics,
which is strongly discouraged by the man page.
»
"
In CMakeList.txt there is a case sensitivity issue which a fix was posted by Robert Osfield in the users forum.
I also had to rename the files OSXAvFoundationCoreVideoTexture.h and OSXAvFoundationCoreVideoTexture.cpp to OSXAVFoundationCoreVideoTexture.h and OSXAVFoundationCoreVideoTexture.cpp
Finally in OSXAvFoundationCoreVideoTexture.cpp the include OSXAVFoundationVideo.H was updated to OSXAVFoundationVideo.h"
I found a bug on DDS ReaderWriter that generates a false positive on a guard for the size check on writing operation. This is due to a wrong imageSize computation that uses img->getImageSizeInBytes() method instead of img->getTotalSizeInBytes(), that actually ignores the r() dimension, contrariwise taken into account by the function ComputeImageSizeInBytes() later.
The line 1062 on file ReaderWriterDDS.cpp should be fixed with:
[code]unsigned int imageSize = img->getTotalSizeInBytes();[/code]
"
1> osgmultiplemovies example does not use SDL so needs no link to SDL
2> Added header files to "Plugins osg" project, so visual studio can find the source of
OSG_WARN << "AsciiInputIterator::readProperty(): Unmatched property "
"
I've also checked the modified files still build ok with other
compilers (Linux gcc, Windows Visual Studio).
osgDB/OutputStream.cpp and osgPlugins/lws/SceneLoader.cpp require
stdlib.h for atoi use.
In osg/Uniform.cpp the compiler complains that base_class is unknown
unless I add a class name qualifier.
Not a build fix, but I spotted a typo in osgUtil/SceneView."
Provided are lua, python and V8 (for javascript) plugins that just open up enough of a link to the respective libs to run a script, there is no scene graph <-> script communication in current implementation.
You can check with the tester2.flt provided earlier and check with the result image.
I double checked this with OpenFlight creator, and it seems the yaw is broken.
With my initial quaternion version is seems correct and if I change the
float cos_yaw = cosf(osg::inDegrees(yaw));
float sin_yaw = sinf(osg::inDegrees(yaw));
to be
float cos_yaw = cosf(osg::inDegrees(-yaw));
float sin_yaw = sinf(osg::inDegrees(-yaw));
it seems to work as well."
Warning, can't assign attribute binding as no has been array assigned to set binding for.
I think those are ive's with bumpmaps, but I have not checked yet. The problem is in
OpenSceneGraph\src\osgPlugins\ive\Geometry.cpp
where the code tries to set Normalize and Binding for a missing Array.
I think that code can safely be skipped, considering the write function has a hardcoded write when the array is missing. (introduced in svn rev 13488)
modified file (OpenSceneGraph\src\osgPlugins\ive\Geometry.cpp) attached in Zip"
svn 13587 From David Callu, warning fixes and removal of spaces at end of lines.
this can be fixed by adding a space before the comment opening /*.
full modified file (openscenegraph\src\osgplugins\osg\BinaryStreamOperator.h) attached in zip
Regards, Laurens.
openscenegraph\src\osgplugins\osg\BinaryStreamOperator.h(71): warning C4138: '*/' found outside of comment (OpenSceneGraph\src\osgPlugins\osg\ReaderWriterOSG2.cpp)
openscenegraph\src\osgplugins\osg\BinaryStreamOperator.h(73): warning C4138: '*/' found outside of comment (OpenSceneGraph\src\osgPlugins\osg\ReaderWriterOSG2.cpp)
openscenegraph\src\osgplugins\osg\BinaryStreamOperator.h(211): warning C4138: '*/' found outside of comment (OpenSceneGraph\src\osgPlugins\osg\ReaderWriterOSG2.cpp)
openscenegraph\src\osgplugins\osg\BinaryStreamOperator.h(213): warning C4138: '*/' found outside of comment (OpenSceneGraph\src\osgPlugins\osg\ReaderWriterOSG2.cpp)"
1. Check the bit depth of the passed Image and return an error if not 8 or 16. (not fully featured, but still an improvement over hard coded 8bit for everything)
2. Endian swap 16bit image data when on a little endian architecture.
"
I just added a field version_ to read it at the beginning and added extra code to check it and read the extra field if needed and read the good filename"
been removed in the most recent versions of libavcodec/ffmpeg. You're
already using avcodec_open2() elsewhere, but one appears to have been
missed. The change is trivial:
[skynet](0) $ svn diff
Index: src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp
===================================================================
--- src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp (revision 13355)
+++ src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp (working copy)
@@ -109,7 +109,7 @@
// m_context->flags |= CODEC_FLAG_TRUNCATED;
// Open codec
- if (avcodec_open(m_context, p_codec) < 0)
+ if (avcodec_open2(m_context, p_codec, NULL) < 0)
throw std::runtime_error("avcodec_open() failed");
}
[skynet](0) $
I've applied similar changes this year to many other packages, including
cheese, blender, linphone, ad nauseam. It's been tested by verifying that
with my patch, OSG builds against the newest libavcodec and ffmpeg, whereas
otherwise it does not.
The modified src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp is attached. It
originates in svn trunk revision 13355. Thanks!"
// A custom class
namespace CustomDomain {
class MyGroup : public osg::Group
{
public:
META_Node( CustomDomain, MyGroup );
void setMyName( const std::string& n );
const std::string& getMyName() const;
void setMyID( int id );
int getMyID() const;
...
};
}
// The serialization wrapper using a custom domain name
REGISTER_CUSTOM_OBJECT_WRAPPER( MyDomain,
CustomDomain_MyGroup,
new CustomDomain::MyGroup,
CustomDomain::MyGroup,
"osg::Object osg::Node osg::Group CustomDomain::MyGroup" )
{
ADD_STRING_SERIALIZER( MyName, std::string() );
{
UPDATE_TO_VERSION_SCOPED( 1 ); // Updated for a new domain version
ADD_INT_SERIALIZER( MyID, 0 );
}
}
Save the class instance as follows:
osgDB::writeNodeFile( *myGroup, "serializer_test.osgt", new osgDB::Options("CustomDomains=MyDomain:1") );
The output file will include the domain version definition and all the class data, and can be read back. We can also force setting the domain version by the CustomDomains option while reading the saved files. If we save the class instance without any options, MyID will be ignored because the default domain version is 0.
This may help third-party libraries like osgEarth to maintain their own serializers without regarding to the OSG soversion changes.
Another feature added is a more robust binary format, which in fact adds a size-offset at each block's beginning. When there are problems or unsupported data types while reading, we can now directly jump to the block end indicated by the offset value. So a .osgb file will automatically ignore bad data and read remains as normal (at present it will fail at all). This feature will not break the backward compatibility, and can be disabled by setting "RobustBinaryFormat=false" while writing out.
Hope these changes can work smoothly with present and future community projects. Maybe we should also consider have an osgserializer example to test and demonstrate all things we can do now."
New methods osg::Geometry::containsDeprecatedData() and osg::Geometry::fixDeprecatedData() provide a means for converting geometries that still use the array indices and BIND_PER_PRIMITIVE across to complient
versions.
Cleaned up the rest of the OSG where use of array indices and BIND_PER_PRIMITIVE were accessed or used.
It's
return osg::Image::computeImageSizeInBytes(width, height, depth, packing, slice_packing, image_packing);
but I think it should be
return osg::Image::computeImageSizeInBytes(width, height, depth, pixelFormat, pixelType, packing, slice_packing, image_packing);"
The API has changed quite a bit, so lots of changes had to be made in the osg readerwriter. The preious version of the FBX SDK (2013.3) already deprecated a lot of the names and functions. The code I submit now still compiles against 2013.3 (possibly needs a #define FBX_NEW_API). Not sure if that's useful, but it might ease the transition."
a change in version 5.0.0 required a call to the fuction "DGifOpen" to pass an int ref for an error code.
My fix ignores the error, just fixes the compile."
The plugin does not support images without alpha channel for opacity
This seems to indicate that the check for alpha should be against the opacity map. I've attached the updated file.
"
- Added missing packing value on S3TC images. Images are coded with 4x4 blocs, whatever the image size. So there is an horizontal packing of 4 pixels (2 bytes in DXT1, 4 bytes in DXT2-5).
- Added crash guard against writing corrupted S3TC images.
Notes:
- What is missing is a support of "lines packing" in osg::Image (see code comments).
- S3TC-DXTC vertical flipping crashes (access violation) with some unusual dimensions (see code). I could not implement missing cases, so I added guards to avoid crashing."
The solution for to refactor the way that events are checked so I add a bool return type to checkEvents() method across osgViewer::GraphcisWindow, osgGA::Devive and osgViewer::Viewer/CompositeViewer classes
Instead of
INCLUDE_DIRECTORIES(${LIBVNCCLIENT_INCLUDE_DIR})
the CMake variable
INCLUDE_DIRECTORIES(${LIBVNCSERVER_INCLUDE_DIR})
should be used.
Attached is a fix for src/osgPlugins/vnc/CMakeLists.txt"
1. Respect "noMatrixTransforms" option for matrices attached to meshes, not only those attached to nodes
2. traverse_nodes variable did the exact opposite of it's description.
3. Always try to load referenced textures, even if we can't find the files (in order to the the registry's ReadFileCallback have a stab at it)
"
See attached my ported code, which fulfills:
- using of setUserValue()/getUserValue()
- user-value will be attached to Geode or Drawable
- actually 3 values will be added: SMC (surface), FID (feature) and IRC (IRcolor). Its UserValue-names are < UA:SMC >, < UA:FID > and < UA:IRC > (without spaces!)
- user-value will be attached to Geode or Drawable
- has an option (named preserveNonOsgAttrsAsUserData) for control whether the UserValues should be attached (Default: no UserValues will be attached)
Reading out this values is very simple. Here is an example (uservalue-name without spaces!):
signed short smc;
if (myGeode.getUserValue("< UA:SMC >", smc))
{
doSomethingWithTheGeodeAndItsSmc(myGeode, smc);
}
else
{
// geode has no SMC
}