Game Development Community

Camera movement with mouse

by Matt Grosse · in Torque Game Engine · 08/20/2006 (1:54 pm) · 12 replies

Basically I'm looking to implement a control scheme similar to the one you get after hitting F11. Holding the right mouse button allows you to look around with the camera, otherwise you have a cursor that lets you select things etc. And the rest of your movement (forward, back, strafe left/right) is done with the keyboard.

I tried "grep'ing" through the scripts looking for bind statements that made sense, but didn't find anything that dealt with the mouse. Any help pointing me in the right direction would be appreciated, thanks!

#1
08/20/2006 (4:57 pm)
From what I can tell (and I'm certainly no expert), it's in the "examples/creator" folder, which also uses classes built into the engine in "engine/creator".

I asked this question a few days ago because this is the kind of interface I need and simple thought Torque would support out of the box, but it doesn't apparently and needs heavy engine modification to acheive it.
#2
08/20/2006 (5:50 pm)
Yeah i'm thinking that behavior is controlled in the engine source as well - which is fine, i'm just not sure where the actual change in the control scheme occurs. i'm hoping to trace what happens and pull out the parts i need to implement the controls setup i would like.
#3
08/23/2006 (3:46 pm)
I traced through some code in editTSControl.cc and WorldEditor.cc - and found a lot of the mouse functionality. but from what i can tell, its only handling the movement/scaling/rotation of objects that are selected (and the selection of objects) but not the movement of the camera.

anyone else have ideas?
#4
08/23/2006 (10:14 pm)
Put me on the list for wanting to know how to do this... I think it should be a fairly simple affair - just gotta figure out how it's done in the tools and also the RTSSK.
#5
09/25/2006 (12:42 pm)
There has got to be a way to do this. Perhaps someone from GG can answer the question.
#6
09/26/2006 (11:12 pm)
I'm thinking that the function is in PlayGui.gui and/or PlayGui.cs -- basically, we want to unlock the mouse at some times, but otherwise keep it as is - ie: fps mode. This isn't my top priority atm as I still can't even compile :/ But I'll look at it sooner or later.

Dan
#7
09/28/2006 (8:45 am)
I have been searching for an answer to this as well. Enabling the cursor in "live" mode is simple enough by setting the noCursor dynamic field in PlayGui to "0", this allows me to select on screen buttons, but I have no way to pan the camera then! Any help from the experts would be much appreciated.
#8
09/28/2006 (10:10 am)
Check the resources. If I recall someone recently uploaded one that allowed for a WoW style control system.
#9
09/28/2006 (4:43 pm)
Here is the link to the WoW style snippet:
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=11152
#10
09/28/2006 (5:54 pm)
Thanks for the resource link. This was my first attempt at compiling, and everything seemed to work ok. When I launched the .exe a command window opened and the TLK engine started up... everything ran sooo slow though. I really couldn't test the success of the integration because the frame rate was so poor and choppy, I followed the C++ 2005 Express directions exactly with no problems... any thoughts?
#11
09/28/2006 (6:16 pm)
Matthew,

Are you running a debug version of TGE?
How new is your TGE source? (have gotten the newest version)
What about a clean,stock version of TGE? Is it slow too?
#12
09/28/2006 (6:55 pm)
Ya... I guess. The new .exe I compiled has _DEBUG after it. It is a clean copy of the latest version of TLK.

Matt

Are there settings in VCC I should change in order to get a "non-debug" compile?

Thanks again.