Commit Graph

201 Commits

Author SHA1 Message Date
Robert Osfield
6ed233d0d2 Added DataVariance enum and set/get fields to osg::Object to help identify
which objects have values that vary over the lifetime of the object (DYNAMIC)
and ones that do not vary (STATIC).  Removed the equivalent code in
osg::Transform, StateSet and StateAttribute, as these are now encompassed
by the new DataVariance field.

Removed MatrixMode enum from Matrix, and associated fields/parameters from
osg::Transfrom and osg::NodeVisitor, since MatrixMode was not providing
any useful functionality, but made the interface more complex (MatrixMode
was an experimental API)

Added ReferenceFrame field to osg::Transform which allows users to specify
transforms that are relative to their parents (the default, and previous behavior)
or absolute reference frame, which can be used for HUD's, camera relative
light sources etc etc.  Note, the view frustum culling for absolute Transform
are disabled, and all their parents up to the root are also automatically
have view frustum culling disabled.  However, once passed an absolute Transform
node culling will return to its default state of on, so you can still cull
underneath an absolute transform, its only the culling above which is disabled.
2002-04-11 23:20:23 +00:00
Robert Osfield
e85e5a6ce6 Added several new methods to osg::Image to help keep track of memory and added
osg::Image::readPixels to encapsulate glReadPixels.

Reordering of includes in include/osg/Fog and include/osg/Light to remove silly warnings under Visual Studio.
2002-04-11 17:15:07 +00:00
Robert Osfield
e037c79917 Fixed refrences to NewCullVisitor which has now been mapped onto CullVisitor. 2002-04-11 08:24:55 +00:00
Robert Osfield
f2ffbdd469 Copied NewCullVisitor over top of CullVisitor and then removed NewCullVisitor.
Added some defines to Image in prep for writing code to determine how big a
pixel is.
2002-04-10 22:10:07 +00:00
Robert Osfield
360247225e Added new osg::DrawPixels class with encapsulates glDrawPixels as and
osg::Drawable.  Added osg::Image::readPixels to osg::Image.

Made osg::LightSource to default to cullActive set to false to that LightSource
nodes don't get culled by default.
2002-04-10 21:51:34 +00:00
Robert Osfield
1369987cdd Added setProjectionMatrix and setModelViewMatrix() methods to osg::SceneView,
and associated member variables.  I have not linked them up to the
cull traversal yet, but this will be the next task.
2002-04-09 21:46:34 +00:00
Robert Osfield
6f65e86057 Further work on removing Camera references from NewCullVisitor and releted
classes, this work paves the way for making osg::Camera an optional
extra rather than a requirement for rendering.
2002-04-09 16:09:19 +00:00
Robert Osfield
3351306d80 Added new osg::Projection node, and osgUtil::NewCullVisitor which are work
in progress for the new support for controlling the projection matrix from
within the scene graph.

Also Added osg::State::getClippingVolume(), getProjectionMatrix() and
getModelViewMatrix() with allows drawables to access the current projection,
and model view matrices and the view frustum in local coords to the drawable.
2002-03-31 16:40:44 +00:00
Robert Osfield
56cee8c711 Move the applying of Projection and ModelView matrices into osg::State so that
it now maintains references to the last applied matrices, automatically doing
lazy state updating.  This simplifies the various places in the OSG which
were previously doing the applying, add paves the way for managing the
projection matrix within the scene graph.

Remove MemoryAdapter and mem_ptr as they arn't being used, and can potentially
confuse users by their existance.
2002-03-29 17:26:40 +00:00
Robert Osfield
07f9421f39 Converted from dos file endings to unix. 2002-03-29 12:23:54 +00:00
Robert Osfield
d421e35c8d A compile fix to the new Texture subload changes. 2002-03-27 23:04:52 +00:00
Robert Osfield
33c89c3be0 Added support for setting the texture subload width and height within
osg::Texture.  The values default to 0, and in this state they are
sizes of the glTexSubImage2D are taken from the source image size.  This
allows the previous setup with no settings for subload size to work as
before.
2002-03-27 22:51:58 +00:00
Robert Osfield
7e2c82f141 Futher updates to MemoryManager, fixed memory leak in osgconv. 2002-03-27 16:31:25 +00:00
Robert Osfield
84d2d01163 Added support for osg::MemoryManager which is based upon Paul Nettle's
memory manager published at flipcode.com.  This can be turned on
with the OSG_USE_MEMORY_MANGER option which then uses custom global
new and delete operators as well as provide osgNew and osgDelete macro's
which add ability to log line and file from which calls are made.

