Hi, as I've introduced myself, I'm trying to port Box2D to another language. 🙂
If you wouldn't mind me asking, I have a specific question about a piece of C++ code, and if I have any more questions I'll post them in this thread.
1)
b2BroadPhase.cpp line 450
b2Bound* bound = bounds + index;
b2Bound* prevEdge = bound - 1;
Alright, so I'm assuming bounds + index is the same as bounds[index], I hope that's correct.
What I don't understand is the second line, bound - 1, since bound is a pointer. What is this operation supposed to accomplish?
I've tried creating a sample C++ program to model this behavior, but I'm getting junk data from the bound - 1 operation.
Any help appreciated, thanks.
~ Clay
If you wouldn't mind me asking, I have a specific question about a piece of C++ code, and if I have any more questions I'll post them in this thread.
1)
b2BroadPhase.cpp line 450
b2Bound* bound = bounds + index;
b2Bound* prevEdge = bound - 1;
Alright, so I'm assuming bounds + index is the same as bounds[index], I hope that's correct.
What I don't understand is the second line, bound - 1, since bound is a pointer. What is this operation supposed to accomplish?
I've tried creating a sample C++ program to model this behavior, but I'm getting junk data from the bound - 1 operation.
Any help appreciated, thanks.
~ Clay