Game Development Community

Camera + FirstPerson + ControlObjects + Confusion

by Steve Acaster · in Torque 3D Professional · 11/11/2009 (8:53 pm) · 2 replies

The TWO Cameras
----------------
Just checking - but the camera in First Person View, and the "Camera"/cameraObject (ALT C) ar not the same thing, are they? In FirstPerson View I can see the cameraObject in the editor.

Fo ease of use in calling with script I've got my client and the camera set as globals - $client and $camera.

When setting a controlobject, it automatically switches to eyenode view of that object. Back in the days of TGE you had to specify this seperately - it was amusing to have a view from one playerobject, whilst controlling another.

What I'm trying to do:
--------------------
Either mount a camera or move the FirstPerson camera to a different node on the player (eg a mountpoint or even an object mounted to the player), and still have control over the player.

I can mount the cameraObject on to my player at a mountpoint, but can't control my player without reverting to FirstPerson view with $client.setcontrolObject(%playerID);

There's a few functions regarding mounting, though I think I initially misunderstood which was the mounter and which was the mountee (lots of attaching my player to things rather than attaching things to my player).

So before I totally start rambling - Is there a way to get/return the FirstPerson View camera (if it is a seperate camera from the CameraObject), and can it be offset/move/mounted away from getEyeTransform.

Cheers

[edit]
I thought I remembered something akin to a getnode() function somewhere (maybe as a resource) but couldn't find that via search, and now think I might have confused that idea with the functions in TsShapeConstructor.

#1
11/12/2009 (7:05 pm)
Steve, you know how pressing tab puts you in 3rd person right? Why not just adjust that to the locations you want the player-camera to go to. You could make a script that checked to see if it was "leftarm", "rightarm", "firstperson", "thirdperson", etc. and then just put in the offsets and that should put your player-camera in the right place and you would still have control of your player.

Does that make sense?
#2
11/12/2009 (8:43 pm)
"technically" - that makes sense, though I've had a fair bit of trouble on hunting backwards through all of the functions to "get" the camera. All of the 1st/3rd person keybinds pass to functions ... which then pass to functions, and even a hunt through shapebase.cpp appeared to continue to pass to other functions or states rather than do the actual biz ... which is around when my brain disolved.

Though now I'm pretty convinced that the cameraObject isn't where I want to be looking (certainly in camera.cpp it doesn't seem to have any references to anything player related).