예제 #1
0
파일: Screen.cpp 프로젝트: fathat/game-src
void Screen3D::DrawAlphaPrimitive( VertexBuffer* VB, Position& camera, Position& CentralLocation, IndexBuffer* IB  )
{
	

	RenderBlock block;
	block.VB = VB;
	block.IB = IB;

	block.m = (CentralLocation.GetMatrix()).Mat ;

	

	Vector3D DistVector;
	DistVector.x = camera.x - CentralLocation.x;
	DistVector.y = camera.y - CentralLocation.y;
	DistVector.z = camera.z - CentralLocation.z;

	block.DistFromCamera = DistVector.Mag();
		
	//sort it in now
	
	if(DrawList.size())
	{
		std::list<RenderBlock>::iterator i;
		i = DrawList.begin();
		bool Inserted=false;

		while(!Inserted )
		{
			if(block.DistFromCamera >= (*i).DistFromCamera )
			{
				DrawList.insert(i, block);
				Inserted = true;
			}
			else if(i == DrawList.end())
			{
				DrawList.push_back(block);
				Inserted = true;
			}
			else
				++i;
	
			
		}


	}
	else
	{
		DrawList.push_back(block);
	}

}
예제 #2
0
void Character::Draw( Screen3D& Screen, MeshManager& MM, Camera& Viewer, GameTimer& Timer )
{
	//set the transformation
	Position DrawLocation;
	DrawLocation = Location;
	DrawLocation.Pitch = 0;
	
	MeshA.Draw( Screen, DrawLocation.GetMatrix() );


	for(int i=0; i<EquipmentList.size(); i++)
	{
		if(EquipmentList[i])
			EquipmentList[i]->Draw( Screen, MM, Viewer, Timer );

	}

}