Commit Graph

1212 Commits

Author SHA1 Message Date
Robert Osfield
053ba0c543 From Wojciech Lewandowski, "I did few tests to see whether adding PreDraw callback would help us with SPI problems when using Viewer. Results were positive so I decided to give it a try and ask you to verify and maybe merge with existing codebase.
I added _preDrawCallback member and neccessary access methods plus modified osgUtil RenderStage.cpp to invoke it before all drawInner calls are made. I tried to maintain symmetry with postDrawCallback but you know better where is a proper place for this call ;-)
"
2007-06-01 19:45:24 +00:00
Robert Osfield
fcafd4db06 From Stephan Huber, "attached you'll find the modified ImageStream
and a small fix for QuicktimeImageStream to disable debug-logging :)"
2007-06-01 19:19:23 +00:00
Robert Osfield
02d2963df4 Updated version number, wrappers and readme for release 2007-05-28 10:17:52 +00:00
Robert Osfield
005268e982 Fixes to help C# binding dev. 2007-05-26 15:49:35 +00:00
Robert Osfield
02b31fdcd9 From Peter Hrenka, fixes regarding line-strips and -loops. 2007-05-24 10:15:50 +00:00
Robert Osfield
30a06a033e From Peter Hrenka, (note from Robert Osfield, renamed GenericPrimitiveFunctor mention below to TemplatePrimitiveFunctor).
"Since we desperately needed a means for picking Lines
and Points I implemented (hopefully!) proper geometrical tests
for the PolytopeIntersector.

First of all I implemented a new "GenericPrimiteFunctor"
which is basically an extended copy TriangleFunctor which also
handles Points, Lines and Quads through suitable overloads of
operator(). I would have liked to call it "PrimitiveFunctor"
but that name was already used...
I used a template method to remove redundancy in the
drawElements method overloads. If you know of platforms where
this will not work I can change it to the style used
in TriangleFunctor.

In PolytopeIntersector.cpp I implemented a
"PolytopePrimitiveIntersector" which provides the needed
overloads for Points, Lines, Triangles and Quads to
the GenericPrimitiveFunctor. This is then used in the
intersect method of PolytopeIntersector.

Implementation summary:
- Points: Check distance to all planes
- Lines: Check distance of both ends against each plane.
  If both are outside -> line is out
  If both are in -> continue checking
  One is in, one is out -> compute intersection point (candidate)
  Then check all candidates against all other polytope
  planes. The remaining candidates are the proper
  intersection points of the line with the polytope.
- Triangles: Perform Line-Checks for all edges of the
  triangle as above. If there is an proper intersection
  -> done.
  In the case where there are more than 2 polytope
  plane to check against we have to check for the case
  where the triangle encloses the polytope.
  In that case the intersection lines of the polytope
  planes are computed and checked against the triangle.
- Quads: handled as two triangles.

This is implementation is certainly not the fastest.
There are certainly ways and strategies to improve it.


I also enabled the code for PolytopeIntersector
in osgkeyboardmouse and added keybindings to
switch the type of intersector ('p') and the picking
coordinate system ('c') on the fly. Since the
PolytopeIntersector does not have a canonical
ordering for its intersections (as opposed to
the LineSegementIntersector) I chaged the
implementation to toggle all hit geometries.


I tested the functionality with osgkeyboardmouse
and several models and it seems to work for
polygonal models. Special nodes such as billboards
do not work.


The next thing on my todo-list is to implement
a an improved Intersection-Structure for the
PolytopeIntersector. We need to know
which primitives where hit (and where).

"
2007-05-23 11:05:59 +00:00
Robert Osfield
c58221ddae Added _firstTimeToInitEyePoint = true to the setAutoRotateMode to force the AutoTransform
to recompute its position on next frame.
2007-05-22 15:17:52 +00:00
Robert Osfield
5056f6fee6 Added osg::Camera::ProjectionResizePolicy enum and associated methods for controlling
how the field of view is adjust on window resizes.
2007-05-22 09:32:38 +00:00
Robert Osfield
ccede7740e Updated version numbers for 1.9.5 release 2007-05-21 09:27:01 +00:00
Robert Osfield
dd796df02a Added support for SG_USE_FLOAT_MATRIX and OSG_USE_FLOAT_PLANE in CMake build and
include/osg/Matrix and include/osg/Plane.
2007-05-20 11:45:09 +00:00
Robert Osfield
e37ec98748 Various additions to better support view dependent overlay node, and updated wrappers 2007-05-19 13:43:38 +00:00
Robert Osfield
c7fc2e018e From Andre Garneau, warnings fixes fo VC++ 2007-05-17 10:59:05 +00:00
Robert Osfield
8c10301d30 From Andre Garneau,"Please find attached changes to have the GraphicsWindowWin32 class
selectively set the pixel format for windows that are inherited, following
some discussions on the mailing list last week.

