Beispiel #1
0
CCAffineTransform CCNode::parentToNodeTransform(void)
{
	if ( m_bIsInverseDirty ) {
		m_tInverse = CCAffineTransformInvert(this->nodeToParentTransform());
		m_bIsInverseDirty = false;
	}

	return m_tInverse;
}
void TransformHelp::transformFromParent(Node &node, const Node &parentNode)
{
	nodeToMatrix(node, helpMatrix1);
	nodeToMatrix(parentNode, helpMatrix2);

	helpMatrix2 = CCAffineTransformInvert(helpMatrix2);
	helpMatrix1 = CCAffineTransformConcat(helpMatrix1, helpMatrix2);

	matrixToNode(helpMatrix1, node);
}
void TransformHelp::transformFromParentWithoutScale(Node &node, const Node &parentNode)
{

	helpParentNode.copy(&parentNode);
	helpParentNode.scaleX = 1;
	helpParentNode.scaleY = 1;

	nodeToMatrix(node, helpMatrix1);
	nodeToMatrix(helpParentNode, helpMatrix2);

	helpMatrix2 = CCAffineTransformInvert(helpMatrix2);
	helpMatrix1 = CCAffineTransformConcat(helpMatrix1, helpMatrix2);

	matrixToNode(helpMatrix1, node);
}
Beispiel #4
0
CCAffineTransform CCNode::worldToNodeTransform(void)
{
	return CCAffineTransformInvert(this->nodeToWorldTransform());
}