Game Development Community

Where is the camera tied to the players point of view

by Rob Segal · in Torque Game Engine · 01/21/2006 (6:28 pm) · 2 replies

Where in script does the camera get tied to the players point of view? For the fps sample game it looks like that occurs in starter.fps\server\scripts\game.cs inside GameConnection::createPlayer. Would that be accurate?

#1
01/22/2006 (2:09 pm)
When an object is set as a control object (%this.setControlObject(%player) in /server/scripts/game.cs--function GameConnection::createPlayer(%this, %spawnPoint) ) is where the camera is really tied to the eye node in a model, as you said. The first %this.camera.setTransform(%player.getEyeTransform()); is there as a one-time call to align the current camera with the player before he moves (which is how the tie is actually handled)

It's a lot deeper than that in actual execution, but in practice that's the script section that causes the rest of the magic to happen.
#2
01/22/2006 (8:10 pm)
Excellent thanks Stephen that's what I needed to know.