Sign in to follow this  
Silverlan

Simple character movement in 3d environment

Recommended Posts

Silverlan    662

I'm currently trying to implement some basic character movement for a first person game I'm working on, but I've run into some problems.

 

Let's say there's an outside force that applies a velocity of Vector(500,60,0) to my character. For the sake of this example, let's say that force is constant and doesn't decrease.

Now the player starts moving in a random direction, like Vector(0.827846,0.560955,0).

How can I determine how much more the player can accelerate in that direction without going over the bounds of his max movement speed?

I basically need to retrieve the speed of the outside force in the player's movement direction.

 

Any suggestions?

How's this usually handled in other games?

Share this post


Link to post
Share on other sites
alvaro    21246

Why do you need to determine that? I would think you just compute the sum of all forces on the character and integrate. If you want to impose a maximum movement speed, I can think of several ways to do it:

 1) limit the velocity vector's magnitude explicitly,

 2) introduce drag,

 3) make the force applied by the character's locomotion system depend on how fast he's going,

 4) Lorenz contraction (this is mostly a joke).

Share this post


Link to post
Share on other sites
mawigator    485

 

I basically need to retrieve the speed of the outside force in the player's movement direction.

 

 

Normalize vector of player direction, and make dot product of normalized direction and the velocity vector arising from outside force.

Share this post


Link to post
Share on other sites
tonemgub    2008

Doesn't "player's max movement speed" actually refer to the speed/velocity that is generated by the player's own, internal forces? I've never heard of limiting external forces. You'll basically end up limitng things like gravity - I don't think that's your intent.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this