This is implemented through a new traits flag
(setInheritedWindowPixelFormat) with a default state of false (to avoid
breaking existing applications). When set to true, the pixel format of the
inherited window will be set according to the traits specifications.
"
2007-05-17 10:33:44 +00:00
Robert Osfield
ab4398e440 From Farshid Lashkari, "I made a modification to the setClientActiveTextureUnit and
setActiveTextureUnit methods of osg::State so they return false if the
texture unit is outside the range of allowable units for the driver.
Currently, the functions would return true even if the units are
invalid. This would cause the osg::State to become out of sync with
the actual driver state, which can cause some bugs in certain cases.

The change I made would verify that the unit passed to
setClientActiveTextureUnit is below GL_MAX_TEXTURE_COORDS, and the
unit passed to setActiveTextureUnit is below
max(GL_MAX_TEXTURE_COORDS,GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS). I
modeled this behavior from the OpenGL docs for these commands which
can be found here:

http://www.opengl.org/sdk/docs/man/xhtml/glClientActiveTexture.xml
http://www.opengl.org/sdk/docs/man/xhtml/glActiveTexture.xml
"
2007-05-15 11:25:14 +00:00
Robert Osfield
51a4de5ec7 Fixed parameter name 2007-05-14 16:16:22 +00:00
Robert Osfield
74e968df76 Clean up comments and rebuilt wrappers.
Added extra event handlers to osgsimulator example
2007-05-14 16:14:40 +00:00
Robert Osfield
9e60a5d222 Updated wrappers and version numbers for 1.9.4 dev release 2007-05-14 09:33:32 +00:00
Robert Osfield
c1332f6893 Removed rendundent const 2007-05-10 18:07:15 +00:00
Robert Osfield
d8ee198735 From John Kelso,
"Attached are updates of src/osg/Sequence.spp and include/osg/Sequence.

I've taken _sbegin/_send/_ubegin/_uend and _step our of the include file
and made them local variables in whatever method might need them.

I got rid of the _recalculate method as it was only getting used in
one place.

I also found a cut/paste bug in setMode's START case."

Note from Robert Osfield, Also includes some guards against crashes that was occuring in this new
code when handling empty Sequences.
2007-05-09 11:11:19 +00:00
Robert Osfield
6c74589014 Added signOrZero template method, and to Matrix_implementation.cpp usage of this
method in the get(Quat&) code.
2007-05-09 09:26:33 +00:00
Robert Osfield
5b9883516a Added CullSettings inheritance mask for LIGHTING_MODE and LIGHT 2007-05-08 10:02:07 +00:00
Robert Osfield
963cd837e3 Added s/getLightingMode and s/getLight to osg::View to allow control of the viewers
global light source.
2007-05-07 22:07:23 +00:00
Robert Osfield
0612fabc47 Updated version numbers for 1.9.3 release, combined INSTALL.txt and README.txt 2007-05-07 07:51:02 +00:00
Robert Osfield
859bcf3c4b Further perfomrmance optimizations and clean up on new VBO/EBO/PBO API. 2007-05-01 18:03:32 +00:00
Robert Osfield
40db1a8934 Moved VBO switching code into inline methods into osg::State to speed performance 2007-05-01 06:28:20 +00:00
Robert Osfield
d625a5e114 Implementated new dirty buffer mechansim for BufferObjects to make it more efficient 2007-04-30 12:18:27 +00:00
Robert Osfield
22ad53d7d9 Updated version number for 1.9.2 dev release 2007-04-30 08:31:25 +00:00
Robert Osfield
921eb0fdd0 Further work on new VertexBufferObject/ElementsBufferObject support 2007-04-29 08:12:29 +00:00
Robert Osfield
4968eb7136 Further work on the new VBO support 2007-04-27 14:52:30 +00:00
Robert Osfield
a3e6d8283d Further work VertexBufferObject and ElementsBufferObject classes 2007-04-26 16:50:06 +00:00
Robert Osfield
a1639c3d2d From Brad Colbert, "Added a new method to ImageStream called getLength that is used to
return the length of the stream.

