- Main Page
- Classes
- Files

- File List
- File Members

# E:/uas2/Server/cPhysics.h

Go to the documentation of this file.

    00001 /*
    00002 * This file is part of UAS2.
    00003 *
    00004 * UAS2 is free software; you can redistribute it and/or modify
    00005 * it under the terms of the GNU General Public License as published by
    00006 * the Free Software Foundation; either version 2 of the License, or
    00007 * (at your option) any later version.
    00008 *
    00009 * UAS2 is distributed in the hope that it will be useful,
    00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00012 * GNU General Public License for more details.
    00013
    00014 * You should have received a copy of the GNU General Public License
    00015 * along with UASv1; if not, write to the Free Software
    00016 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    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 //  Math Functions - Quaternion
    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_)