1 #ifndef GF_PHYSICS_BODY_H 2 #define GF_PHYSICS_BODY_H 15 #ifndef DOXYGEN_SHOULD_SKIP_THIS 106 void move(Vector2f offset);
114 return m_linearVelocity;
123 m_linearVelocity = velocity;
141 return m_acceleration;
216 m_restitution = restitution;
225 return m_restitution;
234 m_staticFriction = friction;
243 return m_staticFriction;
252 m_dynamicFriction = friction;
261 return m_dynamicFriction;
270 m_linearDamping = damping;
279 return m_linearDamping;
299 return m_inverseMass;
316 Vector2f m_linearVelocity;
317 Vector2f m_acceleration;
324 float m_staticFriction;
325 float m_dynamicFriction;
326 float m_linearDamping;
333 #ifndef DOXYGEN_SHOULD_SKIP_THIS Vector2f getLinearVelocity() const
Get the linear velocity of the body.
Definition: PhysicsBody.h:113
void move(Vector2f offset)
Move the body.
void setLinearDamping(float damping)
Set the linear damping of the body.
Definition: PhysicsBody.h:269
void setPosition(Vector2f position)
Set the position of the body.
float getInverseMass() const
Get the inverse mass of the body.
Definition: PhysicsBody.h:298
Base class for all render targets (window, texture, ...)
Definition: RenderTarget.h:66
Type getType() const
Get the type of the body.
Definition: PhysicsBody.h:59
Vector2f getAcceleration() const
Get the acceleration of the body.
Definition: PhysicsBody.h:140
PhysicsBody(const PhysicsGeometry &geometry, Type type=Dynamic)
Constructor.
Define the states used for drawing to a RenderTarget.
Definition: RenderStates.h:82
void render(RenderTarget &target, const RenderStates &states) const
Render the body.
A physics body.
Definition: PhysicsBody.h:36
float getAngle() const
Get the angle of the body.
Definition: PhysicsBody.h:158
Type
Type of body.
Definition: PhysicsBody.h:41
bool collidesWith(const PhysicsBody &other, Penetration &p) const
Check if the body collides with another body.
void applyLinearImpulse(Vector2f impulse)
Apply a linear impulse.
float getDynamicFriction() const
Get the dynamic friction coefficient of the body.
Definition: PhysicsBody.h:260
float getLinearDamping() const
Get the linear damping of the body.
Definition: PhysicsBody.h:278
void setVelocityFromAngle()
Set the velocity direction from the angle of the body.
Static body with infinite mass.
Definition: PhysicsBody.h:42
The namespace for gf classes.
Definition: Action.h:34
float getStaticFriction() const
Get the static friction coefficient of the body.
Definition: PhysicsBody.h:242
void setRestitution(float restitution)
Set the restitution of the body of the body.
Definition: PhysicsBody.h:215
const Transform & getTransform() const
Get the current transform.
Vector2f getPosition() const
Get the position of the body.
Definition: PhysicsBody.h:90
Data about the collision between two objects.
Definition: Collision.h:43
void setAngle(float angle)
Set the angle of the body.
Definition: PhysicsBody.h:167
void turn(float arc)
Change the angle of the body.
Definition: PhysicsBody.h:176
The geometry of a physics body.
Definition: PhysicsGeometry.h:46
void setDynamicFriction(float friction)
Set the dynamic friction coefficient of the body.
Definition: PhysicsBody.h:251
float getRestitution() const
Get the restitution of the body of the body.
Definition: PhysicsBody.h:224
Dynamic bodies with finite mass.
Definition: PhysicsBody.h:43
#define GF_API
Definition: Portability.h:35
void updateTransform()
Update the internal transform.
void step(float dt)
Update the model's state.
void setStaticFriction(float friction)
Set the static friction coefficient of the body.
Definition: PhysicsBody.h:233
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:122