Update of /cvsroot/gcblue/gcb_wx/include/common
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7549/include/common
Modified Files:
simmath.h
Added Files:
tc3DPoint.h
Log Message:
Index: simmath.h
===================================================================
RCS file: /cvsroot/gcblue/gcb_wx/include/common/simmath.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** simmath.h 5 Aug 2004 02:22:34 -0000 1.17
--- simmath.h 6 Aug 2004 02:47:50 -0000 1.18
***************
*** 1,6 ****
! /*
! ** simmath.h
! **
! ** Copyright (C) 2003 Dewitt "Cole" Colclough (de...@tw...)
** All rights reserved.
--- 1,6 ----
! /**
! ** @file simmath.h
! */
! /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...)
** All rights reserved.
***************
*** 24,27 ****
--- 24,31 ----
#define _SIMMATH_H_
+ #if _MSC_VER > 1000
+ #pragma once
+ #endif // _MSC_VER > 1000
+
#include <math.h>
#include "math_constants.h"
***************
*** 43,47 ****
float x;
float y;
! float DistanceTo(tcPoint p) {return (sqrtf((p.x-x)*(p.x-x)+(p.y-y)*(p.y-y)));}
tcPoint() : x(0), y(0) {}
--- 47,51 ----
float x;
float y;
! float DistanceTo(const tcPoint& p) {return (sqrtf((p.x-x)*(p.x-x)+(p.y-y)*(p.y-y)));}
tcPoint() : x(0), y(0) {}
***************
*** 50,53 ****
--- 54,58 ----
};
+
class tcRect
{
--- NEW FILE: tc3DPoint.h ---
/**
** @file simmath.h
*/
/* Copyright (C) 2004 Dewitt Colclough (de...@tw...)
** All rights reserved.
** This file is part of the Global Conflict Blue (GCB) program.
** GCB is free software; you can redistribute it and/or modify
** it under the terms of version 2 of the GNU General Public License as
** published by the Free Software Foundation.
** GCB is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
** You should have received a copy of the GNU General Public License
** along with GCB; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _TC3DPOINT_H_
#define _TC3DPOINT_H_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <math.h>
class tc3DPoint
{
public:
float x;
float y;
float z;
float DistanceTo(const tc3DPoint& p)
{
return (sqrtf((p.x-x)*(p.x-x)+(p.y-y)*(p.y-y) +
(p.z-z)));
}
tc3DPoint() : x(0), y(0), z(0) {}
tc3DPoint(float ax, float ay, float az) : x(ax), y(ay), z(az) {}
tc3DPoint(const tc3DPoint &p) : x(p.x), y(p.y), z(p.z) {}
};
#endif
|