Added support for ClipPlane, ClipNode, TexGenNode to .ive

This commit is contained in:
Robert Osfield
2004-09-29 19:10:00 +00:00
parent 5be0004d52
commit a8739f952a
17 changed files with 394 additions and 39 deletions

View File

@@ -21,6 +21,7 @@
#include "BlendFunc.h"
#include "Material.h"
#include "CullFace.h"
#include "ClipPlane.h"
#include "PolygonOffset.h"
#include "ShadeModel.h"
#include "Point.h"
@@ -41,6 +42,8 @@
#include "MatrixTransform.h"
#include "Geode.h"
#include "LightSource.h"
#include "TexGenNode.h"
#include "ClipNode.h"
#include "Billboard.h"
#include "Sequence.h"
#include "LOD.h"
@@ -311,6 +314,18 @@ osg::Vec4 DataInputStream::readVec4(){
return v;
}
osg::Plane DataInputStream::readPlane(){
osg::Plane v;
v[0]=readFloat();
v[1]=readFloat();
v[2]=readFloat();
v[3]=readFloat();
if (_verboseOutput) std::cout<<"read/writePlane() ["<<v<<"]"<<std::endl;
return v;
}
osg::UByte4 DataInputStream::readUByte4(){
osg::UByte4 v;
v.r()=readChar();
@@ -634,6 +649,10 @@ osg::StateAttribute* DataInputStream::readStateAttribute()
attribute = new osg::CullFace();
((ive::CullFace*)(attribute))->read(this);
}
else if(attributeID == IVECLIPPLANE){
attribute = new osg::ClipPlane();
((ive::ClipPlane*)(attribute))->read(this);
}
else if(attributeID == IVEPOLYGONOFFSET){
attribute = new osg::PolygonOffset();
((ive::PolygonOffset*)(attribute))->read(this);
@@ -835,6 +854,14 @@ osg::Node* DataInputStream::readNode()
node = new osg::LightSource();
((ive::LightSource*)(node))->read(this);
}
else if(nodeTypeID== IVETEXGENNODE){
node = new osg::TexGenNode();
((ive::TexGenNode*)(node))->read(this);
}
else if(nodeTypeID== IVECLIPNODE){
node = new osg::ClipNode();
((ive::ClipNode*)(node))->read(this);
}
else if(nodeTypeID== IVESEQUENCE){
node = new osg::Sequence();
((ive::Sequence*)(node))->read(this);