attached): * Light point strings using the REPLICATE opcode should now be supported (>=15.6?) * Directional lights should now work as in Performer using a viewing frustrum defined by a direction vector, horizontal angular width, vertical angular width, and roll angle about the direction vector. The current directional light implementation had some bad assumptions which caused problems with direction vectors not on the XY plane. * IVE and OSG reader/writers were updated as appropriate"
48 lines
1.4 KiB
C++
48 lines
1.4 KiB
C++
/**********************************************************************
|
|
*
|
|
* FILE: DirectionalSector.cpp
|
|
*
|
|
* DESCRIPTION: Read/Write osgSim::DirectionalSector in binary format to disk.
|
|
*
|
|
* CREATED BY: Auto generated by iveGenerator.exe
|
|
* and later modified by Rune Schmidt Jensen.
|
|
*
|
|
* HISTORY: Created 9.9.2003
|
|
*
|
|
**********************************************************************/
|
|
|
|
#include "Exception.h"
|
|
#include "DirectionalSector.h"
|
|
|
|
using namespace ive;
|
|
|
|
void DirectionalSector::write(DataOutputStream* out){
|
|
// Write DirectionalSector's identification.
|
|
out->writeInt(IVEDIRECTIONALSECTOR);
|
|
// Write DirectionalSector's properties.
|
|
out->writeVec3(getDirection());
|
|
out->writeFloat(getHorizLobeAngle());
|
|
out->writeFloat(getVertLobeAngle());
|
|
out->writeFloat(getLobeRollAngle());
|
|
out->writeFloat(getFadeAngle());
|
|
}
|
|
|
|
void DirectionalSector::read(DataInputStream* in){
|
|
// Peek on DirectionalSector's identification.
|
|
int id = in->peekInt();
|
|
if(id == IVEDIRECTIONALSECTOR){
|
|
// Read DirectionalSector's identification.
|
|
id = in->readInt();
|
|
// Read DirectionalSector's properties
|
|
setDirection(in->readVec3());
|
|
setHorizLobeAngle(in->readFloat());
|
|
setVertLobeAngle(in->readFloat());
|
|
setLobeRollAngle(in->readFloat());
|
|
setFadeAngle(in->readFloat());
|
|
|
|
}
|
|
else{
|
|
throw Exception("DirectionalSector::read(): Expected DirectionalSector identification.");
|
|
}
|
|
}
|