Skip to content

Commit

Permalink
Acceleration is virtual
Browse files Browse the repository at this point in the history
  • Loading branch information
kthakore committed Apr 4, 2011
1 parent 3143656 commit 3fa7e80
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
11 changes: 11 additions & 0 deletions BallController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,17 @@ void BallController::update()

}

Vector BallController::acceleration( const State &state, float t)
{
Vector change( 0, -0.000098, 0);
printf("foo\n");
//Apply Wind to X,Y,Z
change = change + this->wind ;
//Apply Power and Angle to X,Y,Z
return change;
}


void BallController::render( Vector position)
{

Expand Down
4 changes: 4 additions & 0 deletions BallController.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ class BallController : PhysicsManager
//reset the ball
void reset();

protected:


Vector acceleration( const State &state, float t);


private:
Expand Down
2 changes: 1 addition & 1 deletion PhysicsManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class PhysicsManager
State current; State previous;

//Will be overloaded by child class
Vector acceleration( const State &state, float t);
virtual Vector acceleration( const State &state, float t);



Expand Down

0 comments on commit 3fa7e80

Please sign in to comment.