Exemplo n.º 1
0
// move to an object over time
void CCamera::MoveTo(CObject *object)
{
	CVector v = CVector(object->position - position);

	initPosition = position;
	finalPosition = object->position;

	acceleration = -position * 0.25f;

	UpdateMoveTo();
}
Exemplo n.º 2
0
LTBOOL CAISharkStrategyFollowPath::Update()
{
	if ( !super::Update() )
	{
        return LTFALSE;
	}

	_ASSERT(m_eState == eStateSet);

	if ( m_pPath->HasRemainingWaypoints() )
	{
		CAIPathWaypoint* pWaypoint = m_pPath->GetCurrentWaypoint();

		switch ( pWaypoint->GetInstruction() )
		{
			case CAIPathWaypoint::eInstructionMoveTo:
			{
				UpdateMoveTo(pWaypoint);
			}
			break;

			case CAIPathWaypoint::eInstructionOpenDoors:
			{
				UpdateOpenDoors(pWaypoint);
			}
			break;

			default:
			{
                g_pLTServer->CPrint("CAISharkStrategyFollowPath::Update - unrecognized waypoint instruction");
				_ASSERT(!"CAISharkStrategyFollowPath::Update - unrecognized waypoint instruction");
                return LTFALSE;
			}
			break;
		}
	}

	if ( !m_pPath->HasRemainingWaypoints() )
	{
		m_eState = eStateDone;
	}

    return LTTRUE;
}