Commit Graph

5090 Commits

Author SHA1 Message Date
Robert Osfield
e74bb067fb Added ObjectRecordData to include list 2008-03-18 09:17:52 +00:00
Robert Osfield
7a7c197af3 Added minimum and maximum scale support to osg::AutoTransform 2008-03-17 15:22:03 +00:00
Robert Osfield
42e3cb6bf2 Updated wrappers 2008-03-17 12:13:20 +00:00
Robert Osfield
00f161ca35 Introduce osgParticle::ParticleSystem::s/getParticleScaleReferenceFrame() to
help manage the scaling of particles, whether they should be relative to the
local coordiante frame of the particle system, or be in world coordinates.
2008-03-17 12:09:05 +00:00
Robert Osfield
a1c0c2a3eb Added better error reporting 2008-03-15 19:27:35 +00:00
Robert Osfield
45ac890f37 Updated wrappers 2008-03-14 15:33:59 +00:00
Robert Osfield
a49ed677b5 Fixed indenting 2008-03-14 15:32:56 +00:00
Robert Osfield
45bd3802de From Melchior Franz, "Attached is a fix for remaining problems in capslock handling:
It sets osgGA's keymask when restoring keys on FocusIn, according
to the state values of XKeyEvent and XCrossingEvent. (These are
the only source for X11's current capslock state that avoids
pulling in the XKB extension.)
"
2008-03-14 15:13:08 +00:00
Robert Osfield
9c56c5277f Added cloning of the StateSet before modification to work around threading issue
relating to the StateSet being modified by the event/update thread and read from
the draw thread at the same time.
2008-03-14 13:21:35 +00:00
Robert Osfield
8be3123cbf Converted static const unsigned int definitio to enum. 2008-03-14 12:03:11 +00:00
Robert Osfield
721944194c Updated wrappers 2008-03-14 11:07:03 +00:00
Robert Osfield
292be66ecc Removed gl and glu prefixes from SceneGraphBuilder methods to avoid problems under Solaris 2008-03-13 19:44:10 +00:00
Robert Osfield
849d2fdc8f From Gino van den Bergen, "I've added a few fixes to the VRML 2.0 plugin:
1) Full DOS paths are now correctly opened by OpenVRML. A URL containing
a DOS path should be "file:///C:data/blah" rather than "file://C:data/blah".

2)  The last primitive defined in "coordIndex" is now added if the
"coordIndex" is not terminated by -1.

3) Smoothed normals are computed if no normal field is provided.
Currently, there is no support for "creaseAngle", so all edges (even the
ones sharper than the creaseAngle) are smoothed. I might add this in the
future if demand rises.

4) If an IndexedFaceSet contains only triangles or quads then the
primitive type is set to TRIANGLES or QUADS, and the primset becomes
DrawArrays rather than DrawArrayLengths.

Question: I noticed that for DrawArrays you can still provide an index
array. Would the rendering be faster if I'd create DrawElements primsets
rather than DrawArrays? Phrased differently, what is the benefit of
using DrawElements over DrawArrays, as there is clearly not a one-to-one
mapping of these concepts to their OpenGL counterparts?

5) Objects are added to the transparent bin and blend mode is enabled
only if the transparency is nonzero. Rendered transparent objects no
longer write the depth buffer."
2008-03-13 16:40:45 +00:00
Robert Osfield
110c761695 From Melchoir Franz, "ac3d.cpp does currently strip everything but the file name in
"texture" paths. This is to drop absolute paths that some
3d editors export (even AC3D itself!). But this also strips
directories of relative paths, which is wrong and contradicts
the ac3d reference implementation. (The reference implementation
doesn't strip anything, though, and so takes the absolute paths
as they are. Definitely not what we want.)

The attached solution checks absolute paths and only strips
those:

 (1)  A:\\foo\\bar.png   ->   bar.png            (as before)
 (2)  /foo/bar.png       ->   bar.png            (as before)

 (3)  foo/bar.png        ->   foo/bar.png        (new)
 (4)  ../foo/bar.png     ->   ../foo/bar.png     (new)

"
2008-03-13 16:18:03 +00:00
Robert Osfield
a460d66533 From Melchoir Franz, Caps lock support under X11 2008-03-13 16:12:46 +00:00
Robert Osfield
f1fe11f5a9 Added double versions of intersect methods 2008-03-13 16:05:40 +00:00
Robert Osfield
51f872c279 Updated wrappers 2008-03-13 16:05:20 +00:00
Robert Osfield
194a987974 From Andy Skinner, "I've taken this another step, to use value_type inside the intersect calls. I did choose to use sqrt() instead of sqrtf()." 2008-03-13 15:23:24 +00:00
Robert Osfield
a9740118db From Paul Martz, files for adding ObjectRecordData support into OpenFlight 2008-03-13 15:21:34 +00:00
Robert Osfield
e19dbe8daa From Paul Martz, "The attached preserves OpenFlight Object record data as UserData in the osg::Group corresponding to the Object record.
The files are:
    include/osgSim/ObjectRecordData -- The new class. Derives from Object to support .osg IO.
    src/osgPlugins/OpenFlight/PrimaryRecords.cpp -- Reads data into that class.
    src/osgPlugins/osgSim/IO_ObjectRecordData.cpp -- .osg IO support."

From Robert Osfield, made the OpenFlight read object record data optional via the -O readObjectRecordData ReaderWriter option.
2008-03-13 14:09:11 +00:00
Robert Osfield
3a11483ba8 Added support for assigning state to created drawables, implemented gluDisk. 2008-03-13 13:44:34 +00:00
Robert Osfield
e9b3f06c1b Updated wrappers 2008-03-12 20:20:55 +00:00
Robert Osfield
1b9cefa10f Added extra constructors 2008-03-12 20:15:45 +00:00
Robert Osfield
db256b962c Added proper implementations of OpenGL 1.0 calls to OSG object representation methods in SceneGraphBuilder. 2008-03-12 20:15:28 +00:00
Robert Osfield
eb9f7428bc Fixed bug in output of ProxyLayer's MinLevel/MaxLevel 2008-03-12 15:28:26 +00:00
Robert Osfield
a26bdd9446 Added default implementations of new SceneGraphBuilder class 2008-03-11 13:29:12 +00:00
Robert Osfield
b2ead391b3 From Mathias Froehlich, "it appears to me that sun CC cannot use static functions from template
functions. The attached change is required to make it compile with sun CC."
2008-03-11 13:23:49 +00:00
Robert Osfield
af29bccf4f From Andreas Ekstrand and Lars Nilsson, fix for reading Texture Attribute file 2008-03-05 13:54:52 +00:00
Robert Osfield
5deac2ce3a Updated wrappers 2008-03-05 12:05:55 +00:00
Robert Osfield
66f1a6ceaa From Atr Trevs, added missinging initializers 2008-03-05 11:52:56 +00:00
Robert Osfield
6e89dc0d94 From Jean-Sebastien Guay, "I changed osgGA::StateSetManipulator to mirror the
osgViewer::StatsHandler and other handlers which allow you to change the
key(s) you would press to get them to do something. Pretty simple change
but useful in our context and possibly in others too."
2008-03-05 11:33:55 +00:00
Robert Osfield
bc406c8bf0 From Jean-Sebastien Guay, "
The problem can be reproduced by simply changing the osgpick example to
use a CompositeViewer with a single view initialized using
setUpViewAcrossAllScreens(). I have attached a modified osgpick.cpp so
you can test it out quickly (please don't check this file in though :-)
) The eventState is then incorrect and picking does not work. The only
changes are in CompositeViewer.cpp (eventTraversal() method), and fix
the problem for me.
"
2008-03-04 17:57:06 +00:00
Robert Osfield
9d0c950bb0 From Colin McDonald, "Attached is an updated to osgViewer::PixelBufferWin32.
The win32 pbuffer implementation returned an error unless both the
WGL_ARB_pbuffer and the WGL_ARB_render_texture functions were present.
This was too restrictive, as a pbuffer can usefully be created without
render-to-texture, e.g. for use with glReadPixels.  The osg 1.2/Producer
pbuffers worked without RTT, and osgUtil::RenderStage has all the code to
handle both RTT and non-RTT pbuffers, doing a read and copy in the
latter case.

With these changes I have successfully tested the osgprerender example
on a graphics card which supports RTT, and one which doesn't.  Plus
tested in my own application.

In order to aid diagnostics I have also added more function status
return checks, and associated error messages.  I have included the win32
error text in all error messages output.  And there were some errors
with multi-threaded handling of "bind to texture" and a temporary window
context which I have corrected.

These is one (pre-existing) problem with multi-threaded use of pbuffers
in osgViewer & osgprerender, which I have not been able to fix.  A win32
device context (HDC) can only be destroyed from the thread that created
it.  The pbuffers for pre-render cameras are created in
osgUtil::RenderStage::runCameraSetUp, from the draw thread.  But
closeImplementation is normally invoked from the destructor in the main
application thread.  With the additional error messages I have added,
osgprerender will now output a couple of warnings from
osgViewer::PixelBufferWin32::closeImplementation() at exit, after
running multi-threaded on windows.  I think that is a good thing, to
highlight the problem.  I looked into fixing it in osgViewer::Renderer &
osgUtil::RenderStage, but it was too involved for me.  My own
application requirements are only single-threaded.

