当前位置: 首页>>代码示例>>C++>>正文


C++ hsTArray::Append方法代码示例

本文整理汇总了C++中hsTArray::Append方法的典型用法代码示例。如果您正苦于以下问题:C++ hsTArray::Append方法的具体用法?C++ hsTArray::Append怎么用?C++ hsTArray::Append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在hsTArray的用法示例。


在下文中一共展示了hsTArray::Append方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: IGetReceivers

void plActivatorBaseComponent::IGetReceivers(plMaxNode* node, hsTArray<plKey>& receivers)
{
    // Add the guys who want to be notified by all instances
    ReceiverKeys::iterator lowIt = fReceivers.lower_bound(nil);
    ReceiverKeys::iterator highIt = fReceivers.upper_bound(nil);
    for (; lowIt != highIt; lowIt++)
        receivers.Append(lowIt->second);

    // Add the ones for just this instance
    lowIt = fReceivers.lower_bound(node);
    highIt = fReceivers.upper_bound(node);
    for (; lowIt != highIt; lowIt++)
        receivers.Append(lowIt->second);
}
开发者ID:Asteral,项目名称:Plasma,代码行数:14,代码来源:plActivatorBaseComponent.cpp

示例2: GetObjectPoints

static void GetObjectPoints( plSceneObject *so, hsTArray<hsPoint3> &outPoints )
{
    const plDrawInterface* di = so->GetDrawInterface();
    if( !di )
        return;

    // The following uses mf's spiffy plAccessGeometry/Spans stuff, which, in 
    // one uint16_t, kicksAss.
    hsTArray<plAccessSpan> spans;
    plAccessGeometry::Instance()->OpenRO( di, spans );

    int i;
    outPoints.Reset();
    for( i = 0; i < spans.GetCount(); i++ )
    {
        plAccessVtxSpan& vtxSrc = spans[ i ].AccessVtx();
        plAccPositionIterator iterSrc( &vtxSrc );

        for( iterSrc.Begin(); iterSrc.More(); iterSrc.Advance() )
            outPoints.Append( *iterSrc.Position() );
    }
    
    if (plAccessGeometry::Instance())
        plAccessGeometry::Instance()->Close( spans );
}
开发者ID:Deledrius,项目名称:Plasma,代码行数:25,代码来源:pfGUIControlMod.cpp

示例3: FindAllBindingsByKey

//  Same thing, but returns multiple matches (see IFindAllBindingsByKey)
void plKeyMap::FindAllBindingsByKey( const plKeyCombo &combo, hsTArray<const plKeyBinding*> &result ) const
{
    hsTArray<plKeyBinding*> bindings;
    IFindAllBindingsByKey( combo, bindings );

    int i;
    for (i = 0; i < bindings.GetCount(); i++)
        result.Append(bindings[i]);
}
开发者ID:cwalther,项目名称:Plasma-nobink-test,代码行数:10,代码来源:plInputMap.cpp

示例4: EatPage

        virtual bool EatPage( plRegistryPageNode *page )
        {
            if ( !fAge.IsEmpty() && page->GetPageInfo().GetAge().CompareI(fAge) == 0 )
            {
                fPages.Append( page );
            }

            return true;
        }
开发者ID:GPNMilano,项目名称:Plasma,代码行数:9,代码来源:plAgeLoader.cpp

示例5: EatPage

        virtual hsBool EatPage( plRegistryPageNode *page )
        {
            if( fAge && stricmp( page->GetPageInfo().GetAge(), fAge ) == 0 )
            {
                fPages.Append( page );
            }

            return true;
        }
开发者ID:cwalther,项目名称:Plasma-nobink-test,代码行数:9,代码来源:plAgeLoader.cpp

示例6:

bool    plAnimGroupedComponent::GetKeyList( INode *restrictedNode, hsTArray<plKey> &outKeys )
{
    if( fForward )
    {
        outKeys.Append( fForward->GetKey() );
        return true;
    }
    return false;
}
开发者ID:H-uru,项目名称:Plasma,代码行数:9,代码来源:plAnimComponent.cpp

示例7: IHalf

