Jump to content

Procedural geometry physics


mightyboat
 Share

Recommended Posts

Hi, I need to generate a terrain mesh procedurally. I am currently doing it with lots of sprites stuck together in a line to generate the contour of the terrain. It works fairly well, but has a few quirks and seems to affect performance badly.

What I was thinking of doing is generating the points in the preload function, then from that, draw a line to rendering the terrain, and then use the same points to generate the collision polygon.

The issue I found is that the game.load.physics() function works with a url to a json object. Is there a way to pass it a json object that I created in the game itself instead of a url?

By the way, I am using P2 physics for this.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...