Advertisement Jump to content
Sign in to follow this  
Silverlan

Simple character movement in 3d environment

This topic is 1880 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement

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

 

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

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!