Added Camera's s/getCameraThread() and updated wrappers

This commit is contained in:
Robert Osfield
2007-02-05 13:44:16 +00:00
parent ea67cc7a50
commit ebd68ba063
6 changed files with 76 additions and 1 deletions

View File

@@ -56,6 +56,8 @@ Camera::Camera(const Camera& camera,const CopyOp& copyop):
Camera::~Camera()
{
setCameraThread(0);
if (_graphicsContext.valid()) _graphicsContext->removeCamera(this);
}
@@ -301,3 +303,31 @@ bool Camera::computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor*) const
return true;
}
void Camera::createCameraThread()
{
if (!_cameraThread)
{
setCameraThread(new OperationsThread);
}
}
void Camera::setCameraThread(OperationsThread* gt)
{
if (_cameraThread==gt) return;
if (_cameraThread.valid())
{
// need to kill the thread in some way...
_cameraThread->cancel();
_cameraThread->setParent(0);
}
_cameraThread = gt;
if (_cameraThread.valid())
{
_cameraThread->setParent(this);
}
}