Skip to content
Permalink
Browse files

[Physics] Fix #463

  • Loading branch information
Eideren committed Jun 2, 2019
1 parent e547ad6 commit 0241b1571cfee376429649b2bd03180152a7caf4
Showing with 8 additions and 7 deletions.
  1. +8 −7 sources/engine/Xenko.Physics/Engine/PhysicsComponent.cs
@@ -686,18 +686,19 @@ internal void Attach(PhysicsProcessor.AssociatedData data)
//this is not optimal as UpdateWorldMatrix will end up being called twice this frame.. but we need to ensure that we have valid data.
Entity.Transform.UpdateWorldMatrix();

if (ColliderShapes.Count == 0)
if (ColliderShapes.Count == 0 && ColliderShape == null)
{
logger.Error($"Entity {Entity.Name} has a PhysicsComponent without any collider shape.");
return; //no shape no purpose
}

if (ColliderShape == null) ComposeShape();

if (ColliderShape == null)
else if (ColliderShape == null)
{
logger.Error($"Entity {Entity.Name} has a PhysicsComponent but it failed to compose the collider shape.");
return; //no shape no purpose
ComposeShape();
if (ColliderShape == null)
{
logger.Error($"Entity {Entity.Name}'s PhysicsComponent failed to compose its collider shape.");
return; //no shape no purpose
}
}

BoneIndex = -1;

0 comments on commit 0241b15

Please sign in to comment.
You can’t perform that action at this time.