bool plGeoSpanDice::IHalf(plGeometrySpan* src, hsTArray<plGeometrySpan*>& out, int exclAxis) const
{
    if( !INeedSplitting(src) )
        return false;

    int iAxis = ISelectAxis(exclAxis, src);
    // Ran out of axes to try.
    if( iAxis < 0 )
        return false;

    float midPoint = src->fLocalBounds.GetCenter()[iAxis];

    hsTArray<uint32_t>        loTris;
    hsTArray<uint32_t>        hiTris;

    uint16_t* indexData = src->fIndexData;

    int numTris = src->fNumIndices / 3;

    int stride = src->GetVertexSize(src->fFormat);

    int i;
    for( i = 0; i < numTris; i++ )
    {
        hsPoint3& pos0 = *(hsPoint3*)(src->fVertexData + *indexData++ * stride);
        hsPoint3& pos1 = *(hsPoint3*)(src->fVertexData + *indexData++ * stride);
        hsPoint3& pos2 = *(hsPoint3*)(src->fVertexData + *indexData++ * stride);

        if( (pos0[iAxis] >= midPoint)
            &&(pos1[iAxis] >= midPoint)
            &&(pos2[iAxis] >= midPoint) )
        {
            hiTris.Append(i);
        }
        else
        {
            loTris.Append(i);
        }
    }

    // This axis isn't working out, try another.
    if( !hiTris.GetCount() || !loTris.GetCount() )
        return IHalf(src, out, exclAxis | (1 << iAxis));


    plGeometrySpan* loDst = IExtractTris(src, loTris);
    plGeometrySpan* hiDst = IExtractTris(src, hiTris);

    delete src;

    out.Append(loDst);
    out.Append(hiDst);

    return true;
}
开发者ID:Asteral,项目名称:Plasma,代码行数:55,代码来源:plGeoSpanDice.cpp

示例8: FindMorphMods

void plMorphSequence::FindMorphMods(const plSceneObject *so, hsTArray<const plMorphSequence*> &mods)
{
    const plMorphSequence *morph = plMorphSequence::ConvertNoRef(so->GetModifierByType(plMorphSequence::Index()));
    if (morph)
        mods.Append(morph);
    
    const plCoordinateInterface *ci = so->GetCoordinateInterface();
    int i;
    for (i = 0; i < ci->GetNumChildren(); i++)
        FindMorphMods(ci->GetChild(i)->GetOwner(), mods);
}
开发者ID:cwalther,项目名称:Plasma-nobink-test,代码行数:11,代码来源:plMorphSequence.cpp

示例9:

void    plAnimStealthNode::GetAllStopPoints( hsTArray<float> &out )
{
    if( fCachedSegMap == nil )
        return;

    for (SegmentMap::iterator it = fCachedSegMap->begin(); it != fCachedSegMap->end(); it++)
    {
        SegmentSpec *spec = it->second;
        if( spec->fType == SegmentSpec::kStopPoint )
        {
            out.Append( spec->fStart );
        }
    }
}
开发者ID:Hoikas,项目名称:Plasma,代码行数:14,代码来源:plAnimStealthConvert.cpp

示例10: Init

void plDInputMgr::Init(HINSTANCE hInst, HWND hWnd)
{
    
    HRESULT         hr; 
    hr = DirectInput8Create(hInst, DIRECTINPUT_VERSION, IID_IDirectInput8, (void**)&fDI->fDInput, NULL); 
    hsAssert(!hr, "failed to initialize directInput!"); 
    // enumerate game controllers
    Pfunc1 fPtr = &plDInputMgr::EnumGamepadCallback;
    int i = 0;
    

    // set up the action mapping
    fDI->fActionFormat = new DIACTIONFORMAT;
    fDI->fActionFormat->dwSize        = sizeof(DIACTIONFORMAT);
    fDI->fActionFormat->dwActionSize  = sizeof(DIACTION);
    fDI->fActionFormat->dwDataSize    = NUM_ACTIONS * sizeof(DWORD);
    fDI->fActionFormat->dwNumActions  = NUM_ACTIONS;
    fDI->fActionFormat->guidActionMap = PL_ACTION_GUID;
    fDI->fActionFormat->dwGenre       = DIVIRTUAL_FIGHTING_THIRDPERSON;
    fDI->fActionFormat->rgoAction     = fActionMap;
    fDI->fActionFormat->dwBufferSize  = 16;
    fDI->fActionFormat->lAxisMin      = -1000;
    fDI->fActionFormat->lAxisMax      = 1000;
    sprintf( fDI->fActionFormat->tszActionMap, "Plasma 2.0 Game Actions" );

    // this call should not work:
    fDI->fDInput->EnumDevices(DI8DEVCLASS_GAMECTRL, fPtr, fDI, DIEDFL_ATTACHEDONLY); 
    
    // apply the mapping to the game controller 
    // this is the correct <but broken> way to apply the action map:
//  Pfunc3 fPtr3 = &plDInputMgr::EnumSuitableDevices;
//  hr = fDI->fDInput->EnumDevicesBySemantics(NULL, fDI->fActionFormat, EnumSuitableDevices, fDI, NULL);

    
    for (i = 0; i < fDI->fSticks.Count(); i++)
    {
        fDI->fSticks[i]->fCaps = new DIDEVCAPS; 
        fDI->fSticks[i]->fCaps->dwSize = sizeof(DIDEVCAPS);
        hr = fDI->fSticks[i]->fDevice->GetCapabilities(fDI->fSticks[i]->fCaps);
        hsAssert(!hr, "Unable to acquire devcaps in DInput Device!"); 
        hr = fDI->fSticks[i]->fDevice->Acquire();
        hsAssert(!hr, "Unable to acquire DInput Device!"); 
    }

    fhWnd = hWnd;
    
    for (i = 0; i < fDI->fSticks.Count(); i++)
        fInputDevice.Append( new plDInputDevice );
}
开发者ID:branan,项目名称:Plasma-nobink,代码行数:49,代码来源:plInputManager.cpp

