bullet: Fix BulletWheel::empty() referencing local objects

This commit is contained in:
rdb 2022-10-25 12:08:06 +02:00
parent cc24b5373d
commit ef9c9fa20e
3 changed files with 14 additions and 15 deletions

View File

@ -26,17 +26,3 @@ INLINE BulletWheelRaycastInfo::
~BulletWheelRaycastInfo() { ~BulletWheelRaycastInfo() {
} }
/**
* Named constructor intended to be used for asserts with have to return a
* concrete value.
*/
INLINE BulletWheel BulletWheel::
empty() {
btWheelInfoConstructionInfo ci {};
btWheelInfo info(ci);
return BulletWheel(info);
}

View File

@ -23,6 +23,19 @@ BulletWheel(btWheelInfo &info) : _info(info) {
} }
/**
* Named constructor intended to be used for asserts with have to return a
* concrete value.
*/
BulletWheel BulletWheel::
empty() {
static btWheelInfoConstructionInfo ci {};
static btWheelInfo info(ci);
return BulletWheel(info);
}
/** /**
* *
*/ */

View File

@ -143,7 +143,7 @@ PUBLISHED:
public: public:
BulletWheel(btWheelInfo &info); BulletWheel(btWheelInfo &info);
INLINE static BulletWheel empty(); static BulletWheel empty();
private: private:
btWheelInfo &_info; btWheelInfo &_info;