예제 #1
0
파일: CinemaPath.cpp 프로젝트: yuy168/0ad
CCinemaPath::CCinemaPath(const CCinemaData& data, const TNSpline& spline)
	: CCinemaData(data), TNSpline(spline), m_TimeElapsed(0.f)
{ 
	m_TimeElapsed = 0;
	BuildSpline();

	//Set distortion mode and style
	switch(data.m_Mode)
	{
	case CCinemaPath::EM_IN:
		DistModePtr = &CCinemaPath::EaseIn;
		break;
	case CCinemaPath::EM_OUT:
		DistModePtr = &CCinemaPath::EaseOut;
		break;
	case CCinemaPath::EM_INOUT:
		DistModePtr = &CCinemaPath::EaseInOut;
		break;
	case CCinemaPath::EM_OUTIN:
		DistModePtr = &CCinemaPath::EaseOutIn;
		break;
	default:
		debug_printf("Cinematic mode not found for %d\n", data.m_Mode);
		break;
	}

	switch (data.m_Style)
	{
	case CCinemaPath::ES_DEFAULT:
		DistStylePtr = &CCinemaPath::EaseDefault;
		break;
	case CCinemaPath::ES_GROWTH:
		DistStylePtr = &CCinemaPath::EaseGrowth;
		break;
	case CCinemaPath::ES_EXPO:
		DistStylePtr = &CCinemaPath::EaseExpo;
		break;
	case CCinemaPath::ES_CIRCLE:
		DistStylePtr = &CCinemaPath::EaseCircle;
		break;
	case CCinemaPath::ES_SINE:
		DistStylePtr = &CCinemaPath::EaseSine;
		break;
	default:
		debug_printf("Cinematic mode not found for %d\n", data.m_Style);
		break;
	}
	//UpdateDuration();

}
예제 #2
0
CCinemaPath::CCinemaPath(const CCinemaData& data, const TNSpline& spline, const TNSpline& targetSpline)
	: CCinemaData(data), TNSpline(spline), m_TargetSpline(targetSpline), m_TimeElapsed(0.f)
{
	m_TimeElapsed = 0;
	BuildSpline();

	if (m_Orientation == L"target")
	{
		m_LookAtTarget = true;
		ENSURE(!m_TargetSpline.GetAllNodes().empty());
	}

	// Set distortion mode and style
	if (data.m_Mode == L"ease_in")
		DistModePtr = &CCinemaPath::EaseIn;
	else if (data.m_Mode == L"ease_out")
		DistModePtr = &CCinemaPath::EaseOut;
	else if (data.m_Mode == L"ease_inout")
		DistModePtr = &CCinemaPath::EaseInOut;
	else if (data.m_Mode == L"ease_outin")
		DistModePtr = &CCinemaPath::EaseOutIn;
	else
	{
		LOGWARNING("Cinematic mode not found for '%s'", data.m_Mode.ToUTF8().c_str());
		DistModePtr = &CCinemaPath::EaseInOut;
	}

	if (data.m_Style == L"default")
		DistStylePtr = &CCinemaPath::EaseDefault;
	else if (data.m_Style == L"growth")
		DistStylePtr = &CCinemaPath::EaseGrowth;
	else if (data.m_Style == L"expo")
		DistStylePtr = &CCinemaPath::EaseExpo;
	else if (data.m_Style == L"circle")
		DistStylePtr = &CCinemaPath::EaseCircle;
	else if (data.m_Style == L"sine")
		DistStylePtr = &CCinemaPath::EaseSine;
	else
	{
		LOGWARNING("Cinematic style not found for '%s'", data.m_Style.ToUTF8().c_str());
		DistStylePtr = &CCinemaPath::EaseDefault;
	}
}