Commit Graph

3871 Commits

Author SHA1 Message Date
Robert Osfield
bada884342 From Pjotr Svetachov, "when you restart threading
with startThreading/stopThreading the _drawQueue and _availableQueue
are not reset properly. This can lead to a deadlock when threading is
started again. So before threading is started again the queues must be
reset. This deadlock is also reported earlier by someone else in here:
http://forum.openscenegraph.org/viewtopic.php?p=43415#43415"
2013-01-23 17:38:28 +00:00
Robert Osfield
0b1605ed08 From Wang Rui with edits from Robert Osfield, additional GLenums for cross platform build 2013-01-23 16:22:45 +00:00
Robert Osfield
83f9d0f3e6 Added Options support to ImageSequence LOAD_* functionality 2013-01-18 17:11:49 +00:00
Robert Osfield
5fb8cd6a9c Update SO_VERSION to reflect new API changes 2013-01-18 16:30:55 +00:00
Robert Osfield
a0980734ac Added LOAD_AND_RETAIN_IN_UPDATE_TRAVERSAL and LOAD_AND_DISCARD_IN_UPDATE_TRAVERSAL ImageSequence::Mode's to allow for ImageSequence usage without using background paging threads, instead loading all the images on demand in the update traversal. 2013-01-18 16:21:17 +00:00
Robert Osfield
e7e517f2d0 Added <display_broadcast_event> and <dismiss_broadcast_event> support to <timeout> to allow the different timeout statges to be broadcast. 2013-01-17 13:51:52 +00:00
Robert Osfield
dd189f22e5 Completed <timeout> support, to use it with p3d use it along the lines:
<slide>
    <layer>
        <paragraph>Test</paragraph>
        <timeout>
            <idle_duration_before_timeout>3.0</idle_duration_before_timeout>
            <idle_duration_before_action>5.0</idle_duration_before_action>
            <key_starts_timeout_display>A</key_starts_timeout_display>
            <key_dismiss_timeout_display>S</key_dismiss_timeout_display>
            <key_run_action>D</key_run_action>
            <timeout_jump slide="0" layer="1"></timeout_jump>
            <timeout_event>w</timeout_event>
            <timeout_broadcast_event>t</timeout_broadcast_event>
            <image width="0.5">Images/lz.rgb</image>
        </timeout>
    </layer>
    <layer>
        <model>cow.osg</model>
    </layer>
</slide>
2013-01-17 11:48:20 +00:00
Robert Osfield
1fcadcf514 Added support for <timeout_jump> to Timeout support. 2013-01-17 09:51:15 +00:00
Robert Osfield
b8b8365c06 Implemented basic Timeout display and timing codes 2013-01-16 16:13:30 +00:00
Robert Osfield
81008c24df Added shell of Timeout class 2013-01-15 11:31:44 +00:00
Robert Osfield
93334e7df0 Added movie volume animation control to <image> and <stereo_image> tags to be used in the form:
<slide>
        <properties>
            <property name="volume" type="float">0.20</property>
        </properties>

        <property_animation>
            <key_frame time="0.0">
                <property name="volume" type="float">0.0</property>
            </key_frame>
            <key_frame time="2.0">
                <property name="volume" type="float">1.0</property>
            </key_frame>
            <key_frame time="10.0">
                <property name="volume" type="float">1.0</property>
            </key_frame>
            <key_frame time="12.0">
                <property name="volume" type="float">0.0</property>
            </key_frame>
        </property_animation>

        <layer>
              <image volume="$volume" looping="ON">big_buck_bunny_1080p_stereo.ogg</image>
       </layer>
    </slide>
2013-01-11 11:30:44 +00:00
Robert Osfield
4f8847dd50 Added support for <image delay="time" stop="time"> properties that works in conjunction with the start="time" property support checked in in previous submission,
together these control the delay, start position and stop position of movies.
2013-01-10 19:55:50 +00:00
Robert Osfield
e569671d13 Added support for <image "start=10"> property that tells a video to start specificied number of sections into a video. 2013-01-10 14:37:52 +00:00
Robert Osfield
e76e3a7b1b From Stephan Huber, "* osgGA: fixed a small bug regarding emulating mouse-events from touch-events
* resthttp/osc: encapsulate RequestHandler-classes in their own namespaces to prevent class-name-lookup-errors in the debugger/code (had some weird crashes)
* QTKit: fixed a compile-bug for gcc and blocks
* osgPresentation: click_to_* will fire on RELEASE, only if the drawable received a PUSH beforehand
* p3d/osgPresentation: implemented "forward_mouse_event_to_device"-tag, which will forward mouse-events to all registered devices of a viewer, if an intersection occurs. The mouse-coordinates get reprojected
* present3d: all devices get registered with the viewer
* osgViewer: only devices which are capable of receiving events are queried for new events.
* GraphicWindowIOS: added a flag to GraphicWindowIOS::WindowData to set up a retained backing buffer (defaults to false) This will enable read-back of the render-buffer with glReadPixels even after the renderbuffer got presented
* curl: added an optimized check for file-existance, now only the headers are requested and checked, instead of reading the whole file and handle it with a ReaderWriter
* p3d: fixed a bug, where the existence of a local file may prevent the remote loading of a file with the same name.

"
2013-01-07 12:17:26 +00:00
Robert Osfield
6d0e1bd50b Added region="$xmin $ymin $zmin $xmax $ymax $zmax" support to <model> tag, along with animation support via the <property_animation> support. 2012-12-20 12:14:53 +00:00
Robert Osfield
9f0906984b Removed erroneous region setting 2012-12-18 11:20:20 +00:00
Robert Osfield
4a0ce866c0 Updated SO version 2012-12-14 16:30:28 +00:00
Robert Osfield
32c0bc3b39 From Lionel Lagarde, "Here is a correction on the PixelBufferObject getter methods of Image.
The set method modify the buffer object of the BufferData while the get method returned the buffer object of the Image.

