--- trunk/src/brains/DataStorage.cpp 2005/01/12 22:41:40 246 +++ trunk/src/brains/DataStorage.cpp 2005/02/13 21:18:27 331 @@ -49,6 +49,7 @@ #include "brains/DataStorage.hpp" +namespace oopse { DataStorage::DataStorage() : size_(0), storageLayout_(0){ @@ -326,4 +327,35 @@ void DataStorage::internalCopy(std::vector& v, int std::advance(result, target ); std::copy(first, last, result); +} + +int DataStorage::getBytesPerStuntDouble(int layout) { + int bytes = 0; + if (layout & dslPosition) { + bytes += sizeof(Vector3d); + } + if (layout & dslVelocity) { + bytes += sizeof(Vector3d); + } + if (layout & dslAmat) { + bytes += sizeof(Mat3x3d); + } + if (layout & dslAngularMomentum) { + bytes += sizeof(Vector3d); + } + if (layout & dslElectroFrame) { + bytes += sizeof(Mat3x3d); + } + if (layout & dslZAngle) { + bytes += sizeof(Vector3d); + } + if (layout & dslForce) { + bytes += sizeof(Vector3d); + } + if (layout & dslTorque) { + bytes += sizeof(Vector3d); + } + return bytes; } + +}