mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-11 22:54:34 +00:00
update bullet so it actually works
Moved the addSourceDirectory for physics/Bullet into the Engine/Source/CMakeLists.txt file that way it can actually appear where we expect it to in the solution explorer.
This commit is contained in:
parent
c7be48130a
commit
13fa178cf6
5986 changed files with 1811270 additions and 453803 deletions
|
|
@ -4,26 +4,26 @@
|
|||
See license in Gwen.h
|
||||
*/
|
||||
|
||||
|
||||
#include "Gwen/Anim.h"
|
||||
#include "Gwen/Utility.h"
|
||||
#include <math.h>
|
||||
#include <cmath>
|
||||
#include "Gwen/Utility.h"
|
||||
|
||||
using namespace Gwen;
|
||||
|
||||
#ifndef GWEN_NO_ANIMATION
|
||||
|
||||
static Gwen::Anim::Animation::List g_Animations;
|
||||
static Gwen::Anim::Animation::List g_Animations;
|
||||
static Gwen::Anim::Animation::ChildList g_AnimationsListed;
|
||||
|
||||
void Gwen::Anim::Add( Gwen::Controls::Base* control, Animation* animation )
|
||||
void Gwen::Anim::Add(Gwen::Controls::Base* control, Animation* animation)
|
||||
{
|
||||
animation->m_Control = control;
|
||||
|
||||
g_Animations[control].push_back( animation );
|
||||
g_Animations[control].push_back(animation);
|
||||
}
|
||||
|
||||
void Gwen::Anim::Cancel( Gwen::Controls::Base* control )
|
||||
void Gwen::Anim::Cancel(Gwen::Controls::Base* control)
|
||||
{
|
||||
/* cannot use std::list iterator with algoryhtmns based on pointers
|
||||
struct AnimDeletePredicate
|
||||
|
|
@ -46,14 +46,14 @@ void Gwen::Anim::Cancel( Gwen::Controls::Base* control )
|
|||
Gwen::Anim::Animation::List::iterator iAnimations;
|
||||
if ((iAnimations = g_Animations.find(control)) != g_Animations.end())
|
||||
{
|
||||
Gwen::Anim::Animation::ChildList &ChildAnimationsForControl = iAnimations->second;
|
||||
Gwen::Anim::Animation::ChildList& ChildAnimationsForControl = iAnimations->second;
|
||||
Gwen::Anim::Animation::ChildList::iterator iAnimationChild = ChildAnimationsForControl.begin();
|
||||
if (iAnimationChild != ChildAnimationsForControl.end())
|
||||
{
|
||||
do
|
||||
{
|
||||
delete (*iAnimationChild);
|
||||
}while(++iAnimationChild != ChildAnimationsForControl.end());
|
||||
} while (++iAnimationChild != ChildAnimationsForControl.end());
|
||||
}
|
||||
g_Animations.erase(iAnimations);
|
||||
}
|
||||
|
|
@ -63,10 +63,10 @@ void Gwen::Anim::Think()
|
|||
{
|
||||
Gwen::Anim::Animation::List::iterator it = g_Animations.begin();
|
||||
|
||||
if ( it != g_Animations.end() )
|
||||
if (it != g_Animations.end())
|
||||
{
|
||||
Gwen::Anim::Animation::ChildList::iterator itChild;
|
||||
|
||||
|
||||
Gwen::Anim::Animation* anim;
|
||||
|
||||
do
|
||||
|
|
@ -79,9 +79,9 @@ void Gwen::Anim::Think()
|
|||
|
||||
anim->Think();
|
||||
|
||||
if ( anim->Finished() )
|
||||
if (anim->Finished())
|
||||
{
|
||||
itChild = it->second.erase( itChild );
|
||||
itChild = it->second.erase(itChild);
|
||||
|
||||
delete anim;
|
||||
}
|
||||
|
|
@ -90,15 +90,14 @@ void Gwen::Anim::Think()
|
|||
++itChild;
|
||||
}
|
||||
|
||||
}while(itChild != it->second.end());
|
||||
} while (itChild != it->second.end());
|
||||
}
|
||||
|
||||
}while(++it != g_Animations.end());
|
||||
}
|
||||
|
||||
} while (++it != g_Animations.end());
|
||||
}
|
||||
}
|
||||
|
||||
Gwen::Anim::TimedAnimation::TimedAnimation( float fLength, float fDelay, float fEase )
|
||||
Gwen::Anim::TimedAnimation::TimedAnimation(float fLength, float fDelay, float fEase)
|
||||
{
|
||||
m_fStart = Platform::GetTimeInSeconds() + fDelay;
|
||||
m_fEnd = m_fStart + fLength;
|
||||
|
|
@ -109,29 +108,28 @@ Gwen::Anim::TimedAnimation::TimedAnimation( float fLength, float fDelay, float f
|
|||
|
||||
void Gwen::Anim::TimedAnimation::Think()
|
||||
{
|
||||
if ( m_bFinished ) return;
|
||||
if (m_bFinished) return;
|
||||
|
||||
float fCurrent = Platform::GetTimeInSeconds();
|
||||
float fSecondsIn = fCurrent - m_fStart;
|
||||
if ( fSecondsIn < 0.0f ) return;
|
||||
if (fSecondsIn < 0.0f) return;
|
||||
|
||||
if ( !m_bStarted )
|
||||
if (!m_bStarted)
|
||||
{
|
||||
m_bStarted = true;
|
||||
OnStart();
|
||||
}
|
||||
|
||||
float fDelta = fSecondsIn / ( m_fEnd - m_fStart );
|
||||
if ( fDelta < 0.0f ) fDelta = 0.0f;
|
||||
if ( fDelta > 1.0f ) fDelta = 1.0f;
|
||||
float fDelta = fSecondsIn / (m_fEnd - m_fStart);
|
||||
if (fDelta < 0.0f) fDelta = 0.0f;
|
||||
if (fDelta > 1.0f) fDelta = 1.0f;
|
||||
|
||||
Run( pow( fDelta, m_fEase ) );
|
||||
Run(std::pow(fDelta, m_fEase));
|
||||
|
||||
if ( fDelta == 1.0f )
|
||||
{
|
||||
m_bFinished = true;
|
||||
OnFinish();
|
||||
}
|
||||
if (fDelta == 1.0f) {
|
||||
m_bFinished = true;
|
||||
OnFinish();
|
||||
}
|
||||
}
|
||||
|
||||
bool Gwen::Anim::TimedAnimation::Finished()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue