Archived

This topic is now archived and is closed to further replies.

Mephs

Passing information to a class function

Recommended Posts

Mephs    354
Hi, Just had a small problem passing an array of plane data into a class function and I wondered if anyone might have some idea whats going on below is the function header:
  
BOOL cMap::GetIntersection (int a, int b, int c, D3DXPLANE *Plane, float X, float Y, float Z)
  
this is how the function is called:
  
if(GetIntersection (a,b,c,&Plane[20], X, Y, Z) != FALSE) {
  
Now my problem is that within the original function where the plane data is filled in. I get the correct information in the plane structure. BOOL cMap::ConvertThisBrushToPolygons() As soon as I access the information in the array of planes from the GetIntersection function, I get a whole different set of data which is ordely enough not to be undefined data, but is not the original data I filled it with. original data might look as follows Plane[2].a = -1 Plane[2].b = 0 Plane[2].c = 0 Plane[2].d = -128 the new data will be unnormalised and sometimes odd numbers like as follows Plane[2].a = -128 Plane[2].b = 256 Plane[2].c = 1.20281e-038 Plane[2].d = 1.20281e-038 in addition to this Plane[0] is always completely correct, except that the values for .a .b and .c are unnormalised Anyone have any ideas whats causing this? I believe its something to do with how I''m passing the data between the functions, so I thought best to post here as I dont believ the problem has anything to do with DirectX itself. cheers, Steve AKA Mephs

Share this post


Link to post
Share on other sites
amag    152
You should change:

  
if(GetIntersection (a,b,c,&Plane[20], X, Y, Z) != FALSE) {

to

  
if(GetIntersection (a,b,c,&Plane[0], X, Y, Z) != FALSE) {


[edited by - amag on June 9, 2002 7:58:30 AM]

Share this post


Link to post
Share on other sites