Well uh, a quick search didn't yield much results so I figured no one must've utilized this method yet...
Basically, since we can't move the cursor, why not move the camera instead? We know where the cursor is through the API, so all that's left is to adjust the camera so that it points at something.
But how do we know where to point? Well, there's plenty of methods I suppose, some of which might require a higher understanding of mathematics, which I sadly do not possess. So I chose the simple method of comparing cursor coordinates with nameplate coordinates, and through some primitive algorithms, got it to barely work in optimal circumstances. Of course there are some interesting side effects when everything doesn't go as planned, but anyways...
Currently it can only target through names (which are also case sensitive), but it could be possible to target raid target icons or the current selected target. I might introduce those features later if my patience with this project doesn't run out before that :P
The usage for the slash command seen in the video is /pnklook target lock
For example, if you want to point at Thrall, you type /pnklook Thrall
but if you want to lock your cursor on Thrall, you type /pnklook Thrall lock
If you need some lua functionalism in the name selecting, you can use the function lookAt( string name, bool lock )
/run lookAt( "Thrall", false ) and /run lookAt( "Thrall", true ) produce the above results.
Also - the parsing for the slash command doesn't handle special characters well so you might use the lua function in that case.
Third edit: the addon also utilizes SetView(2) in an attempt to get a wide view to search for the name plates. So you might want to set a wide view for the B camera (values used in video: 40 pitch 40 distance 0 yaw). If you use SetView(2) for something else, go ahead and edit it to use some other point or take it out altogether :P
Some known bugs (or unfeatures, rather) include earthquakism and cameraman suddenly flying into outer space. And if the camera is blocked by something, say a ceiling, it might yield unwanted results, since it currently relies on camera zoom to adjust the Y difference between cursor and nameplate (I tried to combine zoom and pitch together but that proved quite difficult :P)
Having your cursor in the upper region of the window is pretty much a requirement to get any reliable results as of now. I might improve the algorithms later but thought I'd put this piece of garbage out for you to enjoy for now.
Fourth edit: aaaalso... the nameplate finding function is quite modest, so nameplate addons might break it up.
Connect With Us