Commit Graph

63 Commits

Author SHA1 Message Date
Robert Osfield
f8340f9ef5 Removed the cached matrices from osg::Camera, so that
osg::Camrea::getModelViewMatrix() and osg::Camera::getProjectionMatrix() are
calculated on the fly.  Removed various redudent methods, including the
project and unproject methods which are better supported within osgUtil::SceneView.

Added a computeWindowMatrix() method to Viewport, to make it easier to construct
a MV*P*W matrix for converting local coords into screen coords and visa versa.
Converted SceneView and CullVisitor to use this new method.
2002-04-16 11:41:32 +00:00
Robert Osfield
9fd7c528f4 Compile fixes for IRIX, submitted by Randall Hopper. 2002-04-15 21:48:43 +00:00
Robert Osfield
bbef7164db Added CullCallbacks to osg::Node, and osgUtil::CullVisitor. 2002-04-15 13:15:48 +00:00
Robert Osfield
9b2fe06896 Fixed compile problem related to missing includes (a result of removing include of Camera..) 2002-04-13 11:08:04 +00:00
Robert Osfield
341ffb2361 Further work on cleaning up SceneView and Camera, in particular moving strereo
support out of Camera and into SceneView. Also enabled the option to set the
projection and modelview matrices directly on SceneView thereby removing the
dependance on osg::Camrea to control the view of the scene.
2002-04-12 18:06:13 +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
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
7e2c82f141 Futher updates to MemoryManager, fixed memory leak in osgconv. 2002-03-27 16:31:25 +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
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
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
685d0b08cb Beginings of reimplementation of stereo support in scene view. Work
not complete yet.
2002-02-14 13:26:37 +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
4c5fcd3f61 Fixes for IRIX and Boris Bralo's TerraPage loader. 2002-02-08 09:30:02 +00:00
Robert Osfield
d12a726d5b Various investigations into culling errors w.r.t matrix inversion resulted in
the conclusion that the osg::Matrix::inverse was broken, have lifted a new
implementation from sgl and it seems to work fine.  Will need further testing
but looks good.
2002-02-07 01:15:15 +00:00
Robert Osfield
a703130aa0 Have taken a few more steps towards support for view dependant transformations
by adding a ComputeTransformCallback to osg::Transform, and have now removed
the recently added AutoTransform since it is nolonger required.  Have also
updated CullVisitor to account for the new ways for tracking transformation
matrices in the scene.
2002-02-05 21:54:46 +00:00
Robert Osfield
6630cfb455 Fixes for GCC 3.0.3 build. 2002-02-03 19:18:14 +00:00
Robert Osfield
c1283c23e8 Removed the trailing ; after namespace {...} declariations in headers
which was being picked as a warning under Codewarrior.
2002-02-03 12:33:41 +00:00
Robert Osfield
0c63a4b65d Added defined( __BCPLUSPLUS__) to windows export code segments. 2002-02-02 20:07:59 +00:00
Robert Osfield
5b978813c3 Fixed clone(CopyOp&) and cloneType() methods which were out of sync with the
new style clone operations.
2002-01-30 19:59:36 +00:00
Robert Osfield
7b370fcb57 Made the LineSegment destructor protected to force users to create segments
on the stack thus ensure that they arn't created locally and have their
memory deleted incorrectly.

Also updated the IntersectVisitor so that it no used osg::ref_ptr<> internally
for storing all data. Have also move the IntersectState helper class to inside the
IntersectVisitor which simplifies the external interface to the class.
2002-01-30 12:09:18 +00:00
Robert Osfield
02ef10fcfa Moved all references to osg::Cloner to osg::CopyOp. 2002-01-29 14:04:06 +00:00
Robert Osfield
f612924a45 Added support for shallow and deep copy of nodes, drawables and state, via a
copy constructor which takes an optional Cloner object, and the old
osg::Object::clone() has changed so that it now requires a Cloner as paramter.
This is passed on to the copy constructor to help control the shallow vs
deep copying.  The old functionality of clone() which was clone of type has
been renamed to cloneType().

Updated all of the OSG to work with these new conventions, implemention all
the required copy constructors etc.  A couple of areas will do shallow
copies by design, a couple of other still need to be updated to do either
shallow or deep.

Neither of the shallow or deep copy operations have been tested yet, only
the old functionality of the OSG has been checked so far, such running the
viewer on various demo datasets.

Also fixed a problem in osg::Optimize::RemoveRendundentNodesVisitor which
was not checking that Group didn't have have any attached StateSet's, Callbacks
or UserData.  These checks have now been added, which fixes a bug which was
revealled by the new osgscribe demo, this related to removal of group acting
as state decorator.

method
2002-01-28 21:17:01 +00:00
Robert Osfield
f16776da22 Fixed FlattenStaticTransformVisitor bug which related to incorrect handling
of objects which were transformed by multiple matrices at one time - this
cannot be handled in the flattening process (since we only have one piece
of geometry to transform).  This visitor now handles this case by disabling
flattening of any objects and transforms associated in this way.
2002-01-22 19:30:51 +00:00
Robert Osfield
cf66502fe5 Converted osgUtil::GUIEventAdapter::MouseButtonMask from LEFT_BUTTON etc to
LEFT_MOUSE_BUTTON etc, to prevent classes with #define of LEFT_BUTTON.. when
including certain MS Windows headers. Arhsh Snarfff..
2002-01-19 22:11:05 +00:00
Robert Osfield
acf256c466 UPdates to CullVisitor so that it keeps in sync with the new method paramter
change in osg::Billboard.

