void RenderWindowOSD::RenderLayers()
		{
			SME::MiscGunk::ScopedSetter<bool> Sentry(RenderingLayers, true);
			for (auto Itr : AttachedLayers)
			{
				if (Itr->IsEnabled())
					Itr->Draw(this, Pipeline);
			}
		}
示例#2
0
/* DJ_ee differential of the Stress Function 
   See declaration in Duda & Hart
   the matrix M is a (pointcount*DIM)x1 matrix
----------------------------------------------*/
void DJ_ee(matrix M,matrix D)
{
   	int i,j,k,q;
	double tot_delta,stat_coeff,Dij();
	double coeff_i,d_kj;
	matrix Y_k=NULL,Y_j=NULL,vec_kj=NULL,diff_k=NULL;
	 
	
	tot_delta = 0.0;
   	for (i=1; i<=pointcount; i++) 
		for (j=1 ; j<i; j++)  
			if (delta[i][j] != LARGE_COEFF)  
				tot_delta += delta[i][j]*delta[i][j];
	stat_coeff = 2.0/tot_delta;

	for (k=1; k<=pointcount; k++)  {

		Y_k = mtx_ver_cut(M,Sentry(k,Dim),Eentry(k,Dim));
		alloc_mtx(&diff_k,Dim,1);

		for (j=1; j<=pointcount; j++)  {
			if ((j!=k) && (delta[k][j] != LARGE_COEFF) ){
				d_kj = Dij(M,k,j);
				coeff_i = (d_kj - delta[k][j])/d_kj;
				Y_j = mtx_ver_cut(M,Sentry(j,Dim),Eentry(j,Dim));
				vec_kj = sub_mtx(Y_k,Y_j);
				mul_scalar_in_mtx(vec_kj,coeff_i);
				add_in_mtx(diff_k,vec_kj,1,1);

				free_all_mtx(2,&Y_j,&vec_kj);
			}
		}
		mul_scalar_in_mtx(diff_k,stat_coeff);
		for (q=1; q<=Dim; q++)  
			VecEntry(D,Dim,k,q) = diff_k[q][1] ;
		free_all_mtx(2,&Y_k,&diff_k);
	}
}
示例#3
0
void ActorEquipmentOverrider::ApplyOverride(int BodyPart, ActorBodyModelData * ModelData, TESForm* ModelSource)
{
	if (HandlerTable.size() == 0)
		return;
	else if (GetEnabled() == false)
		return;

	SME_ASSERT(OverrideInProgress == false);
	SME::MiscGunk::ScopedSetter<bool> Sentry(OverrideInProgress, true);

	TESObjectREFR* CurrentRef = ModelData->parentRef;
	SME_ASSERT(CurrentRef && CurrentRef->baseForm && CurrentRef->baseForm->typeID == kFormType_NPC);
	TESNPC* CurrentNPC = OBLIVION_CAST(CurrentRef->baseForm, TESForm, TESNPC);
	TESBipedModelForm* CurrentBiped = OBLIVION_CAST(ModelSource, TESForm, TESBipedModelForm);
	SME_ASSERT(CurrentBiped);

	ActorBodyModelData::BodyPartData* CurrentBodyPart = NULL;
	if (BodyPart == -1
		|| (((CurrentBiped->partMask & (1 << ActorBodyModelData::kBodyPart_LeftRing)) == false)				// need to check for rings additionally as TESNPC::InitWorn passes those as the partID
		&& ((CurrentBiped->partMask & (1 << ActorBodyModelData::kBodyPart_RightRing)) == false)))
	{
		// pick the first part in the part mask, like the engine does
		UInt32 PartID = ActorBodyModelData::kBodyPart_Head;
		while ((PartID == ActorBodyModelData::kBodyPart_Hair &&	(CurrentBiped->partMask & (1 << ActorBodyModelData::kBodyPart_Head)) == true)
			   || (CurrentBiped->partMask & (1 << PartID)) == false)
		{
			PartID++;
			if (PartID >= ActorBodyModelData::kBodyPart__MAX)
			{
				// the biped item has no slots, so bugger off
				return;
			}
		}

		BodyPart = PartID;
	}

	SME_ASSERT(BodyPart >= ActorBodyModelData::kBodyPart_Head && BodyPart < ActorBodyModelData::kBodyPart__MAX);
	CurrentBodyPart = &ModelData->bodyParts[BodyPart];

	_MESSAGE("Attempting to override equipment model for NPC Ref %s (%08X) | Body Part = %d, Source Item = %s (%08X)",
			 InstanceAbstraction::GetFormName(CurrentNPC), CurrentRef->refID, BodyPart, InstanceAbstraction::GetFormName(ModelSource), ModelSource->refID);
	gLog.Indent();

	OverrideHandler::OverrideResultListT Overrides;
	for each (auto Itr in HandlerTable)
	{
		OverrideHandler& ThisHandler = Itr.second;
		ThisHandler.HandleEquipment(ModelData, ModelSource, CurrentRef, CurrentNPC, Overrides);
	}