Example #1
0
void CKinematics::Spawn			()
{
	inherited::Spawn			();
	// bones
	for (u32 i=0; i<bones->size(); i++)
		bone_instances[i].construct();
	Update_Callback				= NULL;
	CalculateBones_Invalidate	();
	// wallmarks
	ClearWallmarks				();
	Visibility_Invalidate		();
}
Example #2
0
void CKinematics::LL_SetBonesVisible(u64 mask)
{
	visimask.assign			(0);	
	for (u32 b=0; b<bones->size(); b++){
    	u64 bm				= u64(1)<<b;
    	if (mask&bm){
        	visimask.set	(bm,TRUE);
        }else{
	    	Fmatrix& A		= bone_instances[b].mTransform;
	    	Fmatrix& B		= bone_instances[b].mRenderTransform;
        	A.scale			(0.f,0.f,0.f);
	        B.mul_43		(A,(*bones)[b]->m2b_transform);
        }
	}
	CalculateBones_Invalidate		();
	Visibility_Invalidate			();
}
Example #3
0
void CKinematics::LL_SetBoneVisible(u16 bone_id, BOOL val, BOOL bRecursive)
{
	VERIFY				(bone_id<LL_BoneCount());      
    u64 mask 			= u64(1)<<bone_id;
    visimask.set		(mask,val);
	if (!visimask.is(mask)){
        bone_instances[bone_id].mTransform.scale(0.f,0.f,0.f);
	}else{
		CalculateBones_Invalidate	();
	}
	bone_instances[bone_id].mRenderTransform.mul_43(bone_instances[bone_id].mTransform,(*bones)[bone_id]->m2b_transform);
    if (bRecursive)		{
        for (xr_vector<CBoneData*>::iterator C=(*bones)[bone_id]->children.begin(); C!=(*bones)[bone_id]->children.end(); C++)
            LL_SetBoneVisible((*C)->GetSelfID(),val,bRecursive);
    }
	Visibility_Invalidate			();
}
Example #4
0
void CKinematics::Copy(IRender_Visual *P) 
{
	inherited::Copy	(P);

	CKinematics* pFrom = (CKinematics*)P;
    PCOPY(pUserData	);
	PCOPY(bones		);
	PCOPY(iRoot		);
	PCOPY(bone_map_N);
	PCOPY(bone_map_P);
    PCOPY(visimask	);

	IBoneInstances_Create	();

	for (u32 i=0; i<children.size(); i++) 
		LL_GetChild(i)->SetParent(this);

	CalculateBones_Invalidate	();

    m_lod 			= (pFrom->m_lod)?::Render->model_Duplicate	(pFrom->m_lod):0;
}
Example #5
0
void CKinematics::Copy(dxRender_Visual *P) 
{
	inherited::Copy	(P);

	CKinematics* pFrom = dynamic_cast<CKinematics*>(P);
	VERIFY(pFrom);
	pUserData  = pFrom->pUserData;
	bones	   = pFrom->bones;
	iRoot	   = pFrom->iRoot;
	bone_map_N = pFrom->bone_map_N;
	bone_map_P = pFrom->bone_map_P;
	visimask   = pFrom->visimask;

	IBoneInstances_Create	();

	for (u32 i=0; i<children.size(); i++) 
		LL_GetChild(i)->SetParent(this);

	CalculateBones_Invalidate	();

    m_lod 	   = (pFrom->m_lod)?(dxRender_Visual*)::Render->model_Duplicate	(pFrom->m_lod):0;
}