Game Development Community

2 Advanced Cameras???

by Jacob Gostylo · in Torque Game Engine · 03/13/2006 (7:27 pm) · 3 replies

I am trying to alter the Advanced Camera so that it will pan and look at the target object at the same time. I am setting it up as a GodView camera because it is the closest to what I am looking for. What I am having trouble with is that some settings are not getting passed through to the camera object at runtime. After some debugging, the nearest I can tell is that the camera I am sending settings to and the one that is being called during updates are not the same object ('this' is a different location in memory when I am stepping in the various functions). There seems to be 2 Advanced Camera objects. Even with this though, some of the settings are persisting to both objects.

What works:
mCurrentGodViewOffset is being set through "void AdvancedCamera::setGodViewOffset(Point3F offset)". The location in memory for 'this', I will call it &this1, is different from &this2 which is what "void AdvancedCamera::setGodViewOffset(Point3F offset)" is running from. The value of mCurrentGodViewOffset is the same in both places though and it is changing often.

What does not work:
I created mStoreDirection as a MatrixF private to Advanced Camera. I have a function that returns columns in this matrix and it is running in &this1. I change the value of the matrix in "void AdvancedCamera::setPosition(const Point3F& pos)" which is running in &this2. The values do not persist. I have debugged enough to see that everything by itself is running correctly.

My Theory:
I am guessing that &this1 is a server camera and &this2 is a client camera. The only thing I could really think of is that "void AdvancedCamera::writePacketData" and "void AdvancedCamera::readPacketData" was persisting mCurrentGodViewOffset to the client but it does not go back the other way for mStoreDirection. At least it did nto change my results when I added it to the packing list.

So why are there 2 camera objects and how do I go about getting the one I want or at least persisting the settings that I want?

#1
03/15/2006 (12:13 am)
You're correct, the 2 cameras are just the 2 seperate instances of the camera on the server/client. You probably need to network mStoreDirection(oh BTW, the advanced camera networking is kinda screwy). Does that help at all?
#2
03/15/2006 (6:52 am)
It helps reassure me that I am not crazy :). I am not sure what you mean by screwy. The code looked similar to other networked objects. Maybe I am missing something about the details. This will be my first for delving into networking with Torque so it will take me a bit of time to wrap my head around it. I will post a new topic if I am having trouble with that. Thank you for the response!
#3
03/15/2006 (11:00 am)
I ment that it was screwy in that it sends way too much information over the network, sorry.