projects
/
physics.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
renamed a few more members and changed some switch statements
[physics.git]
/
src
/
Entities
/
PhysicsEntity.cpp
diff --git
a/src/Entities/PhysicsEntity.cpp
b/src/Entities/PhysicsEntity.cpp
index
b43874b
..
752d5eb
100644
(file)
--- a/
src/Entities/PhysicsEntity.cpp
+++ b/
src/Entities/PhysicsEntity.cpp
@@
-40,16
+40,16
@@
PhysicsEntity::~PhysicsEntity()
void PhysicsEntity::update(float time_step)
{
void PhysicsEntity::update(float time_step)
{
- position = positionAt(time_step);
- velocity = velocityAt(time_step);
+
m_
position = positionAt(time_step);
+
m_
velocity = velocityAt(time_step);
m_force *= 0;
}
Vector2 PhysicsEntity::positionAt(float time_step) const
{
m_force *= 0;
}
Vector2 PhysicsEntity::positionAt(float time_step) const
{
- Vector2 newPosition = position;
- Vector2 newVelocity = velocity;
+ Vector2 newPosition =
m_
position;
+ Vector2 newVelocity =
m_
velocity;
Vector2 newForce = m_force;
newPosition += effect::positionDelta(this, time_step);
Vector2 newForce = m_force;
newPosition += effect::positionDelta(this, time_step);
@@
-62,7
+62,7
@@
Vector2 PhysicsEntity::positionAt(float time_step) const
Vector2 PhysicsEntity::velocityAt(float time_step) const
{
Vector2 newForce = m_force;
Vector2 PhysicsEntity::velocityAt(float time_step) const
{
Vector2 newForce = m_force;
- Vector2 newVelocity = velocity;
+ Vector2 newVelocity =
m_
velocity;
newForce += effect::forceDelta(this, time_step);
newVelocity += effect::velocityDelta(this, time_step);
newForce += effect::forceDelta(this, time_step);
newVelocity += effect::velocityDelta(this, time_step);
@@
-72,7
+72,7
@@
Vector2 PhysicsEntity::velocityAt(float time_step) const
void PhysicsEntity::applyForce(const Vector2& force)
{
void PhysicsEntity::applyForce(const Vector2& force)
{
- applyForce(force, position);
+ applyForce(force,
m_
position);
}
void PhysicsEntity::applyForce(const Vector2& force, const Vector2& /*at*/)
{
}
void PhysicsEntity::applyForce(const Vector2& force, const Vector2& /*at*/)
{
@@
-81,14
+81,14
@@
void PhysicsEntity::applyForce(const Vector2& force, const Vector2& /*at*/)
void PhysicsEntity::applyImpulse(const Vector2& impulse)
{
void PhysicsEntity::applyImpulse(const Vector2& impulse)
{
- applyImpulse(impulse, position);
+ applyImpulse(impulse,
m_
position);
}
void PhysicsEntity::applyImpulse(const Vector2& impulse, const Vector2& /*at*/)
{
}
void PhysicsEntity::applyImpulse(const Vector2& impulse, const Vector2& /*at*/)
{
- velocity += impulse;
+
m_
velocity += impulse;
}
void PhysicsEntity::applyNudge(const Vector2& vecPush)
{
}
void PhysicsEntity::applyNudge(const Vector2& vecPush)
{
- position += vecPush;
+
m_
position += vecPush;
}
}