當前位置: 首頁>>代碼示例>>C++>>正文


C++ AddBodyToWorld函數代碼示例

本文整理匯總了C++中AddBodyToWorld函數的典型用法代碼示例。如果您正苦於以下問題:C++ AddBodyToWorld函數的具體用法?C++ AddBodyToWorld怎麽用?C++ AddBodyToWorld使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了AddBodyToWorld函數的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: AddBodyToWorld

void RigidBody::SetCollisionLayer(unsigned layer)
{
    if (layer != collisionLayer_)
    {
        collisionLayer_ = layer;
        AddBodyToWorld();
        MarkNetworkUpdate();
    }
}
開發者ID:quinsmpang,項目名稱:Urho3D,代碼行數:9,代碼來源:RigidBody.cpp

示例2: IsEnabledEffective

void RigidBody::OnSetEnabled()
{
    bool enabled = IsEnabledEffective();

    if (enabled && !inWorld_)
        AddBodyToWorld();
    else if (!enabled && inWorld_)
        RemoveBodyFromWorld();
}
開發者ID:quinsmpang,項目名稱:Urho3D,代碼行數:9,代碼來源:RigidBody.cpp

示例3: AddBodyToWorld

void RigidBody::SetPhantom(bool enable)
{
    if (enable != phantom_)
    {
        phantom_ = enable;
        AddBodyToWorld();
        MarkNetworkUpdate();
    }
}
開發者ID:PeteX,項目名稱:Urho3D,代碼行數:9,代碼來源:RigidBody.cpp

示例4: Max

void RigidBody::SetMass(float mass)
{
    mass = Max(mass, 0.0f);

    if (mass != mass_)
    {
        mass_ = mass;
        AddBodyToWorld();
        MarkNetworkUpdate();
    }
}
開發者ID:quinsmpang,項目名稱:Urho3D,代碼行數:11,代碼來源:RigidBody.cpp

示例5: URHO3D_LOGWARNING

void RigidBody::OnSceneSet(Scene* scene)
{
    if (scene)
    {
        if (scene == node_)
            URHO3D_LOGWARNING(GetTypeName() + " should not be created to the root scene node");

        physicsWorld_ = scene->GetOrCreateComponent<PhysicsWorld>();
        physicsWorld_->AddRigidBody(this);

        AddBodyToWorld();
    }
    else
    {
        ReleaseBody();

        if (physicsWorld_)
            physicsWorld_->RemoveRigidBody(this);
    }
}
開發者ID:quinsmpang,項目名稱:Urho3D,代碼行數:20,代碼來源:RigidBody.cpp

示例6: GetScene

void RigidBody::OnNodeSet(Node* node)
{
    if (node)
    {
        Scene* scene = GetScene();
        if (scene)
        {
            if (scene == node)
                LOGWARNING(GetTypeName() + " should not be created to the root scene node");

            physicsWorld_ = scene->GetComponent<PhysicsWorld>();
            if (physicsWorld_)
                physicsWorld_->AddRigidBody(this);
            else
                LOGERROR("No physics world component in scene, can not create rigid body");

            AddBodyToWorld();
        }
        else
            LOGERROR("Node is detached from scene, can not create rigid body");
        
        node->AddListener(this);
    }
}
開發者ID:PeteX,項目名稱:Urho3D,代碼行數:24,代碼來源:RigidBody.cpp


注:本文中的AddBodyToWorld函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。