void UISceneView::SetView(Scene* scene, Camera* camera)
{
    scene_ = scene;
    cameraNode_ = camera ? camera->GetNode() : 0;

    viewport_->SetScene(scene_);
    viewport_->SetCamera(camera);
    QueueUpdate();
}
void SceneView3D::HandleUpdate(StringHash eventType, VariantMap& eventData)
{

    // Timestep parameter is same no matter what event is being listened to
    float timeStep = eventData[Update::P_TIMESTEP].GetFloat();

    if (MouseInView())
        MoveCamera(timeStep);

    QueueUpdate();
}
Beispiel #3
0
bool ObjectUpdater::Load()
{
#ifdef YES_USE_CACHE

#ifdef OU_DEBUG
std::cout << "Loading " << CACHE_FILENAME << "...\n";
#endif

  File f;
  if (!f.OpenRead(CACHE_FILENAME))
  {
    return false;
  }
  if (!m_timestampPos.Load(&f))
  {
    f.ReportError("Object state cache: Expected pos timestamp");
    return false;
  }

  if (!m_timestampUpdate.Load(&f))
  {
    f.ReportError("Object state cache: Expected update timestamp");
    return false;
  }

  int num = 0;

  // Load key/val pairs
  if (!f.GetInteger(&num))
  {
    f.ReportError("Object state cache: Expected num items");
    return false;
  }
  for (int i = 0; i < num; i++)
  {
    std::string s;
    if (!f.GetDataLine(&s))
    {
      f.ReportError("Object state cache: Expected item");
      return false;
    }
    // Format is id, key, val
    Strings strs = Split(s, ',');
    if (strs.size() != 3)
    {
      // Delimiter in key or val ??
      f.ReportError("Object state cache: bad item line: " + s);
      continue; // try to keep going
    }   
    int id = ToInt(strs[0]);
    QueueUpdate(id, strs[1], strs[2]);
  }

#ifdef OU_DEBUG
std::cout << "...Loaded " << num << " update items...\n";
#endif

  // Load positions
  if (!f.GetInteger(&num))
  {
    f.ReportError("Object state cache: Expected num positions");
    return false;
  }
  for (int i = 0; i < num; i++)
  {
    std::string s;
    if (!f.GetDataLine(&s))
    {
      f.ReportError("Object state cache: Expected position");
      return false;
    }
    // Format is id,x, y, z
    Strings strs = Split(s, ',');
    if (strs.size() != 5)
    {
      f.ReportError("Object state cache: bad position: " + s);
      continue;
    } 
    int id = ToInt(strs[0]);
    float x = ToFloat(strs[1]);
    float y = ToFloat(strs[2]);
    float z = ToFloat(strs[3]);
    int location = ToInt(strs[4]);

    QueueUpdatePos(id, Vec3f(x, y, z), location);
  }

#ifdef OU_DEBUG
std::cout << "...Loaded " << num << " positions, OK, done!\n";
#endif
  
#endif // YES_USE_CACHE

  return true;
}
void DistSparseMatrix<T>::Update( Int row, Int col, T value )
{
    DEBUG_ONLY(CSE cse("DistSparseMatrix::Update"))
    QueueUpdate( row, col, value, true );
    ProcessLocalQueues();
}
Beispiel #5
0
void DistSparseMatrix<T>::Update( Int row, Int col, T value )
{
    DEBUG_CSE
    QueueUpdate( row, col, value, true );
    ProcessLocalQueues();
}
Beispiel #6
0
void DistSparseMatrix<T>::Update( Int row, Int col, T value )
{
    DEBUG_ONLY(CallStackEntry cse("DistSparseMatrix::Update"))
    QueueUpdate( row, col, value );
    MakeConsistent();
}