I have 2 possible bugs to report
![Sad :(](./images/smilies/icon_sad.gif)
Hopefully they are just me doing silly things again.
Anyway the first one is with a entity that ignored another entity and when it touched a static object the simulator would crash with this error. It also had a event attached to the EventHandlerCollisionPairColliding eventmanager.
mscorlib.dll!System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument argument, System.ExceptionResource resource) + 0x41 bytes
> mscorlib.dll!System.Collections.Generic.List<BEPUphysics.Events.EventStorageCollisionPairColliding>.Capacity.set(int value = 4) + 0x23 bytes
mscorlib.dll!System.Collections.Generic.List<BEPUphysics.Events.EventStorageCollisionPairColliding>.EnsureCapacity(int min) + 0x2d bytes
mscorlib.dll!System.Collections.Generic.List<BEPUphysics.Events.EventStorageCollisionPairColliding>.Add(BEPUphysics.Events.EventStorageCollisionPairColliding item) + 0x1d bytes
BEPUphysics.dll!BEPUphysics.EntityEventManager.onCollisionPairUpdated(BEPUphysics.CollisionPair collisionPair = {BEPUphysics.CollisionPair}) + 0x138 bytes
BEPUphysics.dll!BEPUphysics.CollisionPair.updateContactManifold(float dt = 0.02) + 0x120 bytes
BEPUphysics.dll!BEPUphysics.Space.updateCollisionDetectionDiscreteMultithreadedSubFunction(object information = {BEPUphysics.DataStructures.ListIntervalTimestep}) + 0x64 bytes
BEPUphysics.dll!BEPUphysics.ThreadManager.WorkerThread.threadExecutionLoop() + 0x120 bytes
mscorlib.dll!System.Threading.ThreadHelper.ThreadStart_Context(object state) + 0x66 bytes
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x6f bytes
mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() + 0x44 bytes
capacity was less than the current size.
Parameter name: value
It didn't happen if the object hit a dynamic object first however...
I have no idea what caused it and i have made work around by making the object in question static for now.
Anyway the other one is more annoying.
I am using a SingleEntityAngularMotor like you suggested to keep a helecoptor upright.
it is starting to work how i want but there is one problem where whenever i change to edit mode (which means all the world objects are re-built and all joints are destroyed) the simulator crashes.
I think i know what this one might be, i was thinking that it could be that the object that the joint was connected too has been removed and somehow the joint is still in the simulator. hence the crash?
Here is the exeption and stack trace
> BEPUphysics.dll!BEPUphysics.Entities.Entity.applySolverAngularImpulse(ref Microsoft.Xna.Framework.Vector3 torque = {X:85.4231 Y:0.002236491 Z:-51.98935}) + 0x71 bytes
BEPUphysics.dll!BEPUphysics.Constraints.SingleEntityAngularMotor.preStep(float dt = 1.99999982E-11) + 0x496 bytes
BEPUphysics.dll!BEPUphysics.Space.preStepSolverUpdateableMultithreadedSubFunction(object information = {BEPUphysics.DataStructures.ListIntervalTimestep}) + 0x9f bytes
BEPUphysics.dll!BEPUphysics.ThreadManager.WorkerThread.threadExecutionLoop() + 0x120 bytes
mscorlib.dll!System.Threading.ThreadHelper.ThreadStart_Context(object state) + 0x66 bytes
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x6f bytes
mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() + 0x44 bytes
Object reference not set to an instance of an object.
Anyway its most likely something i'm doing for both of these crashes but i thought i should ask you what you think they could be.
Also i have one other question...
I am trying to use the SingleEntityAngularMotor to keep a helicoptor and a motorbike upright (within reason)
The problem i am having is that a SingleEntityAngularMotor transforms towards a quaternion on all 3 axis when i just want it to try to keep the motorbike up on 1 axis (faceing the direction of the bike) and 2 for the helicopter and plane.
Also how would i control "Lean" for the motorbike and helicoptor? I imagine that i could just change the direction of the desired quaternion but i am still not that great with quaternion's as far as visualizeing them in my head yet...
Also wheels seem to jump whenever they hit a edge of a flat platform (part of a static tri mesh) anyway to reduce this?
Anyway if you have any ideas that would be great.