Unrelated fix - an uninitialised variable in
osg::GraphicsThread::FlushDeletedGLObjectsOperation().
"
2008-03-04 16:39:44 +00:00
Robert Osfield
dd2b4ed83e From Wojciech Lewandowski, "Attached is modified osgShadow::ShadowMap. I changed following things:
1:
Shadow map camera sets ABSOLUTE_RF_INHERIT_VIEWPOINT refernce frame. 
 
2:
Light Direction  by matrix multiplications replaced with transform3x3 multiplication.
 
3:
I made DebugingHUD functional by adding special draw callback. Former version was simply drawing pale square. 
 
4:
I was tempted to make 4 th change but decided to not do it. Instead I put it whith #if VIEW_DEPNDENT_TEXGEN. If you decide you may let it go.
 
When objects are not centered at 0,0,0 coord but in some distant location (for example at surface of earth ellipsoid) shadow texgen suffers from inadequate precision of float matrices. I changed that by premultiplying Texgen matrix (using OSG double matrices) with inverse modelview and applying it later with ModelView identity matrix. This tweak may be appropriate for OverlayNode texgen as well.
 
I left former version because I suspect that this change will make osgShadow::ShadowMap view dependant. Currently texgen matrix remains the same no matter what View displays it. With my change it wuld be different for each view. This touches the subject of View Dependent Shadow Techniques that J-S asked recently."
2008-03-04 16:22:47 +00:00
Robert Osfield
23bc6c2fe5 Refactored the way that the camera settings are inhertied 2008-03-04 16:03:37 +00:00
Robert Osfield
1d18bc7f48 From Art Trevs, "in the current implementation of the FrameBufferObject
there is a bug. The header file do specify something
like  this:

FrameBufferAttachment(Texture3D* target, int zoffset,
int level = 0);

However in the .cpp file we have:

FrameBufferAttachment::FrameBufferAttachment(Texture3D*
target, int level, int zoffset)


Which means that the meaning of level and zoffset is
interchanged.

The file with the corrected line is attached. Should
go into src/osg/
"
2008-03-04 15:29:47 +00:00
Robert Osfield
712ca43219 From Philip Lowman, "A missing _WIN32_WINNT declaration causes MinGW compilation to fail when reaching FileNameUtils.cpp and the Windows 2000 function GetLongPathName() is called." 2008-03-04 15:10:22 +00:00
Robert Osfield
c4d07194a2 From Art Trevs, add support for saving external shader files.
From Robert Osfield, adding missing member variable initializes and Output::getShaderFileNameForOutput() implementation
2008-03-04 14:04:48 +00:00
Robert Osfield
f7c33bb2e8 Change the setViewAsLookAt method to use Vec3d rather than Vec3 for better precision 2008-03-04 11:53:09 +00:00
Robert Osfield
2db68f98a8 Changed the updateStateSet code so that it creates a new StateSet each update
rather than clear and reuse the existing one, this change fixes a threading
issue that occured when the viewer is in DrawThreadPerContext.
2008-03-04 11:52:21 +00:00
Robert Osfield
9dcab11267 Updated wrappers 2008-03-01 13:42:07 +00:00
Robert Osfield
dd9dc85d40 Disabled the resizing of Camera's with FBO's 2008-02-29 16:09:48 +00:00
Robert Osfield
aa43b3c8a6 Added Camera::g/setIntialDrawCallback and g/setFinalDrawCallback(), and added
screen snapshot example code to osghud.
2008-02-29 15:25:57 +00:00
Robert Osfield
ca513efc1d Added LODScaleHandler 2008-02-28 20:02:43 +00:00
Robert Osfield
1dfffc0494 Added OSG_EXPIRY_DELAY env var option. 2008-02-28 18:08:32 +00:00
Robert Osfield
e26579b0ec Moved the delete operations to before of the compile operations to ensure that
delete operations don't get pushed out by allocations
2008-02-28 17:59:44 +00:00
Robert Osfield
eb46608be4 From Wojciech Lewandowski and Robert Osfield, Support from LightPointNode::s/getPointSprite parameter. 2008-02-27 12:11:02 +00:00
Robert Osfield
3b4af26136 From Paul Martz, fixed get/set methods API 2008-02-27 11:43:58 +00:00
Robert Osfield
335eed204b Added debug message to track cache usage 2008-02-27 11:43:06 +00:00
Robert Osfield
fdb6b31452 From Melchior Franz, fixed handling of modified keys when entering/leaving window 2008-02-25 17:30:30 +00:00