Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - SharkFin

Pages: [1]
1
Edit:    This has been solved. I was dividing by zero, and is not a problem with SFML. My bad

I'm creating a flocking simulation based around http://www.red3d.com/cwr/boids/. I'm getting a problem though.
The flocking is working fine, whatever, but when I try to make the boids wrap around (x position greater than the width, set width to 0 and vice versa), they flash where they should be but then are deleted. I'm using
sf::CircleShape shape(10.f);
shape.setPosition(sf::Vector2f(x,y));
but when the position is set far enough away from it's current position, it is deleted.
The same thing happened with a double pendulum simulation that I attempted yesterday. The physics were all broken which didn't make sense, but the thing would spin faster and faster until sfml just deleted the shapes. (the physics breaking is not the issue here, it's sfml deleting things)
Is there some way to specifically avoid having sfml delete things, or is there a way to turn it off entirely?

Pages: [1]
anything