1 #ifndef GF_PHYSICS_BODY_H
2 #define GF_PHYSICS_BODY_H
14 #ifndef DOXYGEN_SHOULD_SKIP_THIS
103 void move(Vector2f offset);
111 return m_linearVelocity;
120 m_linearVelocity = velocity;
138 return m_acceleration;
213 m_restitution = restitution;
222 return m_restitution;
231 m_staticFriction = friction;
240 return m_staticFriction;
249 m_dynamicFriction = friction;
258 return m_dynamicFriction;
267 m_linearDamping = damping;
276 return m_linearDamping;
296 return m_inverseMass;
313 Vector2f m_linearVelocity;
314 Vector2f m_acceleration;
321 float m_staticFriction;
322 float m_dynamicFriction;
323 float m_linearDamping;
330 #ifndef DOXYGEN_SHOULD_SKIP_THIS
void move(Vector2f offset)
Move the body.
void setLinearDamping(float damping)
Set the linear damping of the body.
Definition: PhysicsBody.h:266
bool collidesWith(const PhysicsBody &other, Penetration &p) const
Check if the body collides with another body.
void setPosition(Vector2f position)
Set the position of the body.
Vector2f getPosition() const
Get the position of the body.
Definition: PhysicsBody.h:87
Base class for all render targets (window, texture, ...)
Definition: RenderTarget.h:65
Dynamic bodies with finite mass.
Definition: PhysicsBody.h:41
PhysicsBody(const PhysicsGeometry &geometry, Type type=Dynamic)
Constructor.
A physics body.
Definition: PhysicsBody.h:34
void update(float dt)
Update the model's state.
void render(RenderTarget &target) const
Render the body.
Type
Type of body.
Definition: PhysicsBody.h:39
void applyLinearImpulse(Vector2f impulse)
Apply a linear impulse.
Vector2f getAcceleration() const
Get the acceleration of the body.
Definition: PhysicsBody.h:137
float getDynamicFriction() const
Get the dynamic friction coefficient of the body.
Definition: PhysicsBody.h:257
void setVelocityFromAngle()
Set the velocity direction from the angle of the body.
Type getType() const
Get the type of the body.
Definition: PhysicsBody.h:57
float getInverseMass() const
Get the inverse mass of the body.
Definition: PhysicsBody.h:295
The namespace for gf classes.
Definition: Action.h:34
float getLinearDamping() const
Get the linear damping of the body.
Definition: PhysicsBody.h:275
void setRestitution(float restitution)
Set the restitution of the body of the body.
Definition: PhysicsBody.h:212
float getRestitution() const
Get the restitution of the body of the body.
Definition: PhysicsBody.h:221
Data about the collision between two objects.
Definition: Collision.h:43
void setAngle(float angle)
Set the angle of the body.
Definition: PhysicsBody.h:164
float getAngle() const
Get the angle of the body.
Definition: PhysicsBody.h:155
void turn(float arc)
Change the angle of the body.
Definition: PhysicsBody.h:173
The geometry of a physics body.
Definition: PhysicsGeometry.h:45
void setDynamicFriction(float friction)
Set the dynamic friction coefficient of the body.
Definition: PhysicsBody.h:248
#define GF_API
Definition: Portability.h:35
const Transform & getTransform() const
Get the current transform.
void updateTransform()
Update the internal transform.
float getStaticFriction() const
Get the static friction coefficient of the body.
Definition: PhysicsBody.h:239
Vector2f getLinearVelocity() const
Get the linear velocity of the body.
Definition: PhysicsBody.h:110
void setStaticFriction(float friction)
Set the static friction coefficient of the body.
Definition: PhysicsBody.h:230
void applyForce(Vector2f force)
Apply a force.
void setDensity(float density)
Set the density of the body.
void setLinearVelocity(Vector2f velocity)
Set the linear velocity of the body.
Definition: PhysicsBody.h:119
Static body with infinite mass.
Definition: PhysicsBody.h:40