Commit Graph

116 Commits

Author SHA1 Message Date
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
ed45cccc25 Fixes for cygwin and mingw builds. 2002-02-09 10:24:39 +00:00
Robert Osfield
2075eb0100 Added support for parents to Drawables.
Bumped up version numbers in prep for 0.8.44.
2002-02-08 22:55:21 +00:00
Robert Osfield
4c5fcd3f61 Fixes for IRIX and Boris Bralo's TerraPage loader. 2002-02-08 09:30:02 +00:00
Robert Osfield
62d8b1e8de Fixed teh setDrawCallback so that it now calls dirtyDisplayList() instead of
dirtyBound.
2002-02-07 08:07:33 +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
ff571d2690 Added a check to the destructor of Referenced so that it detects referenced
objects that are deleted whilest still having a positive _refCount, such
as when a object has been deleted on the stack, yet other references still
exist for it.  Have put the desctructor implementation in Object.cpp to
avoid adding yet another file with only a couple of lines of code in.
2002-02-07 01:11:20 +00:00
Robert Osfield
b00d103f4e Added callbacks to allow users to modify the underlying functionality of
LOD, Billboard and Drawabel objects.
2002-02-07 01:07:11 +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
7293af59ed Have removed the old lazy initialization of Matrix since it was causing bugs
and adding checks to many mothods which in the end slow it down more than
not intilizing the code!  The code is now simpler, more robust and faster:-)
2002-02-05 21:51:06 +00:00
Robert Osfield
57fb5a0182 Added beginings of new AutoTransform class. 2002-02-03 20:57:31 +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
af968b00bd Added first cut at new AutoTransform node which will be used for generating
Transform's during the cull traversal such as for earth/sky etc.
2002-02-03 11:38:20 +00:00
Robert Osfield
cc39c462de Updates for Borland compilation. 2002-02-03 11:35:24 +00:00
Robert Osfield
0c63a4b65d Added defined( __BCPLUSPLUS__) to windows export code segments. 2002-02-02 20:07:59 +00:00
Robert Osfield
1aaa46dbe7 Fixes for Windows build. 2002-01-30 16:24:24 +00:00
Robert Osfield
4d43f83295 Removed the M_PI defines from include/osg/Math and have use a const double osg::PI etc
in its place.
2002-01-30 15:27:45 +00:00
Robert Osfield
9471714ba4 Changes for Borland C++ compiler changes. 2002-01-30 15:02:56 +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
c72efc1059 Fixes for windows build. 2002-01-29 20:25:45 +00:00
Robert Osfield
f061999b22 Removed the now rendundent DeepCopy and ShallowCopy files. 2002-01-29 14:20:29 +00:00
Robert Osfield
02ef10fcfa Moved all references to osg::Cloner to osg::CopyOp. 2002-01-29 14:04:06 +00:00
Robert Osfield
2487861fbc Have add new osg::CopyOp which replaces last nights osg::Cloner, the new
class now combines Cloner and DeepCopy into one class. Cloner and DeepCopy
will be removed in next commit.

Also have added osgcopy app to Demos which shows how the CopyOp have be
subclassed to create users own specific handling of copying.

Have fixed copy constructor problems in GeoSet which fix the deep copy
problem experienced yesterday.
2002-01-29 12:52:04 +00:00
Robert Osfield
f0174e34a3 A couple of fixes to DeepCopy Cloner. 2002-01-28 21:49:31 +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
06bd9fda5b Have made osg::Transform more extensible via additions of new getLocalToWorldMatrix()
and getWorldToLocalMatrix(), computeLocalToWorld() and computeWorldToLocal()
methods.

Have updated the CullVisitor, IntersectVisitor and Optimizer to use the
new osg::Transform::getLocalToWorldMatrix() which has the same functionality
as the old getMatrix() but is now supports subclasses of osg::Transform
transparently.

