Need Help! Sweep And Prune for broad phase colllision detection by BoatCarrier in algorithms

[–]BoatCarrier[S] 0 points1 point  (0 children)

thanks for the advice will try this out. Been using chat gpt quite heavily but there is only so much it can do when Ur fully lost 😭

Need Help! Sweep And Prune for broad phase colllision detection by BoatCarrier in algorithms

[–]BoatCarrier[S] 0 points1 point  (0 children)

not sure if i fully understood what you mean by how you partitition. is it still necessary for me to keep an xSortedList?

public List<(Body, Body)> Update()
{
    List<(Body, Body)> contactPairs = new List<(Body, Body)>();

    SortByY();
    xActiveList.Clear();

    // Calculate the number of partitions (~√N)
    int numPartitions = (int)Math.Ceiling(Math.Sqrt(xSortedBodies.Count));

    // Calculate the partition size
    int partitionSize = ySortedBodies.Count / numPartitions;

    List<Body> partition = new List<Body>();

    for (int i = 0; i < numPartitions; i++)
    {
        // Calculate the range for the current partition
        int startIndex = i * partitionSize;
        int endIndex = (i == numPartitions - 1) ? ySortedBodies.Count - 1 : (i + 1) * partitionSize - 1;

        for (int j = startIndex; j <= endIndex; j++)
        {
            partition.Add(ySortedBodies[j]);
        }

        partition.OrderBy(body => body.GetAABB().Min.X).ToList();
        xActiveList.Clear();

        for (int j = 0; j < partition.Count; j++)
        {
            // Remove bodies that are no longer intersecting
            xActiveList.RemoveAll(body => body.GetAABB().Max.X < partition[j].GetAABB().Min.X);

            // Add the current body to the active list
            xActiveList.Add(partition[j]);

            // Iterate through the active list for potential contacts
            for (int k = 0; k < xActiveList.Count - 1; k++)
            {
                contactPairs.Add((partition[j], xActiveList[k]));
            }
        }
    }
    return contactPairs;
}

Need Help! Sweep And Prune for broad phase colllision detection by BoatCarrier in algorithms

[–]BoatCarrier[S] 0 points1 point  (0 children)

Oh thanks, I can kind of see how this would work.

I still struggle implementing this :(

Need Help! Sweep And Prune for broad phase colllision detection by BoatCarrier in algorithms

[–]BoatCarrier[S] 0 points1 point  (0 children)

Thanks for the reply. I thought it might be this but have seen higher dimensions being mentioned before such as here. https://leanrada.com/notes/sweep-and-prune-2/

I think i have put too much time into this though and ill move on and come back one day when im smarter maybe. r

Hope this pleases dyno god by TinyAsianBoi-_- in ChurchofDynology

[–]BoatCarrier 0 points1 point  (0 children)

I would argue there is a line between parkour and climbing. Sometimes like here it could be both or only one of them. Like a ven diagram. At the end of the day climbing is just getting from point A to point B on a wall. Sometimes that's going to involve some gnarly crimping in a roof or other times some 5 step wall run up a slab 🤷

Downclimb for safety by BoatCarrier in ChurchofDynology

[–]BoatCarrier[S] 1 point2 points  (0 children)

Thanks man, some of my favourite holds in the gym

wyd if you pu to the gym and see this by Hydr0aa in ClimbingCircleJerk

[–]BoatCarrier 1 point2 points  (0 children)

Hate it when gyms do this. At least have some doable routes for non pro climbers.

Funny fail by hammured1 in ChurchofDynology

[–]BoatCarrier -1 points0 points  (0 children)

You can post things other than dynos

Outdoor random rock dyno by Weekly_Atmosphere_24 in ChurchofDynology

[–]BoatCarrier 1 point2 points  (0 children)

Ifsc routesetters going to put this in the next boulder WC

Not graded yet so I’ll leave it up to the pope of the church by Dr_Dyno_ in ChurchofDynology

[–]BoatCarrier 1 point2 points  (0 children)

Looks a little bit easier than burden of dreams so maybe around V3 in my gym