--- trunk/OOPSE-3.0/src/brains/DataStorage.cpp 2005/01/12 22:41:40 1930 +++ trunk/OOPSE-3.0/src/brains/DataStorage.cpp 2005/02/13 15:56:10 2007 @@ -49,6 +49,7 @@ #include "brains/DataStorage.hpp" +namespace oopse { DataStorage::DataStorage() : size_(0), storageLayout_(0){ @@ -327,3 +328,27 @@ void DataStorage::internalCopy(std::vector& v, int std::copy(first, last, result); } + +int DataStorage::getBytesPerStuntDouble(int layout) { + int bytes = 0; + if (layout & dslPosition) { + bytes += sizeof(Vector3d); + } else if (layout & dslVelocity) { + bytes += sizeof(Vector3d); + } else if (layout & dslAmat) { + bytes += sizeof(Mat3x3d); + } else if (layout & dslAngularMomentum) { + bytes += sizeof(Vector3d); + } else if (layout & dslElectroFrame) { + bytes += sizeof(Mat3x3d); + } else if (layout & dslZAngle) { + bytes += sizeof(Vector3d); + } else if (layout & dslForce) { + bytes += sizeof(Vector3d); + } else if (layout & dslTorque) { + bytes += sizeof(Vector3d); + } + return bytes; +} + +}