Пример #1
0
void GQuadTree::DrawFindNode(GNode* pNode)
{
	assert( pNode );

	G_POSITION t_Pos = m_pCamera->CheckPoitionOBBInPlane( &pNode->m_tBox );
	GetLodSubIndex(pNode);
	if( pNode->m_iDepth < m_iRenderDepth ) return;

	// 리프노드 일 경우는 완전히 제외되지 않았다면(걸쳐 있거나 완전 포함)추가한다.
	if( pNode->m_isLeaf &&  t_Pos != P_BACK )
	{
		m_DrawNodeList.push_back( pNode );
		VisibleObject(pNode);
		return;
	}
	// 완전히 포함되어 있으면 자식을 탐색하지 않고 노드를 추가한다.
	if( t_Pos == P_FRONT)
	{
		m_DrawNodeList.push_back( pNode );
		VisibleNode(pNode);
		return;
	}

	// 부모 노드가 걸쳐져 있는 경우에 해당 부모 노드의 오브젝트들을 체크한다.
	if( t_Pos == P_SPANNING )
	{
		VisibleObject(pNode);
	}

	for( int iNode = 0; iNode < pNode->m_ChildList.size(); iNode++ )
	{
		DrawFindNode( pNode->m_ChildList[iNode]);
	}					
}
Пример #2
0
Player::Player(float x, float y): VisibleObject(x, y)
{
	VisibleObject(x, y); // parent constructor

	float speed = 120;

	this->animation[STOPPED]       = new Animation("img/standing.png", 15, 16, 1);
	this->animation[STOPPED]->setTransparentRGBColor(255, 255, 255);

	this->animation[WALKING_RIGHT] = new Animation("img/walking-right.png", 15, 16, 2, speed);
	this->animation[WALKING_RIGHT]->setTransparentRGBColor(255, 255, 255);

	this->animation[WALKING_LEFT]  = new Animation("img/walking-left.png", 15, 16, 2, speed);
	this->animation[WALKING_LEFT]->setTransparentRGBColor(255, 255, 255);

	this->animation[JUMPING_RIGHT] = new Animation("img/jumping-right.png", 16, 16, 1);
	this->animation[JUMPING_RIGHT]->setTransparentRGBColor(255, 255, 255);

	this->animation[JUMPING_LEFT]  = new Animation("img/jumping-left.png", 16, 16, 1);
	this->animation[JUMPING_LEFT]->setTransparentRGBColor(255, 255, 255);

//	this->walking		= new Animation("img/apterus-andando.png", 446, 398, 12, speed);

    this->currentState = STOPPED;
	this->current      = this->animation[STOPPED];
	this->current->start();

	setPosition(x, y);
	this->velX = 0;
	this->velY = 0;
	this->isJumping = true;
}
Пример #3
0
void GQuadTree::VisibleNode( GNode* pNode )
{	
	assert( m_pCamera );
	if( pNode->m_iDepth < m_iRenderDepth ) return;
	
	if( m_pCamera->CheckOBBInPlane( &pNode->m_tBox ) )	
	{
		VisibleObject( pNode);
		for( int iNode = 0; iNode < pNode->m_ChildList.size(); iNode++ )
		{		
			VisibleNode( pNode->m_ChildList[iNode] );
		}	
	}
}