Updated osg,osgUtil,osgDB,osgText and osgPlugins/osg to use osgNew/osgDelete,
and fixed memory leaks highlighted by the new memory manager.
2002-03-26 23:52:52 +00:00
Robert Osfield
651a22453a Added osg::MemoryManger which is currently based on Paul Nettle's memory manager
published at flipcode.  I havn't adopted Paul's macro's for new/delete etc, but use
osg prefixed versions instead to allow greater flexiblity in handling include
ordering.

Have fixed a couple of new/delete[] problems which existed as a result.

To use the MemoryManager to track memory usage simply add
-DOSG_USE_MEMEORY_TRACKING to the compile line.

Have yet to move the osg from using new to osgNew, will do this next.
2002-03-25 23:18:02 +00:00
Robert Osfield
06fcd12598 Fixes for MacOSX build. 2002-03-25 19:04:30 +00:00
Robert Osfield
f50c5f7a5e Moved the exit on escape into Window, and added a virtual free method on both
Window an Viewer to clean up the windows, this is now called before exit is
finally called, ensure that more more memroy is clean up prior to exit.
2002-03-23 21:28:25 +00:00
Robert Osfield
33b0ceac0d Added GL_TEXTURE_3D definition for those with gl.h headers which don't
contain it.
2002-03-23 10:55:29 +00:00
Robert Osfield
03cda7d3f8 Renamed have_applied_mode, have_applied_attribute, apply_mode, apply_attribute
to haveAppliedMode, haveAppliedAttribute, applyMode, applyAttribute to make
it more consistent with the general OSG name convetion.
2002-03-21 12:36:05 +00:00
Robert Osfield
a364875afb Added osg:State:have_applied_mode(mode) and have_applied_attribute(type) to make it
easier to specify which modes and attributes have been modified without
the user requiring to know to what value, or to have an equivilant attribute
to pass to the have_applied_attribute method.  The original have_applied(mode)
and have_applied(attribute) methods have been renamed have_applied_mode(),
have_applied_attribute() as this was required to prevent the mode and type
values colliding during compile (it was causing a compile error when the method
names were the same.)
2002-03-21 12:00:10 +00:00
Robert Osfield
9836af1055 Added osg::TextureCubeMap which encapsulates OpenGL's cube texture mapping. 2002-03-20 22:39:51 +00:00
Robert Osfield
8656adb463 Added a Referenced::unref_nodelete() method which unreferences but does
not delete the object even if its count goes to 0 or below.  This should
only be called in special circumstances, the ReaderWriter::ReadResult
being one of them. This new method has allowed the problem of objects
being multiple referenced on return from readNodeFile() & readImageFile().
2002-03-20 14:03:30 +00:00
Robert Osfield
0b27e5c381 Updates to Texture and TextureCubeMap to clean up the code so they share
much more of the core texture setup code. This largely invloved paramterizing
the applyImmediateMode, which has also been rename applyTexImage to reflect
its functionality better.
2002-03-20 11:24:47 +00:00
Robert Osfield
8f02db61e5 Added osg::TextureCubeMap. submission from Brede Johansen. 2002-03-18 23:10:33 +00:00
Don BURNS
eb0587b5fb Changes required for SUN Solaris port... 2002-03-18 21:56:00 +00:00
Robert Osfield
c49c62ee15 Integrated various changes worked on at the Glasgow Science Center. Changes
include change the CameraManipulators so they work with double for time
instead of float.  Also added support for DataType to osg::StateAttribute
and StateSet so that they can be set to either STATIC or DYNAMIC, this
allows the optimizer to know whether that an attribute can be optimized
or not.
2002-03-14 17:34:08 +00:00
Robert Osfield
e80496d5db Changed Texture so that is use lazy updating on texture paramters (Filter/Wrap)
mode by using a _texParamtersDirty flag in combination with an
applyTexParamters(State&) method which does the paramters setting in one
tidy bundle.  This new implementations replaces the CompileFlags submitted
yesterday.

Simplified NodeCallback by remove osg::NodeCallback::Requirements as they
are no longer needed.

