Language:EN
Pages: 2
Rating : ⭐⭐⭐⭐⭐
Price: $10.99
Page 1 Preview
other rigidbody code before calculates internal da

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

You are viewing 1/3rd of the document.Purchase the document to get full access instantly

Immediately available after payment
Both online and downloadable
No strings attached
How It Works
Login account
Login Your Account
Place in cart
Add to Cart
send in the money
Make payment
Document download
Download File
img

Uploaded by : Mia Reed

PageId: ELIE781B17