本文整理汇总了C++中Projectile::calculateScale方法的典型用法代码示例。如果您正苦于以下问题:C++ Projectile::calculateScale方法的具体用法?C++ Projectile::calculateScale怎么用?C++ Projectile::calculateScale使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Projectile
的用法示例。
在下文中一共展示了Projectile::calculateScale方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
void MASOSApp::update()
{
if (mAngle != oldAngle)
{
scale = mProjectileUnderTest.calculateScale(mInitialVelocity, mAngle, mTerminalVelocity, getWindowCenter().x, getWindowCenter().y);
}
oldAngle = mAngle;
if (scale != oldScale)
{
scale = mProjectileUnderTest.calculateScale(mInitialVelocity, mAngle, mTerminalVelocity, getWindowCenter().x, getWindowCenter().y);
}
oldScale = scale;
if (mTerminalVelocity != oldTerminalVelocity)
{
scale = mProjectileUnderTest.calculateScale(mInitialVelocity, mAngle, mTerminalVelocity, getWindowCenter().x, getWindowCenter().y);
}
oldTerminalVelocity = mTerminalVelocity;
if (mInitialVelocity != oldInitialVelocity)
{
scale = mProjectileUnderTest.calculateScale(mInitialVelocity, mAngle, mTerminalVelocity, getWindowCenter().x, getWindowCenter().y);
}
oldInitialVelocity =mInitialVelocity;
float tmp = mProjectileUnderTest.mPosition.y;
mProjectileUnderTest.update(mInitialVelocity, mAngle, mCurrentTime, mTerminalVelocity);
if (mProjectileUnderTest.mPosition.y > 0)
{
mProjectileUnderTest.mPosition.y = 0;
mIsPlaying = false;
}
if (tmp >= 0 && mProjectileUnderTest.mPosition.y >= 0)
{
mProjectileUnderTest.mPosition.y = 0;
mIsPlaying = false;
mCurrentTime = oldTime;
}
if (mProjectileUnderTest.mPosition.x < 0)
{
mProjectileUnderTest.mPosition.x = 0.f;
}
oldTime = mCurrentTime;
currX = mProjectileUnderTest.mPosition.x;
currY = -(mProjectileUnderTest.mPosition.y);
if (currY == -0) currY = 0;
mParams->setPosition(ivec2(0,0));
}
示例2: buttonStart
void MASOSApp::buttonStart()
{
scale = mProjectileUnderTest.calculateScale(mInitialVelocity, mAngle, mTerminalVelocity, getWindowCenter().x, getWindowCenter().y);
oldScale = scale;
mIsPlaying = true;
}