Beispiel #1
0
        private bool CanAttachTo(HkBodyCollision obj, MyEntity entity)
        {
            if (entity == CubeGrid)
            {
                return(false);
            }

            var grid = entity as MyCubeGrid;

            if (grid == null)
            {
                grid = entity.Parent as MyCubeGrid;
                if ((grid != null && !grid.IsStatic && obj.Body.IsFixedOrKeyframed))
                {
                    return(false);
                }
            }

            // Dont want to lock to fixed/keyframed object
            if (entity is Sandbox.Game.Entities.Character.MyCharacter)
            {
                return(false);
            }
            return(true);
        }
        private bool CanAttachTo(HkBodyCollision obj, MyEntity entity)
        {
            //Gregory: Check parent also! (Fix for Welder bug)
            if (entity == CubeGrid || entity.Parent == CubeGrid)
            {
                return(false);
            }

            if (!obj.Body.IsFixed && obj.Body.IsFixedOrKeyframed)
            {
                return(false);
            }

            // Dont want to lock to fixed/keyframed object
            if (entity is Sandbox.Game.Entities.Character.MyCharacter)
            {
                return(false);
            }
            return(true);
        }
 public static IMyEntity GetCollisionEntity(this HkBodyCollision collision)
 {
     return(collision.Body != null?collision.Body.GetEntity(0) : null);
 }
Beispiel #4
0
        private bool CanAttachTo(HkBodyCollision obj, MyEntity entity)
        {
            if (entity == CubeGrid)
            {
                return false;
            }

            var grid = entity as MyCubeGrid;
            if (grid == null)
            {
                grid = entity.Parent as MyCubeGrid;
                if ((grid != null && !grid.IsStatic && obj.Body.IsFixedOrKeyframed))
                    return false;
            }

            // Dont want to lock to fixed/keyframed object
            if (entity is Sandbox.Game.Entities.Character.MyCharacter)
            {
                return false;
            }
            return true;
        }
        private bool CanAttachTo(HkBodyCollision obj, MyEntity entity)
        {
            //Gregory: Check parent also! (Fix for Welder bug)
            if (entity == CubeGrid || entity.Parent == CubeGrid)
            {
                return false;
            }

            if (!obj.Body.IsFixed && obj.Body.IsFixedOrKeyframed)
                return false;

            // Dont want to lock to fixed/keyframed object
            if (entity is Sandbox.Game.Entities.Character.MyCharacter)
            {
                return false;
            }
            return true;
        }