Game Development Reference
In-Depth Information
C
O THER
A PPENDIX
P ROGRAMMING
L ANGUAGES
gramming languages.
This appendix gives notes on converting the engine source code into other pro-
C.1
C
Most of the source code can be translated into C fairly easily. All methods in classes
are replaced by functions, and the overloaded operators used to represent vector and
matrix operations are replaced by the regular function version.
The tricky part about using C is the force generators. Polymorphism used in this
book is a convenient way to create force generators without having to understand
their properties.
You can do a similar thing in C, however, by using a fixed function signature of
the form:
(void)(*forceGenerator)(void* inData,
RigidBody* inOutBody);
where RigidBody is a typedef of a structure.
Search Nedrilad ::




Custom Search