Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
I made a small vector2d class. When I print just the vector2d itself, I get a 3 point value despite the class only having a X and Y value. My class has no Z value or field, so its impossible to return a third value. Its default constructor insures that. For example:
Outputs:
Where as:
Outputs:
Here is my class:
|
||||
|
Coppercube will always provide 3 cordinates even if you use vecotor2d... It will still provide you 3 cordinates... You may use ccbget2dposfrom3dpos... If that helps... |
||||
|
You clearly don't know what I mean. My class is literally a custom made 2d vector class with ONLY 2 points so the default value SHOULD NOT return a 3 point value itself. This is a BUG. |
||||
|
So, where is the definition of your class? |
||||
|
We can't see your custom defined class.... So can't say if it is a bug within coppercube or if there is some issue with your custom class? |
||||
|
I updated the post with my class. |
||||
|
For having the correct output, you need to add something like this into your class:
then it should work. |
||||
|
wrote: For having the correct output, you need to add something like this into your class:
then it should work. That actually works... I didn't actually think to add a standard toString method to my class. Thank you niko! |
|