Jump to content
  • Advertisement
Sign in to follow this  
Kris2456

Strange Member Problem

This topic is 4990 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

Ok, i have some standard structures in a file called maths.h. They are very simple ones, much like the ones most of you have. Now the problem is. When i try to assign any data to the last member (eg. Vec3.z or Vec2.y) it doesnt do anything. And gives me a random number. Its like these values are not accessed. If i add two vectors, both x,y add, but not z. This only happens in my model loading file. I am using Dev-C++, if u need anymore info plz ask.

Share this post


Link to post
Share on other sites
Advertisement
Sounds like a logical error. Could you post the code for where you add the vectors and assign the members variables?

Try adding another member called "temp" to your vector structure. Now see if you can successfully assign a value to the temp member of your structure. This may help you determine what the problem is.

Oh, one other thing which sounds likely. If you're debugging and stepping through the instructions, don't forget that the line you're on isn't executed until you've passed it. So step through to the line after where you assign values to the vector members before checking their value.

Share this post


Link to post
Share on other sites
A logical error as in, it sounds like you have made an error in your algorithm, rather than there being some technical problem or subtlety. Perhaps you could post the code where you perform the addition? It is likely something extremely simple—I'm sure we've all experienced situations where we stare ourselves blind on a section of code and overlook what would usually seem blatantly obvious. At least I have, many times, and I hope I am not alone.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!