Page 1 of 28

Physics improvement

Posted: 05 Feb 2012, 04:57
by jhooks1
OpenMW physics are kinda bad, constantly falling through floors and other problems. I have been looking into our physics system a little trying to understand it for the past 2 days. Mainly physic.hpp/cpp, physicsystem, and bullet_nif_loader. I plan on looking into Project Aedra to see what they are doing differently, hopefully whatever it is can be applied to openmw.

Re: Physics improvement

Posted: 05 Feb 2012, 10:06
by Zini
Okay, but wasn't gus planning to do the same? If so, you probably should coordinate with him.

Re: Physics improvement

Posted: 05 Feb 2012, 10:11
by gus
Here are some important paramters:
*setMargin() in collision shape
*gravity
*the whole btKinematicController stuff

IMO, you should check first which kinematicController aedra use.

Re: Physics improvement

Posted: 05 Feb 2012, 20:39
by jhooks1
Gus, we can work together on this if you want 8-)

Re: Physics improvement

Posted: 05 Feb 2012, 23:00
by gus
sure ;)
btw, i'm often in the irc channel.

but for now, i'm focusing on the crash related to the physic system. Which version of bullet do you have btw? Because i've a strange bug with bullet 2.76 (basically i can't use the debug mode... very annoying)

Re: Physics improvement

Posted: 06 Feb 2012, 11:49
by psi29a
gus wrote:but for now, i'm focusing on the crash related to the physic system. Which version of bullet do you have btw? Because i've a strange bug with bullet 2.76 (basically i can't use the debug mode... very annoying)
The latest stable (and trusted) release of libbullet is 2.77, almost all of our releases packages are based on this as well.

We will not be upgraded until 2.80 is released as versions in between have a horribly crippling performance bug.

Re: Physics improvement

Posted: 07 Feb 2012, 20:09
by jhooks1
Got the latest Project Aedra from the svn. It doesn't use btKinematicController.

Re: Physics improvement

Posted: 08 Feb 2012, 06:55
by jhooks1
Changing our capsule width seems to eliminate the falling bug. But areas where we should fall now don't always work correctly.

Re: Physics improvement

Posted: 08 Feb 2012, 08:30
by Rhys
I remember using blender game engine (bullet physics) lots of people would make their player code cast rays (from the previous location to current location) to test if the base of the player object had glitched through and if so, place the player back at the previous tick position. Otherwise I would find it always falling through, especially through edges that border changes in surface direction.
This might be too 'hackish' for openmw though.

Re: Physics improvement

Posted: 08 Feb 2012, 09:03
by gus
I remember using blender game engine (bullet physics) lots of people would make their player code cast rays (from the previous location to current location) to test if the base of the player object had glitched through and if so, place the player back at the previous tick position. Otherwise I would find it always falling through, especially through edges that border changes in surface direction.
This might be too 'hackish' for openmw though.
Why not? If other stuff do not work, we might try that, thanks ;)

jhooks1: I think we should first determine the right gravity to apply, because many other parameters depends on the gravity. With a small gravity, you don't go through the floor etc.