2020-09-15 10:45 AM - last edited on 2021-09-14 01:47 PM by Noemi Balogh
Solved! Go to Solution.
2020-09-17 12:03 PM
class MySightObserver: public Modeler::ISightObserver { public: Modeler::Camera cam; void CameraChanged(const Modeler::Camera&); }; MySightObserver mso; MySight::MySight(Modeler::Sight *sig){ mysight = sig; myobserver = &mso; ((MySightObserver*)myobserver)->cam = sig->GetCamera(); sig->Attach(*myobserver); } void MySightObserver::CameraChanged(const Modeler::Camera& newCamera) { if (!newCamera.IsNear(cam)) { /*Your code here*/ } return; }PS: You need to fetch the Modeler::Sight (see my another post) and create an instance of MySightObserver.
2020-09-15 01:35 PM
2020-09-17 12:03 PM
class MySightObserver: public Modeler::ISightObserver { public: Modeler::Camera cam; void CameraChanged(const Modeler::Camera&); }; MySightObserver mso; MySight::MySight(Modeler::Sight *sig){ mysight = sig; myobserver = &mso; ((MySightObserver*)myobserver)->cam = sig->GetCamera(); sig->Attach(*myobserver); } void MySightObserver::CameraChanged(const Modeler::Camera& newCamera) { if (!newCamera.IsNear(cam)) { /*Your code here*/ } return; }PS: You need to fetch the Modeler::Sight (see my another post) and create an instance of MySightObserver.