I can try to help with some of these:
sketchbookgames wrote:
im not familiar with C code.
B should i be porting the .h or the .cpp files or both in some manner?
Both - the .h files specify the interface (i.e. they define the methods that will be implemented in the .cpp files, as well as the simpler implementations), and the .cpp files specify the actual code.
Quote:
the "virtual bool Process(void* userData) = 0;"
i can interpret to mean
public virtual function Process(userData:*)
C but the = 0 throws me off a bit,
Just don't worry about the "= 0", it just means that the implementation is left to a subclass.
Quote:
i did some reading on ~ as a mathematic operator and bitwise calculations last night.
D but i think "~b2QueryCallback() {}" may have something else in mind.
--edit-- i wonder if it means this class needs a kill function?
~ClassName() is a destructor for the class. In AS3 or any GC language, we don't have destructors, so you can just leave it out altogether if all it's doing is deallocating memory and stuff like that, which will happen automatically for us.
If that's not the case, and non-trivial logic happens there, it's
much more difficult to port, but thus far Erin has been kind to us and refrained from such shenanigans.
🙂sketchbookgames wrote:
this has several classes declared in it, and i think since they are publicly accessible classes they will need to be separate .as files.
Yup, there's no way around that.
Quote:
Quote:
virtual float32 Process(const b2RayCastInput& input, void* userData) = 0;
if have
b2internal virtual function Process(b2RayCastInput & input, userData:*)
--edit-- b2internal virtual function Process(input:b2RayCastInput, userData:*) // i have a feeling this is correct.
E not sure what to do with the
& input, perhaps it just gets left off?
Most of the time (not quite all, unfortunately), & and * can just be deleted, and -> can turn into a dot. The & to the left of a parameter in the method signature marks the parameter as pass by reference, which for objects is (roughly speaking) how AS3 and Java pass things anyways. For primitives, this is not the case, however.
sketchbookgames wrote:
F template <typename T>
void Query(T* callback, const b2AABB& aabb) const;
Templates are tough to port if you can't use them in the target language (I don't think AS3 has templates or generics). You'll just have to look through and see how they're used and then generate the appropriate specific functions yourself; this is essentially what the C++ compiler does, you just have to do it by hand.