Have added osg::PositionAttitudeTransform as subclass of osg::Transform
which manages the transform as position and attitude via a Vec3 and Quat
respectively.
2002-01-23 22:15:39 +00:00
Robert Osfield
9c8c73c77f Updates to osg::Transform to allow it subclassed more easily. 2002-01-23 15:42:36 +00:00
Robert Osfield
58f72ee2d7 Changes to fix compilation problems on the Sparc.
GeoSet.cpp simply remove rendundent code that had already been commented out.
2002-01-18 22:34:07 +00:00
Robert Osfield
58ead9aead First steps to updating the calcTransform function in Billboard to fix
z axis contraint on rotation axis.
2002-01-18 22:15:59 +00:00
Robert Osfield
d20c2795d1 Removed the global scope operators for the isnan(..) etc calls to fix compilation
under some compiler combinations.
2002-01-18 14:12:36 +00:00
Robert Osfield
25bb70a86b Made the osg::Timer::tick() method a const method. 2002-01-18 14:11:46 +00:00
Robert Osfield
5cff1c7a6f Fixed typo in comment, reference to BoundingSphere has been changed to
BoundingBox.  Typo spotted by Gial Paolo Lorenzetto.
2002-01-18 10:26:06 +00:00
Robert Osfield
7c29110e40 Changed the enum Types { ... } so that in no longer explicitly sets the values,
leaving C++ to ensire that values are unque and insequence.
2002-01-16 21:22:06 +00:00
Robert Osfield
1fb8f9cb86 First batch of changes required for MacOS X build. Orignal submission from
Phil Atkin, merged by Robert Osfield.
2002-01-16 10:36:20 +00:00
Robert Osfield
87763acc03 New ajustAspectRatio (ADJUST_NODE) mode added to osg::Camera to fix issue
with integration with vrjuggler, submitted by Allen Bierbaum.
2002-01-15 11:05:00 +00:00
Robert Osfield
4ea7de39c6 Added osg::ShadeModel state attribute which encapsulates glShadeModel. 2002-01-04 17:35:54 +00:00
Robert Osfield
e3ad8a87ee Updates for Cygwin port, from Norman Vine. 2002-01-03 21:34:57 +00:00
Robert Osfield
03b161942b Fixed the orientation of for_each_triangle cases for QUAD and QUAD_STRIP. 2002-01-02 10:49:26 +00:00
Robert Osfield
bd0f334329 Added a more detailed explanation of how LOD's work. 2001-12-31 23:16:20 +00:00
Robert Osfield
97e7f5b829 Added osg::GeoSet::FLAT_TRIANGLE_FAN to the list if primitive handled by the
for_each_triangle template function.
2001-12-30 20:03:42 +00:00
Robert Osfield
625e8e730a Added comment to osg::Transform w.r.t use of GL_NORMALIZE when using
scaling Transforms.
2001-12-29 14:27:46 +00:00
Robert Osfield
c236e38b90 Made inline documentation on the Values enum clearer w.r.t the function of
OVERRIDE_ON and OVERRIDE_OFF.
2001-12-27 20:06:07 +00:00
Robert Osfield
98c8447ae9 Fixed the osg::Light so that it requires the user to explicitly define which
OpenGL light is being operated on, and also now relies upong the standard
osg::State handling of OpenGL modes to switch on the appropriate lights.

The previous static counter mechansim for the light number was causing a
redundent light to be created when the osg plugin created the first osg::Light
to use a prototype for other osg::Light's to be cloned from in the
.osg plugin execution.

The static count mechanism also prevent the lights modes being controlled
independantly from the setting of the light paramters themselves.  This
meant that a light once created was global, and couldn't be turned off
locally via the OSG's support for OpenGL mode enabling/disabling.  This
has been overcome with the new implementation, the user has complete
flexiblity of when and where to use the different lights at their
disposal.
2001-12-24 21:34:40 +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
734be18471 Updates to the support for stereo in osg::Camera, osgUtil::SceneView and
the CameraManipulators.
2001-12-21 13:07:35 +00:00
Robert Osfield
9365f0e3b1 Added support for glLineWidth via an osg::LineWidth StateAttribute. 2001-12-20 20:48:46 +00:00
Robert Osfield
8aa72d85cf Updates to the camera code related to stereo, adding fusion distance. 2001-12-20 16:35:38 +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
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