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


C++ PODVector::Clear方法代码示例

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


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

示例1: GetComponents

void Component::GetComponents(PODVector<Component*>& dest, StringHash type) const
{
    if (node_)
        node_->GetComponents(dest, type);
    else
        dest.Clear();
}
开发者ID:ElishaMcNutt,项目名称:Clockwork,代码行数:7,代码来源:Component.cpp

示例2: callback

void PhysicsWorld2D::Raycast(PODVector<PhysicsRaycastResult2D>& results, const Vector2& startPoint, const Vector2& endPoint, unsigned collisionMask)
{
    results.Clear();

    RayCastCallback callback(results, startPoint, collisionMask);
    world_->RayCast(&callback, ToB2Vec2(startPoint), ToB2Vec2(endPoint));
}
开发者ID:zhzhxtrrk,项目名称:Urho3D,代码行数:7,代码来源:PhysicsWorld2D.cpp

示例3:

template<> void* ToluaToPODVector<Vector2>(lua_State* L, int narg, void* def)
{
    if (!lua_istable(L, narg))
        return 0;

    static PODVector<Vector2> result;
    result.Clear();

    tolua_Error tolua_err;

    int length = lua_objlen(L, narg);
    for (int i = 1; i <= length; ++i)
    {
        lua_pushinteger(L, i);
        lua_gettable(L, narg);

        if (!tolua_isusertype(L, -1, "Vector2", 0, &tolua_err))
        {
            lua_pop(L, 1);
            return 0;
        }

        Vector2* value = (Vector2*)tolua_touserdata(L, -1, 0);
        result.Push(*value);

        lua_pop(L, 1);
    }

    return &result;
}
开发者ID:Hevedy,项目名称:Urho3D,代码行数:30,代码来源:ToluaUtils.cpp

示例4: ClipPolygon

static void ClipPolygon(PODVector<DecalVertex>& dest, const PODVector<DecalVertex>& src, const Plane& plane, bool skinned)
{
    unsigned last = 0;
    float lastDistance = 0.0f;
    dest.Clear();

    if (src.Empty())
        return;

    for (unsigned i = 0; i < src.Size(); ++i)
    {
        float distance = plane.Distance(src[i].position_);
        if (distance >= 0.0f)
        {
            if (lastDistance < 0.0f)
                dest.Push(ClipEdge(src[last], src[i], lastDistance, distance, skinned));

            dest.Push(src[i]);
        }
        else
        {
            if (lastDistance >= 0.0f && i != 0)
                dest.Push(ClipEdge(src[last], src[i], lastDistance, distance, skinned));
        }

        last = i;
        lastDistance = distance;
    }

    // Recheck the distances of the last and first vertices and add the final clipped vertex if applicable
    float distance = plane.Distance(src[0].position_);
    if ((lastDistance < 0.0f && distance >= 0.0f) || (lastDistance >= 0.0f && distance < 0.0f))
        dest.Push(ClipEdge(src[last], src[0], lastDistance, distance, skinned));
}
开发者ID:TheComet93,项目名称:Urho3D,代码行数:34,代码来源:DecalSet.cpp

示例5: GetCollidingBodies

void RigidBody::GetCollidingBodies(PODVector<RigidBody*>& result) const
{
    if (physicsWorld_)
        physicsWorld_->GetRigidBodies(result, this);
    else
        result.Clear();
}
开发者ID:quinsmpang,项目名称:Urho3D,代码行数:7,代码来源:RigidBody.cpp

示例6: CopyStrippedCode

void CopyStrippedCode(PODVector<unsigned char>& dest, void* src, unsigned srcSize)
{
    unsigned const D3DSIO_COMMENT = 0xFFFE;
    unsigned* srcWords = (unsigned*)src;
    unsigned srcWordSize = srcSize >> 2;
    
    dest.Clear();
    
    for (unsigned i = 0; i < srcWordSize; ++i)
    {
        unsigned opcode = srcWords[i] & 0xffff;
        unsigned paramLength = (srcWords[i] & 0x0f000000) >> 24;
        unsigned commentLength = srcWords[i] >> 16;
        
        // For now, skip comment only at fixed position to prevent false positives
        if (i == 1 && opcode == D3DSIO_COMMENT)
        {
            // Skip the comment
            i += commentLength;
        }
        else
        {
            // Not a comment, copy the data
            unsigned char* srcBytes = (unsigned char*)(srcWords + i);
            dest.Push(*srcBytes++);
            dest.Push(*srcBytes++);
            dest.Push(*srcBytes++);
            dest.Push(*srcBytes++);
        }
    }
}
开发者ID:LuisAntonRebollo,项目名称:Urho3D,代码行数:31,代码来源:ShaderCompiler.cpp

示例7: GetComponents

