Game Development Community

Mounting camera with a static shape

by M Mahmud Hasan · in Torque Game Engine · 10/01/2006 (2:27 pm) · 5 replies

Hi,

Can anyone help me to locate any resource about mounting Camera with a static shape?

I have a static shape with ambient animation for Radar structure. The radar has an ambient
animation that rotate all the time.

the code is as follows:

datablock StaticShapeData(Radar)
{
Category = "Misc";
ShapeFile = "~/data/shapes/radar/Radar.dts";
};

function Radar::onAdd(%this, %obj)
{
%obj.playThread(0, "ambient");

}

The radar has a mount point mount0. What i wanted is to attach a camera in mount point,
so that the camera also rotate with the structure.

Can anyone help me to figure out how to that?

Great thanks in advance

#1
10/01/2006 (2:34 pm)
"fxGuiSnooper" Is usefull for that.
#2
10/01/2006 (3:28 pm)
Hello Caylo,

I think the resource is very interesting, but smewaht overkill for my objective.
In my case the radar will be the control object (it will not change position though),
when player will load the mission, the caemra will get attached with it's cam node
or something like that.

I am assuming since the cam node is attached with its moving seqence, the camera should be
rotate with the sweep automatically.

Anyway ..I hope some one can suggest me how can I attach the camera with the cam node of a static shape in first person mode.

Thank you,
#3
10/01/2006 (6:39 pm)
For what I need, I made change to the fxGuiSnooper code. fxGuiSnooper will show you how to get a camera view from an 'object', and how to attach that view to the object, so the object and cam view move together. It would just be a matter of edit fxGuiSnooper into what you need after you get the basic functions.

IF all you need is to switch the 'normal' cam view over to your static shape, you should try something like what is in 'game.cs' function GameConnection::onDeath this function examples %this.setControlObject(%this.camera); and that might lead you in the right area...
#4
10/02/2006 (11:49 am)
Hi Caylo,

You are right. I think i need to make the camera a control object.
for that I can use the code you posted:

%this.setControlObject(%this.camera);

But I also needed to know how can i make the camera attached to a
static mesh. The static mesh probably will be a StaticShape type, which will
use a datablock of StaticShapeData (But I am not sure, My be I am wrong).

What I was thining is that I needed a mount point probably "cam" or ''eye" node
in the shape, where I can attach the camera, similar to firstperson view t a player.

But I am not sure how to do it exactly. If you have any idea please share.

Thank you.
#5
10/08/2006 (2:50 am)
As i was researching some ShapeBaseData information, i found this : observeThroughObject Im not sure what it will do for you, but it MIGHT save you from adding extra functions that you dont actualy need.