public Scene(Viewport v, Camera cam) { this.cameraPropertyChangedEventHandler = new PropertyChangedEventHandler(OnCameraPropertyChanged); this._camera = cam; if (_camera != null) _camera.PropertyChanged += cameraPropertyChangedEventHandler; _Viewport = v; _World = Matrix.Identity; UpdateProjectionMatrix(); _WorldViewProj = (_World * Camera.View) * _Projection; }
protected void Dispose(bool freeManagedObjectsAlso) { if (freeManagedObjectsAlso) { if (_camera != null) { _camera.PropertyChanged -= this.cameraPropertyChangedEventHandler; _camera = null; } } }