⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 acmcminl.cpp

📁 空战游戏flacon源码
💻 CPP
字号:
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//
// ACMICamera inlines.

inline int ACMICamera::Type() const
{
	return _type;
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

inline void ACMICamera::SetRotateType(int type)
{
//!	_rotType = _type;
	_rotType = type;
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

inline void ACMICamera::SetAction(int currentAction)
{
	_action = currentAction;
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

inline void ACMICamera::SetAction(int currentAction, float az, float el)
{
	_action = currentAction;
	SetAzDir(az);
	SetElDir(el);
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

inline int ACMICamera::Action() const
{
	return _action;
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

inline void ACMICamera::ToggleTracking()
{
	/*
	if(_tracking >= NUM_TRACKING_CAMS)
	{
		_tracking = NO_TRACKING;
	}
	else
	{
		_tracking++;
	}
	*/
	_tracking ^= 1;
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

inline void ACMICamera::SetTracking(int n)
{
	_tracking = n;
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

inline int ACMICamera::Tracking() const
{
	return _tracking;
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

inline void ACMICamera::SetPosition(const Tpoint& pos)
{
	_pos.x = pos.x;
	_pos.y = pos.y;
	_pos.z = pos.z;
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

inline void ACMICamera::GetPosition(Tpoint& pos) const
{
	pos.x = _pos.x;
	pos.y = _pos.y;
	pos.z = _pos.z;
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

inline const Tpoint &ACMICamera::Position() const
{
	return _pos;
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

inline void ACMICamera::SetRotation(const Trotation &rot)
{
	memcpy(const_cast<Trotation *>(&_rot), const_cast<Trotation *>(&rot), sizeof(Trotation));
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

inline void ACMICamera::GetRotation(Trotation &rot) const
{
	memcpy(const_cast<Trotation *>(&rot), const_cast<Trotation *>(&_rot), sizeof(Trotation));
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

inline const Trotation &ACMICamera::Rotation() const
{
	return _rot;
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

inline void ACMICamera::SetWorldPosition(const Tpoint &pos)
{
	_worldPos.x = pos.x;
	_worldPos.y = pos.y;
	_worldPos.z = pos.z;
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

inline void ACMICamera::Translate(float x, float y, float z, Tpoint* camView)
{
	camView->x = x;
	camView->y = y;
	camView->z = z;
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

inline void ACMICamera::SetElDir(float diff)
{
	_elDir = diff;
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

inline void ACMICamera::SetAzDir(float diff)
{
	_azDir = diff;
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

inline void ACMICamera::SetObjectEl(float diff)
{
	_objectEl = diff;
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

inline void ACMICamera::SetObjectAz(float diff)
{
	_objectAz = diff;
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

inline void ACMICamera::SetObjectRoll(float diff)
{
	_objectRoll = diff;
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

inline void ACMICamera::SetPannerAz()
{
	_pannerAz = _objectAz;
	_pannerEl = _objectEl;
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

inline void ACMICamera::SetLocalEl(float diff)
{
	_localEl = diff;
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

inline void ACMICamera::SetLocalAz(float diff)
{
	_localAz = diff;
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

inline float ACMICamera::El() const
{
	return(_objectEl + _localEl);
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

inline float ACMICamera::Az() const
{
	return(_objectAz + _localAz);
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

inline void ACMICamera::SetSlewRate(float diff)
{
	_slewRate = diff;
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////








⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -