NVIDIAGameWorks / FleX

Other
668 stars 100 forks source link

Documentation allocates velocity buffers that are too large #132

Open ixchow opened 2 years ago

ixchow commented 2 years ago

In at least two places I have noticed, the manual suggests allocating a velocity buffer with 32 bytes per element despite only using 24 bytes (i.e., sizeof(Vec3)) per element.

In manual.html#quick-start:

NvFlexBuffer* velocityBuffer = NvFlexAllocBuffer(library, n, sizeof(float4), eNvFlexBufferHost);

In NvFlex.h (and the documentation generated from it):

NvFlexBuffer* velocityBuffer = NvFlexAllocBuffer(library, n, sizeof(Vec4), eNvFlexBufferHost);

It is clear there is not some hidden constraint that requires allocating 33% more memory for velocities, given that the extensions code uses a 24-bytes-per-element buffer (via NvFlexVector< Vec3 >). I suggest that these mentions in the manual be corrected.