Over 10 Million Study Resources Now at Your Fingertips


Download as :
Rating : ⭐⭐⭐⭐⭐
Price : $10.99
Language:EN
Pages: 2

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

/**
* Holds the angular orientation of the rigid body in world space.

*/
Quaternion orientation;

/**
* Holds a transform matrix for converting body space into world * space and vice versa. This can be achieved by calling the * getPointIn*Space functions.

Matrix4 transformMatrix;

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

/**
* and orientation.

2*orientation.k*orientation.k;
const Vector3 &position,

const Quaternion &orientation)

* Inline function that creates a transform matrix from a position

How It Works
Login account
Login Your Account
Add to cart
Add to Cart
Payment
Make payment
Document download
Download File
PageId: ELIE781B17
img
Uploaded by :
PbPlLNb3
Page 1 Preview
other rigidbody code before calculates internal da
Sell Your Old Documents & Earn Wallet Balance