Commit Graph

195 Commits

Author SHA1 Message Date
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
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
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
97df94db7e Typo fixed in the header guard. 2002-02-02 10:52:30 +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
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
9a6a96a7e7 Fixed the header guard, which was using the name define as FileUtils.
Problem spotted by Terry Welsh.
2002-01-29 12:55:23 +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
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
604110b245 Updates to help compilation under gcc 3.03. 2002-01-20 16:24:54 +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
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
4fbf4db42e Added support for multiple graphics contexts, submission from Max Rhiener.
Alas changed the indenting to use 4 spaces instead of tabs, this irons out
differences when working under Windows and Unix, keeping the identing
consistent.
2002-01-18 22:25:51 +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
d1b2fcd0df Fixed ENALBE_ALL_CULLING spelling mistake, have changed it to ENABLE_ALL_CULLING. 2002-01-17 22:41:34 +00:00
Robert Osfield
06e0310314 Added support for glutSpecialFunc, glutSpaceballMotion, glutSpaceballRotate and
glutSpaceballRotate into osgGLUT::Window base class.
2002-01-17 22:40:16 +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
c518d69013 Removed the variables which were duplicated in osgGLUT::Viewer and
osgGLUT::Window, standardising on the Window ones, and therefore removing
an unitialized variable that had been introduced.  This caused a crash
under WindowsXP due to send invalid values to glutReshapeWindow.
2001-12-31 23:21:16 +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
a6d329b812 Updated the osgGLUT::Viewer to subclass from osgGLUT::Window as has been
intended since the development of osgGLUT::Window.
2001-12-24 19:06:49 +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
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
b1f478e5d2 Updated OSG so that the old OSG_USE_IO_DOT_H has be removed from all headers
that used it, all references to the Standard C++ stream classes use the
std::ostream etc convention, all references to "using namespace std" and
"using namespace std::ostream etc" have been removed.
2001-12-14 21:49:04 +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
84605a5f4e Fixes for Win32 build related to changes in using namespace std. 2001-12-14 10:47:20 +00:00
Robert Osfield
a4e4d4fa7c Removed all references to using namespace std to help solve compilation problems
under Windows and IRIX.

Also integrated small change to lib3ds from Drew for IRIX compilation.
2001-12-14 10:02:27 +00:00
Robert Osfield
f848c54ba3 Made the following name changes to Matrix and Quat to clean them up and make
the functionality clear given the name.  This will break user code unfortunately
so please be away of the following mapping.

  osg::Matrix::makeTrans(..)?\026 -> osg::Matrix::makeTranslate(..)
  osg::Matrix::makeRot(..)?\026   -> osg::Matrix::makeRotate(..)
  osg::Matrix::trans(..)?\026     -> osg::Matrix::translate(..)

  osg::Quat::makeRot(..)?\026     -> osg::Quat::makeRotate(..)

Also updated the rest of the OSG distribution to use the new names, and
have removed the old deprecated Matrix methods too.
2001-12-12 20:29:10 +00:00
Robert Osfield
05e4a0b4ce Fixed problem with loading interleaved arrays in the .osg loader, and corrected
a spelling mistake in osg::GeoSet.
2001-12-12 12:55:01 +00:00
Robert Osfield
b3cfed2cb2 Fixed compilation problems under Windows due to changes in using std::ostream etc. 2001-12-11 16:00:32 +00:00
Robert Osfield
6c38b61185 Removed the 'using namespace std' and replaced with more specific 'using std::ostream'
this should help prevent polution of the global namespace with std when including
these osg include files.
2001-12-11 11:22:44 +00:00
Robert Osfield
a23627467b Added support for automatic deletion of osg::GeoSet's attributes, via a
default AttributeDeleteFunctor which uses delete [].  Users can create
their own handlers for the attribute memory to override this default
behavior.

Fixed a typo in ReaderWriterOBJ.cpp.
2001-12-04 22:57:40 +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
Don BURNS
bca8b68a18 Corrected a small booboo in preprocessor guard for header file in GLU and
added Matrix::identity() to Matrix
2001-12-02 08:59:39 +00:00
Don BURNS
4ef08067b7 Small fix for preprocessor _MP symbol clash with MFC. 2001-11-21 15:53:29 +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
969f757679 Added osg::Image::dirtyImage() and setModifiedTag() to allow external
updating of the image modified flag to be used in conjunction with
texture subloading.
2001-11-18 21:31:16 +00:00
Robert Osfield
2c3b927d6c Fixed compilation problem under Wndows 2001-11-14 15:32:15 +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
34555f61d6 Added new files to cvs. 2001-11-12 10:04:57 +00:00
Robert Osfield
5ceefdcc12 Fixed compilation error in src/osgDB/FileUtils.cpp.
Added support for nested NodeCallbacks, allowing them to be chained together
so that multiple operations can be applied.
2001-11-11 22:32:59 +00:00
Robert Osfield
7290f793f1 Added osgText::Paragraph which is a subclass from Geode which composes a
list of text drawables as a paragraph block, handles breaking of text into
individual lines automatically.

