本文整理汇总了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);
}
}