Implemented the virtual methods in QuicktimeImageStream, (getLength,
getReferenceTime, setTimeMultiplier), to return valid value for each.
"
2007-04-26 08:11:09 +00:00
Robert Osfield
4b71e3948b Added VertexBufferObject and ElementBufferObject class interfaces, and wired
up osg::Array and osg::DrawElements* to these respectively.

Updated wrappers
2007-04-25 18:50:11 +00:00
Robert Osfield
0e6bcc61f0 Updated version to 1.9.1 2007-04-23 20:21:06 +00:00
Robert Osfield
f242570269 Unified the setup of version numbers so that they all are based on the version
number setup in the include/osg/Version header file.
2007-04-22 20:19:43 +00:00
Robert Osfield
9db23e0b22 Fixed bug associated with complex RenderBin setup. 2007-04-16 12:18:56 +00:00
Robert Osfield
8a5b8d9656 Set default ShadeModel back to SMOOTH 2007-04-05 20:27:02 +00:00
Robert Osfield
6c12c71337 Added constructor argument to ShadeModel 2007-04-05 16:12:10 +00:00
Robert Osfield
538a83dad4 Added support for flushing buffer objects 2007-04-04 09:07:46 +00:00
Robert Osfield
307a9a9a78 From Andy Skinner, warning fix for Windows 64-bit build 2007-04-03 19:42:43 +00:00
Robert Osfield
31d9f40a2f Preliminary work on TransferFunction support 2007-04-03 15:39:05 +00:00
Robert Osfield
43c24da12d Added setValue method and osg::Image setup to osg::TransferFunction1D, and setup
of TransferFunction1D into osgterrain example.
2007-04-02 13:06:59 +00:00
Robert Osfield
a2ecb93c2b Converted osg::HeightField across to using a osg::FloatArray internally to enable
it to be assigned as a vertex attribute array to an osg::Geometry.

Removed the osgTerrain::ArrayLayer as its no longer required thanks to the above change
which makes the osgTerrain::HeightFieldLayer more flexible.  

Updated wrappers
2007-03-29 19:42:07 +00:00
Robert Osfield
0f507e317d Removed the using to avoid VS 7.1 build problem 2007-03-29 15:41:59 +00:00
Robert Osfield
b7967b7007 From Mike Wittman, "Here is a change to the .cpp file to fix it by disambiguating the cull invocation." 2007-03-28 15:05:49 +00:00
Robert Osfield
7fc714ada1 Removed deprecated drawImplementation(State&) method from Drawable and Drawable::DrawCallback 2007-03-28 11:30:38 +00:00
Robert Osfield
7013c12a0d From Mike Wittman, "This is another weirdo change to support code generation. It brings all the Drawable::supports and Drawable::accepts overloads into the ShapeDrawable scope to avoid errors invoking the ones that are not defined in ShapeDrawable. Currently you'll get compilation errors if you pass a Drawable::AttributeFunctor or PrimitiveIndexFunctor to the "accept" function invoked on a ShapeDrawable pointer or reference, since those overloads are only defined in the base class. You'll also get the same error passing a PrimitiveIndexFunctor to the "supports" function. These errors occur because C++ function overload resolution does not cross inheritance boundaries." 2007-03-26 13:00:29 +00:00
Robert Osfield
37f4740c45 From Mike Wittman, remove redundent const from in front of unsigned int.
From Robert Osfield, updated wrappers
2007-03-23 17:27:53 +00:00
Robert Osfield
541c3f13e9 Added GeometryTechinque to osgTerrain. Added usage of GeometryTechnique into osgterrain example
Added --width and --height command line options to osgdistortion to allow users
to control the window size.
2007-03-21 16:34:04 +00:00
Robert Osfield
aa28f60357 Added WindowData structures to GraphicsWindowX11,Win32 and Carbon to help support
GraphicsWindow inheriting their window handles from an external toolkit
2007-03-16 13:22:05 +00:00
Robert Osfield
083618cc65 Added inheritedWindowData member variable to Traits. 2007-03-11 11:48:03 +00:00