1 #ifndef KINEMATICBODY_HPP 2 #define KINEMATICBODY_HPP 4 #include <Box2D/Box2D.h> 182 #endif // KINEMATICBODY_HPP KinematicBody()
Default constructor - Inaccessible.
Definition: KinematicBody.hpp:27
void destroyBody()
Destroy the KinematicBody. Safely removes the body using Box2D internals.
Definition: KinematicBody.hpp:169
b2Vec2 getPosition()
Get the position of the body in Box2D units (meters).
Definition: KinematicBody.hpp:111
void setFixedRotation(bool r)
Set the body's rotation as fixed (no rotation).
Definition: KinematicBody.hpp:93
float getRestitution()
Get the restitution of the body.
Definition: KinematicBody.hpp:86
b2World * getWorld()
Get a pointer to the Box2D world the static platform is tied to.
Definition: KinematicBody.hpp:44
float getDensity()
Get the density of the body.
Definition: KinematicBody.hpp:58
void setLinearVelocity(glm::vec2 v)
Set the linear velocity of the body.
Definition: KinematicBody.hpp:154
float getFriction()
Get the friction of the body.
Definition: KinematicBody.hpp:72
void setFriction(float friction)
Set the friction for the body.
Definition: KinematicBody.hpp:65
b2Body * m_body
A Box2D body.
Definition: KinematicBody.hpp:176
GLRect m_rect
A GLRect structure.
Definition: KinematicBody.hpp:177
b2PolygonShape m_shape
A Box2D polygon shape.
Definition: KinematicBody.hpp:174
glm::vec2 getPositionInPixels()
Get the position of the body in screen units (pixels).
Definition: KinematicBody.hpp:146
glm::vec2 getLinearVelocity()
Get the linear velocity of the body.
Definition: KinematicBody.hpp:162
b2BodyDef m_bodyDef
A Box2D body definition structure.
Definition: KinematicBody.hpp:173
void setRestitution(float restitution)
Set the restitution (bounciness) for the body.
Definition: KinematicBody.hpp:79
Useful for defining size and origin of an OpenGL object.
Definition: GLTransformable.hpp:15
b2FixtureDef m_fixtureDef
A Box2D fixture definition structure.
Definition: KinematicBody.hpp:175
A class wrapper to ease the instantiation and use of Box2D kinematic bodies. It also performs convers...
Definition: KinematicBody.hpp:20
void setTransform(b2Vec2 position, float angle)
Set the transform (position and angle) of the KinematicBody.
Definition: KinematicBody.hpp:138
void setPosition(glm::vec2 position)
Set the position of the KinematicBody.
Definition: KinematicBody.hpp:119
void setDensity(float density)
Set the density of the body.
Definition: KinematicBody.hpp:51
float getRotation()
Get the rotation of the KinematicBody.
Definition: KinematicBody.hpp:127
b2World * m_world
A pointer to the Box2D world.
Definition: KinematicBody.hpp:169
void allowSleep(bool s)
Set the body to allow sleeping. This increases efficiency and performance of Box2D while also prevent...
Definition: KinematicBody.hpp:103