Merge branch 'Physics' of https://github.com/dean11/Danbias into GameLogic

This commit is contained in:
lindaandersson 2014-01-21 10:05:03 +01:00
commit a1d98b9357
1 changed files with 2 additions and 1 deletions

View File

@ -159,11 +159,12 @@ void API_Impl::Update()
{ /** @todo TODO: Update is a temporary solution .*/ { /** @todo TODO: Update is a temporary solution .*/
::std::vector<ICustomBody*> updateList; ::std::vector<ICustomBody*> updateList;
auto proto = this->worldScene.Sample( Universe(), updateList ).begin(); auto proto = this->worldScene.Sample( Universe(), updateList ).begin();
ICustomBody::State state; (*proto)->GetState( state ); ICustomBody::State state;
for( ; proto != updateList.end(); ++proto ) for( ; proto != updateList.end(); ++proto )
{ {
// Step 1: Apply Gravity // Step 1: Apply Gravity
Float4 gravityImpulse = Float4::null; Float4 gravityImpulse = Float4::null;
(*proto)->GetState( state );
for( ::std::vector<Gravity>::size_type i = 0; i < this->gravity.size(); ++i ) for( ::std::vector<Gravity>::size_type i = 0; i < this->gravity.size(); ++i )
{ {
switch( this->gravity[i].gravityType ) switch( this->gravity[i].gravityType )