---------------------------------------------------------------------------
| 73 | |
| 74 | //--------------------------------------------------------------------------- |
| 75 | void GameTSCtrl::makeScriptCall(const char *func, const GuiEvent &evt) const |
| 76 | { |
| 77 | // write screen position |
| 78 | char *sp = Con::getArgBuffer(32); |
| 79 | dSprintf(sp, 32, "%d %d", evt.mousePoint.x, evt.mousePoint.y); |
| 80 | |
| 81 | // write world position |
| 82 | char *wp = Con::getArgBuffer(32); |
| 83 | Point3F camPos; |
| 84 | mLastCameraQuery.cameraMatrix.getColumn(3, &camPos); |
| 85 | dSprintf(wp, 32, "%g %g %g", camPos.x, camPos.y, camPos.z); |
| 86 | |
| 87 | // write click vector |
| 88 | char *vec = Con::getArgBuffer(32); |
| 89 | Point3F fp(evt.mousePoint.x, evt.mousePoint.y, 1.0); |
| 90 | Point3F ray; |
| 91 | unproject(fp, &ray); |
| 92 | ray -= camPos; |
| 93 | ray.normalizeSafe(); |
| 94 | dSprintf(vec, 32, "%g %g %g", ray.x, ray.y, ray.z); |
| 95 | |
| 96 | Con::executef( (SimObject*)this, func, sp, wp, vec ); |
| 97 | } |
| 98 | |
| 99 | void GameTSCtrl::onMouseDown(const GuiEvent &evt) |
| 100 | { |
nothing calls this directly
no test coverage detected