|
Revision 13041, 2.2 kB
(checked in by robert, 14 months ago)
|
|
Ran script to remove trailing spaces and tabs
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | #include "Exception.h" |
|---|
| 16 | #include "ClusterCullingCallback.h" |
|---|
| 17 | #include "Object.h" |
|---|
| 18 | |
|---|
| 19 | using namespace ive; |
|---|
| 20 | |
|---|
| 21 | void ClusterCullingCallback::write(DataOutputStream* out) |
|---|
| 22 | { |
|---|
| 23 | |
|---|
| 24 | out->writeInt(IVECLUSTERCULLINGCALLBACK); |
|---|
| 25 | |
|---|
| 26 | osg::Object* obj = dynamic_cast<osg::Object*>(this); |
|---|
| 27 | if(obj) |
|---|
| 28 | { |
|---|
| 29 | ((ive::Object*)(obj))->write(out); |
|---|
| 30 | } |
|---|
| 31 | else |
|---|
| 32 | out_THROW_EXCEPTION("ClusterCullingCallback::write(): Could not cast this osg::ClusterCullingCallback to an osg::Object."); |
|---|
| 33 | |
|---|
| 34 | |
|---|
| 35 | out->writeVec3(_controlPoint); |
|---|
| 36 | out->writeVec3(_normal); |
|---|
| 37 | out->writeFloat(_radius); |
|---|
| 38 | out->writeFloat(_deviation); |
|---|
| 39 | } |
|---|
| 40 | |
|---|
| 41 | void ClusterCullingCallback::read(DataInputStream* in) |
|---|
| 42 | { |
|---|
| 43 | |
|---|
| 44 | int id = in->peekInt(); |
|---|
| 45 | if(id == IVECLUSTERCULLINGCALLBACK) |
|---|
| 46 | { |
|---|
| 47 | |
|---|
| 48 | id = in->readInt(); |
|---|
| 49 | |
|---|
| 50 | osg::Object* obj = dynamic_cast<osg::Object*>(this); |
|---|
| 51 | if(obj) |
|---|
| 52 | { |
|---|
| 53 | ((ive::Object*)(obj))->read(in); |
|---|
| 54 | } |
|---|
| 55 | else |
|---|
| 56 | in_THROW_EXCEPTION("ClusterCullingCallback::read(): Could not cast this osg::ClusterCullingCallback to an osg::Object."); |
|---|
| 57 | |
|---|
| 58 | |
|---|
| 59 | |
|---|
| 60 | _controlPoint = in->readVec3(); |
|---|
| 61 | _normal = in->readVec3(); |
|---|
| 62 | _radius = in->readFloat(); |
|---|
| 63 | _deviation = in->readFloat(); |
|---|
| 64 | |
|---|
| 65 | } |
|---|
| 66 | else |
|---|
| 67 | { |
|---|
| 68 | in_THROW_EXCEPTION("ClusterCullingCallback::read(): Expected ClusterCullingCallback identification."); |
|---|
| 69 | } |
|---|
| 70 | } |
|---|