コード例 #1
0
ファイル: CC3MeshNode.cpp プロジェクト: ClAndHHL/cocos3d-x
/**
 * Template method disables depth testing and/or writing to the depth buffer if the
 * shouldDisableDepthTest and shouldDisableDepthMask property is set to YES, respectively,
 * and set the depth function.
 */
void CC3MeshNode::configureDepthTesting( CC3NodeDrawingVisitor* visitor )
{
	CC3OpenGL* gl = visitor->getGL();
	gl->enableDepthTest( !_shouldDisableDepthTest );
	gl->setDepthMask( !_shouldDisableDepthMask );
	gl->setDepthFunc( _depthFunction );
}
コード例 #2
0
/**
 * During normal drawing, establish 2D drawing environment.
 * Don't configure anything if painting for node picking.
 */
void CC3Billboard::applyMaterialWithVisitor( CC3NodeDrawingVisitor* visitor )
{
	super::applyMaterialWithVisitor( visitor );
	if (visitor->shouldDecorateNode()) 
	{
		CC3OpenGL* gl = visitor->getGL();
		gl->alignFor2DDrawingWithVisitor( visitor );
		gl->setDepthMask( !m_shouldDisableDepthMask );
	}
}