49 |
|
|
50 |
|
#include "brains/DataStorage.hpp" |
51 |
|
|
52 |
+ |
namespace oopse { |
53 |
|
|
54 |
|
DataStorage::DataStorage() : size_(0), storageLayout_(0){ |
55 |
|
|
328 |
|
|
329 |
|
std::copy(first, last, result); |
330 |
|
} |
331 |
+ |
|
332 |
+ |
int DataStorage::getBytesPerStuntDouble(int layout) { |
333 |
+ |
int bytes = 0; |
334 |
+ |
if (layout & dslPosition) { |
335 |
+ |
bytes += sizeof(Vector3d); |
336 |
+ |
} else if (layout & dslVelocity) { |
337 |
+ |
bytes += sizeof(Vector3d); |
338 |
+ |
} else if (layout & dslAmat) { |
339 |
+ |
bytes += sizeof(Mat3x3d); |
340 |
+ |
} else if (layout & dslAngularMomentum) { |
341 |
+ |
bytes += sizeof(Vector3d); |
342 |
+ |
} else if (layout & dslElectroFrame) { |
343 |
+ |
bytes += sizeof(Mat3x3d); |
344 |
+ |
} else if (layout & dslZAngle) { |
345 |
+ |
bytes += sizeof(Vector3d); |
346 |
+ |
} else if (layout & dslForce) { |
347 |
+ |
bytes += sizeof(Vector3d); |
348 |
+ |
} else if (layout & dslTorque) { |
349 |
+ |
bytes += sizeof(Vector3d); |
350 |
+ |
} |
351 |
+ |
return bytes; |
352 |
+ |
} |
353 |
+ |
|
354 |
+ |
} |