Esempio n. 1
0
bool ObjectDao::parseObject(const QJsonObject & objectObj)
{
   if (!typesCheck(objectObj))
      return false;

   model = objectObj["model"].toString();
   shader = objectObj["shader"].toString();

   QJsonArray posArr = objectObj["pos"].toArray();
   pos = glm::vec3((float) posArr[0].toDouble(),
                   (float) posArr[1].toDouble(),
                   (float) posArr[2].toDouble());

   QJsonArray rotArr = objectObj["rot"].toArray();
   rot = glm::vec3((float) rotArr[0].toDouble(),
                   (float) rotArr[1].toDouble(),
                   (float) rotArr[2].toDouble());

   QJsonArray scaleArr = objectObj["scale"].toArray();
   scale = glm::vec3((float) scaleArr[0].toDouble(),
                     (float) scaleArr[1].toDouble(),
                     (float) scaleArr[2].toDouble());

   if (!validCheck())
      return false;

   valid = true;
   return true;
}
Esempio n. 2
0
void
kTable::kSet(int i, int j, DComplex value) {
  validCheck();
  if (j<0) {
    array[index(i,j)]=conj(value)/scaleby;
    if (j==-N/2) array[index(-i,j)]=value/scaleby;
  }
  else {
    array[index(i,j)]=value/scaleby;
    if (j==0 || j==N/2) array[index(-i,j)]=conj(value)/scaleby;
  }
  return;
}
Esempio n. 3
0
void
xTable::xSet(int i, int j, double value) {
  validCheck();
  array[index(i,j)]=value/scaleby;
  return;
}
Esempio n. 4
0
double xTable::xval(int i, int j) const {
  validCheck();
  return scaleby*array[index(i,j)];
}
Esempio n. 5
0
DComplex kTable::kval(int i, int j) const {
  validCheck();
  DComplex retval=scaleby*array[index(i,j)];
  if (j<0) return conj(retval);
  else return retval;
}