When I change the goal of a servo in SingleEntityAngularMotor I get OutOfMemoryException after a while.
I have 50 ragdolls and a SingleEntityAngularMotor attached to each limb
in every Update() I change the goal of each SingleEntityAngularMotor, and when I comment out that line that changes the servo's goal I dont get the error
I should also add that I reset the scene every 10 seconds, and this only happens when I use this line:
glMotor[m].Settings.Servo.Goal = newGoal;
I looked at the Demos source, and I think I am doing everything the demo does when resetting the scene
Any ideas why this might be happening? Maybe a bug when changing the goal of the SingleEntityAngularMotor in servo mode?
OutOfMemoryException for a line of code
Re: OutOfMemoryException for a line of code
Setting that property activates the entity if it isn't already active, and sets a quaternion field value. It shouldn't be able to do fill up memory by itself. There could be some weird external factors which cause the activation process to pile garbage (I don't know what they'd be), but I have no idea how it might fill up memory without the GC clearing things up.
I suggest running the CLR profiler to see what exactly is taking up the space and where it's coming from.
I suggest running the CLR profiler to see what exactly is taking up the space and where it's coming from.
Re: OutOfMemoryException for a line of code
Thanks for the quick answer, but I think I fixed it now.
Don't know what the problem was though, I basically copied the whole structure of the BEPUphysicsDemos and added my game as a Demo
Don't know what the problem was though, I basically copied the whole structure of the BEPUphysicsDemos and added my game as a Demo