Tokomak in Qt
Verfasst: 28. Juli 2009 19:33
Hallo,
ich versuche gerade die Tokamak Physik-Engine in ein erweitertes open-gl-Beispiel einzubinden.
Ich hab dazu die Version aus diesem Tutorial geholt, und die Ordnerstruktur von Tokamak in mein QT-Verzeichnis übernommen. (Also .lib in \2009.01\qt\lib, .h in \2009.01\qt\include...)
Jetzt setzte ich die ersten Teile des Codes aus dem Tutorial in meine glwidget.cpp ein, also:
Hier kommt jetzt die Warnung
Kann mir jemand weiterhelfen?
Vielen Dank,
streikbrecher
ich versuche gerade die Tokamak Physik-Engine in ein erweitertes open-gl-Beispiel einzubinden.
Ich hab dazu die Version aus diesem Tutorial geholt, und die Ordnerstruktur von Tokamak in mein QT-Verzeichnis übernommen. (Also .lib in \2009.01\qt\lib, .h in \2009.01\qt\include...)
Jetzt setzte ich die ersten Teile des Codes aus dem Tutorial in meine glwidget.cpp ein, also:
Code: Alles auswählen
#include <tokamak.h>
#pragma comment(lib, "tokamak.lib")
neSimulator *gSim = NULL;
// The number of cubes to render in the simulation (try values between 2 and about 50)
#define CUBECOUNT 5
neRigidBody *gCubes[CUBECOUNT];
neAnimatedBody *gFloor = NULL;
bool GLWidget::InitPhysics(void)
{
neGeometry *geom; // A Geometry object which used to define the shape/size of each cube
neV3 boxSize1; // A variable to store the length, width and height of the cube
neV3 gravity; // A vector to store the direction and intensity of gravity
neV3 pos; // The position of a cube
f32 mass; // The mass of our cubes
neSimulatorSizeInfo sizeInfo; // Stores data about how many objects we are going to model
int i;
// Create and initialise the simulator
// Tell the simulator how many rigid bodies we have
sizeInfo.rigidBodiesCount = CUBECOUNT;
// Tell the simulator how many animated bodies we have
sizeInfo.animatedBodiesCount = 1;
// Tell the simulator how many bodies we have in total
s32 totalBody = sizeInfo.rigidBodiesCount + sizeInfo.animatedBodiesCount;
sizeInfo.geometriesCount = totalBody;
// The overlapped pairs count defines how many bodies it is possible to be in collision
// at a single time. The SDK states this should be calculated as:
// bodies * (bodies-1) / 2
// So we'll take its word for it. :-)
sizeInfo.overlappedPairsCount = totalBody * (totalBody - 1) / 2;
// We're not using any of these so set them all to zero
sizeInfo.rigidParticleCount = 0;
sizeInfo.constraintsCount = 0;
sizeInfo.terrainNodesStartCount = 0;
// Set the gravity. Try changing this to see the effect on the objects
gravity.Set(0.0f, -10.0f, 0.0f);
qDebug() << sizeInfo.rigidBodiesCount ;
// Ready to go, create the simulator object
gSim = neSimulator::CreateSimulator(sizeInfo, NULL, &gravity);
[...]
und der Fehler:undefined reference to `neSimulator::CreateSimulator(neSimulatorSizeInfo const&, neAllocatorAbstract*, neV3 const*)'
Ich weiß jetzt nicht ob ich etwas beim Einrichten von Tokamak falsch gemacht habe, oder was anderes.. auf jeden Fall kann er die Zeileerror: collect2: ld returned 1 exit status
nicht ausführen.gSim = neSimulator::CreateSimulator(sizeInfo, NULL, &gravity);
Kann mir jemand weiterhelfen?
Vielen Dank,
streikbrecher