public bool FullObjectCollision(CollidingAdvancedSprite CAS) { CollisionUtils.CreateCollidingSpriteTransformMatrix(CAS); CollisionUtils.CreateCollidingSpriteTransformMatrix(this); if (Rotation == 0 || Rotation == Math.PI) { if (Intersects(CAS)) { CollisionUtils.CreateCollidingSpriteTransformMatrix(CAS); CollisionUtils.CreateCollidingSpriteTransformMatrix(this); CollisionUtils.GetColors(this); CollisionUtils.GetColors(CAS); return(CollisionUtils.IntersectPixels(this.TransformMatrix, this.BoundingBox.Width, this.BoundingBox.Height, Colors, this.IgnoreTranslucentCol, CAS.TransformMatrix, CAS.BoundingBox.Width, CAS.BoundingBox.Height, CAS.Colors, CAS.IgnoreTranslucentCol)); } } else { CollisionUtils.CreateCollidingSpriteTransformMatrix(CAS); CollisionUtils.CreateCollidingSpriteTransformMatrix(this); colltemp = CollisionUtils.CalculateBoundingRectangle(tempdrawrect, _transformMatrix); if (colltemp.Intersects(CollisionUtils.CalculateBoundingRectangle(CAS.tempdrawrect, CAS._transformMatrix))) { CollisionUtils.GetColors(this); CollisionUtils.GetColors(CAS); return(CollisionUtils.IntersectPixels(this.TransformMatrix, this.BoundingBox.Width, this.BoundingBox.Height, Colors, this.IgnoreTranslucentCol, CAS.TransformMatrix, CAS.BoundingBox.Width, CAS.BoundingBox.Height, CAS.Colors, CAS.IgnoreTranslucentCol)); } } return(false); }
public override void Update() { CollisionUtils.CreateCollidingSpriteTransformMatrix(this); base.Update(); }