2003-09-15 06:48:35 +08:00
|
|
|
/**********************************************************************
|
|
|
|
*
|
2005-11-17 23:03:51 +08:00
|
|
|
* FILE: ConeSector.cpp
|
2003-09-15 06:48:35 +08:00
|
|
|
*
|
2005-11-17 23:03:51 +08:00
|
|
|
* DESCRIPTION: Read/Write osgSim::ConeSector in binary format to disk.
|
2003-09-15 06:48:35 +08:00
|
|
|
*
|
2005-11-17 23:03:51 +08:00
|
|
|
* CREATED BY: Auto generated by iveGenerator.exe
|
|
|
|
* and later modified by Rune Schmidt Jensen.
|
2003-09-15 06:48:35 +08:00
|
|
|
*
|
2005-11-17 23:03:51 +08:00
|
|
|
* HISTORY: Created 9.9.2003
|
2003-09-15 06:48:35 +08:00
|
|
|
*
|
|
|
|
**********************************************************************/
|
|
|
|
|
|
|
|
#include "Exception.h"
|
|
|
|
#include "ConeSector.h"
|
|
|
|
|
|
|
|
using namespace ive;
|
|
|
|
|
|
|
|
void ConeSector::write(DataOutputStream* out){
|
2005-11-17 23:03:51 +08:00
|
|
|
// Write ConeSector's identification.
|
|
|
|
out->writeInt(IVECONESECTOR);
|
|
|
|
// Write ConeSector's properties.
|
|
|
|
out->writeVec3(getAxis());
|
|
|
|
out->writeFloat(getAngle());
|
2003-09-15 06:48:35 +08:00
|
|
|
out->writeFloat(getFadeAngle());
|
|
|
|
}
|
|
|
|
|
|
|
|
void ConeSector::read(DataInputStream* in){
|
2005-11-17 23:03:51 +08:00
|
|
|
// Peek on ConeSector's identification.
|
|
|
|
int id = in->peekInt();
|
|
|
|
if(id == IVECONESECTOR){
|
|
|
|
// Read ConeSector's identification.
|
|
|
|
id = in->readInt();
|
|
|
|
// Read ConeSector's properties
|
|
|
|
setAxis(in->readVec3());
|
2003-09-15 06:48:35 +08:00
|
|
|
float angle = in->readFloat();
|
|
|
|
float fadeangle = in->readFloat();;
|
|
|
|
setAngle(angle, fadeangle);
|
2005-11-17 23:03:51 +08:00
|
|
|
}
|
|
|
|
else{
|
2009-11-17 20:54:55 +08:00
|
|
|
in_THROW_EXCEPTION("ConeSector::read(): Expected ConeSector identification.");
|
2005-11-17 23:03:51 +08:00
|
|
|
}
|
2003-09-15 06:48:35 +08:00
|
|
|
}
|