ChaseCamera

If any of you are using the ChaseCamera and ThirdPersonController classes, please read this and respond as needed.



I will be retooling these classes over the next couple weeks as they do not work as advertised (too many requests for "well it would be perfect if it did just this one thing differently…" have broken some of the basic functionality.)  During this retooling, I may hack out parts of code that do not make sense any more or add undo complications to the code.  If you have specific needs, let's hear them now.

I'm using the ChaseCamera.  Specific needs…not so much, for me it seemed like it was well-featured enough.  The only thing I had an issue with was locking the mouse to the same position while rotating the camera using the property set in the ChaseCamera, but I think that's more of an issue with Mouse/MouseInput than the chaser.



I'd just request that there still be a way (or if you can suggest a better way) to do the enabling/disabling of ChaseCamera rotation with a given mouse button.  Whether it belongs in there, or could be more cohesively done in another place…you'd probably know best.

Maybe this isn't a problem any more (I created a custom input system as a work around and it's become quite tightly integrated into my app), but it used to be the case that you couldn't position the camera directly above the target without it going crazy.



I think it was because the Y axis was used as the up vector for calculating the orientation, and this get broken when you're looking straight down. My work around was to basically create a couple of points, one at (0, 0, 0), one at (0, 0, 1) and one at (0, 1, 0) (basically: here, forwards and up), transform and rotate these with the requests for the camera and then use their world transformations as the reference vectors.

haven't any of this in a while but if that getting rid of the circular strafing when the the character is constrained to turn with the mouse will be good



thanks in advance

I ended up just fixing the movement jitter and cleaning a few things for now.  :/  Come back to this later.

My needs would be a system like World of Warcraft uses:



You move with a standard WSAD(QE) or arrow key set. Movement is relative.

You can freely look around with the camera while holding down the left mouse button. The model does not rotate.

You rotate the model while holding down the right mouse button.

The camera always stays behind the model and swings in nicely during movement. The camera does nothing automatically if standing still, so while standing still you can look around with the left mouse button.



I hope it's not to late to make wishes  :smiley:

Wouldn't ThirdPersonHandler be what you're looking to use, in that case?  Or does it not use the ChaseCamera? (I haven't taken a look at it in a while, and don't have access to code right now)



It's got all the code to do everything you requested, iirc.  I actually have been using ChaseCamera, until I realized I need something more like that, as well, due to the math required for moving the character based on the camera - renanse already did all this (iirc) in ThirdPersonHandler!

I think the only thing not covered in your req. is having two mouse buttons rotate the camera (one rotating the player and the other not)

How about a smooth transition between first & third person? So basically set the distance to be negative (is this possible) & lock the camera (disable the "chase" effect)

I already used ThirdPersonController, I only postet my wishlist because renanse said "If you have specific needs, let's hear them now.". I thought I just write down whats necessary for me, so that nothing gets lost while refactoring.



One thing I never was able to achieve with the "old" TPC was my intended way of "swinging in" behind the model. In a way that nothing happens if you just stand still, and the "swinging in" continues only while walking. But thats a minor thing, I just tried to replicate WoW's brilliant control system (its really very good, and just "feels" right).

Good call, Bregosch.  I didn't mean to dissuade renanse from doing those things, was just saying that it was all available, and might be easier to add than custom things, if ThirdPersonController doesn't already use ChaseCamera.



If you ever have a friend who has the game, I'd also suggest the controls of Guild Wars.  To me, that's a game you can (and I usually do, having to micromanage spells+minions, being a Minion Master Necro most of the time!) play completely with the keyboard.  Mouse usually helps a lot with movement, but…yeah.  I'm sure renanse and all those guys working at NC already know all about it, but…great game imo.  I think I spent 10 minutes trying to figure out what they were using for their skies (skybox, dome, etc - I think I settled on that it's a skybox with very nice textures to provide a great illusion).

When I have played with chasecam the last time I fount it reacting to the turn events rather slowly.

By looking at the code I can the tell it's based on spring simulation… The problem with springs is that given a variable motion (slower then faster) spring will not interpolate smoothly unless you have high damping, in which case the reaction time becomes slow. So with springs there is always a trade-off: good reaction vs smooth interpolation. From my experience with springs I could never have both no matter how hard I've tried tweaking the variables.



Ideal third person controller would be snappy and still interpolate smoothly. Perhaps a third person controller with custom pluggable filters?

As a side note: I think it would be cool to have a consistent framework of input filter throughout jme, then all of the controllers could have pluggable input filters.