Announcement

Collapse
No announcement yet.

v2.3.0.29 update - Missing Update in RectangleCollider2D

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • v2.3.0.29 update - Missing Update in RectangleCollider2D

    Hey, just updated the WaveEditor. I was overriding "Update" on inherited object, RectangleCollider2DBase. It seems to no longer be available. Was an alternative method added? Or will I have to move this somewhere else? What was the reason for removing it?

    I also noticed that there are additional Physics2D classes added and removed based on intellisense, but when looking at the Api Reference, it still shows. An example of this would be PerPixelCollider2D.

    Code:
    protected override void Update(TimeSpan gameTime)
            {
                if (RenderManager.DebugLines)
                {
                    RenderManager.LineBatch2D.DrawLine(new Vector2((int)this.X, (int)this.Y), new Vector2((int)this.XPlusWidth, (int)this.YPlusHeight), this.DebugLineColor, 1);
                    RenderManager.LineBatch2D.DrawLine(new Vector2((int)this.CollisionCenter.X, (int)this.CollisionCenter.Y), new Vector2((int)this.CollisionCenter.X + this.HalfWidth, (int)this.CollisionCenter.Y), this.DebugLineColor, 1);
                    RenderManager.LineBatch2D.DrawRectangle(new RectangleF((int)this.X, (int)this.Y, (int)this.CollisionSize.X, (int)this.CollisionSize.Y), this.DebugLineColor, 1);
                }
                base.Update(gameTime);
            }
    
     protected override void Update(TimeSpan gameTime)
            {
                if (RenderManager.DebugLines)
                {
                    var characterCenterX = this.transform2D.Position.X;
                    var characterCenterY = this.transform2D.Position.Y;
                    var characterWidth = this.transform2D.Rectangle.Width;
                    var characterHeight = this.transform2D.Rectangle.Height;
                    var characterHalfWidth = characterWidth * .5f;
                    var characterHalfHeight = characterHeight * .5f;
                    var characterMarginedWidth = characterWidth - 25;
                    var characterMarginedHeight = characterHeight - 5;
                    var characterMarginedHalfWidth = characterMarginedWidth * .5f;
                    var characterMarginedHalfHeight = characterMarginedHeight * .5f;
                    var characterOuterX = characterCenterX - characterHalfWidth;
                    var characterOuterY = characterCenterY - characterHalfHeight;
                    var characterMarginedOuterX = characterCenterX - characterMarginedHalfWidth;
                    var characterMarginedOuterY = characterCenterY - characterMarginedHalfHeight;
                    var characterWidthOuterX = characterOuterX + characterWidth;
                    var characterHeightOuterY = characterOuterY + characterHeight;
                    var characterMarginWidthOuterX = characterMarginedOuterX + characterMarginedWidth;
                    var characterMarginHeightOuterY = characterMarginedOuterY + characterMarginedHeight;
    
                    RenderManager.LineBatch2D.DrawRectangle(new RectangleF((int)characterMarginedOuterX, (int)characterMarginedOuterY, (int)characterMarginedWidth, (int)characterMarginedHeight), this.DebugLineColor, 0);
                }
    
                base.Update(gameTime);
            }

  • #2
    Luckily, I am just drawing debug lines, so I am overriding the DrawDebuglines method. However, I am getting some other errors that I am looking, so I will let you know how it goes.

    Comment


    • #3
      Hi zaryk,

      The physics framework has been completely remodeled in Wave 2.3, so I would better have a look at Wave Engine Samples to understand how it works now and be able to override RectangleCollider2DBase.

      You are right regarding the Api Reference, the team is having some troubles to update it. Hope we can update it as soon as possible.

      Have a nice day, Juan.

      Comment


      • #4
        Cool, thanks! I will check these out!

        Comment

        Working...
        X