is incompatible with parameter of type
salut,
voici déjà mon code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
BMP heightmap; //bmp image
u32 heightmapX; //u32 = unsigned int for irrlicht
u32 heightmapY;
unsigned short* heightmapData = new unsigned short [256*256]; // allocate memory at runtime
//load the heightmap
heightmap.ReadFromFile("heightmap/F18");
//heightmapData
for(heightmapX=0;heightmapX<256;heightmapX++)
{
for(heightmapY=0;heightmapY<256;heightmapY++)
{
RGBApixel pixelTemp = heightmap.GetPixel(heightmapX,heightmapY);
heightmapData [heightmapX + heightmapY*256] = pixelTemp.Red*256;
}
}
//Newton
NewtonCollision* nTerrainCol = NewtonCreateHeightFieldCollision(
nWorld, //world pointer
256, //width
256, //height
0, //diagonal cut
heightmapData, //unsigned short* elevationMap - the actual elevation map as 16-bit integer array from ram
0,
400.0f, //calcul one cell, check irrlicht scaling
33.0f); //maximum height
//NewtonBody* nTerrain=NewtonCreateDynamicBody(nWorld, nTerrainCol,0);
//NewtonDestroyCollision(nTerrainCol); |
http://newtondynamics.com/wiki/index...FieldCollision
heightmapData dans la fonction me donne cete erreur :
Citation:
unsigned short* heigtmapData
Error: argument of type "unsigned short *" is incompatible with parameter of type "const float *"
donc d'apres mon code et ce que j'ai trouver sur le net, je pense que je mélange "array" et "pointer" mais je comprend pas comment je peux résoudre mon problème car je ne peux pas initialiser un int par exemple et y attribuer un pointer comme si c'était une fonction.
l'allocation mémoire m'a été suggéré par un membre du forum de newton game dynamics.
'fin bref, est-ce que quelqu'un peut m'aider à comprendre comment résoudre cette erreur ?