• Content Count

  • Joined

  • Last visited

About nilwater

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. All right, you gave me a lot of useful suggestions. I'll implement it using PIXI.Graphics. Thank you!
  2. Hi, I've been trying out pixi.js lately and wanted to start adding physics. I'm currently looking at matter.js, and although it seems to work fine, one issue I'm having is that I can't (properly) draw the physics wireframes for debugging. I wanted to use the MatterJS/render module to draw the wireframes, but I couldn't get it to work on the Pixi canvas. I assume the reason is that MatterJs/Render is using the 2d context ( but Pixi uses Webgl2. The alternative was to add the MatterJs canvas on top of the Pixi canvas, and have that draw the wireframe. This worked, however I noticed extreme delays in the drawing of the frames (the pixi sprite was being drawn further than the wireframe at high velocity). I assume (and hope) that this is caused by the fact that there are multiple render loops with this method, and not because of faulty code. As far as I could see, collision looked fine. So what I'm wondering; If I'm using Pixi + Matter, do I need to implement my own wireframe drawing in Pixi? Even though I don't think that would be too hard. Collecting all the bodies, mapping over their vertices, would probably be enough to draw all the lines with Pixi. But maybe I'm making this more difficult than necessary?