X-Git-Url: http://gitweb.pgornicz.com/gitweb.cgi?a=blobdiff_plain;f=src%2FEffects%2FGravity.cpp;h=5c654519f09e55138e02b7718b17cad47d080c04;hb=3d1f081343dc603a3292538eeb9bd794b255deb6;hp=3d2cd0a5f8b483ca09aba8baef12bfe773e92d8c;hpb=cd8389935add9981ac03f058994a185e2208a32f;p=physics.git diff --git a/src/Effects/Gravity.cpp b/src/Effects/Gravity.cpp index 3d2cd0a..5c65451 100644 --- a/src/Effects/Gravity.cpp +++ b/src/Effects/Gravity.cpp @@ -1,13 +1,42 @@ +/* + * Copyright (C) 2008 Patrik Gornicz, Gornicz_P (at) hotmail (dot) com. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include "Gravity.h" -/// ***** Header Class ***** -Vector2 Gravity::positionAfter(const Vector2&, float) +#include "Entities/PhysicsEntity.h" + +/// ***** Private Variables ***** + +float forceGravity = 0.001; + +/// ***** Constructors/Destructors ***** + +Gravity::Gravity() { } -Vector2 Gravity::velocityAfter(const Vector2&, float) +Gravity::~Gravity() { } -#endif // GRAVITY_H +/// ***** Public Class Methods ***** + +Vector2 Gravity::forceDelta(const PhysicsEntity* e, float) const +{ + return Vector2(0, e->mass * forceGravity); +}