Additions since the CVS back up was made.

This commit is contained in:
Robert Osfield
2003-06-24 21:57:13 +00:00
parent 15f88f35b2
commit d70ab592ed
53 changed files with 2630 additions and 124 deletions

View File

@@ -394,6 +394,11 @@ class SG_EXPORT Geometry : public Drawable
mutable bool _fastPath;
};
/** Convenience function to be used for creating quad geometry with texture coords.
* Tex coords go from bottom left (0,0) to top right (1,1).*/
extern SG_EXPORT Geometry* createTexturedQuadGeometry(const Vec3& corner,const Vec3& widthVec,const Vec3& heightVec);
}

View File

@@ -29,6 +29,7 @@ class TessellationHints : public Object
TessellationHints():
_TessellationMode(USE_SHAPE_DEFAULTS),
_detailRatio(1.0f),
_targetNumFaces(100),
_createFrontFace(true),
_createBackFace(false),
@@ -42,6 +43,7 @@ class TessellationHints : public Object
TessellationHints(const TessellationHints& tess, const CopyOp& copyop=CopyOp::SHALLOW_COPY):
Object(tess,copyop),
_TessellationMode(tess._TessellationMode),
_detailRatio(tess._detailRatio),
_targetNumFaces(tess._targetNumFaces),
_createFrontFace(tess._createFrontFace),
_createBackFace(tess._createBackFace),
@@ -63,6 +65,9 @@ class TessellationHints : public Object
inline void setTessellationMode(TessellationMode mode) { _TessellationMode=mode; }
inline TessellationMode getTessellationMode() const { return _TessellationMode; }
inline void setDetailRatio(float ratio) { _detailRatio = ratio; }
inline float getDetailRatio() const { return _detailRatio; }
inline void setTargetNumFaces(unsigned int target) { _targetNumFaces=target; }
inline unsigned int getTargetNumFaces() const { return _targetNumFaces; }
@@ -93,6 +98,8 @@ class TessellationHints : public Object
TessellationMode _TessellationMode;
float _detailRatio;
unsigned int _targetNumFaces;
bool _createFrontFace;
@@ -112,7 +119,7 @@ class SG_EXPORT ShapeDrawable : public Drawable
ShapeDrawable();
ShapeDrawable(Shape* shape);
ShapeDrawable(Shape* shape,TessellationHints* hints=0);
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
ShapeDrawable(const ShapeDrawable& pg,const CopyOp& copyop=CopyOp::SHALLOW_COPY);

View File

@@ -26,6 +26,8 @@ class SG_EXPORT Texture2D : public Texture
Texture2D();
Texture2D(osg::Image* image);
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
Texture2D(const Texture2D& text,const CopyOp& copyop=CopyOp::SHALLOW_COPY);

View File

@@ -0,0 +1,45 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2003 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#ifndef OSGUTIL_TRANSFORMATTRIBUTEFUNCTOR
#define OSGUTIL_TRANSFORMATTRIBUTEFUNCTOR 1
#include <osg/Drawable>
#include <osg/Notify>
#include <osgUtil/Export>
namespace osgUtil {
/** Functor for transforming a drawable's vertex and normal attributes by specified matrix.
* typically used for flattening transform down onto drawable leaves. */
class OSGUTIL_EXPORT TransformAttributeFunctor : public osg::Drawable::AttributeFunctor
{
public:
/** construct a functor to transform a drawable's vertex and normal attributes by specified matrix.*/
TransformAttributeFunctor(const osg::Matrix& m);
virtual ~TransformAttributeFunctor();
/** do the work of transforming vertex and normal attributes. */
virtual void apply(osg::Drawable::AttributeType type,unsigned int count,osg::Vec3* begin);
osg::Matrix _m;
osg::Matrix _im;
};
}
#endif