Bug: Crash if there are no entities, version 0.16.0

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Arcades
Posts: 17
Joined: Wed May 18, 2011 5:01 pm

Bug: Crash if there are no entities, version 0.16.0

Post by Arcades »

Hi,
I know there is a bug tracker: I apologize but I do not have time to register and issue a new ticket. I found nothing on the forums nor in the codeplex page so I'm posting here. Feel free to move or delete this post.
If I do Space.update() but Space is empty (with no entities) BEPU crash with no redemption.

How to reproduce:
In the project BEPUDemo (0.16.0, commit d9ef57fe4628), on the class Demo, edit the update function this way (this is a quick and dirty way but it work):

Code: Select all

public virtual void Update(float dt)
{
    if (Space.Entities.Count > 0)
    {
        for (int i = Space.Entities.Count -1; i >= 0 ; i--)
        {
            Space.Remove(Space.Entities[i]);
        }
    }
/* rest of the function..*/
}
Compile and run.

Is there any rule which say Space must have at least an object? Because I have an editor for my project which use Space and it's empty at the beginning, only after the user create a new entity on my editor the program add something to the Space class.
Thank you for your time.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Bug: Crash if there are no entities, version 0.16.0

Post by Norbo »

Is there any rule which say Space must have at least an object?
Nope, that was just a little bug that snuck by in the rewritten dynamic hierarchy broad phase, sorry! It was fixed shortly after v0.16.0's release in the development version which you can grab here: http://bepuphysics.codeplex.com/SourceC ... evelopment
Arcades
Posts: 17
Joined: Wed May 18, 2011 5:01 pm

Re: Bug: Crash if there are no entities, version 0.16.0

Post by Arcades »

Ah nice, thanks again for your quick answer.

May I suggest to change the stable version with that specific build?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Bug: Crash if there are no entities, version 0.16.0

Post by Norbo »

May I suggest to change the stable version with that specific build?
I do plan a v0.16.1 to include that, but there's a couple more things I'd like to get in first.
Post Reply