Removed in instance of an object being passed () brackets, have removed the
brackets to avoid an amiguity with the compiler intepreting it as a function.
2002-01-18 22:36:56 +00:00
Robert Osfield
d1b2fcd0df Fixed ENALBE_ALL_CULLING spelling mistake, have changed it to ENABLE_ALL_CULLING. 2002-01-17 22:41:34 +00:00
Robert Osfield
e3ad8a87ee Updates for Cygwin port, from Norman Vine. 2002-01-03 21:34:57 +00:00
Robert Osfield
19c99dc94c Further work on improving stereo support in the OSG.
Renamed the osg::VisualsSettings to osg::DisplaySettings, and
osgUtil::VisualsRequirementsVisitor to osgUtil::DisplayRequirementsVisitor.

Added support for OSG_SCREEN_HEIGHT into osg::DisplaySettings, and added
a DisplaySettings* to the constructors of osg::SceneView and osg::Camera.
2001-12-21 22:48:19 +00:00
Robert Osfield
296865e250 Adding support for controlling visual settings via environmental variables
and command line paramters.  Including support for stereo and stencil buffer.
2001-12-19 00:38:23 +00:00
Robert Osfield
bc49a83c51 Updated the Optimzer::FatternStaticTransform visit so by default it ignores
all dynamic transforms, previously it flattened dynamic transforms as well.
2001-12-17 15:05:06 +00:00
Robert Osfield
f5873a82c5 Integrated detailed near clipping plane calculation into osgUtil::CullVisitor,
submitted by Sasa Bistroviae.
2001-12-16 22:20:26 +00:00
Robert Osfield
cb8025d913 Renamed osg::Matric::makeIdent() to osg::Matrix::makeIdentity() to make
it consistent with the rest of the osg::Matrix naming.  Updated OSG
distribution to account for new name.

Added support for the STATIC/DYNAMIC osg::Transform::Type to the .osg
ASCII reader/writer plugin and the flt reader plugin.

Removed the non cost version of osg::Transform::getMatrix() as this could
by pass the dirty mechinism.
2001-12-15 16:56:39 +00:00
Robert Osfield
478274ae7d Fixes to Windows build in liu of the move to using just std::streams. 2001-12-14 23:18:28 +00:00
Robert Osfield
6070a9e1b1 Updatedwidley used includes to remove most of the float/double warnings
generated when compiling under Windows with STLport.
2001-12-14 18:06:34 +00:00
Robert Osfield
20e3785bf8 Various files which should have been checked in earlier but were missed...
VisualStudio files for flt loader, and header files or Image and Texture
for new osg::Texture::CLAMP_TO_EDGE and osg::Image::dirty.
2001-12-04 20:38:27 +00:00
Robert Osfield
34a4c18a26 Beginings of support for quad bufferd, red/green, and slit screen stereo. 2001-12-02 22:20:46 +00:00
Robert Osfield
bc44b9342b Added DLL export to the internal classes in osgUtil::Optimize so that the internal
classes can be used directly by client applications.
2001-11-19 11:52:58 +00:00
Robert Osfield
6cf543cf8c Added osgUtil::TransformCallback to help with rigid body animation. 2001-11-14 14:10:12 +00:00
Robert Osfield
a434abafd7 Fixes for IRIX build.
Updates to the osg::Transform, adding preMult and postMult methods and
deprecating the old preRotate,preTranslate,preScale.

Updated the rest of the OSG so that it nolonger uses the deprecated
osg::Transform nodes.

Renamed osgUtil::SceneView::setGlobalState() to
osgUtil::SceneView::setGlobalStateSet() so that the name reflects its
functionality better.  Updated osgGLUT::Viewer etc to cope with new
name change.
2001-11-14 14:09:07 +00:00
Robert Osfield
b45aa55555 Integrated updates to stats sent in my Geoff Michel. 2001-11-04 19:29:20 +00:00
Robert Osfield
25c8b05914 Integrated Geoff Michel's updates to Stats code, whilest move all text rendering
back in the viewer from the Statistics header.

Added a osg::State::captureCurrentState(StateSet&) method and a copy constructor
to osg::StateSet.
2001-10-22 22:02:47 +00:00
Robert Osfield
7082abb8ad Added support for an osgUtil::SceneView::init() traversal which is called once
per scene view.  The user can attach a NodeVisitor to do init for them, or
leave it to the default which is to use the osgUtil::DisplayListVisitor
which compiles all display lists and texture objects.  The init traversal
is called automatically by the first call to either app() or cull(), so
should not be called by user code during initialization. This ensures
that a valid graphics context has been established before OpenGL is initialized.

osgUtil::DisplayListVisitor has also been updated to use a bit mask for options, and the addition of
compilation of texture objects (via StateAttribute::compile) has also been
added.
2001-10-20 20:26:36 +00:00
Robert Osfield
ccc3d3fd8a Added osgUtil::Optimizer which contains four visitor each designed for doing
different types of optimization on the scene graph - state optimization,
flattening static transforms, combining LOD's and removing redundent groups.
The new Optimizer replaces the once seperate OptimizerStateVisitor.
2001-10-19 14:22:02 +00:00