Books
in black and white
Main menu
Home About us Share a book
Books
Biology Business Chemistry Computers Culture Economics Fiction Games Guide History Management Mathematical Medicine Mental Fitnes Physics Psychology Scince Sport Technics
Ads

Troublshooting your pc for dummies - Bourg D.M.

Bourg D.M. Troublshooting your pc for dummies - Wiley publishing , 2002. - 350 p.
ISBN 0-596-00006-5
Download (direct link): fordummiestroublesho2005.pdf
Previous << 1 .. 94 95 96 97 98 99 < 100 > 101 102 103 104 105 106 .. 128 >> Next

} else {
Bodies[i].vPosition.x = O.Of;
Bodies[i].vPosition.y = o.of;
Bodies[i].vPosition.z = BL0CKSIZE/2.0f;
}
break;
case 1:
if(i==i)
{
Bodies[i].vPosition.x = BL0CKSIZE*4;
Bodies[i].vPosition.y = ď(BL0CKSIZE/2.0f+1.0f); Bodies[i].vPosition.z = BL0CKSIZE/2.0f;
} else {
Bodies[i].vPosition.x = o.of;
Bodies[i].vPosition.y - BL0CKSIZE/2.0f+l.0f; 8odies[i].vPosition.z = BL0CKSIZE/2.0f;
}
break;
case 0:
if(i==l)
{
Bodies[ij.vPosition.x = BLOCKSIZE+l.Of;
Bodies[i].vPosition.y = BLOCKSIZE/2.0f+l.of; Bodies[i].vPosition.z = BL0CKSIZE/2.0f;
} else {
Bodies[i].vPosition.x = o.of;
Bodies[i].vPosition.y = BL0CKSIZE/2.0f+l.0f; Bodiesfij.vPosition.z = BL0CKSIZE/2.0f;
}
break;
}
// Set initial velocity Bodies[i].vVelocity.x = o.of;
Bodies[i].vVelocity.y = o.of;
Bodiesfij.vVelocity.z = o.of;
BodiesfiJ.fSpeed = o.of;
// Set initial angular velocity Bodies[i].vAngularVelocity.x = O.Of;
Bodies[ij.vAngularVelocity.y = O.Of;
Bodiesfij.vAngularVeloCity.z = O.Of;
Bodies[i].vAngularAcceleration.x = o.of; Bodies[i].vAngularAcceleration.y = o.of; Bodies[i].vAngularAcceleration.z = o.of;
Bodies[i].vAcceleration.x = o.of;
Bodiesfij.vAcceleration.y = o.of;
Bodiesfij.vAcceleration.z = o.of;
| Chapter 16: Multiple Bodies in 3D
// Set the initial thrust, forces and moments Bodiesfi].vForces.x = O.Of;
Bodiesfi].vForces.y = O.Of;
Bodiesfi].vForces.z = O.Of;
Bodiesfi].vMoments.x = O.Of;
Bodies[i].vMoments.y - O.Of;
Bodiesfi].vMoments.z = O.Of;
// Zero the velocity in body space coordinates Bodies[i].vVelocityBody.x = O.Of;
Bodies[ij.vVelocityBody.y = O.Of;
Bodiesfi],vVelocityBody.z = O.Of;
// Set the initial orientation iRoll O.Of; iPitch = O.Of; if(configuration == 2) iYaw = 45.Of;
else
iYaw = O.Of;
Bodies[i].qOrientation = MakeOFromEulerAnglesfiRoll,
iPitch,
iYaw);
// Set the mass properties Bodiesfi].fMass = 500.0f/(-g);
Ixx = Iyy = Izz = Bodiesfi].fMass/12.Of *
(BL0CK5IZE+BL0CKSIZE + BLOCKSIZE*BLOCKSlZE);
Bodies[i].mInertia.ell = Ixx;
Bodiesfi],mlnertia.el2 = 0;
Bodiesfi].mlnertia.el3 = 0;
Bodiesfi],mlnertia.e2l = 0;
Bodiesfi].mlnertia.e22 = Iyy;
Bodiesfi],mlnertia.e23 = 0;
Bodiesfi].mlnertia.e31 = 0;
Bodiesfi].mlnertia.e32 = 0;
Bodiesfi],mlnertia.e33 = Izz;
Bodiesfi].mlnertialnverse = Bodiesfi].mlnertia,lnverse();
Bodiesfi].fRadius = BL0CK5IZE/2; // for bounding sphere check
// bounding verteces relative to CC (assumed centered) Bodiesfi].vVertexListfo].x = BL0CKSIZE/2.Of;
Bodiesfij.vVertexListfo].y = BL0CKSIZE/2.0f;
Bodiesfi].vVertexListfo].z = -BL0CKSIZE/2.0f;
Bodiesfi].vVertexList[l].x = BL0CKSIZE/2.0f;
Bodiesfi].vVertexList[l].y = BL0CKSIZE/2.0f;
Bodiesfi].vVertexListflj.z = BL0CKSIZE/2.0f;
Bodiesfi].vVertexList[2].x = BL0CKSIZE/2.0f;
Bodiesfi].vVertexList[2].y = -BL0CKSIZE/2.0f;
Bodiesfi].vVertexList[2].z = BL0CK5IZE/2.0f;
Bodiesfi].vVertexList[3].x = BLOCKSIZE/2.of;
Bodiesfi).vVertexList[3] .y = -BL0CKSIZE/2.0f;
Bodiesfi],vVertexList[3].z - -BL0CKSIZE/2.0f;
Bodies[i].vVertexList[4].x = -BL0CKSIZE/2.Of;
Bodies[i].vVertexList[4].y = BL0CKSlZE/2.of;
Bodies[i].vVertexList[4].z = -BL0CKSIZE/2.0f;
,
'' Bodies[i].vVertexList[5].x = ďBL0CKSIZE/2.of; ?
Bodies[i].vVertexList[5].y = BL0CKSIZE/2.of;
Bodies[i],vVertexList[5].z - BL0CKSIZE/2.Crf;
Bodies[i].vVertexList[6].x = -BL0CKSIZE/2.of;
Bodies[i].vVertexList[6].y = -BLOCKSIZE/2.of;
Bodies[i].vVertexList[6].z = BL0CKSIZE/2.0f;
Bodies[i].vVertexList[7].x = -BL0CKSIZE/2.Of; -
Bodies[i].vVertexList[7].y = -BL0CKSIZE/2.of;
Bodies[i].vVertexList[7].z = -BL0CKSIZE/2.0f;
}
}
This is a long function, but itís really quite simple. All it does is initialize each parameter in the RigidBody structure for each body where body [0] is the car.
The configuration parameter thatís passed into the function is used to control which of the three different crash scenarios is initialized.
I would also like to point out that Iím assuming that each objectís moment of inertia, including the carís, can be approximated as a rectangular cylinder (a box). Therefore, you can use the inertia formulas for a rectangular cylinder that I gave you back in Chapter 1.
Forces and Moments
As I said earlier, Iím using a simplified approach to handling the forces that act the objects in this simulation. There are four basic loads that I consider:
ē Thrust (for the car only)
ē Aerodynamic drag (linear and angular)
ē Gravity
ē Contact with the ground plane
All of these loads are taken care of in the function CalcObjectForces:
This function calculates all of the forces and moments acting on the objects at any given time.
void CalcObjectForces(void) "?
r _ f -r -IW
Vector Fb, Mb; .
Vector vOragVector;
Vector vAngularDragVector;
int C j;
Vector ContactForce;
Vector pt;
int check = NOCOLLISION;
256 | Chapter 16: Multiple Bodies in 3D
pCollision pCollisionData; // used for contact forces here Vector FrictionForce;
Vector fDir;
for(i=0; icNUMBODIES; i++)
{
II reset forces and moments:
Bodies[i],vForces.x = O.Of;
Bodiesfi].vForces.y = O.Of;
Previous << 1 .. 94 95 96 97 98 99 < 100 > 101 102 103 104 105 106 .. 128 >> Next