I've also removed the _bufferObject member of Image (not used anymore)."
--This line, Lionel Lagardeand those below, will be ignored--

M    include/osg/Image
2012-12-13 17:35:27 +00:00
Robert Osfield
22868bce4f From Stephan Huber, "attached you'll find a zip containing some bug-fixes and some refactored + new code.
* ZeroConfDevice does now return FILE_NOT_HANDLED instead of FILE_NOT_FOUND
* present3D supports multiple devices per env-var P3D_DEVICE, separate multiple device with a space

I refactored parts the p3d-plugin, the curl-plugin and parts of Registry and ReaderWriter. Currently the p3d-plugin tries to open all remote files with the help of the curl-plugin.

I added a new method to Registry called getReaderWriterForProtocolAndExtension. which will return a ReaderWriter which is capable in handling the remote file for the given protocol and extension. If no readerwriter is found for the given extension, a list is built of all readerwriters supporting the given protocol and this list is checked for support of wildcards (extension = "*"). If anything matches it get returned.

I added this principle also to the Registry, so now it's possible to register a generic ReaderWriter which can handle all filetypes for a given protocol, similar what curl is doing. All you have to do is to load the plugin at startup. The curl-fallback is still in place.

With these changes it is now possible to reference a movie inside a presentation without a server-address, read the presentation (with curl) and stream the movie with the correct plugin (e.g. QTKit)

"
2012-12-07 19:05:47 +00:00
Robert Osfield
e64d5e5eca Added template swapBytes method 2012-12-07 19:04:49 +00:00
Robert Osfield
eed71f647d From Stephan Huber, "* imageio: removed ReaderWriterImageIO_IOS.cpp, refactored ReaderWriterImageIO to work on OS X and IOS
* avfoundation: added support for IOS (CoreVideo-support is still in development, works only for SDK >= 6.0, set IPHONE_SDKVER in cMake accordingly)
* zeroconf: added ZeroConf-device-plugin (Mac/Win only, linux implementation missing) to advertise and discover services via ZeroConf/Bonjour, on windows you'll need the Bonjour SDK from Apple
* osgosc: modified the example to demonstrate the usage of the ZeroConf-plugin (start the example with the command-line-argument --zeroconf)
* SlideShowConstructor: enable/disable CoreVideo via a environment variable (P3D_ENABLE_CORE_VIDEO)
* RestHttp: mouse-motion-events get interpolated
* RestHttp: unhandled http-requests get sent as an user-event to the event-queue, all arguments get attached as user-values to the event
* modified some CMakeModules to work correctly when compiling for IOS
* fixed a compile-error for IOS in GraphicsWindowIOS
* some minor bugfixes"
2012-12-05 17:15:53 +00:00
Robert Osfield
5a88734598 Moved the expansion of the key codes into ApplicationUsage so that help is only generated for non zero keycodes. 2012-12-05 10:13:51 +00:00
Robert Osfield
e4a42fa65c Fixed error in Unfiform set method 2012-12-03 09:50:41 +00:00
Robert Osfield
9a2f7c7d8e From Wang Rui, build fix 2012-12-02 11:45:57 +00:00
Robert Osfield
6eb3b2f091 Added support for pausing and restart the property_animation. 2012-11-30 15:43:31 +00:00
Robert Osfield
236e75b2be Added xml defined property/property animation to .p3d format for <volume> propeties:
alpha="$alphaname"
   cutoff="$cutoffname"
   region="$minx $miny $minz $maxx $maxy $maxz"
   sampleDensity="$densityname"
   sampleDensityWhenMoving="$densityname"
2012-11-30 14:21:45 +00:00
Robert Osfield
8b231ba8e3 From Stephan Huber, added event sending support into osgGA::Device along with implementation on this into the osc plugin. Added osgoscdevice example to demonstate this in action. 2012-11-28 10:43:58 +00:00
Robert Osfield
42529ca415 Added preliminary support for <property_animation> 2012-11-27 15:09:44 +00:00
Robert Osfield
3a67eefd9f Refactored osgDB::Input::readObjectOfType to use a template, and updated associated wrappers to avoid using local static's 2012-11-21 13:38:11 +00:00
Robert Osfield
8b30807ef1 From Paul Martz, build fixes 2012-11-19 11:25:52 +00:00
Robert Osfield
c005e6997c Added first cut implememtation of PropertyAnimation class 2012-11-16 15:40:41 +00:00
Robert Osfield
10c43a3052 Moved PropertyManager related classes out from SlideEventHandler into their own dedicated header/source file. 2012-11-15 12:11:19 +00:00
Robert Osfield
057f8a8b3b Added support for <image blending="ON" or blending="OFF"> to allow user definition of when to enable OpenGL blending for an image or not. 2012-11-13 14:22:37 +00:00
Robert Osfield
933baf5db4 Changed COLOUR to COLOR to be consistent with OpenGL spelling 2012-11-13 13:32:01 +00:00
Robert Osfield
92975a01fd Moved colour space conversion of volumes from the osgvolume example into osg/ImageUtils and added support for colorSpaceConversion="MODULATE_ALPHA_BY_LUMINANCE","MODULATE_ALPHA_BY_COLOUR","REPLACE_ALPHA_WITH_LUMINANCE" and "REPLACE_RGB_WITH_LUMINANCE" to .p3d <volume> tag 2012-11-13 13:16:10 +00:00
Robert Osfield
e72af02c2b Added first step to adding pruning of expired image requests. 2012-11-13 11:45:20 +00:00
Robert Osfield
e9a7b2a6e5 Changed the default settings to fix a jump problems 2012-11-12 10:36:21 +00:00
Robert Osfield
e8b86dc4ec Added missing files in support of key_jump and key_run tags 2012-11-10 12:12:24 +00:00
Robert Osfield
ff476e9c15 Added support for naming slides and layers with slide_name and layer_name properties respectively.
Added support for creating events based on key presses using a <key_to_run> and <key_to_jump> tags.
2012-11-09 21:32:54 +00:00
Robert Osfield
36f6ef7242 From Alexander Sinditskiy, "I found issue with capturing mouse buttons.
This issue can be reproduced:
1. Create osgViewer window,
2. Push right&left mouse buttons on the osgViewer window,
3. Move mouse out of window, and release right&left mouse buttons.

