Update userdata stuff to how new box2d wants it

This commit is contained in:
Garrett Brown
2020-10-17 22:30:01 -04:00
parent 77f238767f
commit 1b74b34cce
7 changed files with 7 additions and 43 deletions
+1 -6
View File
@@ -379,7 +379,7 @@ public:
b2BodyUserData& GetUserData();
/// Set the user data. Use this to store your application specific data.
void SetUserData(b2BodyUserData& data);
void SetUserData(void* data);
/// Get the parent world of this body.
b2World* GetWorld();
@@ -736,11 +736,6 @@ inline b2BodyUserData& b2Body::GetUserData()
return m_userData;
}
inline void b2Body::SetUserData(b2BodyUserData& userData)
{
m_userData = userData;
}
inline void b2Body::ApplyForce(const b2Vec2& force, const b2Vec2& point, bool wake)
{
if (m_type != b2_dynamicBody)
-8
View File
@@ -158,9 +158,6 @@ public:
/// store your application specific data.
b2FixtureUserData& GetUserData();
/// Set the user data. Use this to store your application specific data.
void SetUserData(b2FixtureUserData& userData);
/// Test a point for containment in this fixture.
/// @param p a point in world coordinates.
bool TestPoint(const b2Vec2& p) const;
@@ -283,11 +280,6 @@ inline b2FixtureUserData& b2Fixture::GetUserData()
return m_userData;
}
inline void b2Fixture::SetUserData(b2FixtureUserData& userData)
{
m_userData = userData;
}
inline b2Body* b2Fixture::GetBody()
{
return m_body;
-8
View File
@@ -139,9 +139,6 @@ public:
/// Get the user data pointer.
b2JointUserData& GetUserData();
/// Set the user data pointer.
void SetUserData(b2JointUserData& userData);
/// Short-cut function to determine if either body is enabled.
bool IsEnabled() const;
@@ -223,11 +220,6 @@ inline b2JointUserData& b2Joint::GetUserData()
return m_userData;
}
inline void b2Joint::SetUserData(b2JointUserData& userData)
{
m_userData = userData;
}
inline bool b2Joint::GetCollideConnected() const
{
return m_collideConnected;
-15
View File
@@ -123,23 +123,8 @@ inline void b2Log(const char* string, ...)
#endif // B2_USER_SETTINGS
void loveAssert(bool test, const char* teststr);
#define b2Assert(A) loveAssert((A), #A)
namespace love {
namespace physics {
namespace box2d {
struct bodyudata;
struct fixtureudata;
struct jointudata;
}
}
}
#define b2BodyUserData love::physics::box2d::bodyudata*
#define b2FixtureUserData love::physics::box2d::fixtureudata*
#define b2JointUserData love::physics::box2d::jointudata*
#include "b2_common.h"
#endif