What is the best way for controlling a character?

Post Reply
BigHatLogan
Posts: 7
Joined: Mon Sep 02, 2013 4:15 am

What is the best way for controlling a character?

Post by BigHatLogan »

Hello

I know this one of the most talked about things on these forums, so apologies for bringing it up again. I'm hoping I can get some feedback on what people think is the best way to move a character around the world?

The two options seemed to be:
The btKinematicCharacterController still seems experimental. I have problems with the fall speed and gravity of this, and it also requires you to write your own response for Dynamic objects.

The DynamicCharacterController says (in the .cpp) that it is now obsolete. I attempted to use this but I could not get it to work correctly.

I've always had a feeling the best way to do this is to have a rigid body that is kinematic and setting its:

m_rigidBody->setSleepingThresholds (0.0, 0.0);
m_rigidBody->setAngularFactor (0.0);

But I don't like the idea of moving it just by setting it's position.
Is there a way to move a rigid body that doesn't collide with the world's objects?

So what have people had success with for controlling a character? Or is one of the above satisfactory and I'm just not using it correctly.

Thanks
MaxDZ8
Posts: 149
Joined: Fri Jun 24, 2011 8:53 am

Re: What is the best way for controlling a character?

Post by MaxDZ8 »

You don't need to do that. Kinematics are not affected by physics in any way. They won't move, won't rotate, won't be affected by gravity. Will happily go around encroaching other objects. If the other object is dynamic, it will be pushed away, otherwise nothing will happen.

Personally I believe using a dynamic rigidbody for player-controlled avatars is mostly nonsense. Beside eg. racing games, dynamics are too implicit to be handled correctly by an artist and even the code involves pretty ugly tricks in my opinion.

I personally don't use the provided kinematic controller, albeit I have something which is somewhat similar. I can afford to perform sweeping movements for collisions against dynamic rigidbodies so I believe you should be sweeping too. As far as I remember, the provided kinematic controller also sweeps.

What's the problem in just setting the position?

You will have to do that sooner or later. If you played games by ID or Valve, there are often things called "func trains" which move without considering physics. Their position is function of time and typically highly unrealistic in physics terms. Feel free to elaborate on your concerns.
Post Reply