Beispiel #1
0
// Experiment specific functions called from ARSS.cpp
void CreateExperiment()
{
	// This is how you turn on the grid display. (There is also an XY Grid.)
	gDebug.bXZGridOn=true;

	// This is how you create a ground plane (and save its address in gExp.VIPs).
	CreateGroundPlane();

	// This is how you create a compound, multi-shape, static actor.
	PxRigidStatic* basket = gPhysX.mPhysics->createRigidStatic(PxTransform(PxVec3(0)));
	if (!basket)
		ncc__error("basket fail!");
	PxMaterial* defmat=gPhysX.mDefaultMaterial;
	PxBoxGeometry base(0.5,0.1,0.5);
	PxBoxGeometry pole(0.05,1,0.05);
	PxBoxGeometry board(0.5,0.5,0.01);
	PxBoxGeometry hoopel(0.01,0.01,0.15);
	basket->createShape(base,*defmat,PxTransform(PxVec3(0,0.1,0)));
	basket->createShape(pole,*defmat,PxTransform(PxVec3(0,1,0)));
	PxShape* sboard = basket->createShape(board,*defmat,PxTransform(PxVec3(0,2,0.05)));
	PxShape* shoopel1 = basket->createShape(hoopel,*defmat,PxTransform(PxVec3(-0.15,2,0.15+0.06)));
	PxShape* shoopel2 = basket->createShape(hoopel,*defmat,PxTransform(PxVec3(+0.15,2,0.15+0.06)));
	PxShape* shoopel3 = basket->createShape(hoopel,*defmat,PxTransform(PxVec3(+0.00,2,0.30+0.05),PxQuat(PxPi/2,PxVec3(0,1,0))));

	gPhysX.mScene->addActor(*basket);
	
	// We saved the pointers to the shapes we wish to color separately, with a call to the convenience function...
	ColorShape(sboard, ncc::rgb::yLightYellow);

	// ... or manually (in case we wish to be efficient with duplicate colors).
	gColors.colorBucket.push_back(vector<GLubyte>(3));
	gColors.colorBucket.back()[0]=ncc::rgb::grBlack[0];
	gColors.colorBucket.back()[1]=ncc::rgb::grBlack[1];
	gColors.colorBucket.back()[2]=ncc::rgb::grBlack[2];
	shoopel1->userData=&(gColors.colorBucket.back()[0]);
	shoopel2->userData=&(gColors.colorBucket.back()[0]);
	shoopel3->userData=&(gColors.colorBucket.back()[0]);

	// We signal that the experiment is ready for simulation by setting this flag.
	gSim.isRunning = true;
}
int main()
{
  //Tablica 10 okręgów
  int x[10];
  int y[10];
  float r[10];

  //Uzupełniamy pierwszy okrąg (1,2,5,0)
  x[0] = 1;
  y[0] = 2;
  r[0] = 2.0;

  wypisz(x[0], y[0], r[0]);
  printf("Pole okręgu to %f\n", pole(x[0], y[0], r[0]));

  //Uzupełniamy pierwszy okrąg
  x[1] = 3;
  y[1] = 4;
  r[1] = 5.0;

  return 0;
}
Beispiel #3
0
Dispersive::Dispersive(const Id id,
                                   const std::string& name,
                                   const Math::Real rEps,
                                   const Math::Real rMu,
                                   const Math::Real elecCond,
                                   const Math::Real magnCond,
                                   const std::vector<PoleResidue>& poleResidue)
:   Identifiable<Id>(id),
    PhysicalModel(name) {
    rEpsInfty_ = rEps;
    rMuInfty_ = rMu;
    // Adds conductivity as a permittivity pole.
    if (elecCond != 0.0) {
        std::complex<Math::Real> pole(0.0);
        std::complex<Math::Real> residue(elecCond / Math::Real(2.0) /
                                         Math::Constants::eps0, 0);
        poleResidue_.push_back(PoleResidue(pole, residue));
    }
    //
    if (magnCond != 0.0) {
        throw std::logic_error("Dispersive magnetic materials not implemented");
    }
    poleResidue_ = poleResidue;
}