osgViewer window handle only first mouse release, as result window thinks that we did not released second mouse button.

I attached fix for this issue."
2012-11-08 17:19:51 +00:00
Robert Osfield
1b871a822d Added support for <imagesequence interaction_mode="USE_MOUSE_Y_POSITION"> 2012-11-08 15:45:23 +00:00
Robert Osfield
014f13f774 Refactored ImageSequence to better handle random access usage. 2012-11-08 11:19:31 +00:00
Robert Osfield
a6f3e0af78 Added event and update callbacks to pass up changes to the mouse position to the ImageSequence::seek() to control which images is selected based on mouse x position 2012-10-31 16:07:23 +00:00
Robert Osfield
d879cd7715 Intial work towards support an interaction <imagesequence> tag in Present3D. 2012-10-29 15:58:02 +00:00
Robert Osfield
f9fd4342ba From Stephan Huber, "attached you'll find the latest versions of the QTKit + the AVFoundation-plugin, some changes to osgPresentation and a small enhancement für ImageIO.
I fixed some bugs and did some more tests with both of the video-plugins. I integrated CoreVideo with osgPresentation, ImageStream has a new virtual method called createSuitableTexture which returns NULL for default implementations. Specialized implementations like the QTKit-plugin return a CoreVideo-texture. I refactored the code in SlideShowConstructor::createTexturedQuad to use a texture returned from ImageStream::createSuitableTexture.

I did not use osgDB::readObjectFile to get the texture-object, as a lot of image-related code in SlideShowConstructor had to be refactored to use a texture.  My changes are minimal and should not break existing code.

There's one minor issue with CoreVideo in general: As the implementation is asynchronous, there might be no texture available, when first showing the video the first frame. I am a bit unsure how to tackle this problem, any input on this is appreciated.

Back to the AVFoundation-plugin: the current implementation does not support CoreVideo as the QTKit-plugin supports it. There's no way to get decoded frames from AVFoundation stored on the GPU, which is kind of sad. I added some support for CoreVideo to transfer decoded frames back to the GPU, but in my testings the performance was worse than using the normal approach using glTexSubImage. This is why I disabled CoreVideo for AVFoundation. You can still request a CoreVideoTexture via readObjectFile, though.
"
2012-10-24 10:43:01 +00:00
Robert Osfield
1591fe09f3 Added osgGA::Device class for integration of both physical and virtual devices.
Added template readFile(..) function to make it more convinient to cast to a specific object type.

Added support for osgGA::Device to osgViewer.

Added sdl plugin to provides very basic joystick osgGA::Device integration.
2012-10-23 16:15:03 +00:00
Robert Osfield
9fab99ddd9 From Wang Rui, "I modified the Serializer header to add a UPDATE_TO_VERSION_SCOPED
macro, which could set version within brackets and reset it after
that. All related serializers are also modified so that the
backward-compatibility bug reported by Farshid can be fixed.
"

