RpClump *CClumpModelInfo::CreateInstance()
{
    if (GetRwObject() == NULL)
    {
        return NULL;
    }
    AddRef();
    RpClump *pCloned = RpClumpClone((RpClump*)GetRwObject());
    RpAtomic *pFirst = GetFirstAtomic(pCloned);
    if (pFirst)
    {
        if(RpSkinGeometryGetSkin(pFirst->geometry) != NULL)
        {
            if(!dwUnknownFlag10)
            {
                RpHAnimHierarchy *pHAnim = GetAnimHierarchyFromClump(pCloned);
                RpClumpForAllAtomics(pCloned, SetAtomicHAnimHierarchyCB, pHAnim);
                RtAnimAnimation *pAnim = RpAnimBlendCreateAnimationForHierarchy(pHAnim);
                RtAnimInterpolatorSetCurrentAnim(pHAnim->currentAnim, pAnim);
                pHAnim->flags = rpHANIMHIERARCHYUPDATEMODELLINGMATRICES | rpHANIMHIERARCHYUPDATELTMS;
            }
        }
    }
    if (GetIsRoad())
    {
        RpAnimBlendClumpInit(pCloned);
        CAnimBlendHierarchy *pAnim = CAnimManager::GetAnimationByID(GetHashKey(), &CAnimManager::AnimBlocks[m_AnimId]);
        if (pAnim)
        {
            CAnimManager::BlendAnimation(pCloned, pAnim, 2, 1.0f);
        }
    }
    RemoveRef();
    return pCloned;
}
Exemple #2
0
void CEntitySAInterface::UpdateRwFrame( void )
{
    if ( !GetRwObject() )
        return;

    GetRwObject()->parent->Update();
}
Exemple #3
0
void CEntitySAInterface::UpdateRwMatrix( void )
{
    if ( !GetRwObject() )
        return;

    Placeable.GetMatrix( GetRwObject()->parent->modelling );
}
RpClump *CClumpModelInfo::CreateInstance(RwMatrixTag *pMatrix)
{
    if(GetRwObject() == NULL)
    {
        return NULL;
    }
    RpClump *pInst = CreateInstance();
    ((RwFrame*)pInst->object.parent)->modelling = *pMatrix;
    return pInst;
}
Exemple #5
0
void* CPedModelInfo::SetClump(RpClump* clump)
{
	CClumpModelInfo::SetClump(clump);
	CClumpModelInfo::SetFrameIds(&m_pPedIds);
	if (!m_hitColModel)
	{
		CreateHitColModelSkinned(clump);
	}
	RpClumpForAllAtomics((RpClump*)GetRwObject(), CClumpModelInfo::SetAtomicRendererCB, CVisibilityPlugins::RenderPedCB);
	return (void*)GetAnimHierarchyFromClump(clump);
}
Exemple #6
0
void CEntitySAInterface::SetAlpha( unsigned char alpha )
{
    RwObject *rwobj = GetRwObject();

    if ( !rwobj )
        return;

    if ( rwobj->type == RW_ATOMIC )
    {
        RpAtomicMaterialSetAlpha( (RpAtomic*)rwobj, alpha );
    }
    else if ( rwobj->type == RW_CLUMP )
    {
        ((RpClump*)rwobj)->ForAllAtomics( RpAtomicMaterialSetAlpha, alpha );
    }
}