Thanks for releasing b2d 2.2! I've already integrated it into my project and I can't wait to check out the new features. I've been using b2d for a few years now and I love it.
One tiny suggestion I have is to use constructor initialization lists, even for structs. For example:
It's faster than setting that variables in the body of the constructor or by a creating class because the init list commands occur as the memory for the variables is allocated, rather than after.
More importantly, using them can avoid bugs. For example, b2Filter's members are usually set during b2d helper functions or convenience calls, but when you create a filter manually they are not. This created some strange bugs for me that were difficult to track down. I assumed that the members of the filter would always have the same values when constructed, but without an init list, the default values of the members were undefined and would change from run to run.
Thanks again!
---
Paul, Riverman Media
http://www.rivermanmedia.com
One tiny suggestion I have is to use constructor initialization lists, even for structs. For example:
Code:
b2Filter::b2Filter() :
categoryBits(0x0),
maskBits(0x0),
groupIndex(0)
{
}
categoryBits(0x0),
maskBits(0x0),
groupIndex(0)
{
}
It's faster than setting that variables in the body of the constructor or by a creating class because the init list commands occur as the memory for the variables is allocated, rather than after.
More importantly, using them can avoid bugs. For example, b2Filter's members are usually set during b2d helper functions or convenience calls, but when you create a filter manually they are not. This created some strange bugs for me that were difficult to track down. I assumed that the members of the filter would always have the same values when constructed, but without an init list, the default values of the members were undefined and would change from run to run.
Thanks again!
---
Paul, Riverman Media
http://www.rivermanmedia.com