示例11: hsAssert

bool    plAnimComponent::GetKeyList( INode *restrictedNode, hsTArray<plKey> &outKeys )
{
    if( restrictedNode != nil )
    {
        if( fMods.find( (plMaxNode *)restrictedNode ) != fMods.end() )
        {
            outKeys.Append( fMods[ (plMaxNode *)restrictedNode ]->GetKey() );
            return true;
        }
        return false;
    }
    else
    {
        hsAssert( false, "DO SOMETHING!" );
        return false;
    }
}
开发者ID:H-uru,项目名称:Plasma,代码行数:17,代码来源:plAnimComponent.cpp

示例12: FindSharedVerts

void plInterMeshSmooth::FindSharedVerts(hsPoint3& searchPos, plSpanHandle& set, hsTArray<uint16_t>& edgeVerts, hsTArray<uint16_t>& shareVtx, hsVector3& normAccum)
{
    int i;
    for( i = 0; i < edgeVerts.GetCount(); i++ )
    {
        hsPoint3 pos = GetPosition(set, edgeVerts[i]);
        hsVector3 norm = GetNormal(set, edgeVerts[i]);
        if( searchPos == pos )
        {
            if( norm.InnerProduct(normAccum) > fMinNormDot )
            {
                shareVtx.Append(edgeVerts[i]);
                normAccum += norm;
            }
        }
    }
}
开发者ID:MareinK,项目名称:Plasma,代码行数:17,代码来源:plInterMeshSmooth.cpp

示例13: ISearchLayerRecur

static void ISearchLayerRecur( plLayerInterface *layer, const ST::string &segName, hsTArray<plKey>& keys )
{
    if( !layer )
        return;

    plLayerAnimation *animLayer = plLayerAnimation::ConvertNoRef(layer);
    if (animLayer)
    {
        ST::string ID = animLayer->GetSegmentID();
        if (!ID.compare(segName))
        {
            if( keys.kMissingIndex == keys.Find(animLayer->GetKey()) )
                keys.Append(animLayer->GetKey());
        }
    }

    ISearchLayerRecur(layer->GetAttached(), segName, keys);
}
开发者ID:Hoikas,项目名称:Plasma,代码行数:18,代码来源:plAnimStealthConvert.cpp

示例14: IFindAllBindingsByKey

// Find ALL bindings that could be triggered by this combo. Meaning that if we have multiple
// bindings for a key with different shift/ctrl combinations, we want any that are satisfied with
// the given combo.
// We guarantee that the first binding in the result array is that one with priority.
void plKeyMap::IFindAllBindingsByKey(const plKeyCombo &combo, hsTArray<plKeyBinding*> &result) const
{
    uint32_t i;
    uint8_t bestScore = 0;
    for (i = 0; i < fBindings.GetCount(); i++)
    {
        hsBool s1, s2;
        s1 = fBindings[i]->GetKey1().IsSatisfiedBy(combo);
        s2 = fBindings[i]->GetKey2().IsSatisfiedBy(combo);
        if (s1 || s2)
        {
            uint8_t myScore = 0;
            if (s1)
                myScore = fBindings[i]->GetKey1().fFlags;
            if (s2 && (fBindings[i]->GetKey2().fFlags > myScore))
                myScore = fBindings[i]->GetKey2().fFlags;

            if (myScore >= bestScore)
                result.Insert(0, fBindings[i]);
            else
                result.Append(fBindings[i]);
        }
    }
}
开发者ID:cwalther,项目名称:Plasma-nobink-test,代码行数:28,代码来源:plInputMap.cpp

示例15: Add

 void    Add( plCommonObjLib *lib )
 {
     fLibs.Append( lib );
     fRefCount++;
 }
开发者ID:Hoikas,项目名称:Plasma,代码行数:5,代码来源:plCommonObjLib.cpp


注:本文中的hsTArray::Append方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。