Other rigidbody code before calculates internal data from state data
194 Chapter 10 Laws of Motion for Rigid Bodies
Excerpt from include/cyclone/body.h
|
---|
I call this “derived data,” and it is the first of a handful we’ll add to the rigid body. If you are working on a highly memory-starved machine, you may want to remove these data: they are only copies of existing information in a more convenient form. You can simply calculate them as they are needed. The same is true for all the derived data I will add to the rigid body.
Let’s add a function to the class to calculate the transform matrix and a function to calculate all derived data. Initially calculateDerivedData will only calculate the transform matrix:
Excerpt from src/body.cpp
|
---|