From Robert Osfield, removed the use of osg::Referenced and creating the proxy object on the heap.
2012-10-09 16:05:50 +00:00
Robert Osfield
740f660ef1 Made TouchData and osg::Object to aid with serialization. 2012-10-05 16:31:23 +00:00
Robert Osfield
2e79a0e2d4 Added set methods to assist with serialization support 2012-10-05 10:07:09 +00:00
Robert Osfield
1796d55bea From Stephan Huber, OSX and iOS Video support via a QTKit plugin from OSX 10.7 and before, and an AVFoundation plugin for iOS and OSX10.8 and later. 2012-10-02 14:07:12 +00:00
Robert Osfield
03047f3e7f From Paul Martz, "This change to include/osg/GL correctly includes the OpenGL header on OSX 10.7 when building OSG trunk for GL3. It also adds some CPP defines for compatibility." 2012-09-26 08:42:04 +00:00
Robert Osfield
86a37616f7 Changed dispatch to virtual 2012-09-25 11:04:11 +00:00
Robert Osfield
b3f8679b69 From Luc Frauciel, Added sRGB FrameBuffer string 2012-09-20 14:03:47 +00:00
Robert Osfield
f804d7dd81 From Vladimir Cheaev, "
I worked with a osg::Constraint and found strange part of code:
class OSGMANIPULATOR_EXPORT Constraint : public osg::Referenced
{
    public:
...
        virtual bool constrain(ScaleUniformCommand& command) const     { return constrain((MotionCommand&)command); }
        virtual bool constrain(const Rotate3DCommand& command)         { return constrain((MotionCommand&)command); }
...

If i use osgManipulator::Rotate3DCommand then method Rotate3DCommand::accept(const Constraint& constraint) calls Constraint::constrain(MotionCommand&) instead Constraint:: constrain(const Rotate3DCommand&).

If you replace
        virtual bool constrain(const Rotate3DCommand& command)         { return constrain((MotionCommand&)command); }
on to
        virtual bool constrain(Rotate3DCommand& command) const         { return constrain((MotionCommand&)command); }
then all works correctly.
"
2012-09-20 11:27:57 +00:00
Robert Osfield
01c7d87b1a From Farshid Lashkari, Added GLBeginEndAdapter::reset(), and _overallNormalAssigned, _overallColorAssigned flags to avoid the GLBeginEndAdapter adapter setting colour and normals when none has been assigned. 2012-09-20 11:18:19 +00:00
Robert Osfield
b32cf216a7 Added ReadQueue::size() method to help with debugging. 2012-09-20 11:14:10 +00:00
Robert Osfield
5d5cf26138 Added osgDB::getSortedDirectoryContents and osgDB::FileNameComparator to help with sorting directory contents into alphabetic and numerical order. 2012-09-12 16:02:02 +00:00
Robert Osfield
7fe5db073b Updated version after 3.1.3 dev release 2012-09-10 08:24:49 +00:00
Robert Osfield
f288f9e996 From Wojciech Lewandowski, "With current trunk I had an error while compiling osg/Image.cpp for IOS simulator / GLES2. Symbol GL_RGBA16 was missing. Adding #define GL_RGBA16 0x805B to Image header solves the problem. " 2012-09-07 14:55:09 +00:00
Robert Osfield
3b8802c5aa From Piotr Domagalski, "Currently, code using OpenSceneGraph doesn't build with clang due to the way __sync_bool_compare_and_swap() is used in OpenThreads/Atomic header file.
I tested it with clang 3.1 and it seems that clang is enforcing the use of the same type for all parameters in this builtin. Looking at the function declaration [1]

bool __sync_bool_compare_and_swap (type *ptr, type oldval type newval, ...)

it seems to be doing the right thing: here the same type is used for *ptr, oldval and newval.

[1] http://gcc.gnu.org/onlinedocs/gcc/_005f_005fsync-Builtins.html#g_t_005f_005fsync-Builtins
"
2012-09-06 10:52:28 +00:00
Robert Osfield
39dcea9ebb From Colin McDonald and Robert Osfield, converted Traits::sharedContext from GraphicsContext* to osg:observer_ptr<GraphicsContext> to prevent dangling pointer issues. 2012-09-05 21:03:41 +00:00
Robert Osfield
f5a3c40934 Moved the OSG_INIT_SINGLETON_PROXY macro into include/osg/Object to make it more generally useful and added it's usage into the RenderBinPrototypeList initialization. 2012-09-05 13:48:23 +00:00
Robert Osfield
fd2ee19b62 Updated SO version number to avoid collision with new additions to serializers 2012-09-05 09:30:33 +00:00
Robert Osfield
bc533022ae Added deprecated note to indices entry. 2012-09-05 08:42:14 +00:00
Robert Osfield
30c35cb407 Adjusted the #define's to help GLES2 build 2012-09-03 09:08:16 +00:00
Robert Osfield
794e0e71f4 From Johannes Scholz, fix for writing out of hexidecimal numbers 2012-08-24 15:05:03 +00:00
Robert Osfield
583401970a Fixed typo 2012-08-22 16:39:47 +00:00
Robert Osfield
284f410436 Added ShadowSettings::s/getMaximumShadowMapDistance(double) property, usage of these property in ViewDependentShadowMap,
and setting of it with --max-shadow-distance <double> in the osgshadow example.
2012-08-15 12:40:48 +00:00
Robert Osfield
52861ecbb0 Added a mutex to protect the removal and addition of Uniform and Program to StateSet to avoid parents being invalidated when multi-threading. 2012-08-14 20:15:00 +00:00
Robert Osfield
fb83c2b061 Introduced --near-far-mode into osgshadow and ShadowSettings::setComputeNearFarModeOverride(..) to allow user control of how the cull traversal is optimized for computing the depth range of the shadow map. 2012-08-03 16:14:14 +00:00
Robert Osfield
0a746faa2d Introduced Texture::Extensions::s/getPreferGenerateMipmapSGISForPowerOfTwo() flag that defaults to false for Radeon, true elsewhere.
This is used to workaround mipmapping bugs with ATI/AMD cards.
2012-07-12 16:41:53 +00:00
Robert Osfield
283c2d3ed0 Fixed parameter default value to avoid warning 2012-07-11 08:39:11 +00:00
Robert Osfield
b4d397cfd7 Moved mask settings into ShadowSettings 2012-07-10 15:50:46 +00:00
Robert Osfield
4b220d4fd7 Changed updateCamera(Camera*) to updateCamera(Camera&) to make it clear that a valid Camera object should be passed in. 2012-07-09 17:49:04 +00:00
Robert Osfield
65ab874143 From Riccardo Corsi, introduced CameraManipulator::updateCamera() method that allows more Camera properties to be controlled by the CameraManipulator. 2012-07-09 17:32:13 +00:00
Robert Osfield
2faeaf553b Added support for setting the <image> paging_mode property to PRE_LOAD_ALL_IMAGES, PAGE_AND_RETAIN_IMAGES or PAGE_AND_DICARD_IMAGE for osg::ImageStream,
with PAGE_AND_DICARD_IMAGE set as the default.
2012-06-11 19:54:07 +00:00
Robert Osfield
c39ee015d6 Added ImageStream support to <image> and <stereo_image> tags in .p3d 2012-06-08 10:26:23 +00:00
Robert Osfield
5d3cb4f754 Added osg::ImageSequence support into osgPresentation::SlideShowConstructor and the associated <image> tag in .p3d. 2012-06-08 04:18:28 +00:00
Robert Osfield
1dbb0a7a82 Added Dragger::get/setActivationMouseButtonMask(uint). 2012-05-25 15:32:51 +00:00
Robert Osfield
c21f1f488f From Jaap Glas, "Added a default parameter to the following constructor in TabPlaneDragger
and TabPlaneDragger.cpp:

TabPlaneDragger(float handleScaleFactor=20.0f);

The reason for this is that the default OSG tab sizes are way bigger than
those we used in our application so far. And since handleScaleFactor_
is already a (constant) class member, I see no objection against making
it user defined."
2012-05-25 08:56:25 +00:00
Robert Osfield
476dbf1c33 Fixed for including cmath before osg/Math. 2012-05-02 13:58:34 +00:00
Robert Osfield
d32160abde Added using base_class::set to the Matrix*Template class to enable the set() method from the base class to be used. 2012-04-27 09:43:25 +00:00
Robert Osfield
de05dd22a8 Restructed how the GL_SAMPLER_* #define's are placed to avoid build problems under GLES. 2012-04-19 14:58:35 +00:00
Robert Osfield
9f93b005cc From David Callu, "Here the fix for Matrix{2,3,4}x{2,3,4}{fd} defined in Uniform header.
My previous patch for Atomic Counter Uniform provide new template implementation
of Matrix{2,3,4}x{2,3,4}{fd}. This new implementation use Column-Major Matrix.
Original code define matrix as Row-Major matrix like other Matrix in OSG, and
my matrix implementation break compatibility with previous code.
For example osg_normalMatrix define in osg::State report by Roland Hill.
Thanks to Paul Martz to spot me when the bug appear."
2012-04-19 10:27:58 +00:00
Robert Osfield
01beb82041 From Mathias Froehlich, "Attached is a change to the slow path geometry dispatch tables that allows the
use of 3 component float color vectors."
2012-04-18 09:56:00 +00:00
Robert Osfield
b882467217 Updated version number 2012-04-18 09:50:23 +00:00
Robert Osfield
95cac0b549 From Ulrich Hertlein, Fix for MatrixTemplate compile errors 2012-04-06 10:42:17 +00:00
Robert Osfield
5e315d5fab From Wang Rui, "I'd like to submit the changes that will put ObjectProperty and ObjectMark variables into the InputStream/OutputStream class instead of static ones. This should avoid the threading problem and won't repeatedly reallocate memory for the properties. Some of the wrappers will be slightly modified to use the property variable stored in the InputStream/OutputStream as well." 2012-04-05 13:53:47 +00:00
Robert Osfield
c0bd5cda99 From Magnus Kessler, typo and documentation fixes 2012-03-29 15:08:15 +00:00
Robert Osfield
68412a1784 From Magnus Kessler, "remove unecessary conversion from float in double precision method" 2012-03-29 09:57:47 +00:00
Robert Osfield
aab27e106c From David Callu, "Here an update of osg::Uniform :
- add non square matrix
- add double
- add all uniform type available in OpenGL 4.2
- backward compatibility for Matrixd to set/get an float uniform matrix
- update of IVE / Wrapper ReadWriter

implementation of AtomicCounterBuffer based on BufferIndexBinding

add example that use AtomicCounterBuffer and show rendering order of fragments,
original idea from geeks3d.com."
2012-03-29 09:43:12 +00:00
Robert Osfield
59d6931b59 Added int packing parameter to Image::readPixels(..) 2012-03-29 08:27:21 +00:00
Robert Osfield
14a563dc9f Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Robert Osfield
1e35f8975d For all OSG_GL*_FEATURE #defines changed 1's to true and 0's to false. 2012-03-21 16:02:32 +00:00
Robert Osfield
c3a0a8ddc3 Added Traits::getContextVersion(uint,uint) 2012-03-21 11:36:54 +00:00
Robert Osfield
cee53f6adc Updated version number 2012-03-21 11:26:09 +00:00
Cedric Pinson
df82754203 Changed osgAnimation::StackedTransform::update(t). It can now be used for custom usage 2012-03-11 22:05:29 +00:00
Robert Osfield
5e105d2fc4 From Chuck Seberino, "Attached are modified versions of RotateCylinderDragger and Projector files that clean up the use of _onCylinder / isProjectionOnCylinder().
I have also made changes to the RotateCylinderDragger to provide a cylinder ring with a thickness.   It is totally optional, but IMHO makes the default behavior work better than a solid cylinder (which typically obscures the geometry you are trying to drag).  Gives it a bit more to grab, especially in the case where eyepoint and cylinder axis are near parallel.
"
2012-03-09 10:20:23 +00:00
Robert Osfield
fc6fdeaa2c Updated version number for 3.1.1 dev release 2012-03-08 16:33:44 +00:00
Robert Osfield
fef2628d00 From Farshid Lashkari, "I've added support for reading contents of cubemap textures to the osg::Image::readImageFromCurrentTexture method. I added a new parameter to the method for specifying which face of the cubemap to read." 2012-03-08 16:05:17 +00:00
Robert Osfield
fd97a9a800 From Chuck Seberino, "Here is a fix for the RotateCylinderDragger. This patch fixes the case where the picking direction is close to the cylinder axis. The current behavior is this:
* If the eyepoint and cylinder axis are close to parallel (given some tolerance), then it uses a plane perpendicular to the cylinder axis.
* Otherwise it uses a plane parallel to the cylinder axis oriented towards the eyepoint (previous behavior).  This gives decent behavior and is the only path that was taken in the previous code.   I kept with previous behavior and that allowed a good bit of code to be removed, simplifying things.  There is now no need for the _onCylinder flag, but since there is a public accessor, I wasn't sure how to handle it for backwards compatibility, so I left it in.  NOTE - there is no default initialized value, so if it is kept in, it should be set to 'false' to keep same behavior as before.  I am not quite sure how the _onCylinder case was supposed to behave as even forcing that path gave undesirable behavior, even with carefully controlled dragging.
"
2012-03-06 10:08:49 +00:00
Robert Osfield
2c7b82b401 From David Callu, "I found a bug in osg::Program.
in osg::Program::PerContextProgram :

typedef std::vector<UniformModifiedCountPair> LastAppliedUniformList;
should be
typedef std::map<unsigned int, UniformModifiedCountPair> LastAppliedUniformList;

Intel driver can use index uniform value > 200000.
With a std::vector, this index uniform value generate an out of memory error

Nothing in OpenGL or GLSL specification define index uniform value rules.
And all other implementation that deal with uniform index in osg::Program
use a std::map.
This fix could have a little performance impact but this is the cost
to pay to work with
all driver."
2012-03-01 10:38:28 +00:00
Robert Osfield
2907284d00 Removed redudent spaces at ends of lines 2012-03-01 10:14:55 +00:00
Robert Osfield
9c5774defb Improved the handling of endian swap of osg::Array 2012-02-29 10:22:56 +00:00
Robert Osfield
84ca21655e Added build problem with using float Matrix. 2012-02-28 11:37:09 +00:00
Robert Osfield
e8ac276451 Added s/getByteSwap to teh InputStreamOperator base class and use of this method in the InputStream::start(InputStreamOperator*) method to ensure the bytes are swapped consistently. 2012-02-24 21:07:02 +00:00
Robert Osfield
caceb94db8 From Miha Ravsel, "While trying to create my custom serializer class, i created some dummy data which accidentally popped-up bug in InputStream readObjectFields function.
Bug description:
 Let's say we have class A
namespace Bug
{
class A : public osg::Object
{
public:
  //...
  typedef std::vector<osg::ref_ptr<A> > AList;

protected:
  AList _alist;
  //...
}
}

REGISTER_OBJECT_WRAPPER( A,
                        new Bug::A,
                        Bug::A,
                        "osg::Object Bug::A" )
{
       ADD_LIST_SERIALIZER(A,Bug::A::AList);
}


Bug:
We create say 3 instances of class A: A1,A2,A3 and then we add A2 and A3 and A1 as child instances of A1 so we get next structure:
A1
 |- A2,A3,A1

we call osgDB::writeObjectFile(A1,"/data/a.osgt") -> saved correctly( third element in list is saved as unique id that references parentClass

now we call
A1 = osgDB::readObjectFile("/data/a.osgt");

Everything is deserialized correctely except last element in list which should be same instance as parent A1.

The attached code resolves this issue by passing UniqueID in readObjectFields method and saving object in _identifierMap as soon as we have valid object instance so we can make reference to parent object from any child instance.
"
2012-02-22 10:46:35 +00:00
Robert Osfield
5ac0181cdc From Dietmar Funck, "in order to use a customized database thread it's necessary to use a customized database pager, which creates such customized database threads, too.
I think the best way to achieve this is to overwrite the DatabasePager::addDatabaseThread() method within the customized database pager. However this method is not 'virtual' yet, so I propose to make the method 'virtual'."
2012-02-20 12:33:17 +00:00
Robert Osfield
48b9b25805 From Johannes Baeurele, "The osg::Image class now contains a 'supportsTextureSubloading()' method that is used inside the Texture2D::apply method. For now it only checks for the etc1 format in which case it returns 'false'. All other formats lead to a return value of 'true'.
Without the change the application does not work properly. First I get the notification that an OpenGL error occured. After some more of this error messages I see broken textures on the screen. With the changes attached to this message my application works as intended."

Note from Robert Osfield, changed the Image::supportsTextureSubloading() to be const and to be implemented in the .cpp rather than inline.
2012-02-20 12:03:14 +00:00
Robert Osfield
bd81dd5ff8 From Stephan Huber, attached you'll find a compile fix for the new introduced rowlength-feature on IOS/OpenGL ES builds 2012-02-10 15:57:51 +00:00
Robert Osfield
06e88f3b91 From Luc Frauciel, "osgUtil Tessellator : beginTessellation() made virtual to allow configuration of tessellation:
The initialisation of glu low level tessellator is done in  osgUtil::Tessellator::beginTessellation()
This function is not virtual, preventing any customization of the tesselation.
In particular, there in an option in glu tesselator that force the generated primitives to be triangles and that I'd like to use (GLU_TESS_EDGE_FLAG).
"
2012-02-09 18:10:52 +00:00
Robert Osfield
5f4c155d6b Added back in support for checking the current working directory by default, but now do the check
after the Options and Registry DataFilePathLists have been checked, which will allow users to better control
over where files are searched for.
2012-02-09 14:28:39 +00:00
Robert Osfield
f537ece404 From Leandro Motto Barros,
"I've made a few changes to osgUtil::PolytopeIntersector so that it
actually uses double precision floating point numbers everywhere (as
long as OSG_USE_FLOAT_PLANE is not defined).

I needed double precision intersections in a project I am working on.
These changes fixed the problems I was having -- this is all testing I
have done.

Notice that I have changed
osgUtil::PolytopeIntersector::Intersection's members to use doubles
(osg::Vec3d, instead of osg::Vec3). I could have added #ifdef's there
too, but I think it is better to not change the types of stuff in the
public interface depending on some preprocessor definition.

The modified files are attached. A diff also follows, for those who like it."

With the following changes from Robert Osfield:

"I've just reviewed your changes and have just tweaked them a little to
streamline them.  What I have done in the PolytopeIntersector header
is add:

       typedef osg::Plane::Vec3_type Vec3_type;

And then use this typedef in the definition of the vertices rather
then Vec3d as you did.  Next changes were to PolytopeInteresector.cpp
where to the PolytopeIntersectorUtils defintions of the Vec3_type, and
value_type which now simply read:

   typedef osg::Plane::Vec3_type Vec3_type;
   typedef Vec3_type::value_type value_type;

This way I was able to complete avoid any if def's and have essential
the same implementation as you achieved.  Changes now checked into
svn/trunk."
2012-02-08 10:06:58 +00:00
Robert Osfield
06f7fd4f48 From Marius Kintel, "GraphicsWindowQt::WindowData no longer requires the parent widget of a graphics window to be of type GLWidget." 2012-02-07 11:41:20 +00:00
Robert Osfield
52270c9656 From David Fries, "Of the two ways to use the Tessellator object, only
retessellatePolygons was applying the winding and boundary option.
Moved the gluTessProperty calls into beginTessellation().

There's a comment typo fix, removing an unused VertexPointList
typedef, and allocates one _tobj instead of one per tesellation.
Protections were added to check that _tobj was allocated in the few
remaining places it wasn't being checked.

---
On a side note, I would like to avoid the 'new Vec3d' in
Tessellator::addVertex for each call to
gluTessVertex(tess, location, data).
The RedBook leaves it ambiguous if the location pointer must
remain valid after gluTessVertex or not.
http://www.opengl.org/sdk/docs/man/xhtml/gluTessVertex.xml
says that changing location is not safe, so being conservative, I'll
leave it as is, even though the Mesa GLU library copies the data not
the pointer, so it is currently safe."
2012-02-07 11:29:47 +00:00
Robert Osfield
5d50913722 From Mathias Froehlich, "Attached is a change to the stats handler so that the aspect ratio of the
viewer stats coordinates always stay about 1:1 to the pixels.
This helps for more readable stats with very wide windows for example."
2012-02-06 13:40:01 +00:00
Robert Osfield
38b17bc5fa From Jan Peciva, "attaching improved StatsVisitor. Changes:
- apply() and reset() methods made virtual to allow overriding
- added apply(StateSet&) to make more easier to gather StateAttribute
statistics in user-derived classes
"
2012-02-06 12:36:25 +00:00
Robert Osfield
6ebe48d6bb Fixed indendation and line endings 2012-02-06 12:29:29 +00:00
Robert Osfield
db49c23944 From Brad Christiansen, "The attached files add the ability to control when a paged child becomes eligible for expiry based on time and/or elapsed frames.
I found that some of the items that had been paged in were being expired on the first frame that they were not visible (as the cache was full). This resulted in excessive paging every time the view was moved. With the following changes I could only allow children to be expired if they had not been used for e.g. 30 seconds or 60 frames."
2012-02-06 12:06:40 +00:00
Robert Osfield
85bce8b8ad From Stephan Huber, "attached you'll find a first version of multi-touch-support for OS X (>=
10.6), which will forward all multi-touch events from a trackpad to the
corresponding osgGA-event-structures.

The support is switched off per default, but you can enable multi-touch
support via a new flag for GraphicsWindowCocoa::WindowData or directly
via the GraphicsWindowCocoa-class.

After switching multi-touch-support on, all mouse-events from the
trackpad get ignored, otherwise you'll have multiple events for the same
pointer which is very confusing (as the trackpad reports absolute
movement, and as a mouse relative movement).

I think this is not a problem, as multi-touch-input is a completely
different beast as a mouse, so you'll have to code your own
event-handlers anyway.

While coding this stuff, I asked myself if we should refactor
GUIEventAdapter/EventQueue and assign a specific event-type for
touch-input instead of using PUSH/DRAG/RELEASE. This will make it
clearer how to use the code, but will break the mouse-emulation for the
first touch-point and with that all existing manipulators. What do you
think? I am happy to code the proposed changes.

Additionally I created a small (and ugly) example osgmultitouch which
makes use of the osgGA::MultiTouchTrackballManipulator, shows all
touch-points on a HUD and demonstrates how to get the touchpoints from
an osgGA::GUIEventAdapter.

There's even a small example video here: http://vimeo.com/31611842"
2012-02-03 14:25:08 +00:00
Robert Osfield
e5a16de7d4 Improved handling of archives 2012-02-03 11:10:17 +00:00
Robert Osfield
487ee0f8e7 Added DraggerTransformCallback::HandleCommandMask to DraggerTransformCallback to allow applications to select which
commands they want the dragger callback to respond to why updating the transform.
2012-02-01 13:55:38 +00:00
Robert Osfield
7664d90504 Improved the handling of osgManipulator::Constraint, DraggerCallbacks and Command so that they now use a Visitor Pattern
to ensure the correct methods on constraints and callbaks are called for each Command.  Also fixed the handling of
Constraints when applied to composite Draggers.
2012-01-31 10:56:52 +00:00
Robert Osfield
68f776e2cc From Paulk Martz, "Looks like the ClipNode::setReferenceFrame comment block came from LightSource. Fixing the comment block to refer to ClipNode instead of light source." 2012-01-24 17:40:31 +00:00
Robert Osfield
d350ea5395 Moved setEndBarrierOperation(..) implementation into .cpp and added support for stoppig and starting threading if required. 2012-01-24 17:30:44 +00:00
Robert Osfield
b0b98d49b8 From Paul Martz, Added ViewerBase::s/getEndBarrierOperation(..) method to allow user control of how viewers are sync'd. 2012-01-24 17:21:14 +00:00
Robert Osfield
6d66e1abaa Added support for using GL_UNPACK_ROW_LENGTH in conjunction with texture's + osg::Image via new RowLength
parameter in osg::Image.  To support this Image::setData(..) now has a new optional rowLength parameter which
defaults to 0, which provides the original behaviour, Image::setRowLength(int) and int Image::getRowLength() are also provided.

With the introduction of RowLength support in osg::Image it is now possible to create a sub image where
the t size of the image are smaller than the row length, useful for when you have a large image on the CPU
and which to use a small portion of it on the GPU.  However, when these sub images are created the data
within the image is no longer contiguous so data access can no longer assume that all the data is in
one block.  The new method Image::isDataContiguous() enables the user to check whether the data is contiguous,
and if not one can either access the data row by row using Image::data(column,row,image) accessor, or use the
new Image::DataIterator for stepping through each block on memory assocatied with the image.

To support the possibility of non contiguous osg::Image usage of image objects has had to be updated to
check DataContiguous and handle the case or use access via the DataIerator or by row by row.  To achieve
this a relatively large number of files has had to be modified, in particular the texture classes and
image plugins that doing writing.
2012-01-24 14:34:02 +00:00
Robert Osfield
6aa6e9a38c Refactored the click_to_run implementation to avoid bug associated with running the first click_to_run entry in a layer when
subsequent click to run's are called.
2012-01-24 14:27:17 +00:00
Robert Osfield
d9fd29d996 From Chris Denham, Implementation of write functions in CURL plugin 2012-01-02 16:38:01 +00:00
Robert Osfield
a53308f7e8 Gunnar Holm, "After upgrading from 2.8.3 to 3.0.1 we experienced a lock in the Mutex
functionality when using Terrain::setVerticalScale. This was caused by
the following call sequence resulting in a lockup:

void Terrain::setVerticalScale(float scale)
  CALLS    dirtyRegisteredTiles();


void Terrain::dirtyRegisteredTiles(int dirtyMask)
 SETS LOCK    OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
 and CALLS (on every tile)   setDirtyMask(dirtyMask);


void TerrainTile::setDirtyMask(int dirtyMask)
 CALLS _terrain->updateTerrainTileOnNextFrame(this);


void Terrain::updateTerrainTileOnNextFrame(TerrainTile* terrainTile)
 SETS LOCK   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
******* PROBLEM - since lock has already been set! ********


The suggested fix submitted changes from using Mutex to ReentrantMutex.
"
2011-12-23 17:34:07 +00:00
Robert Osfield
c7698c1334 From Aurelien Albert, "I made a modification in the Dragger class :
You can now set a "intersection mask" and it will be used when looking for intersections.

So you can now easily "hide" some objects from manipulators."
2011-12-23 17:21:59 +00:00
Robert Osfield
4e834dfc73 From Brad Christiansen, "Attached are some small changes to the ImageStream interface and the DirectShow and FFMPEG plugins to provide the current time being displayed in the image stream.
I don’t have access to an OSX or Linux dev machine to make the changes required to the quick time plugin. This plugin will just default to returning 0."
2011-12-23 16:27:25 +00:00
Robert Osfield
f6ace4a7d0 From Ulrich Hertlein, typo fixes 2011-12-23 16:14:51 +00:00
Robert Osfield
c86e2361d2 Moved the createSpotLightImage function into include/osg/ImageUtils 2011-12-19 09:37:57 +00:00
Robert Osfield
22e309e8fb Created new PerlinNoise class from the Noise.h+Noise.cpp code in the osgshaders example. 2011-12-13 21:12:00 +00:00
Robert Osfield
92ed903a7f Added prelimanary support for parallel split shadow maps into ViewDependentShadowMap. 2011-11-22 21:55:30 +00:00
Robert Osfield
a548daa4be Added a check against OSX 10.6 to enable better selection of when to provide custom cosf etc. definition.
This change has been introduced to address recurcsion problems in 10.7 in the ac3d plugin.
2011-11-07 14:36:50 +00:00
Robert Osfield
693d79c638 Implement presentation update feature that reloads the presentation on pressing 'u'. 2011-11-04 12:50:05 +00:00
Robert Osfield
0329ca5cea Improved handling of resetting of the EventQueue::startTick(). 2011-11-04 12:45:32 +00:00
Robert Osfield
747654fb6d Added removeFromObjectCache method. 2011-11-04 12:44:01 +00:00
Robert Osfield
881078289d Added support into the .p3d format for specifying the osgDB::Options::OptionString via the <tag options="value">.
Added support into .vnc plugin for passing in the keywords "swap", "RGB", "RGBA", "BGR", "BGRA" as OptionString values to allow .p3d presentations to control
whether the pixelformat should be swapped or set to a specific format.
2011-10-26 14:25:56 +00:00
Robert Osfield
5d26d16fd3 Added password support into present3D's vnc support via the tag usage : <vnc password="mypassword">hostname</vnc> 2011-10-26 12:48:57 +00:00
Robert Osfield
e04ca06fc8 Fixed build of StreamOperator 2011-10-22 09:02:18 +00:00
Robert Osfield
9e903861a2 Fixed handling of Vec3dArray in GLBeginEdnAdapter/ArrayDispatchers. 2011-10-21 15:39:51 +00:00
Robert Osfield
d3cebab9a3 Added flipDepth() method 2011-10-21 10:59:42 +00:00
Robert Osfield
affe0b4a6d Added support for calling throwException() from InputIterator and added a check for negative string sizes. 2011-10-20 16:35:50 +00:00
Robert Osfield
33479c7768 Improvements to the compute near/far 2011-10-17 14:41:49 +00:00
Robert Osfield
bdb0dfe27d Improvements to osgShadow::ViewDependentShadowMap and ShadowSettings 2011-10-17 14:40:29 +00:00
Robert Osfield
bb48cef38c Added Font::getVertical(float& ascender, float& descender) methods. 2011-10-03 10:36:18 +00:00
Robert Osfield
8a230d42ed From Luc Frauciel, "You'll find attached a new option that allow, when using LOD in USER_DEFINED_CENTER mode to expand the radius of the node by the radius of loaded objets.
Motivation ;
When using PagedLODs, you don't always know the real size of loaded children,
If it occurs that they  are out of predefined bounds, picking on the parts that are out of bound will fail
They also can be culled out too soon.
The problem often  occurs with long object (roads).
I've modified LOD and ProxyNode to include this option."

and later email:

"Attached the UNION_OF_BOUNDING_SPHERE_AND_USER_DEFINED version
There are impacts on some serializers (dae, osgWrapper).
I haven't modified deprecated osg, since it's deprecated"
2011-09-19 10:34:31 +00:00