Game Development Community

Callback for "onViewLimit"?

by Timbo · in Torque Game Builder · 09/28/2010 (8:14 am) · 1 replies

Hello everybody.

I need a callback, when the camera hits the view limit. My problem is this:
I have the camera mounted to a "camera dummy" which is used for movement on the playing field. When I set the view limit (via "sceneWindow2D.setViewLimitOn(...)") the camera stops at the view limits, but my camera dummy keeps moving outside. So my idea is to set a callback when the camera actually reaches the limits where I can call setAtRest or something for my camera dummy.

So I looked up the source code and figured out, that the view limit is used in t2dSceneWindow::calculateCameraView. But with a bit of research I found out that the two "if"-cases seem never to be called...

Is it possible to place a callback somewhere in there that tells me, if the camera reached the view limit?

Thanks in advance!

#1
09/29/2010 (2:52 pm)
You should post with your account that has source access... Nonetheless, why don't you use the callback from the dummy camera object that it is attached to since that's what's driving the movement anyways?