how create cloth physics in construct 3

0 favourites
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • Well here’s the general idea how you can do it.

    Currently, it creates a grid of points over a sprite (at least in my example). Then it uses a loop to do all the edges between the points in an automated fashion. All the edges have a fixed length.

    The change needed is to make each edge length customizable. You could make it even calculate the lengths from the distances between the points.

    Seems unwieldy to me though. And very tedious to have to define the length of each edge.

  • R0J0hound thanks. i tried but could you please give an example on construct 2

  • So the steps are.

    1. create all the points you want, wherever you want.

    2. create all the edges you want between pairs of points.

    3. when the simulation starts use the starting length of the edges as the limit length.

    If you ever want to move the points around so the cloth has a new rest position then you have to do 3 again.

    Here's a test that's basically the same as the examples before, but it calculates the limit lengths when the simulation starts.

    It shows three ways to make the mesh. The first is a simple chain created manually. The next is a square grid created with some loops and some cleverness. The third loads from an obj file created in blender.

    dropbox.com/s/fnhb1hpingkd7o0/verlet_cloth2.capx

  • R0J0hound thank you so much excuse me again if it is not a nuisance could you please also insert the mesh distortion with the paster for cionstruct 2

  • I’ll get to it eventually when I get time. The solution is there one way or another in the other capx.

  • Hello

    R0J0hound how do I smesh points can collide with square objects, not round like the ball in the above examples

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Boxes are a bit more involved.

    For a circle you use the distance between the points and the center of the circle. For a box you use the distance from the closest point on the edge of the box.

    For a non rotated box you could get that point with:

    X = clamp(p.x, box.bbleft, box.bbright)

    Y = clamp(p.y, box.bbtop, box.bbbottom)

    At least that’s a start. That gives points inside the box.

    I’ve run out of time again. Time management for me is very poor lately.

  • thank you very much

  • hello R0J0hound sorry I'm back to work on this project I can't create the collision box you could if you have time now give an example please

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)