|
@@ -145,7 +145,11 @@ void Constraint2D::OnNodeSet(Node* node)
|
|
|
void Constraint2D::OnSceneSet(Scene* scene)
|
|
void Constraint2D::OnSceneSet(Scene* scene)
|
|
|
{
|
|
{
|
|
|
if (scene)
|
|
if (scene)
|
|
|
- physicsWorld_ = scene->GetOrCreateComponent<PhysicsWorld2D>();
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ physicsWorld_ = scene->GetDerivedComponent<PhysicsWorld2D>();
|
|
|
|
|
+ if (!physicsWorld_)
|
|
|
|
|
+ physicsWorld_ = scene->CreateComponent<PhysicsWorld2D>();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void Constraint2D::InitializeJointDef(b2JointDef* jointDef)
|
|
void Constraint2D::InitializeJointDef(b2JointDef* jointDef)
|