DanielChappuis / reactphysics3d

Open source C++ physics engine library in 3D
http://www.reactphysics3d.com
zlib License
1.54k stars 223 forks source link

bug in RigidBodyComponents::allocate #195

Closed graphitemaster closed 3 years ago

graphitemaster commented 3 years ago

Spent awhile tracking this one down, but the component allocation code only copies sizeof(bool) * mNbComponents instead of sizeof(decimal) for mSleepTimes

https://github.com/DanielChappuis/reactphysics3d/blob/master/src/components/RigidBodyComponents.cpp#L101

memcpy(newSleepTimes, mSleepTimes, mNbComponents * sizeof(bool));

DanielChappuis commented 3 years ago

I have pushed a fix for this bug in the master branch.

Thanks a lot for taking the time to investigate this issue. This is very helpful.