00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00023 #if !defined(AFX_CPHYSICS_H__87BF30D9_6373_47F7_AAC7_56024CA96079__INCLUDED_)
00024 #define AFX_CPHYSICS_H__87BF30D9_6373_47F7_AAC7_56024CA96079__INCLUDED_
00025
00026 #if _MSC_VER > 1000
00027 #pragma once
00028 #endif // _MSC_VER > 1000
00029 #include "uas.h"
00030
00032
00034 struct quaternion
00035 {
00036 float x, y, z, w;
00037 };
00038
00039 struct vector
00040 {
00041 float x, y, z;
00042 };
00043
00045
00046 class cPhysics
00047 {
00048 public:
00049 cPhysics();
00050 virtual ~cPhysics();
00051
00052 static float length ( quaternion quat );
00053 static quaternion normalize ( quaternion quat );
00054 static quaternion conjugate ( quaternion quat );
00055 static quaternion mult ( quaternion A, quaternion B );
00056 static void Rotate ( float Angle, float x, float y, float z, vector& View );
00057 static float GetRange ( cLocation usrLoc, cLocation tarLoc );
00058 static float Get3DRange ( cLocation usrLoc, cLocation tarLoc );
00059 static cVelocity GetTargetVelocity ( cLocation usrLoc, cLocation tarLoc );
00060 static cLocation VelocityMove ( cLocation usrLoc, cVelocity tarVel, float flSpeed );
00061 static float GetLineDistance ( cLocation OldLoc, cLocation NewLoc, cLocation TarLoc );
00062 static float Get3DLineDistance ( cLocation OldLoc, cLocation NewLoc, cLocation TarLoc );
00063 static float GetHeadingTarget ( cLocation usrLoc, cLocation tarLoc );
00064 static float GetAvatarHeading ( cLocation usrLoc );
00065 static float GetHeadingDifference( float flUserHeading, float flTargetHeading );
00066 static float GetLandZ ( cLocation usrLoc );
00067 };
00068
00069 #endif // !defined(AFX_CPHYSICS_H__87BF30D9_6373_47F7_AAC7_56024CA96079__INCLUDED_)