Property API clean to smooth the task of generating wrappers.
This commit is contained in:
parent
4383655fcd
commit
a0ba625cb0
@ -243,7 +243,7 @@ osg::Node* createMirroredScene(osg::Node* model)
|
||||
// poke through the mirror. However, this clip plane should really
|
||||
// flip sides once the eye point goes to the back of the mirror...
|
||||
osg::ClipPlane* clipplane = new osg::ClipPlane;
|
||||
clipplane->setClipPlane(osg::Vec4(0.0f,0.0f,-1.0f,z));
|
||||
clipplane->setClipPlane(0.0,0.0,-1.0,z);
|
||||
clipplane->setClipPlaneNum(0);
|
||||
|
||||
osg::ClipNode* clipNode = new osg::ClipNode;
|
||||
|
@ -43,8 +43,9 @@ class SG_EXPORT AnimationPath : public virtual osg::Object
|
||||
|
||||
META_Object(osg,AnimationPath);
|
||||
|
||||
struct ControlPoint
|
||||
class ControlPoint
|
||||
{
|
||||
public:
|
||||
ControlPoint():
|
||||
_scale(1.0,1.0,1.0) {}
|
||||
|
||||
@ -63,10 +64,14 @@ class SG_EXPORT AnimationPath : public virtual osg::Object
|
||||
_rotation(rotation),
|
||||
_scale(scale) {}
|
||||
|
||||
osg::Vec3d _position;
|
||||
osg::Quat _rotation;
|
||||
osg::Vec3d _scale;
|
||||
void setPosition(const osg::Vec3d& position) { _position = position; }
|
||||
const osg::Vec3d& getPosition() const { return _position; }
|
||||
|
||||
void setRotation(const osg::Quat& rotation) { _rotation = rotation; }
|
||||
const osg::Quat& getRotation() const { return _rotation; }
|
||||
|
||||
void setScale(const osg::Vec3d& scale) { _scale = scale; }
|
||||
const osg::Vec3d& getScale() const { return _scale; }
|
||||
|
||||
inline void interpolate(float ratio,const ControlPoint& first, const ControlPoint& second)
|
||||
{
|
||||
@ -103,6 +108,14 @@ class SG_EXPORT AnimationPath : public virtual osg::Object
|
||||
matrix.preMult(osg::Matrixd::rotate(_rotation.inverse()));
|
||||
matrix.preMult(osg::Matrixd::translate(-_position));
|
||||
}
|
||||
|
||||
#ifdef USE_DEPRECATED_API
|
||||
protected:
|
||||
#endif
|
||||
osg::Vec3d _position;
|
||||
osg::Quat _rotation;
|
||||
osg::Vec3d _scale;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@ -60,6 +60,9 @@ class SG_EXPORT ClipNode : public Group
|
||||
/** Get const ClipPlane at the given index position. */
|
||||
inline const ClipPlane* getClipPlane(unsigned int pos) const { return _planes[pos].get(); }
|
||||
|
||||
/** Set the ClipPlaneList. */
|
||||
inline void getClipPlaneList(const ClipPlaneList& cpl) { _planes=cpl; }
|
||||
|
||||
/** Get the ClipPlaneList. */
|
||||
inline ClipPlaneList& getClipPlaneList() { return _planes; }
|
||||
|
||||
|
@ -14,6 +14,7 @@
|
||||
#ifndef OSG_CLIPPLANE
|
||||
#define OSG_CLIPPLANE 1
|
||||
|
||||
#include <osg/Vec4d>
|
||||
#include <osg/Plane>
|
||||
#include <osg/StateAttribute>
|
||||
|
||||
@ -26,7 +27,7 @@ class SG_EXPORT ClipPlane : public StateAttribute
|
||||
public :
|
||||
|
||||
ClipPlane();
|
||||
inline ClipPlane(unsigned int no,const Vec4& plane) { setClipPlaneNum(no); setClipPlane(plane); }
|
||||
inline ClipPlane(unsigned int no,const Vec4d& plane) { setClipPlaneNum(no); setClipPlane(plane); }
|
||||
inline ClipPlane(unsigned int no,const Plane& plane) { setClipPlaneNum(no); setClipPlane(plane); }
|
||||
inline ClipPlane(unsigned int no,double a,double b,double c,double d) { setClipPlaneNum(no); setClipPlane(a,b,c,d); }
|
||||
|
||||
@ -69,29 +70,24 @@ class SG_EXPORT ClipPlane : public StateAttribute
|
||||
}
|
||||
|
||||
|
||||
/** Defines the clip plane with the given Vec4. */
|
||||
void setClipPlane(const Vec4& plane);
|
||||
|
||||
/** Defines this plane with the given Plane. */
|
||||
void setClipPlane(const Plane& plane);
|
||||
|
||||
/** Defines the clip plane with the given double[4]. */
|
||||
void setClipPlane(const double* plane);
|
||||
/** Set the clip plane with the given Plane. */
|
||||
void setClipPlane(const Plane& plane)
|
||||
{
|
||||
_clipPlane.set(plane[0],plane[1],plane[2],plane[3]);
|
||||
}
|
||||
|
||||
/** Defines the plane as [ a b c d ]. */
|
||||
void setClipPlane(double a,double b,double c,double d)
|
||||
{
|
||||
_clipPlane[0]=a;_clipPlane[1]=b;_clipPlane[2]=c;_clipPlane[3]=d;
|
||||
_clipPlane.set(a,b,c,d);
|
||||
}
|
||||
|
||||
/** Gets the clip plane as a Vec4. */
|
||||
void getClipPlane(Vec4& plane) const;
|
||||
/** Set the clip plane with the given Vec4. */
|
||||
inline void setClipPlane(const Vec4d& plane) { _clipPlane = plane; }
|
||||
|
||||
/** Gets the clip plane as a Plane. */
|
||||
void getClipPlane(Plane& plane) const;
|
||||
/** Gets the clip plane as a Vec4d. */
|
||||
const Vec4d& getClipPlane() const { return _clipPlane; }
|
||||
|
||||
/** Gets the clip plane as an array of doubles. */
|
||||
void getClipPlane(double* plane) const;
|
||||
|
||||
/** Sets the clip plane number. */
|
||||
void setClipPlaneNum(unsigned int num);
|
||||
@ -106,7 +102,7 @@ class SG_EXPORT ClipPlane : public StateAttribute
|
||||
|
||||
virtual ~ClipPlane();
|
||||
|
||||
double _clipPlane[4];
|
||||
Vec4d _clipPlane;
|
||||
unsigned int _clipPlaneNum;
|
||||
|
||||
};
|
||||
|
@ -70,12 +70,16 @@ class SG_EXPORT ColorMask : public StateAttribute
|
||||
|
||||
}
|
||||
|
||||
inline void getRedMask(bool mask) { _red=mask; }
|
||||
inline bool getRedMask() const { return _red; }
|
||||
|
||||
inline void setGreenMask(bool mask) { _green=mask; }
|
||||
inline bool getGreenMask() const { return _green; }
|
||||
|
||||
inline void setBlueMask(bool mask) { _blue=mask; }
|
||||
inline bool getBlueMask() const { return _blue; }
|
||||
|
||||
inline void setAlphaMask(bool mask) { _alpha=mask; }
|
||||
inline bool getAlphaMask() const { return _alpha; }
|
||||
|
||||
virtual void apply(State& state) const;
|
||||
|
@ -48,6 +48,8 @@ class SG_EXPORT ConvexPlanarOccluder : public Object
|
||||
|
||||
void addHole(const ConvexPlanarPolygon& cpp) { _holeList.push_back(cpp); }
|
||||
|
||||
void setHoleList(const HoleList& holeList) { _holeList=holeList; }
|
||||
|
||||
HoleList& getHoleList() { return _holeList; }
|
||||
|
||||
const HoleList& getHoleList() const { return _holeList; }
|
||||
|
@ -36,6 +36,8 @@ class SG_EXPORT ConvexPlanarPolygon
|
||||
|
||||
void add(const Vec3& v) { _vertexList.push_back(v); }
|
||||
|
||||
void setVertexList(const VertexList& vertexList) { _vertexList=vertexList; }
|
||||
|
||||
VertexList& getVertexList() { return _vertexList; }
|
||||
|
||||
const VertexList& getVertexList() const { return _vertexList; }
|
||||
|
@ -123,6 +123,7 @@ class SG_EXPORT CullingSet : public Referenced
|
||||
};
|
||||
|
||||
void setCullingMask(Mask mask) { _mask = mask; }
|
||||
Mask getCullingMask() const { return _mask; }
|
||||
|
||||
void setFrustum(Polytope& cv) { _frustum = cv; }
|
||||
|
||||
|
@ -74,7 +74,6 @@ class SG_EXPORT Depth : public StateAttribute
|
||||
}
|
||||
|
||||
inline void setFunction(Function func) { _func = func; }
|
||||
|
||||
inline Function getFunction() const { return _func; }
|
||||
|
||||
|
||||
@ -84,11 +83,13 @@ class SG_EXPORT Depth : public StateAttribute
|
||||
_zFar = zFar;
|
||||
}
|
||||
|
||||
inline void setZNear(double zNear) { _zNear=zNear; }
|
||||
inline double getZNear() const { return _zNear; }
|
||||
|
||||
inline void setZFar(double zFar) { _zFar=zFar; }
|
||||
inline double getZFar() const { return _zFar; }
|
||||
|
||||
inline void setWriteMask(bool mask) { _depthWriteMask = mask; }
|
||||
|
||||
inline bool getWriteMask() const { return _depthWriteMask; }
|
||||
|
||||
|
||||
|
@ -51,14 +51,11 @@ class SG_EXPORT DrawPixels : public Drawable
|
||||
osg::Image* getImage() { return _image.get(); }
|
||||
const osg::Image* getImage() const { return _image.get(); }
|
||||
|
||||
void setUseCompleteImage() { _useSubImage = false; }
|
||||
|
||||
void setSubImageDimensions(unsigned int offsetX,unsigned int offsetY,unsigned int width,unsigned int height);
|
||||
|
||||
void getSubImageDimensions(unsigned int& offsetX,unsigned int& offsetY,unsigned int& width,unsigned int& height) const;
|
||||
|
||||
void setUseSubImage(bool useSubImage) { _useSubImage=useSubImage; }
|
||||
bool getUseSubImage() const { return _useSubImage; }
|
||||
|
||||
void setSubImageDimensions(unsigned int offsetX,unsigned int offsetY,unsigned int width,unsigned int height);
|
||||
void getSubImageDimensions(unsigned int& offsetX,unsigned int& offsetY,unsigned int& width,unsigned int& height) const;
|
||||
|
||||
virtual void drawImplementation(State& state) const;
|
||||
|
||||
|
@ -177,7 +177,7 @@ class SG_EXPORT FragmentProgram : public StateAttribute
|
||||
typedef std::map<GLuint,Vec4> LocalParamList;
|
||||
|
||||
/** Set list of Program Parameters */
|
||||
inline void setLocalParameters(LocalParamList& lpl) { _programLocalParameters = lpl; }
|
||||
inline void setLocalParameters(const LocalParamList& lpl) { _programLocalParameters = lpl; }
|
||||
|
||||
/** Get list of Program Parameters */
|
||||
inline LocalParamList& getLocalParameters() { return _programLocalParameters; }
|
||||
@ -194,7 +194,7 @@ class SG_EXPORT FragmentProgram : public StateAttribute
|
||||
typedef std::map<GLenum,Matrix> MatrixList;
|
||||
|
||||
/** Set list of Matrices */
|
||||
inline void setMatrices(MatrixList& matrices) { _matrixList = matrices; }
|
||||
inline void setMatrices(const MatrixList& matrices) { _matrixList = matrices; }
|
||||
|
||||
/** Get list of Matrices */
|
||||
inline MatrixList& getMatrices() { return _matrixList; }
|
||||
|
@ -53,7 +53,7 @@ class SG_EXPORT FrontFace : public StateAttribute
|
||||
};
|
||||
|
||||
inline void setMode(Mode mode) { _mode = mode; }
|
||||
inline const Mode getMode() const { return _mode; }
|
||||
inline Mode getMode() const { return _mode; }
|
||||
|
||||
virtual void apply(State& state) const;
|
||||
|
||||
|
@ -224,20 +224,28 @@ class SG_EXPORT Image : public Object
|
||||
};
|
||||
|
||||
/** Send offsets into data. It is assumed that first mipmap offset (index 0) is 0.*/
|
||||
inline void setMipmapData(const MipmapDataType& mipmapDataVector)
|
||||
inline void setMipmapLevels(const MipmapDataType& mipmapDataVector) { _mipmapData = mipmapDataVector; }
|
||||
|
||||
inline const MipmapDataType& getMipmapLevels() const { return _mipmapData; }
|
||||
|
||||
inline unsigned int getMipmapOffset(unsigned int mipmapLevel) const
|
||||
{
|
||||
_mipmapData = mipmapDataVector;
|
||||
if(mipmapLevel == 0)
|
||||
return 0;
|
||||
else if (mipmapLevel < getNumMipmapLevels())
|
||||
return _mipmapData[mipmapLevel-1];
|
||||
return 0;
|
||||
};
|
||||
|
||||
inline unsigned char* getMipmapData(unsigned int mipmapNumber) const
|
||||
inline unsigned char* getMipmapData(unsigned int mipmapLevel)
|
||||
{
|
||||
if(mipmapNumber == 0)
|
||||
return _data;
|
||||
else if(mipmapNumber < getNumMipmapLevels())
|
||||
return _data + _mipmapData[mipmapNumber-1];
|
||||
return 0L;
|
||||
};
|
||||
return _data+getMipmapOffset(mipmapLevel);
|
||||
}
|
||||
|
||||
inline const unsigned char* getMipmapData(unsigned int mipmapLevel) const
|
||||
{
|
||||
return _data+getMipmapOffset(mipmapLevel);
|
||||
}
|
||||
|
||||
/** Return true if this image is translucent - i.e. it has alpha values that are less 1.0 (when normalized). */
|
||||
bool isImageTranslucent() const;
|
||||
|
@ -77,17 +77,14 @@ class SG_EXPORT Impostor : public LOD
|
||||
*/
|
||||
inline void setImpostorThreshold(float distance) { _impostorThreshold = distance; }
|
||||
|
||||
/* Get the Impostor threshold distance. */
|
||||
inline float getImpostorThreshold() const { return _impostorThreshold; }
|
||||
|
||||
/** Set the Impostor threshold distance relative to the node's bounding
|
||||
* sphere's radius.
|
||||
*/
|
||||
inline void setImpostorThresholdToBound(float ratio=1.0f) { _impostorThreshold = getBound().radius()*ratio; }
|
||||
|
||||
/* Get the Impostor threshold distance. */
|
||||
inline float getImpostorThreshold() const { return _impostorThreshold; }
|
||||
|
||||
/* Get the Impostor threshold distance squared. */
|
||||
inline float getImpostorThreshold2() const { return _impostorThreshold*_impostorThreshold; }
|
||||
|
||||
/** Find the ImposterSprite which fits the current eye point best. */
|
||||
ImpostorSprite* findBestImpostorSprite(unsigned int contextID, const osg::Vec3& currLocalEyePoint) const;
|
||||
|
||||
|
@ -117,9 +117,9 @@ class SG_EXPORT ImpostorSprite : public Drawable
|
||||
float calcPixelError(const Matrix& MVPW) const;
|
||||
|
||||
void setTexture(Texture2D* tex,int s,int t);
|
||||
|
||||
Texture2D* getTexture() { return _texture; }
|
||||
const Texture2D* getTexture() const { return _texture; }
|
||||
|
||||
int s() const { return _s; }
|
||||
int t() const { return _t; }
|
||||
|
||||
|
@ -113,6 +113,9 @@ class SG_EXPORT LOD : public Group
|
||||
* An LOD which has been fully set up will have getNumChildren()==getNumRanges(). */
|
||||
inline unsigned int getNumRanges() const { return _rangeList.size(); }
|
||||
|
||||
/** set the list of MinMax ranges for each child.*/
|
||||
inline void setRangeList(const RangeList& rangeList) { _rangeList=rangeList; }
|
||||
|
||||
/** return the list of MinMax ranges for each child.*/
|
||||
inline const RangeList& getRangeList() const { return _rangeList; }
|
||||
|
||||
|
@ -81,10 +81,14 @@ class SG_EXPORT Multisample : public StateAttribute
|
||||
_coverage = coverage;
|
||||
_invert = invert;
|
||||
}
|
||||
inline void setCoverage(float coverage) { _coverage=coverage; }
|
||||
inline float getCoverage() const { return _coverage; }
|
||||
|
||||
inline void setInvert(bool invert) { _invert=invert; }
|
||||
inline bool getInvert() const { return _invert; }
|
||||
|
||||
inline void setHint(Mode mode) { _mode = mode; }
|
||||
inline Mode getHint() const { return _mode; }
|
||||
|
||||
virtual void apply(State& state) const;
|
||||
|
||||
|
@ -198,10 +198,13 @@ class SG_EXPORT Node : public Object
|
||||
/** A vector of std::string's which are used to describe the object.*/
|
||||
typedef std::vector<std::string> DescriptionList;
|
||||
|
||||
/** Set the description list of the const node.*/
|
||||
inline void setDescriptions(const DescriptionList& descriptions) { _descriptions=descriptions; }
|
||||
/** Get the description list of the const node.*/
|
||||
inline const DescriptionList& getDescriptions() const { return _descriptions; }
|
||||
/** Get the description list of the const node.*/
|
||||
inline DescriptionList& getDescriptions() { return _descriptions; }
|
||||
|
||||
/** Get a single const description of the const node.*/
|
||||
inline const std::string& getDescription(unsigned int i) const { return _descriptions[i]; }
|
||||
/** Get a single description of the node.*/
|
||||
|
@ -50,6 +50,7 @@ class SG_EXPORT NodeCallback : public virtual Object {
|
||||
|
||||
void setNestedCallback(NodeCallback* nc) { _nestedCallback = nc; }
|
||||
NodeCallback* getNestedCallback() { return _nestedCallback.get(); }
|
||||
const NodeCallback* getNestedCallback() const { return _nestedCallback.get(); }
|
||||
|
||||
inline void addNestedCallback(NodeCallback* nc)
|
||||
{
|
||||
|
@ -30,7 +30,6 @@ class SG_EXPORT PolygonMode : public StateAttribute
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
PolygonMode(const PolygonMode& pm,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
StateAttribute(pm,copyop),
|
||||
_frontAndBack(pm._frontAndBack),
|
||||
_modeFront(pm._modeFront),
|
||||
_modeBack(pm._modeBack) {}
|
||||
|
||||
@ -44,30 +43,36 @@ class SG_EXPORT PolygonMode : public StateAttribute
|
||||
COMPARE_StateAttribute_Types(PolygonMode,sa)
|
||||
|
||||
// compare each paramter in turn against the rhs.
|
||||
COMPARE_StateAttribute_Parameter(_frontAndBack)
|
||||
COMPARE_StateAttribute_Parameter(_modeFront)
|
||||
COMPARE_StateAttribute_Parameter(_modeBack)
|
||||
|
||||
return 0; // passed all the above comparison macros, must be equal.
|
||||
}
|
||||
|
||||
enum Face {
|
||||
FRONT,
|
||||
BACK,
|
||||
FRONT_AND_BACK
|
||||
};
|
||||
|
||||
enum Mode {
|
||||
POINT = GL_POINT,
|
||||
LINE = GL_LINE,
|
||||
FILL = GL_FILL
|
||||
};
|
||||
/*
|
||||
void setFrontAndBackFaceMode(Mode mode) { _modeFront = _modeBack = mode; }
|
||||
|
||||
void setFrontFaceMode(Mode mode) { _modeFront = mode; }
|
||||
Mode getFrontFaceMode() const { return _modeFront; }
|
||||
|
||||
void setBackFaceMode(Mode mode) { _modeFront = mode; }
|
||||
Mode getBackFaceMode() const { return _modeBack; }
|
||||
*/
|
||||
enum Face {
|
||||
FRONT_AND_BACK,
|
||||
FRONT,
|
||||
BACK,
|
||||
};
|
||||
|
||||
void setMode(Face face,Mode mode);
|
||||
|
||||
Mode getMode(Face face) const;
|
||||
|
||||
inline bool getFrontAndBack() const { return _frontAndBack; }
|
||||
inline bool getFrontAndBack() const { return _modeFront==_modeBack; }
|
||||
|
||||
virtual void apply(State& state) const;
|
||||
|
||||
@ -75,7 +80,6 @@ class SG_EXPORT PolygonMode : public StateAttribute
|
||||
|
||||
virtual ~PolygonMode();
|
||||
|
||||
bool _frontAndBack;
|
||||
Mode _modeFront;
|
||||
Mode _modeBack;
|
||||
|
||||
|
@ -221,7 +221,7 @@ class Box : public Shape
|
||||
|
||||
inline void setRotation(const Quat& quat) { _rotation = quat; }
|
||||
inline const Quat& getRotation() const { return _rotation; }
|
||||
inline Matrix getRotationMatrix() const { return Matrix(_rotation); }
|
||||
inline Matrix computeRotationMatrix() const { return Matrix(_rotation); }
|
||||
inline bool zeroRotation() const { return _rotation.zeroRotation(); }
|
||||
|
||||
protected:
|
||||
@ -279,7 +279,7 @@ class Cone : public Shape
|
||||
|
||||
inline void setRotation(const Quat& quat) { _rotation = quat; }
|
||||
inline const Quat& getRotation() const { return _rotation; }
|
||||
inline Matrix getRotationMatrix() const { return Matrix(_rotation); }
|
||||
inline Matrix computeRotationMatrix() const { return Matrix(_rotation); }
|
||||
inline bool zeroRotation() const { return _rotation.zeroRotation(); }
|
||||
|
||||
inline float getBaseOffsetFactor() const { return 0.25f; }
|
||||
@ -339,7 +339,7 @@ class Cylinder : public Shape
|
||||
|
||||
inline void setRotation(const Quat& quat) { _rotation = quat; }
|
||||
inline const Quat& getRotation() const { return _rotation; }
|
||||
inline Matrix getRotationMatrix() const { return Matrix(_rotation); }
|
||||
inline Matrix computeRotationMatrix() const { return Matrix(_rotation); }
|
||||
bool zeroRotation() const { return _rotation.zeroRotation(); }
|
||||
|
||||
protected:
|
||||
@ -396,7 +396,7 @@ class Capsule : public Shape
|
||||
|
||||
inline void setRotation(const Quat& quat) { _rotation = quat; }
|
||||
inline const Quat& getRotation() const { return _rotation; }
|
||||
inline Matrix getRotationMatrix() const { return Matrix(_rotation); }
|
||||
inline Matrix computeRotationMatrix() const { return Matrix(_rotation); }
|
||||
bool zeroRotation() const { return _rotation.zeroRotation(); }
|
||||
|
||||
protected:
|
||||
@ -538,7 +538,7 @@ class SG_EXPORT HeightField : public Shape
|
||||
|
||||
inline void setRotation(const Quat& quat) { _rotation = quat; }
|
||||
inline const Quat& getRotation() const { return _rotation; }
|
||||
inline Matrix getRotationMatrix() const { return Matrix(_rotation); }
|
||||
inline Matrix computeRotationMatrix() const { return Matrix(_rotation); }
|
||||
inline bool zeroRotation() const { return _rotation.zeroRotation(); }
|
||||
|
||||
/* set a single height point in the height field */
|
||||
|
@ -92,6 +92,9 @@ class SG_EXPORT StateSet : public Object
|
||||
* returns INHERIT if no GLModeValue is contained within StateSet.*/
|
||||
StateAttribute::GLModeValue getMode(StateAttribute::GLMode mode) const;
|
||||
|
||||
/** set the list of all GLModes contained in this StateSet.*/
|
||||
inline void setModeList(ModeList& ml) { _modeList=ml; }
|
||||
|
||||
/** return the list of all GLModes contained in this StateSet.*/
|
||||
inline ModeList& getModeList() { return _modeList; }
|
||||
|
||||
@ -135,6 +138,9 @@ class SG_EXPORT StateSet : public Object
|
||||
* Returns NULL if no type is contained within StateSet.*/
|
||||
const RefAttributePair* getAttributePair(StateAttribute::Type type, unsigned int member = 0) const;
|
||||
|
||||
/** set the list of all StateAttributes contained in this StateSet.*/
|
||||
inline void setAttributeList(AttributeList& al) { _attributeList=al; }
|
||||
|
||||
/** return the list of all StateAttributes contained in this StateSet.*/
|
||||
inline AttributeList& getAttributeList() { return _attributeList; }
|
||||
|
||||
@ -160,6 +166,9 @@ class SG_EXPORT StateSet : public Object
|
||||
* returns INHERIT if no GLModeValue is contained within StateSet.*/
|
||||
StateAttribute::GLModeValue getTextureMode(unsigned int unit,StateAttribute::GLMode mode) const;
|
||||
|
||||
/** set the list of all Texture related GLModes contained in this StateSet.*/
|
||||
inline void setTextureModeList(TextureModeList& tml) { _textureModeList=tml; }
|
||||
|
||||
/** return the list of all Texture related GLModes contained in this StateSet.*/
|
||||
inline TextureModeList& getTextureModeList() { return _textureModeList; }
|
||||
|
||||
@ -198,6 +207,9 @@ class SG_EXPORT StateSet : public Object
|
||||
* Returns NULL if no type is contained within StateSet.*/
|
||||
const RefAttributePair* getTextureAttributePair(unsigned int unit,StateAttribute::Type type) const;
|
||||
|
||||
/** Set the list of all Texture related StateAttributes contained in this StateSet.*/
|
||||
inline void setTextureAttributeList(TextureAttributeList& tal) { _textureAttributeList=tal; }
|
||||
|
||||
/** Return the list of all Texture related StateAttributes contained in this StateSet.*/
|
||||
inline TextureAttributeList& getTextureAttributeList() { return _textureAttributeList; }
|
||||
|
||||
@ -240,15 +252,24 @@ class SG_EXPORT StateSet : public Object
|
||||
/** Set the render bin details to inherit.*/
|
||||
void setRenderBinToInherit();
|
||||
|
||||
/** Get the render bin mode.*/
|
||||
inline RenderBinMode getRenderBinMode() const { return _binMode; }
|
||||
|
||||
/** Get whether the render bin details are set and should be used.*/
|
||||
inline bool useRenderBinDetails() const { return _binMode!=INHERIT_RENDERBIN_DETAILS; }
|
||||
|
||||
/** Set the render bin mode.*/
|
||||
inline void setRenderBinMode(RenderBinMode mode) { _binMode=mode; }
|
||||
|
||||
/** Get the render bin mode.*/
|
||||
inline RenderBinMode getRenderBinMode() const { return _binMode; }
|
||||
|
||||
/** Set the render bin number.*/
|
||||
inline void setBinNumber(int num) { _binNum=num; }
|
||||
|
||||
/** Get the render bin number.*/
|
||||
inline int getBinNumber() const { return _binNum; }
|
||||
|
||||
/** Set the render bin name.*/
|
||||
inline void setBinName(const std::string& name) { _binName=name; }
|
||||
|
||||
/** Get the render bin name.*/
|
||||
inline const std::string& getBinName() const { return _binName; }
|
||||
|
||||
|
@ -70,28 +70,11 @@ class SG_EXPORT Switch : public Group
|
||||
/** Set a single child on, switch off all other children. */
|
||||
bool setSingleChildOn(unsigned int pos);
|
||||
|
||||
#ifdef USE_DEPRECATED_API
|
||||
/** Special values for the Switch. Use these if you want to
|
||||
* turn on/off all child nodes. */
|
||||
enum Values {
|
||||
/** All children turned on. */
|
||||
ALL_CHILDREN_ON=-1,
|
||||
/** All children off. */
|
||||
ALL_CHILDREN_OFF=-2,
|
||||
/** Multiple children turned on.*/
|
||||
MULTIPLE_CHILDREN_ON=-3
|
||||
};
|
||||
|
||||
/** Selects the active child Node or enables a special SwitchType mode.
|
||||
* @param value the number of the active child (first child == number
|
||||
* 0) or SwitchType. Invalid values will be ignored. */
|
||||
void setValue(int value);
|
||||
|
||||
int getValue() const;
|
||||
#endif
|
||||
|
||||
typedef std::vector<bool> ValueList;
|
||||
|
||||
void setValueList(const ValueList& values) { _values=values; }
|
||||
|
||||
const ValueList& getValueList() const { return _values; }
|
||||
|
||||
protected :
|
||||
|
@ -177,7 +177,7 @@ class SG_EXPORT VertexProgram : public StateAttribute
|
||||
typedef std::map<GLuint,Vec4> LocalParamList;
|
||||
|
||||
/** Set list of Program Parameters */
|
||||
inline void setLocalParameters(LocalParamList& lpl) { _programLocalParameters = lpl; }
|
||||
inline void setLocalParameters(const LocalParamList& lpl) { _programLocalParameters = lpl; }
|
||||
|
||||
/** Get list of Program Parameters */
|
||||
inline LocalParamList& getLocalParameters() { return _programLocalParameters; }
|
||||
@ -194,7 +194,7 @@ class SG_EXPORT VertexProgram : public StateAttribute
|
||||
typedef std::map<GLenum,Matrix> MatrixList;
|
||||
|
||||
/** Set list of Matrices */
|
||||
inline void setMatrices(MatrixList& matrices) { _matrixList = matrices; }
|
||||
inline void setMatrices(const MatrixList& matrices) { _matrixList = matrices; }
|
||||
|
||||
/** Get list of Matrices */
|
||||
inline MatrixList& getMatrices() { return _matrixList; }
|
||||
|
@ -106,7 +106,7 @@ void AnimationPath::write(std::ostream& fout) const
|
||||
++tcpmitr)
|
||||
{
|
||||
const ControlPoint& cp = tcpmitr->second;
|
||||
fout<<tcpmitr->first<<" "<<cp._position<<" "<<cp._rotation<<std::endl;
|
||||
fout<<tcpmitr->first<<" "<<cp.getPosition()<<" "<<cp.getRotation()<<std::endl;
|
||||
}
|
||||
|
||||
fout.precision(prec);
|
||||
@ -139,16 +139,16 @@ class AnimationPathCallbackVisitor : public NodeVisitor
|
||||
Matrix matrix;
|
||||
_cp.getInverse(matrix);
|
||||
pat.setPosition(matrix.getTrans());
|
||||
pat.setAttitude(_cp._rotation.inverse());
|
||||
pat.setScale(osg::Vec3(1.0f/_cp._scale.x(),1.0f/_cp._scale.y(),1.0f/_cp._scale.z()));
|
||||
pat.setAttitude(_cp.getRotation().inverse());
|
||||
pat.setScale(osg::Vec3(1.0f/_cp.getScale().x(),1.0f/_cp.getScale().y(),1.0f/_cp.getScale().z()));
|
||||
pat.setPivotPoint(_pivotPoint);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
pat.setPosition(_cp._position);
|
||||
pat.setAttitude(_cp._rotation);
|
||||
pat.setScale(_cp._scale);
|
||||
pat.setPosition(_cp.getPosition());
|
||||
pat.setAttitude(_cp.getRotation());
|
||||
pat.setScale(_cp.getScale());
|
||||
pat.setPivotPoint(_pivotPoint);
|
||||
}
|
||||
}
|
||||
|
@ -17,10 +17,7 @@ using namespace osg;
|
||||
|
||||
ClipPlane::ClipPlane()
|
||||
{
|
||||
_clipPlane[0] = 0.0;
|
||||
_clipPlane[1] = 0.0;
|
||||
_clipPlane[2] = 0.0;
|
||||
_clipPlane[3] = 0.0;
|
||||
_clipPlane.set(0.0,0.0,0.0,0.0);
|
||||
_clipPlaneNum = 0;
|
||||
}
|
||||
|
||||
@ -29,61 +26,6 @@ ClipPlane::~ClipPlane()
|
||||
{
|
||||
}
|
||||
|
||||
void ClipPlane::setClipPlane(const Vec4& plane)
|
||||
{
|
||||
_clipPlane[0] = plane[0];
|
||||
_clipPlane[1] = plane[1];
|
||||
_clipPlane[2] = plane[2];
|
||||
_clipPlane[3] = plane[3];
|
||||
}
|
||||
|
||||
void ClipPlane::setClipPlane(const Plane& plane)
|
||||
{
|
||||
_clipPlane[0] = plane[0];
|
||||
_clipPlane[1] = plane[1];
|
||||
_clipPlane[2] = plane[2];
|
||||
_clipPlane[3] = plane[3];
|
||||
}
|
||||
|
||||
void ClipPlane::setClipPlane(const double* plane)
|
||||
{
|
||||
if (plane)
|
||||
{
|
||||
_clipPlane[0] = plane[0];
|
||||
_clipPlane[1] = plane[1];
|
||||
_clipPlane[2] = plane[2];
|
||||
_clipPlane[3] = plane[3];
|
||||
}
|
||||
else
|
||||
{
|
||||
notify(WARN)<<"Warning: ClipPlane::setClipPlane() passed NULL plane array, ignoring operation."<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void ClipPlane::getClipPlane(Vec4& plane) const
|
||||
{
|
||||
plane[0] = (float)_clipPlane[0];
|
||||
plane[1] = (float)_clipPlane[1];
|
||||
plane[2] = (float)_clipPlane[2];
|
||||
plane[3] = (float)_clipPlane[3];
|
||||
}
|
||||
|
||||
void ClipPlane::getClipPlane(Plane& plane) const
|
||||
{
|
||||
plane[0] = _clipPlane[0];
|
||||
plane[1] = _clipPlane[1];
|
||||
plane[2] = _clipPlane[2];
|
||||
plane[3] = _clipPlane[3];
|
||||
}
|
||||
|
||||
void ClipPlane::getClipPlane(double* plane) const
|
||||
{
|
||||
plane[0] = _clipPlane[0];
|
||||
plane[1] = _clipPlane[1];
|
||||
plane[2] = _clipPlane[2];
|
||||
plane[3] = _clipPlane[3];
|
||||
}
|
||||
|
||||
void ClipPlane::setClipPlaneNum(unsigned int num)
|
||||
{
|
||||
_clipPlaneNum = num;
|
||||
@ -96,6 +38,6 @@ unsigned int ClipPlane::getClipPlaneNum() const
|
||||
|
||||
void ClipPlane::apply(State&) const
|
||||
{
|
||||
glClipPlane((GLenum)(GL_CLIP_PLANE0+_clipPlaneNum),_clipPlane);
|
||||
glClipPlane((GLenum)(GL_CLIP_PLANE0+_clipPlaneNum),_clipPlane.ptr());
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,6 @@ using namespace osg;
|
||||
|
||||
PolygonMode::PolygonMode()
|
||||
{
|
||||
_frontAndBack = true;
|
||||
_modeFront = FILL;
|
||||
_modeBack = FILL;
|
||||
}
|
||||
@ -33,15 +32,12 @@ void PolygonMode::setMode(Face face,Mode mode)
|
||||
switch(face)
|
||||
{
|
||||
case(FRONT):
|
||||
_frontAndBack = false;
|
||||
_modeFront = mode;
|
||||
break;
|
||||
case(BACK):
|
||||
_frontAndBack = false;
|
||||
_modeBack = mode;
|
||||
break;
|
||||
case(FRONT_AND_BACK):
|
||||
_frontAndBack = true;
|
||||
_modeFront = mode;
|
||||
_modeBack = mode;
|
||||
break;
|
||||
@ -65,7 +61,7 @@ PolygonMode::Mode PolygonMode::getMode(Face face) const
|
||||
|
||||
void PolygonMode::apply(State&) const
|
||||
{
|
||||
if (_frontAndBack)
|
||||
if (_modeFront==_modeBack)
|
||||
{
|
||||
glPolygonMode(GL_FRONT_AND_BACK,(GLenum)_modeFront);
|
||||
}
|
||||
|
@ -457,7 +457,7 @@ void DrawShapeVisitor::apply(const Box& box)
|
||||
|
||||
if (!box.zeroRotation())
|
||||
{
|
||||
Matrix rotation(box.getRotationMatrix());
|
||||
Matrix rotation(box.computeRotationMatrix());
|
||||
glMultMatrix(rotation.ptr());
|
||||
}
|
||||
|
||||
@ -573,7 +573,7 @@ void DrawShapeVisitor::apply(const Cone& cone)
|
||||
|
||||
if (!cone.zeroRotation())
|
||||
{
|
||||
Matrix rotation(cone.getRotationMatrix());
|
||||
Matrix rotation(cone.computeRotationMatrix());
|
||||
glMultMatrix(rotation.ptr());
|
||||
}
|
||||
|
||||
@ -691,7 +691,7 @@ void DrawShapeVisitor::apply(const Cylinder& cylinder)
|
||||
|
||||
if (!cylinder.zeroRotation())
|
||||
{
|
||||
Matrix rotation(cylinder.getRotationMatrix());
|
||||
Matrix rotation(cylinder.computeRotationMatrix());
|
||||
glMultMatrix(rotation.ptr());
|
||||
}
|
||||
|
||||
@ -790,7 +790,7 @@ void DrawShapeVisitor::apply(const Capsule& capsule)
|
||||
|
||||
if (!capsule.zeroRotation())
|
||||
{
|
||||
Matrix rotation(capsule.getRotationMatrix());
|
||||
Matrix rotation(capsule.computeRotationMatrix());
|
||||
glMultMatrix(rotation.ptr());
|
||||
}
|
||||
|
||||
@ -876,7 +876,7 @@ void DrawShapeVisitor::apply(const HeightField& field)
|
||||
|
||||
if (!field.zeroRotation())
|
||||
{
|
||||
Matrix rotation(field.getRotationMatrix());
|
||||
Matrix rotation(field.computeRotationMatrix());
|
||||
glMultMatrix(rotation.ptr());
|
||||
}
|
||||
|
||||
@ -1087,7 +1087,7 @@ void ComputeBoundShapeVisitor::apply(const Box& box)
|
||||
Vec3 top_3(Vec3(x,y,z));
|
||||
Vec3 top_4(Vec3(-x,y,z));
|
||||
|
||||
Matrix matrix = box.getRotationMatrix();
|
||||
Matrix matrix = box.computeRotationMatrix();
|
||||
_bb.expandBy(box.getCenter()+base_1*matrix);
|
||||
_bb.expandBy(box.getCenter()+base_2*matrix);
|
||||
_bb.expandBy(box.getCenter()+base_3*matrix);
|
||||
@ -1116,7 +1116,7 @@ void ComputeBoundShapeVisitor::apply(const Cone& cone)
|
||||
Vec3 base_3(Vec3(cone.getRadius(),cone.getRadius(),cone.getBaseOffset()));
|
||||
Vec3 base_4(Vec3(-cone.getRadius(),cone.getRadius(),cone.getBaseOffset()));
|
||||
|
||||
Matrix matrix = cone.getRotationMatrix();
|
||||
Matrix matrix = cone.computeRotationMatrix();
|
||||
_bb.expandBy(cone.getCenter()+base_1*matrix);
|
||||
_bb.expandBy(cone.getCenter()+base_2*matrix);
|
||||
_bb.expandBy(cone.getCenter()+base_3*matrix);
|
||||
@ -1149,7 +1149,7 @@ void ComputeBoundShapeVisitor::apply(const Cylinder& cylinder)
|
||||
Vec3 top_3(Vec3(r,r,z));
|
||||
Vec3 top_4(Vec3(-r,r,z));
|
||||
|
||||
Matrix matrix = cylinder.getRotationMatrix();
|
||||
Matrix matrix = cylinder.computeRotationMatrix();
|
||||
_bb.expandBy(cylinder.getCenter()+base_1*matrix);
|
||||
_bb.expandBy(cylinder.getCenter()+base_2*matrix);
|
||||
_bb.expandBy(cylinder.getCenter()+base_3*matrix);
|
||||
@ -1186,7 +1186,7 @@ void ComputeBoundShapeVisitor::apply(const Capsule& capsule)
|
||||
Vec3 top_3(Vec3(r,r,z));
|
||||
Vec3 top_4(Vec3(-r,r,z));
|
||||
|
||||
Matrix matrix = capsule.getRotationMatrix();
|
||||
Matrix matrix = capsule.computeRotationMatrix();
|
||||
_bb.expandBy(capsule.getCenter()+base_1*matrix);
|
||||
_bb.expandBy(capsule.getCenter()+base_2*matrix);
|
||||
_bb.expandBy(capsule.getCenter()+base_3*matrix);
|
||||
@ -1269,7 +1269,7 @@ void ComputeBoundShapeVisitor::apply(const HeightField& field)
|
||||
Vec3 top_3(Vec3(x,y,zMax));
|
||||
Vec3 top_4(Vec3(0,y,zMax));
|
||||
|
||||
Matrix matrix = field.getRotationMatrix();
|
||||
Matrix matrix = field.computeRotationMatrix();
|
||||
_bb.expandBy(field.getOrigin()+base_1*matrix);
|
||||
_bb.expandBy(field.getOrigin()+base_2*matrix);
|
||||
_bb.expandBy(field.getOrigin()+base_3*matrix);
|
||||
@ -1424,7 +1424,7 @@ void PrimitiveShapeVisitor::apply(const Box& box)
|
||||
}
|
||||
else
|
||||
{
|
||||
Matrix matrix = box.getRotationMatrix();
|
||||
Matrix matrix = box.computeRotationMatrix();
|
||||
matrix.setTrans(box.getCenter());
|
||||
|
||||
base_1 = base_1*matrix;
|
||||
@ -1476,7 +1476,7 @@ void PrimitiveShapeVisitor::apply(const Box& box)
|
||||
|
||||
void PrimitiveShapeVisitor::apply(const Cone& cone)
|
||||
{
|
||||
Matrix matrix = cone.getRotationMatrix();
|
||||
Matrix matrix = cone.computeRotationMatrix();
|
||||
matrix.setTrans(cone.getCenter());
|
||||
|
||||
|
||||
@ -1567,7 +1567,7 @@ void PrimitiveShapeVisitor::apply(const Cone& cone)
|
||||
|
||||
void PrimitiveShapeVisitor::apply(const Cylinder& cylinder)
|
||||
{
|
||||
Matrix matrix = cylinder.getRotationMatrix();
|
||||
Matrix matrix = cylinder.computeRotationMatrix();
|
||||
matrix.setTrans(cylinder.getCenter());
|
||||
|
||||
unsigned int numSegments = 40;
|
||||
@ -1697,7 +1697,7 @@ void PrimitiveShapeVisitor::apply(const HeightField& field)
|
||||
{
|
||||
if (field.getNumColumns()==0 || field.getNumRows()==0) return;
|
||||
|
||||
Matrix matrix = field.getRotationMatrix();
|
||||
Matrix matrix = field.computeRotationMatrix();
|
||||
matrix.setTrans(field.getOrigin());
|
||||
|
||||
float dx = field.getXInterval();
|
||||
|
@ -410,7 +410,7 @@ osg::Image* ReadDDSFile(std::istream& _istream)
|
||||
|
||||
|
||||
osgImage->setImage(s,t,r, internalFormat, pixelFormat, dataType, 0, osg::Image::USE_NEW_DELETE);
|
||||
if (mipmaps.size()>0) osgImage->setMipmapData(mipmaps);
|
||||
if (mipmaps.size()>0) osgImage->setMipmapLevels(mipmaps);
|
||||
unsigned int size = osgImage->getTotalSizeInBytesIncludingMipmaps();
|
||||
|
||||
if(size <= 0)
|
||||
@ -428,7 +428,7 @@ osg::Image* ReadDDSFile(std::istream& _istream)
|
||||
_istream.read((char*)imageData, size);
|
||||
|
||||
osgImage->setImage(s,t,r, internalFormat, pixelFormat, dataType, imageData, osg::Image::USE_NEW_DELETE);
|
||||
if (mipmaps.size()>0) osgImage->setMipmapData(mipmaps);
|
||||
if (mipmaps.size()>0) osgImage->setMipmapLevels(mipmaps);
|
||||
|
||||
|
||||
|
||||
@ -463,10 +463,10 @@ bool WriteDDSFile(const osg::Image *img, std::ostream& fout)
|
||||
// Initialize ddsd structure and its members
|
||||
DDSURFACEDESC2 ddsd;
|
||||
DDPIXELFORMAT ddpf;
|
||||
DDCOLORKEY ddckCKDestOverlay;
|
||||
DDCOLORKEY ddckCKDestBlt;
|
||||
DDCOLORKEY ddckCKSrcOverlay;
|
||||
DDCOLORKEY ddckCKSrcBlt;
|
||||
//DDCOLORKEY ddckCKDestOverlay;
|
||||
//DDCOLORKEY ddckCKDestBlt;
|
||||
//DDCOLORKEY ddckCKSrcOverlay;
|
||||
//DDCOLORKEY ddckCKSrcBlt;
|
||||
DDSCAPS2 ddsCaps;
|
||||
|
||||
ddsd.dwSize = sizeof(ddsd);
|
||||
@ -647,7 +647,7 @@ bool WriteDDSFile(const osg::Image *img, std::ostream& fout)
|
||||
if(img->isMipmap())
|
||||
{
|
||||
dataPtr += imageSize;
|
||||
unsigned char *mmdPtr, *next_mmdPtr;
|
||||
const unsigned char *mmdPtr, *next_mmdPtr;
|
||||
int offset;
|
||||
unsigned int mipmaps = img->getNumMipmapLevels();
|
||||
unsigned int blockSize;
|
||||
|
@ -37,9 +37,9 @@ void AnimationPath::write(DataOutputStream* out){
|
||||
out->writeInt(tcpm.size());
|
||||
for(AnimationPath::TimeControlPointMap::iterator itr=tcpm.begin(); itr!=tcpm.end(); ++itr){
|
||||
out->writeFloat(itr->first);
|
||||
out->writeVec3(itr->second._position);
|
||||
out->writeQuat(itr->second._rotation);
|
||||
out->writeVec3(itr->second._scale);
|
||||
out->writeVec3(itr->second.getPosition());
|
||||
out->writeQuat(itr->second.getRotation());
|
||||
out->writeVec3(itr->second.getScale());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,16 +31,7 @@ void ClipPlane::write(DataOutputStream* out){
|
||||
|
||||
// write ClipPlane's properties
|
||||
|
||||
|
||||
|
||||
|
||||
double plane[4];
|
||||
getClipPlane(plane);
|
||||
|
||||
out->writeDouble(plane[0]);
|
||||
out->writeDouble(plane[1]);
|
||||
out->writeDouble(plane[2]);
|
||||
out->writeDouble(plane[3]);
|
||||
out->writeVec4d(getClipPlane());
|
||||
|
||||
out->writeUInt(getClipPlaneNum());
|
||||
|
||||
@ -62,15 +53,7 @@ void ClipPlane::read(DataInputStream* in){
|
||||
else
|
||||
throw Exception("ClipPlane::read(): Could not cast this osg::ClipPlane to an osg::Object.");
|
||||
|
||||
// Read ClipPlane's properties
|
||||
double plane[4];
|
||||
|
||||
plane[0] = in->readDouble();
|
||||
plane[1] = in->readDouble();
|
||||
plane[2] = in->readDouble();
|
||||
plane[3] = in->readDouble();
|
||||
|
||||
setClipPlane(plane);
|
||||
setClipPlane(in->readVec4d());
|
||||
|
||||
setClipPlaneNum(in->readUInt());
|
||||
}
|
||||
|
@ -313,6 +313,39 @@ osg::Vec4 DataInputStream::readVec4(){
|
||||
|
||||
return v;
|
||||
}
|
||||
osg::Vec2d DataInputStream::readVec2d()
|
||||
{
|
||||
osg::Vec2d v;
|
||||
v.x()=readDouble();
|
||||
v.y()=readDouble();
|
||||
|
||||
if (_verboseOutput) std::cout<<"read/writeVec2d() ["<<v<<"]"<<std::endl;
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
osg::Vec3d DataInputStream::readVec3d(){
|
||||
osg::Vec3d v;
|
||||
v.x()=readDouble();
|
||||
v.y()=readDouble();
|
||||
v.z()=readDouble();
|
||||
|
||||
if (_verboseOutput) std::cout<<"read/writeVec3d() ["<<v<<"]"<<std::endl;
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
osg::Vec4d DataInputStream::readVec4d(){
|
||||
osg::Vec4d v;
|
||||
v.x()=readDouble();
|
||||
v.y()=readDouble();
|
||||
v.z()=readDouble();
|
||||
v.w()=readDouble();
|
||||
|
||||
if (_verboseOutput) std::cout<<"read/writeVec4d() ["<<v<<"]"<<std::endl;
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
osg::Plane DataInputStream::readPlane(){
|
||||
osg::Plane v;
|
||||
|
@ -9,6 +9,9 @@
|
||||
#include <osg/Vec2>
|
||||
#include <osg/Vec3>
|
||||
#include <osg/Vec4>
|
||||
#include <osg/Vec2d>
|
||||
#include <osg/Vec3d>
|
||||
#include <osg/Vec4d>
|
||||
#include <osg/Quat>
|
||||
#include <osg/Array>
|
||||
#include <osg/Matrix>
|
||||
@ -54,6 +57,9 @@ public:
|
||||
osg::Vec2 readVec2();
|
||||
osg::Vec3 readVec3();
|
||||
osg::Vec4 readVec4();
|
||||
osg::Vec2d readVec2d();
|
||||
osg::Vec3d readVec3d();
|
||||
osg::Vec4d readVec4d();
|
||||
osg::Plane readPlane();
|
||||
osg::UByte4 readUByte4();
|
||||
osg::Quat readQuat();
|
||||
|
@ -182,6 +182,30 @@ void DataOutputStream::writeVec4(const osg::Vec4& v){
|
||||
if (_verboseOutput) std::cout<<"read/writeVec4() ["<<v<<"]"<<std::endl;
|
||||
}
|
||||
|
||||
void DataOutputStream::writeVec2d(const osg::Vec2d& v){
|
||||
writeDouble(v.x());
|
||||
writeDouble(v.y());
|
||||
|
||||
if (_verboseOutput) std::cout<<"read/writeVec2() ["<<v<<"]"<<std::endl;
|
||||
}
|
||||
|
||||
void DataOutputStream::writeVec3d(const osg::Vec3d& v){
|
||||
writeDouble(v.x());
|
||||
writeDouble(v.y());
|
||||
writeDouble(v.z());
|
||||
|
||||
if (_verboseOutput) std::cout<<"read/writeVec3d() ["<<v<<"]"<<std::endl;
|
||||
}
|
||||
|
||||
void DataOutputStream::writeVec4d(const osg::Vec4d& v){
|
||||
writeDouble(v.x());
|
||||
writeDouble(v.y());
|
||||
writeDouble(v.z());
|
||||
writeDouble(v.w());
|
||||
|
||||
if (_verboseOutput) std::cout<<"read/writeVec4d() ["<<v<<"]"<<std::endl;
|
||||
}
|
||||
|
||||
void DataOutputStream::writePlane(const osg::Plane& v)
|
||||
{
|
||||
writeFloat(v[0]);
|
||||
|
@ -46,6 +46,9 @@ public:
|
||||
void writeVec2(const osg::Vec2& v);
|
||||
void writeVec3(const osg::Vec3& v);
|
||||
void writeVec4(const osg::Vec4& v);
|
||||
void writeVec2d(const osg::Vec2d& v);
|
||||
void writeVec3d(const osg::Vec3d& v);
|
||||
void writeVec4d(const osg::Vec4d& v);
|
||||
void writePlane(const osg::Plane& v);
|
||||
void writeUByte4(const osg::UByte4& v);
|
||||
void writeQuat(const osg::Quat& q);
|
||||
|
@ -86,11 +86,7 @@ bool AnimationPath_readLocalData(osg::Object &obj, osgDB::Input &fr)
|
||||
{
|
||||
|
||||
|
||||
osg::AnimationPath::ControlPoint ctrlPoint;
|
||||
ctrlPoint._position = position;
|
||||
ctrlPoint._rotation = rotation;
|
||||
ctrlPoint._scale = scale;
|
||||
|
||||
osg::AnimationPath::ControlPoint ctrlPoint(position,rotation,scale);
|
||||
ap->insert(time, ctrlPoint);
|
||||
|
||||
fr+=11;
|
||||
@ -138,7 +134,7 @@ bool AnimationPath_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
|
||||
itr!=tcpm.end();
|
||||
++itr)
|
||||
{
|
||||
fw.indent() << itr->first << " " << itr->second._position << " " << itr->second._rotation << " " << itr->second._scale << std::endl;
|
||||
fw.indent() << itr->first << " " << itr->second.getPosition() << " " << itr->second.getRotation() << " " <<itr->second.getScale() << std::endl;
|
||||
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ bool ClipPlane_readLocalData(Object& obj, Input& fr)
|
||||
fr[2].getFloat(plane[1]);
|
||||
fr[3].getFloat(plane[2]);
|
||||
fr[4].getFloat(plane[3]);
|
||||
clipplane.setClipPlane(plane);
|
||||
clipplane.setClipPlane(plane[0],plane[1],plane[2],plane[3]);
|
||||
|
||||
fr+=5;
|
||||
iteratorAdvanced = true;
|
||||
@ -66,9 +66,7 @@ bool ClipPlane_writeLocalData(const Object& obj,Output& fw)
|
||||
|
||||
fw.indent() << "clipPlaneNum " << clipplane.getClipPlaneNum() <<std::endl;
|
||||
|
||||
double plane[4];
|
||||
clipplane.getClipPlane(plane);
|
||||
fw.indent() << "plane " << plane[0] << ' ' << plane[1] << ' ' << plane[2] << ' ' << plane[3] << std::endl;
|
||||
fw.indent() << "plane " << clipplane.getClipPlane()<< std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1526,7 +1526,7 @@ osg::Texture2D* txp::getLocalTexture(trpgrImageHelper& image_helper, const trpgT
|
||||
{
|
||||
mipmaps[k-1] = tmp_tex->MipLevelOffset(k);
|
||||
}
|
||||
image->setMipmapData(mipmaps);
|
||||
image->setMipmapLevels(mipmaps);
|
||||
|
||||
}
|
||||
|
||||
@ -1601,7 +1601,7 @@ osg::Texture2D* txp::getTemplateTexture(trpgrImageHelper& image_helper, trpgLoca
|
||||
{
|
||||
mipmaps[k-1] = tmp_tex->MipLevelOffset(k);
|
||||
}
|
||||
image->setMipmapData(mipmaps);
|
||||
image->setMipmapLevels(mipmaps);
|
||||
|
||||
}
|
||||
|
||||
|
@ -1083,7 +1083,7 @@ void CullVisitor::apply(Impostor& node)
|
||||
|
||||
float distance2 = (eyeLocal-bs.center()).length2();
|
||||
if (!_impostorActive ||
|
||||
distance2*_LODScale*_LODScale<node.getImpostorThreshold2() ||
|
||||
distance2*_LODScale*_LODScale<osg::square(node.getImpostorThreshold()) ||
|
||||
distance2<bs.radius2()*2.0f)
|
||||
{
|
||||
// outwith the impostor distance threshold therefore simple
|
||||
|
Loading…
Reference in New Issue
Block a user