I've been using BEPU (great physics engine btw!) for a while now, but this one problem has eluded me for days.
Any pointers or code examples would be a great help a lot!

That would definitely help anyone else out there who happens to get stuck on getting a 6DOF character controller working.norbo wrote:I think I'll just make the needed modifications, should be up sometime today.
Code: Select all
at BEPUutilities.MathChecker.Validate(Quaternion q) in D:\c# projects\SDKs\bepuphysics_4100150a55e2\BEPUutilities\MathChecker.cs:line 128
at BEPUphysics.Entities.Entity.set_Orientation(Quaternion value) in D:\c# projects\SDKs\bepuphysics_4100150a55e2\BEPUphysics\Entities\EntityBase.cs:line 84
at BEPUphysicsDemos.AlternateMovement.Character.CharacterController.set_Down(Vector3 value) in D:\c# projects\SDKs\bepuphysics_4100150a55e2\BEPUphysicsDemos\BEPUphysicsDemos\Alternate Movement\Character\CharacterController.cs:line 74
at BEPUphysicsDemos.Demos.PlanetDemo.Update(Single dt) in D:\c# projects\SDKs\bepuphysics_4100150a55e2\BEPUphysicsDemos\BEPUphysicsDemos\Demos\PlanetDemo.cs:line 68
at BEPUphysicsDemos.DemosGame.Update(GameTime gameTime) in D:\c# projects\SDKs\bepuphysics_4100150a55e2\BEPUphysicsDemos\BEPUphysicsDemos\DemosGame.cs:line 388
at Microsoft.Xna.Framework.Game.Tick()
at Microsoft.Xna.Framework.Game.HostIdle(Object sender, EventArgs e)
at Microsoft.Xna.Framework.GameHost.OnIdle()
at Microsoft.Xna.Framework.WindowsGameHost.RunOneFrame()
at Microsoft.Xna.Framework.WindowsGameHost.ApplicationIdle(Object sender, EventArgs e)
at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Microsoft.Xna.Framework.WindowsGameHost.Run()
at Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)
at Microsoft.Xna.Framework.Game.Run()
at BEPUphysicsDemos.Program.Main(String[] args) in D:\c# projects\SDKs\bepuphysics_4100150a55e2\BEPUphysicsDemos\BEPUphysicsDemos\Program.cs:line 13
Except that the character no longer slides off the planet when you reach the "sides".Norbo wrote:The PlanetDemo now uses it, though it's hard to tell since the camera's up vector is locked.
Everything appears to work fine now. I haven't ran into that crash in the new version.Norbo wrote:Alrighty, new version.
1) That crash should be fixed.
2) I forgot a couple of areas where the movement direction needed to be updated. Stepping and much of support finding was pretty broken- it should work now.
3) SphereCharacterController has been updated to match.
Code: Select all
Vector3 right = Vector3.Normalize(Vector3.Cross(Vector3.Forward, upVector)); //<---- Problem here when upVector is close to being equal to Vector3.Forward or Backward.
Vector3 forward = Vector3.Cross(-right, upVector);
Matrix upRot = Matrix.Invert(Matrix.CreateLookAt(Vector3.Zero, forward, upVector));
WorldMatrix = upRot * Matrix.CreateTranslation(Position);
Vector3 camLookat = Position + forward;
View = Matrix.CreateLookAt(Position, camLookat, upRot.Up);
Ah, thats great!Norbo wrote:I went ahead and modified the camera and some other bits to support arbitrary up vectors, but it appears codeplex doesn't want to hear about my pushes. It'll be uploaded as soon as codeplex stops having a tantrum.
It all works perfectly now. Originally I was doubting whether or not I chose the right physics engine for the task. But once you started adding 6DoF support to the demos, all doubt was cleared. I'll get a video up of what it is I've started on sometime later today.Norbo wrote:Looks like it's working again!
ThanksAs a thank you for all your help, and for BEPU, I threw $5 at your Donate button on Codeplex and my screen magically absorbed it. Who knows, it might turn into a beer when it reaches you.