void Node::GetComponents(PODVector<Component*>& dest, ShortStringHash type) const
{
    dest.Clear();
    for (Vector<SharedPtr<Component> >::ConstIterator i = components_.Begin(); i != components_.End(); ++i)
    {
        if ((*i)->GetType() == type)
            dest.Push(*i);
    }
}
开发者ID:acremean,项目名称:urho3d,代码行数:9,代码来源:Node.cpp

示例8: FindPath

void NavigationMesh::FindPath(PODVector<Vector3>& dest, const Vector3& start, const Vector3& end, const Vector3& extents,
    const dtQueryFilter* filter)
{
    PODVector<NavigationPathPoint> navPathPoints;
    FindPath(navPathPoints, start, end, extents, filter);

    dest.Clear();
    for (unsigned i = 0; i < navPathPoints.Size(); ++i)
        dest.Push(navPathPoints[i].position_);
}
开发者ID:LumaDigital,项目名称:AtomicGameEngine,代码行数:10,代码来源:NavigationMesh.cpp

示例9: GetResources

void ResourceCache::GetResources(PODVector<Resource*>& result, ShortStringHash type) const
{
    result.Clear();
    HashMap<ShortStringHash, ResourceGroup>::ConstIterator i = resourceGroups_.Find(type);
    if (i != resourceGroups_.End())
    {
        for (HashMap<StringHash, SharedPtr<Resource> >::ConstIterator j = i->second_.resources_.Begin();
            j != i->second_.resources_.End(); ++j)
            result.Push(j->second_);
    }
}
开发者ID:acremean,项目名称:urho3d,代码行数:11,代码来源:ResourceCache.cpp

示例10: GetNodesWithTag

bool Scene::GetNodesWithTag(PODVector<Node*>& dest, const String& tag) const
{
    dest.Clear();
    HashMap<StringHash, PODVector<Node*> >::ConstIterator it = taggedNodes_.Find(tag);
    if (it != taggedNodes_.End())
    {
        dest = it->second_;
        return true;
    }
    else
        return false;
}
开发者ID:ClockTeam,项目名称:Clockwork,代码行数:12,代码来源:Scene.cpp

示例11: GetChildren

void Node::GetChildren(PODVector<Node*>& dest, bool recursive) const
{
    dest.Clear();

    if (!recursive)
    {
        for (Vector<SharedPtr<Node> >::ConstIterator i = children_.Begin(); i != children_.End(); ++i)
            dest.Push(*i);
    }
    else
        GetChildrenRecursive(dest);
}
开发者ID:eberan,项目名称:urho3d_old_mirror,代码行数:12,代码来源:Node.cpp

示例12: GetDirtyAssets

void AssetDatabase::GetDirtyAssets(PODVector<Asset*>& assets)
{
    assets.Clear();

    List<SharedPtr<Asset>>::ConstIterator itr = assets_.Begin();

    while (itr != assets_.End())
    {
        if ((*itr)->IsDirty())
            assets.Push(*itr);
        itr++;
    }
}
开发者ID:nonconforme,项目名称:AtomicGameEngine,代码行数:13,代码来源:AssetDatabase.cpp

示例13:

template <> void* ToluaToPODVector<bool>(double /*overload*/, lua_State* L, int narg, void* /*def*/)
{
    if (!lua_istable(L, narg))
        return 0;
    static PODVector<bool> result;
    result.Clear();
    result.Resize((unsigned)lua_objlen(L, narg));
    for (unsigned i = 0; i < result.Size(); ++i)
    {
        lua_rawgeti(L, narg, i + 1);
        result[i] = (bool)tolua_toboolean(L, -1, 0);
        lua_pop(L, 1);
    }
    return &result;
}
开发者ID:boberfly,项目名称:Urho3D,代码行数:15,代码来源:ToluaUtils.cpp

示例14: GetRigidBodies

void PhysicsWorld::GetRigidBodies(PODVector<RigidBody*>& result, const RigidBody* body)
{
    PROFILE(GetCollidingBodies);

    result.Clear();

    for (HashMap<Pair<WeakPtr<RigidBody>, WeakPtr<RigidBody> >, btPersistentManifold*>::Iterator i = currentCollisions_.Begin();
        i != currentCollisions_.End(); ++i)
    {
        if (i->first_.first_ == body)
            result.Push(i->first_.second_);
        else if (i->first_.second_ == body)
            result.Push(i->first_.first_);
    }
}
开发者ID:asherkin,项目名称:Urho3D,代码行数:15,代码来源:PhysicsWorld.cpp

示例15: GetChildrenWithComponent

void Node::GetChildrenWithComponent(PODVector<Node*>& dest, ShortStringHash type, bool recursive) const
{
    dest.Clear();

    if (!recursive)
    {
        for (Vector<SharedPtr<Node> >::ConstIterator i = children_.Begin(); i != children_.End(); ++i)
        {
            if ((*i)->HasComponent(type))
                dest.Push(*i);
        }
    }
    else
        GetChildrenWithComponentRecursive(dest, type);
}
开发者ID:eberan,项目名称:urho3d_old_mirror,代码行数:15,代码来源:Node.cpp


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