当前位置: 首页>>代码示例>>C++>>正文


C++ FPoint::GetAngle方法代码示例

本文整理汇总了C++中FPoint::GetAngle方法的典型用法代码示例。如果您正苦于以下问题:C++ FPoint::GetAngle方法的具体用法?C++ FPoint::GetAngle怎么用?C++ FPoint::GetAngle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FPoint的用法示例。


在下文中一共展示了FPoint::GetAngle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DrawAbsolute

	void ReceiverEffect::DrawAbsolute()
	{
		float alpha = 1.f;
		FPoint pos;
		FPoint scale(1.0f, 1.f);
        float angle = 0.0f;
        
		if(_state == RE_JUMP)
		{
			float t = _time;
			pos = GameSettings::ToScreenPos(_posStartOnField);
			pos += math::lerp(FPoint(0.f, 0.f), JUMP_POS, math::ease(t, 0.9f, 0.1f));
            
			scale = math::lerp(FPoint(1.f, 1.f), FPoint(_jumpScale, _jumpScale), t);
		}
		else if(_state == RE_STAY)
		{
			scale = FPoint(_jumpScale, _jumpScale);
			pos = GameSettings::ToScreenPos(_posStartOnField + JUMP_POS);
		}
		else if(_state == RE_FLY)
		{
			float t = math::ease(math::clamp(0.f, 1.f, (_time-0.2f)/0.8f), 0.4f, 0.1f);
			//float t = math::clamp(0.f, 1.f, (_time-0.2f)/0.8f);
            
            
			pos = _spline.getGlobalFrame(t);

			//pos.y += 150.f*math::clamp(0.f, 1.f, _time/0.5f)*math::clamp(0.f, 1.f, 1 - (_time - 0.4f)/0.6f);
            
			scale = math::lerp(FPoint(_jumpScale, _jumpScale), _finishScaleCrystal, t);

			scale.y *= 1 - 0.3f*sinf(math::clamp(0.f, 1.f, _time/0.4f)*math::PI*1.5f);
			
			//angle = _angleSpline.getGlobalFrame(t);
			//angle = math::lerp(0.f, angle, t/0.3f);
			//angle = math::lerp(angle, 0.f, (t - 0.7f)/0.3f);
			FPoint dir = _spline.getGlobalFrame(1.f) - pos;
			if(dir.Length() > 0)
			{
				angle = (dir.GetAngle()*180.f/math::PI - 90.f)*math::clamp(0.f, 1.f, (_time- 0.f)/0.2f);
				_lastAngle = angle;
			}	
			alpha = math::clamp(0.f, 1.f, 1 - (t - 0.95f)/0.05f);
		}
		else if(_state == RE_HIDE)
		{
			pos = _spline.getGlobalFrame(1.f);
			scale = _finishScaleCrystal;
			scale.y *= 1.3f;
			angle = _lastAngle;
			alpha = 0.f; // math::clamp(0.f, 1.f, math::cos(math::clamp(0.f, 1.f, _time*4.f)*math::PI*0.5f));
		}
		//else if(_state == RE_WAIT)
		//{
		//	pos = _spline.getGlobalFrame(1.f);
		//	alpha = math::clamp(0.f, 1.f, math::cos(_time*math::PI*0.5f));
		//	scale = _finishScaleCrystal;
		//	angle = _lastAngle;
		//}
		else if(_state == RE_FINISH)
		{
			pos = _spline.getGlobalFrame(1.f);
			alpha = 0.f;
			scale = _finishScaleCrystal;
			scale.y *= 1.3f;
			angle = _lastAngle;
		}
		if(_flyEffect)
		{
			_flyEffect->SetPos(pos);
		}
		_effCont.Draw();


		Render::device.PushMatrix();
		Render::device.MatrixTranslate(pos);

		Render::device.MatrixTranslate(-CRYSTAL_POS_ANIM_ON_SQUARE + CRYSTAL_SCALE_CENTER);
        Render::device.MatrixRotate(math::Vector3::UnitZ, angle);
		Render::device.MatrixTranslate(CRYSTAL_POS_ANIM_ON_SQUARE - CRYSTAL_SCALE_CENTER);

		Render::device.PushMatrix();
		Render::device.MatrixScale(scale.x, scale.y, 1.0f);	

		_effContInner.Draw();

		Render::BeginAlphaMul(alpha);

		Render::device.MatrixTranslate(-CRYSTAL_POS_ANIM_ON_SQUARE);
		_crystalAnim->Draw();

		Render::EndAlphaMul();

		Render::device.PopMatrix();
		Render::device.PopMatrix();
	}
开发者ID:code4funnn,项目名称:4-Elements-Test,代码行数:97,代码来源:ReceiverEffects.cpp


注:本文中的FPoint::GetAngle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。