Commit Graph

8735 Commits

Author SHA1 Message Date
Robert Osfield
1b34fed500 Added handling of up/down key to ComboBox 2014-05-19 09:30:36 +00:00
Robert Osfield
87fd1d38fb Added initial cut of ComboBox 2014-05-16 19:24:58 +00:00
Robert Osfield
3e00764649 Added initial shell of PushButton implementation 2014-05-16 10:38:40 +00:00
Robert Osfield
03fc0c3662 Added support for intesecting Drawable that are attached directly to the scene graph without an osg::Geode 2014-05-15 16:30:17 +00:00
Robert Osfield
5b60708e80 From Sebastian Messerschmidt, "There was some small error due to MS non-conformity handling comments correctly." 2014-05-15 14:57:28 +00:00
Robert Osfield
d8a06f827e From Pjotr Svetachov, build fixes for VisualStudio 2014-05-15 14:45:28 +00:00
Robert Osfield
85386daa25 Added osgGA dependency 2014-05-15 13:34:50 +00:00
Robert Osfield
20b9f3ff88 Added Node::asDrawable() and Node::asGeometry() methods to provide a low cost way of casting a node to Drawable and Geoemtry.
Changed the Group::computeBound() method so that it takes account of the a Drawable's BoundingBox.
2014-05-15 09:26:59 +00:00
Robert Osfield
afcf54b108 Fixed the bounding sphere computation and handling of Drawable as the root of the scene graph 2014-05-14 16:52:18 +00:00
Robert Osfield
74f91037a7 Further work on Bound class/Node::getBound() and Drawable::getBound() and usage in OSG codebase 2014-05-14 16:01:40 +00:00
Robert Osfield
ff21af2b0d Cleaned up code 2014-05-14 16:00:08 +00:00
Robert Osfield
4174d72a52 2014-05-14 10:19:43 +00:00
Robert Osfield
12a737ae02 Changed the Node::ParentList to be a list of osg::Node rather than osg::Group, and added addChild, removeChild, replaceChild virtual method to Node to enable code
to user code compile with minimal modifications to account for the new change to the Node ParentList.
2014-05-13 08:43:07 +00:00
Robert Osfield
b2c7bacfe9 From Farshid Lashkari, "As discussed, I've added the ability to handle Drawable objects within the NodeVisitor class. Here is an overview of the changes:
- Added apply(Drawable) and apply(Geometry) to NodeVisitor

- Added accept(NodeVisitor) method to Drawable/Geometry

- Added traverse(NodeVisitor) to Geode which calls accept(NodeVisitor) on all Drawables

- Updated CullVisitor to use new apply(Drawable) to handle drawables. The apply(Billboard) method still manually handles the drawables since it is depends on the billboard settings. I needed to disable the traverse within billboard to prevent duplicate traversal of drawables.

- Update other osgUtil node visitors (GLObjectsVisitor, IncrementalCompileOperation, ..) to use new apply(Drawable) method.
"
2014-05-12 12:10:35 +00:00
Robert Osfield
ead92353fe Added beginnings of new osgUI library, a replacement for osgWidget that works fully in 3D/stereo and is scriptable. 2014-05-12 11:27:54 +00:00
Robert Osfield
490b351330 Replaced obsolete __linux usage. 2014-05-06 16:38:57 +00:00
Robert Osfield
cf66750d7b From Farshid Lashkari, "fix for the Collada loader where it would access a null string in some cases" 2014-05-02 09:12:36 +00:00
Robert Osfield
1f33e2a2a0 From Ali Botorabi, "recently I ran into a problem with Microsoft's Appverifier while using OpenThreads on win32 platform. The Appverifier complained about an invalid thread handle during starting of a new thread. After looking closer into the problem it seemed that indeed a potential root of problem may be in the thread startup code. See the line below in Win32Thread.cpp (line number 347):
pd->tid.set( (void*)_beginthreadex(NULL,static_cast<unsigned>(pd->stackSize),ThreadPrivateActions::StartThread,static_cast<void *>(this),0,&ID));

the method "pd->tid.set" sets the thread id, however via the startup function "ThreadPrivateActions::StartThread" that thread id is used (see further down the call hierarchy the line "int status = SetThreadPriority( pd->tid.get(), prio);".

Until now I never ran into any problem in debug or release builds, though. It seems that furtunately the tid.set method was executed always before the tid.get method in the startup code. However, this may make trouble in the furture. A simple solution is the following: just replace the line above with following two lines:

    pd->tid.set( (void*)_beginthreadex(NULL,static_cast<unsigned>(pd->stackSize),ThreadPrivateActions::StartThread,static_cast<void *>(this),CREATE_SUSPENDED,&ID));
    ResumeThread(pd->tid.get());


The trick is just starting the thread in suspended mode so the StartThread function does not get executed and we can safely store the tid by pd->tid.set. Then start the Thread by calling ResumeThread."
2014-05-02 09:11:16 +00:00
Robert Osfield
298f1c65b6 Renamed the new include/osg/OpenGL automatically configured header file to include/osg/GL replacing the original hand built GL header 2014-04-30 13:19:22 +00:00
Robert Osfield
a04232a75a From Pjotr Svetachov, "have added some missing serializers for RigGeomery. Withouth them I
ran into two issues.

At first you get a bunch of warnings that osg::ComputeBoundCallback
and osg::UpdateCallback were unsupported wrapper classes when
converting fbx models with skeletal animation to osg(t/b).

The second issue was that when reading, the readers fail to read the
ComputeBoundCallback and UpdateCallback and set them to NULL which
messes up the RigGeometry.

Because a RigGeometry makes his own classes in the constructor it
might be preferable to not write them at all, because now those
classes are being made two times when reading a RigGeometry. But after
thinking about this that would place too much limits on them (you
won't be able to share or name them and save that information or make
a new inherited class from them and write that one) So I ended up
thinking the best way was to just write the files.
"
2014-04-29 15:14:39 +00:00
Robert Osfield
2bb4e0566c From Pjotr Svetachov, "I had the osgvolume example crash on me when loading large volume
datasets due to an overflow in image.cpp after a unneeded cast from
unsigned int to int. Here is a small fix."
2014-04-28 14:58:36 +00:00
Robert Osfield
4dd3e3562f From Jason Beverage, "Here is a fix for a small race condition in osgDB::makeDirectory. It attempts to create all the directories in the given path and stops attempting to make directories when one of them fails. I've added a check to see if the failure occurred b/c the directory was created by another thread or process.
We were running into issues occasionally in osgEarth where multiple threads were writing out files like /1/2/3.jpg and /1/3/4.jpg.  Both threads would try to create the /1 directory and only one of them would succeed.  So the first thread would write out the full /1/2/3.jpg while the second thread wouldn't create the /1/3 directory b/c /1 was already created and the writing of /1/3/4.jpg would fail.
"
2014-04-28 14:57:05 +00:00
Robert Osfield
f5261b9877 Fixed type error 2014-04-28 11:53:58 +00:00
Robert Osfield
4994b806d2 From Pjotr Svetachov, "For me osgviewer.cpp and Renderer.cpp were not compiling (visual studio 2013 with profile GL2) because they were still using GLuintEXT. So I changed that, see the attached files.
I also noticed that the generated OpenGL header were not copied to the installation directory so my own application could not find it."
2014-04-25 08:57:27 +00:00
Robert Osfield
7b4d7cd221 From Farshid Lashkari, "I've attached a small fix to the Collada loader which prevents a null pointer access in some cases." 2014-04-24 17:26:46 +00:00
Robert Osfield
77f1c58345 From Lionel Lagarde, "In the ::apply method, when the image data need to be re-uploaded, the Texture2DArray checks if the TextureObject can be re-used. The test was made using the constant 1 instead of the real texture depth, so the TextureObject was never re-used." 2014-04-24 17:23:16 +00:00
Robert Osfield
bc5575f83a From Kristofer Tingdahl, "I and my team have gone over the code again, and we feel that we are comfortable in our current proposal for change. It goes deeper than it did before, and I explain why:
There was code in the osgViewer/Viewer.cpp and osgViewer/CompositeViewer.cpp that transformed the Y-coordinates of an event. The code in the composite viewer did however miss the touch-data of the event. I thought that it should really be the GUIEventAdapter that should know about this, and hence I added the
GUIEventAdapter::setMouseYOrientationAndUpdateCoords which is re-computing the coordinates. First I simply added a boolean to the setMouseYOrientation function:

setMouseYOrientation( MouseYOrientation, bool updatecooreds=false );

but then the serializer complained.

This function is called from both the Viewer and the CompositeViewer. We have not tested from the viewer, but I cannot see it would not work from visual inspection.

The other change is in MultiTouchTrackballManipulator::handleMultiTouchDrag. I have removed the normalisation. The reason for that is that it normalised into screen coordinates from 0,0 to 1,1. The problem with that is that if you have a pinch event and you keep the distance say 300 pixels between your fingers, these 300 pixels represent 0.20 of the screen in the horizontal domain, but 0.3 of the screen in the vertical domain. A rotation of the pinch-fingers will hence result in a zoom in, as the normalised distance is changing between them.

A consequence of this is that I have changed the pan-code to use the same algorithm as the middle-mouse-pan.

The rest of it is very similar from previous revision, and there has been some fine-tuning here and there.

"
2014-04-24 17:14:54 +00:00
Robert Osfield
ec658b115c Fixed reference invalidation bug. 2014-04-24 10:38:58 +00:00
Robert Osfield
a1342a6bf6 Added src/osg/OpenGL.in configuration file and include/osg/OpenGL header files 2014-04-23 19:30:33 +00:00
Robert Osfield
5597248895 Introduced new scheme for setting up which version of OpenGL/OpenGL ES the OSG is compiled for.
To select standard OpenGL 1/2 build with full backwards and forwards comtability use:

  ./configure
  make

OR

  ./configure -DOPENGL_PROFILE=GL2

To select OpenGL 3 core profile build using GL3/gl3.h header:

  ./configure -DOPENGL_PROFILE=GL3

To select OpenGL Arb core profile build using GL/glcorearb.h header:

  ./configure -DOPENGL_PROFILE=GLCORE

To select OpenGL ES 1.1 profile use:

  ./configure -DOPENGL_PROFILE=GLES1

To select OpenGL ES 2 profile use:

  ./configure -DOPENGL_PROFILE=GLES2


Using OPENGL_PROFILE will select all the appropriate features required so no other settings in cmake will need to be adjusted.
The new configuration options are stored in the include/osg/OpenGL header that deprecates the old include/osg/GL header.
2014-04-23 09:08:26 +00:00
Robert Osfield
c168887e5e From Paul Cheyrou-Lagreze, "Attached is fix/feature for FBX osgplugins against latest trunk:
- ReaderWriterFBX.cpp: add "z up scene axis" support:  FBX provides facility to convert model scene axis during conversion. Currently fbx plugin convert axis to fbx:opengl axis system (which is arbitrarily at Y up, as opengl is in reality axis agnostic) and sometimes what is needed is Z up so added an option for Z up conversion

- FindFBX.cmake: add support for latest fbx sdk ( 2014.2 )"
2014-04-09 17:40:27 +00:00
Robert Osfield
db6df6fefd Disabled warnings to address issues in FBX headers that generate lots of warnings that we can't fix. 2014-04-09 17:20:26 +00:00
Robert Osfield
a4a5957e2f From Remo Eichenberger, "I have extended the TIFF plugin that allows you to write LZW or JPEG compressed TIFF's. Options are:
tiff_compression = lzw | jpeg"
2014-04-08 12:00:52 +00:00
Robert Osfield
f2b746520b From Pjotr Svetachov, "We had a small problem converting skeleton animations from fbx to osgt
format. Turned out that the serializer didn't handle bone names with
spaces very well (the 3ds studio max biped for instance has spaces by
default). Here is a small fix for the problem."
2014-04-08 11:17:59 +00:00
Robert Osfield
ca4d93652d From Pjotr Svetachov, previous obj "commit broke compilation under visual studio 2013. To use std::not1 you need to include the functional header. Here is a fix." 2014-04-08 11:08:05 +00:00
Robert Osfield
391ab02573 From Jan Peciva, "I am sending four fixes to obj plugin:
- materialName used to be not stripped of whitespace, making number of models
fail to load materials; now fixed
- stripping was considering spaces only, thus models using tabs had problems
to load correctly; fixed
- fixed references to textures; they did not performed conversion to native
directory separators
- make d (dissolve) takes precedence over Tr (transparency); there seems to be
a confusion about the Tr item - some claiming 1 to be opaque and 0
transparent, while number of models uses exactly the opposite. d (dissolve),
if present in the model, does not suffer from this confusion, thus using it
instead fixes the problem for many many models.

I put many comments to the file concerning d and Tr item as others may further
investigate. Let me know in the case of any problems."
2014-04-07 14:17:57 +00:00
Robert Osfield
64979a0c1a From Marcel Pursche, "The problem is that when OpenThreads is build with the Linux pthreads implementation all threads inherit the processor affinity from their parent thread.
This behavior is also described in the pthreads man page (http://man7.org/linux/man-pages/man3/pthread_create.3.html):

>
> Linux-specific details
> The new thread inherits copies of the calling thread's capability
> sets (see capabilities(7)) and CPU affinity mask (see
> sched_setaffinity(2)).
>

To prevent this behaviour I wrote a patch that explicitly sets the affinity mask to all cores of the system, if no specific affinity was defined with PThread::setProcessorAffinity(unsigned int) .

Thank you!
"
2014-04-07 14:11:14 +00:00
Robert Osfield
20c0292e97 From Bjorn Blessing, "I got bored of the constant reports of “missing chunk 0xA08A” when reading 3ds-files. After a bit of research I discovered that this property is related to the advanced transparency settings for the material in 3D studio. In this case the falloff parameter. These controls affect the opacity falloff of a transparent material. And the property chooses whether falloff is in or out. I have added the property to the file reader BUT no changes are made to make this property propagate into the osgMaterial. But at least we get rid of this annoying error message." 2014-04-07 14:03:40 +00:00
Robert Osfield
88aa9ac5de From Bjorn Hein, "please find attached a small fix for RayIntersector.cpp.
* Changes are made against trunk
* Reason: crashes when using specific constructor from RayIntersector
* Info: Line 42:  added in constructor
RayIntersector::RayIntersector(const Vec3d& start, const Vec3d&
direction) missing initialisation of _parent
"
2014-04-07 13:52:01 +00:00
Robert Osfield
67b4d5412b Fixed iso surface shaders 2014-04-04 11:25:51 +00:00
Robert Osfield
d773d358c4 Improved the setting of sample density/ratio so that they are consistent 2014-04-01 18:56:57 +00:00
Robert Osfield
e5fe59799d Fixed handling of volume tiles with a region. 2014-04-01 18:33:02 +00:00
Robert Osfield
27b71e3927 Added cube and hull rendering support 2014-03-27 12:47:44 +00:00
Robert Osfield
2f8b0f7a70 Restructured the handling of TileData to make it more extensible and flexible. 2014-03-19 17:56:40 +00:00
Robert Osfield
d7944b6ca9 Addd ExteriorTransparencyFactorProperty for support of upcomming functionality of rendering a cube volume with a hull volume inside it. 2014-03-18 18:14:15 +00:00
Robert Osfield
ed724a730e Added support for animating volume hulls. 2014-03-17 15:54:52 +00:00
Robert Osfield
d703a2df44 From Stephan Huber, "attached is a fix for the rest-http-plugin which should fix the font-issue reported by Phil. The old implementation did forward all requests to the internal http-server via user-events. This prevented error-reporting for missing files, as the request was accidentally handled by the plugin. As a request for missing font-file succeeds and returned an empty file, the curl-plugin hands the data happily to the freetype-plugin which failed trying to load an empty font-file, obviously.
My fix was to rename the standard request handler to a specialized user-event-handler which handles only requests for "/user-event“

So fonts should work on iOS when loaded remotely, even when a local file is available and with the resthttp-plugin serving the presentation.
"
2014-03-13 14:02:50 +00:00
Robert Osfield
7f206fbf80 From Stephan Huber, fix for building lua plugin from local source 2014-03-13 13:59:34 +00:00
Robert Osfield
ea865d0ff9 Added support for directly invoking scripts using <run-script> and <run-script-file> to enable scripts to interact with each other. 2014-03-13 10:28:18 +00:00
Robert Osfield
75982f3379 Improved support for passing events between scripts and Present3D application 2014-03-12 11:01:09 +00:00