Пример #1
0
void TSStaticPolysoupConvex::getPolyList(AbstractPolyList *list)
{
   // Transform the list into object space and set the pointer to the object
   MatrixF i( mObject->getTransform() );
   Point3F iS( mObject->getScale() );
   list->setTransform(&i, iS);
   list->setObject(mObject);

   // Add only the original collision triangle
   S32 base =  list->addPoint(verts[0]);
               list->addPoint(verts[2]);
               list->addPoint(verts[1]);

   list->begin(0, (U32)idx ^ (U32)mesh);
   list->vertex(base + 2);
   list->vertex(base + 1);
   list->vertex(base + 0);
   list->plane(base + 0, base + 1, base + 2);
   list->end();
}
Пример #2
0
/*  ...
 */
void CBaSwOsciTest::ConcreteNiceWeather() {
   CBaSwOsci *p = CBaSwOsci::Create("BaSwOsciTest", RESPATH, true);
   ASS(p);
   double d = 3.14e-5;
   uint64_t llu = 999999999999;
   uint16_t usi = 300;
   int8_t c = 56;

   ASS(p->Register(&d, eBaSwOsci_double, "d", "double"));
   ASS(p->Register(&llu, eBaSwOsci_uint64, "llu", "unsigned ll"));
   ASS(p->Register(&usi, eBaSwOsci_uint16, "usi", "unsigned s"));
   ASS(p->Register(&c, eBaSwOsci_int8, "c", "signed char"));

   ASS(p->Sample());
   // Let the thread flush it
   BaCoreSleep(1);

   // Re-sample
   d *= 2;
   llu *= 2;
   usi *= 2;
   c *= 2;
   ASS(p->Sample());
   ASS(CBaSwOsci::Destroy(p, 300));

   // Test the header
   std::ifstream iS(RESPATH "BaSwOsciTest.csv");

   ASS(iS.good());
   std::string s;
   std::getline(iS, s, ','); // Header
   ASS(s == "Time");
   std::getline(iS, s, ',');
   ASS(s == " Timestamp");
   std::getline(iS, s, ',');
   ASS(s == " d");
   std::getline(iS, s, ',');
   ASS(s == " llu");
   std::getline(iS, s, ',');
   ASS(s == " usi");
   std::getline(iS, s);
   ASS(s == " c");

   // Test the first line
   std::getline(iS, s, ',');
   std::getline(iS, s, ',');
   std::getline(iS, s, ',');
#ifdef __WIN32
   ASS(s == " 3.14e-005");
#else
   ASS(s == " 3.14e-05");
#endif
   std::getline(iS, s, ',');
   ASS(s == " 999999999999");
   std::getline(iS, s, ',');
   ASS(s == " 300");
   std::getline(iS, s);
   ASS(s == " 56");

   // Test the second line
   std::getline(iS, s, ',');
   std::getline(iS, s, ',');
   std::getline(iS, s, ',');
#ifdef __WIN32
   ASS(s == " 6.28e-005");
#else
   ASS(s == " 6.28e-05");
#endif
   std::getline(iS, s, ',');
   ASS(s == " 1999999999998");
   std::getline(iS, s, ',');
   ASS(s == " 600");
   std::getline(iS, s);
   ASS(s == " 112");

}