Skip to main content

Collision Handling

·241 words·2 mins

Info

This post was imported from a personal note. It may contain inside jokes, streams of consciousness, errors, and other nonsense.

image

Now the boids increment a numFoodsEaten counter when they collide with food and the food source disappears.

Watching their behaviour, I’m reminded of the vision of predators vs. prey. image

These boids hunting for food are more like predators and it might actually help a lot to restrict their vision. Right now they pass by a food source and with their slow turning speed they have no chance of getting it, however, it’s still the nearest one so it controls their direction of movement.

I need a better way of producing screenies and animations like I’ve been doing with Processing.

Screenshots
#

Aiya yai. To use std::filesystem I needed to change the C++ language standard version from C++14 to C++17 or higher. I made the change and for some reason it still wasn’t working. I even increased the compiler output verbosity to “Detailed” (Tools > Options > Projects and Solutions > Build and Run > MSBuild project build [output|log file] verbosity) and looked at the full command used by the compiler, “CL.exe” and there was no option listed for “/std:c++20” showing up. What the hey..?

Oh.

I had updated the project settings for “Release” and not for “Debug” and I was running the debugger. Updated it for both and now it works. That cost me a good 30 minutes at least.