Example #1
0
void CEditorEngine::toolsSetType(const EEditorTool &type, int centralPointX, int centralPointY)
{
	CNode *node;

	if(m_selectedNodes.size() > 0)
	{
		node = m_selectedNodes.front();

		if(m_tool == EET_NONE)
		{
			m_tempPosition = node->getPosition();
			m_tempRotation = node->getRotation();
			m_centralPoint = glm::ivec2(centralPointX, centralPointY);
			m_translatePlane.fromOrigin(m_tempPosition, m_currentEditorScene->getActiveCamera()->getForwardVector());
		}
		else
		{
			node->setPosition(m_tempPosition);
			node->setRotation(m_tempRotation);
		}
	}

	m_tool = type;
}