Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface
In directory sc8-pr-cvs1:/tmp/cvs-serv30143/src/scriptinterface
Modified Files:
tcScenarioInterface.cpp
Log Message:
FlybyCamera event
Index: tcScenarioInterface.cpp
===================================================================
RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcScenarioInterface.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** tcScenarioInterface.cpp 29 Dec 2003 01:10:25 -0000 1.5
--- tcScenarioInterface.cpp 31 Dec 2003 17:34:10 -0000 1.6
***************
*** 126,129 ****
--- 126,131 ----
.def("ConsoleText",&tcScenarioInterface::ConsoleText)
.def("MapText",&tcScenarioInterface::MapText)
+ // camera and 3D viewer events
+ .def("FlybyCamera",&tcScenarioInterface::FlybyCamera)
// goal creation workaround
.def("CompoundGoal",&tcScenarioInterface::CompoundGoal)
***************
*** 416,419 ****
--- 418,442 ----
director->AddEvent(new tcMapTextEvent(mapView,text,eventTime,eventTime+duration,
lon_deg, lat_deg, effect));
+ }
+
+ void tcScenarioInterface::FlybyCamera(std::string unitName, double duration,
+ float az1_deg, float az2_deg,
+ float el1_deg, float el2_deg, float r1_m, float r2_m)
+ {
+ wxASSERT(director);
+
+ // repeated code from HookPlatform, refactor this
+ wxASSERT(simState);
+ tcGameObject* obj = simState->GetObjectByName(unitName);
+ if (obj == NULL)
+ {
+ std::cerr << "FlybyCamera: Object not found ("
+ << unitName << ")\n";
+ return;
+ }
+ director->AddEvent(new tcFlybyCameraEvent(eventTime, eventTime+duration, obj->mnID,
+ C_PIOVER180*az1_deg, C_PIOVER180*az2_deg,
+ C_PIOVER180*el1_deg, C_PIOVER180*el2_deg,
+ r1_m, r2_m));
}
|