本文整理匯總了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();
}
}
示例2: IsEnabledEffective
void RigidBody::OnSetEnabled()
{
bool enabled = IsEnabledEffective();
if (enabled && !inWorld_)
AddBodyToWorld();
else if (!enabled && inWorld_)
RemoveBodyFromWorld();
}
示例3: AddBodyToWorld
void RigidBody::SetPhantom(bool enable)
{
if (enable != phantom_)
{
phantom_ = enable;
AddBodyToWorld();
MarkNetworkUpdate();
}
}
示例4: Max
void RigidBody::SetMass(float mass)
{
mass = Max(mass, 0.0f);
if (mass != mass_)
{
mass_ = mass;
AddBodyToWorld();
MarkNetworkUpdate();
}
}
示例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);
}
}
示例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);
}
}