Use mounted object's Camera?
by Britt Scott · in Torque Game Engine · 01/27/2009 (10:01 am) · 8 replies
First off, I'm using TGE 1.5.2. What I'm trying to do is mount a player to player II and then use "player II's" camera. I'm using the example stronghold mission and trying to mount the player to the "AI" Kork running around. I can mount the player to Kork and even take control of Kork. But, the camera is still using the player's camera settings. Any suggestions?
About the author
Attended Brown College in Mendota Heights, MN for Game Design and Development. Projects include the Mech Starter Kit and the Battle Frog. Currently working toward a game design career.
#2
For example :
%client.setCameraObject( %client.player );
02/04/2009 (10:52 pm)
Have you tried the setCameraObject function?For example :
%client.setCameraObject( %client.player );
#3
02/05/2009 (9:39 am)
Tried it. It works, but I can't take control of the A.I. after I use its camera.
#4
Usually the setControlObject function will take over the controlled object's camera though, so I'm not entirely sure what's going on.
02/05/2009 (10:04 am)
Hmm.. I would try setting the control object first, then setting the camera object. Usually the setControlObject function will take over the controlled object's camera though, so I'm not entirely sure what's going on.
#5
02/05/2009 (10:41 am)
Also, since I'm not realizing that your AI is the mech, not kork, do you have the camera/eye nodes in place? Maybe that's a silly question, but I thought I'd check with you.
#6
02/05/2009 (10:53 am)
yeah they are there.
#7
It's in
Find
And add whats in bold
I would point you to the original thread or resource I got it from but I can't find it because the search is flat out broken.
02/05/2009 (7:54 pm)
What you need requires a source code mod.It's in
void ShapeBase::getCameraTransform(F32* pos,MatrixF* mat)
Find
void ShapeBase::getCameraTransform(F32* pos,MatrixF* mat)
{
// Returns camera to world space transform
// Handles first person / third person camera position
if (isServerObject() && mShapeInstance)
mShapeInstance->animateNodeSubtrees(true);
if (*pos != 0)
{And add whats in bold
void ShapeBase::getCameraTransform(F32* pos,MatrixF* mat)
{
// Returns camera to world space transform
// Handles first person / third person camera position
if (isServerObject() && mShapeInstance)
mShapeInstance->animateNodeSubtrees(true);
if (*pos != 0)
{
[b]
if ( getControlObject())
{
getControlObject()->getCameraTransform( pos, mat );
return;
}[/b]I would point you to the original thread or resource I got it from but I can't find it because the search is flat out broken.
#8
02/05/2009 (10:27 pm)
Fiddle sticks! I figured an engine change would be needed. Thanks!
Associate Britt Scott