82 T temp(std::forward<Args>(args)...,uid);
89 if constexpr(std::is_same<T,RigidbodyComponent>::value){
93 body_def.position.Set(entity->
m_X*m_ScalingFactor,entity->
m_Y*m_ScalingFactor);
96 b2Body *body=m_PhysicsWorld->CreateBody(&body_def);
97 body->SetFixedRotation(temp.m_FixedRotation);
98 temp.m_RuntimeBody=body;
99 }
else if constexpr(std::is_same<T,BoxColliderComponent>::value){
102 printf(
"Entity %d does not have a rigidbody\n",
uid);
107 box_shape.SetAsBox(
temp.m_Width/2.0f*m_ScalingFactor,
temp.m_Height/2.0f*m_ScalingFactor,
b2Vec2((
temp.m_XOffset+
temp.m_Width/2.0f)*m_ScalingFactor,(
temp.m_YOffset+
temp.m_Height/2.0f)*m_ScalingFactor),0.0f);
116 }
else if constexpr(std::is_same<T,CircleColliderComponent>::value){
119 printf(
"Entity %d does not have a rigidbody\n",
uid);