Hi!
before creating this thread, I have already searched all over.
I have a boid algorithm , there are functions to make turns and propelling, but sometimes they need to rotate just a tiny amount and that’s when the problem occurs.
As I have a populations of 25 groups with 15 individuals each (375) each second more than 999 log messages are thrown and more than 2.5Mb of garbage are generated.
First thing:
Would be nice if we could catch those “errors” (as it is not really an error) despite of just logging it without giving us the chance of correct it.
Second:
without correcting that, my code tries to apply the rotation and the real errors appears:
- CompareApproximately (det, 1.0F, .005f);
- fRoot >= Vector3f::epsilon;
- rigidbody.rotation assign attempt for ‘XXXX’ is not valid. Input rotation is { NaN, NaN, NaN, NaN }.
I have already tried to avoid next to zero angles, next to zero magnitudes, but It all stops those small movement corrections that makes the individuals look like alive inside the flock and just make them move straight ahead forever.
There’s no need to put any code in here, the logic is:
- Each frame theres a resultant vector that adds up each behaviour function for each individual rotating it towards the resultant over time.