//===============================================================================================================================
void ModelEnvironment::Update()
{
	// Need to get toggle update time based on the amount of triangles rendered (This needs to be fixed)
	float dt = fFrameTime;
	
	mPlane->SetWireframe(bWireframeMode);
	
	// Uncomment if using the picking sphere
	mPickingSphere->SetWireframe(bWireframeMode);
	
	UpdateSpawnedMeshItems(dt);
	
	mSpaceCompound->SetWireframe(bWireframeMode);
	mHuman->SetWireframe(bWireframeMode);

	mSpaceCompound->SetFarPlane(mEngineOptions->fFarPlane);
	mHuman->SetFarPlane(mEngineOptions->fFarPlane);
	
	ToggleLightMeshWireframe(bWireframeMode);
	
	//// OBJ Mesh Collision test with camera
	//bool touchedAABB = false;
	//bool touchedSphere = false;
	//
	//if (mSpaceCompound->IntersectsAABB(eye))
	//{
	//	touchedAABB = true;
	//}
	//
	//if (mHuman->IntersectsAABB(eye))
	//{
	//	touchedAABB = true;
	//}
	//
	///*if (mSpaceCompound->IntersectsSphere(eye))
	//{
	//	touchedSphere = true;
	//}
	//
	//if (mHuman->IntersectsSphere(eye))
	//{
	//	touchedSphere = true;
	//}*/
	//
	//bToggleGBufferDebugging = touchedAABB;// && touchedSphere;

	// If the camera touched an OBJ Mesh then render everything in wireframe mode
	//bWireframeMode = touchedAABB && touchedSphere;
}
//===============================================================================================================================
void RoomEnvironment::Update()
{
	mRoom->SetWireframe(bWireframeMode);
	UpdateSpawnedMeshItems(fFrameTime);
	ToggleLightMeshWireframe(bWireframeMode);
}