Jump to content
  • Advertisement

Archived

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

Mephs

Passing information to a class function

This topic is 5859 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!