Fixed comments in Drawable.

Put guards around cosf definations so that they are only used under Win32/Mac.

Fixed warning in CullVisitor.
2002-03-14 16:01:21 +00:00
Don BURNS
fea861e013 Fixed compile flags in Texture 2002-03-14 00:07:29 +00:00
Don BURNS
d0ee300405 Fixed DrawCallback in Drawable and added CullCallback to Drawable
Cull Visitor now checks for a Drawable's CullCallback and calls it
if it exists.  It then prunes based on the return value (bool) of the
cull callback.
2002-03-13 22:44:22 +00:00
Robert Osfield
a6aa57a255 Added support for seperate traversal masks for standard, left and right
cull traversals.  This allows one to create seperate rendering for left
and right eyes when doing stereo.
2002-03-03 22:31:46 +00:00
Robert Osfield
0439b72da7 Updates to the clamp to border support in osg::Texture. 2002-03-01 09:27:10 +00:00
Robert Osfield
2973ca0a25 Added support for setting the maximum number of graphics contexts that the
OSG has to maintian.
2002-02-28 00:11:31 +00:00
Robert Osfield
3444c95261 Integrated support for GL_CLAMP_TO_BORDER_ARB extension to osg::Texture,
submitted by Sasa Bistrovic.
2002-02-27 22:00:47 +00:00
Robert Osfield
1bdebcf174 Added new osg::AnimationPath which is contaner for a set of key frames for
defining an animation path.  To be used with osg::Transform etc.
2002-02-27 00:58:54 +00:00
Robert Osfield
7c0eb0f380 Added makeRotate(heading,pitch,roll) to Quat in prep for new classes for
animation paths.
2002-02-26 20:01:04 +00:00
Robert Osfield
e21af2adce Added support for glLightModel functionality via osg::LightModel. 2002-02-25 22:46:38 +00:00
Robert Osfield
f600f6fe4a Added support for glLineStipple via osg::LineStipple state attribute. 2002-02-24 20:55:45 +00:00
Robert Osfield
20781cc621 updates for Win32 Codewarrior build 2002-02-22 23:40:25 +00:00
Robert Osfield
64b706fd0b Fix for win32 Codewarrior build 2002-02-22 23:39:42 +00:00
Robert Osfield
00e91eec1d Add support for Metrowerks Codewarrior build under Windows. 2002-02-22 17:12:10 +00:00
Robert Osfield
aefaafdbf9 Fixed stereo implementation. 2002-02-18 23:01:09 +00:00
Robert Osfield
4abfdb1ebd Added OpenDX writer from Randall Hopper. 2002-02-18 20:46:47 +00:00
Robert Osfield
685d0b08cb Beginings of reimplementation of stereo support in scene view. Work
not complete yet.
2002-02-14 13:26:37 +00:00
Robert Osfield
0c1264f547 Fixed the fabsf define which was eroneous mapped to sqrtf, due to the copy and
paste antipattern no doubt.
2002-02-13 22:52:07 +00:00
Robert Osfield
b2e2a971fd Updates to Transform and CullVistor to support new getLocalToWorldMatrix methods. 2002-02-12 08:23:07 +00:00
Robert Osfield
386b87d4a0 Cleand up the root Makefile.
Moved CullVisitor/RenderStage/RenderStageLighting across to managing lights
entirely within RenderStageLighting, and changed the management of modelview
matrices so that RenderLeaf now stores the absolute modelview matrix, rather
than a model matrix as done previously. The later allows RenderLeaf's to do
a glLoadMatrix rather than a glPushMatrix/glMultMatrix/glPopMatrix.
2002-02-11 19:51:24 +00:00
Robert Osfield
0aab3a38b0 Updated Stats code, sent in by Geof Michel. 2002-02-11 00:40:37 +00:00
Robert Osfield
7d03f8a548 Implemented NodeVisitor's getLocalToWorldMatrix and getWorldToLocalMatrix
to allow users to querry the current accumulated matrix state within the
scene graph.
2002-02-10 22:35:22 +00:00
Robert Osfield
e6638d9974 Disbalbed a dumb warning in Windows build via a #pragma. 2002-02-10 20:05:38 +00:00
Robert Osfield
c999dfb154 Updates to docs and fixes to a few warnings. 2002-02-09 14:29:58 +00:00