Changed the osg::Node::setUserData so that the data type has to be an
osg::Referenced, and removes the dependancy on osg::MemoryAdapter.  I have
done this since it simplifies the OSG side of the interface and makes it
less like that the user might abuse the memory managment of the data. It
does however mean that user data will have by subclassed from Referenced,
and therefor may require users to have their own adapter to do this.
However, this little nuasance is worth the extra cleaness and robustness
afforded by going the osg::Referenced route.
2001-11-09 15:06:01 +00:00
Robert Osfield
b3160c882e Fixed inlcude/BoundingBox to compile under Windows. 2001-11-06 11:36:11 +00:00
Robert Osfield
138a5300b0 Fixed inlcude/Math to compile under Windows. 2001-11-06 11:07:43 +00:00
Robert Osfield
5e6153b428 Added methods to support isNaN,isInfinte and valid to osg::Vec* and osg::Math,
and added a guard to IntersectVisitor which uses these new methods to prevent
invalid segments being added.
2001-11-06 10:34:51 +00:00
Robert Osfield
b45aa55555 Integrated updates to stats sent in my Geoff Michel. 2001-11-04 19:29:20 +00:00
Robert Osfield
06abf2266b Updates to Makefiles to include osgText.
Also a couple of undefined methods in osgText::Text have been added.
2001-11-02 20:11:37 +00:00
Robert Osfield
42faf78b47 Updated index.html with dependacy info about the new osgText library.
Modified osg/Drawable::draw(..) so that it uses display list COMPILE
rather than COMPILE_AND_EXECUTE to solve performance problems under
NVidia drivers.  The old behavior is still available by comments out
a #define.
Fixed the default compilation list src/osgPlugins/Makefile so that it
compiles by defalt png and gif.
2001-11-02 12:26:33 +00:00
Robert Osfield
4d4ff39ff9 Added a bool paramter to osg::StateSet::compare(const StateSet& rhs,bool compareAttributeContents=false) const;
to allow it to use different comparison schemes, now it can use checking for pointer equality (the default)
or attribute contexts.  This has been added to assist optimization of databases within the flt loader, but
also could be useful for other operations too.
2001-10-31 20:04:32 +00:00
Robert Osfield
94ce36f9a3 Update to osgText to get things compiling under Windows. 2001-10-31 12:27:48 +00:00
Robert Osfield
8f4e62ced0 Further updates to the ReaderWriter support in osgDB, and a fix to a small warning
in Matrix.cpp.
2001-10-30 19:23:24 +00:00
Robert Osfield
f0372817b5 Added support for ReadResult and WriteResult to the osgDB::ReaderWriter
to allo plugins to pass back more information about the success or failure
of a file load.  All plugins have been updated to the new convention.
2001-10-30 14:20:37 +00:00
Robert Osfield
97e4488d80 Changed a #define ... (GLenum) 0x84fe to 0x84FE to fix problems under MacOS9
build.
2001-10-29 19:29:49 +00:00
Robert Osfield
939b12a908 Updates of osgDB/FileUtils to fix compilation problems under Win32 2001-10-24 19:48:58 +00:00
Robert Osfield
573f68c35b Updates to osgText. 2001-10-24 13:46:58 +00:00
Robert Osfield
6ddb40ba70 Updated the osgText implemention, now works under Linux. 2001-10-24 09:08:02 +00:00
Robert Osfield
36d206f40f Updates to the new osgText library to get it to compile under Linux. 2001-10-23 22:08:02 +00:00
Robert Osfield
8e1b1bcfc1 First past integrat of Max Rhiener work on wrapping FTGL to create osgText
library and demo.
2001-10-23 19:51:39 +00:00
Robert Osfield
63bb05e6fd Added new osgGLUT::Window base class which is very basic right now, all it does
is bring up a GLUT window and provide virtual functions from which users should
subclass to add functionality.
2001-10-23 15:55:01 +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