Closed kamn closed 9 years ago
How about we add a new arity to direction!
? We could allow passing a single argument, which is interpreted as a vector-3.
That could work to but I can forsee someone posting a bug about how there is a different in functionality between the arities.
Does the lookAt function that takes a vector not work for you?
I was having some issues with it. It seemed to be causing a jittering and would constatly look near the center 0, 0, 0. I assume it is because of the extra calculations it performs. Once I got around it looking worked fine. I can make a simple test case if you want to try it out yourself.
I'm not sure why I chose to use lookAt there. I think we could just change it to modify the direction vector directly.
That works! I was worried it might change some functionality of existing projects but code search is down so I can't check. We could also change the current direction!
to lookAt!
since I think that might be valuable. I can do that tomorrow if you like.
Ah, I just tried it on my 3d examples and it does seem to break them, so I'd rather avoid that. Have you tried calling (.normalizeUp (:camera screen))
before calling direction!
? The docs seem to indicate you may need to.
I added a new arity to direction!
, but in a different way. It takes an optional fourth arg, a boolean value that I called look-at?
for lack of a better term. If you set it to false, it will just set the direction vector as you were looking for. Hopefully that works for you. I pushed 0.4.5-SNAPSHOT so you can try it.
Thanks for responding so quickly. I have used the new arity direction!
and it works! I have not pushed it because now that everything is working I am trying to figure out how to reorganize and clean up the code.
Hi @oakes, As previously meantioned I am working on a First Person Controller example. I am mostly done but there is one part that I wanted some input form you on. In order to look around correctly I need to modify the
direction
vector of the camera. Thedirection!
calls thelookAt
function which does not seem to work for me. Currently in my project I just directly modify the camera vector and have a custom functioncamera-update!
in the play-clj fork. I was wondering if there was some other way to update the camera and if it might be better to have adirection-vector!
function added.Thanks!