Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
GAMEOBJ.CPP
Package: openglsystem.rar [view]
Upload User: nthssl
Upload Date: 2022-04-05
Package Size: 25357k
Code Size: 1k
Category:
OpenCV
Development Platform:
Visual C++
- // GameObj.cpp: implementation of the CGameObj class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "MyGame.h"
- #include "GameObj.h"
- #ifdef _DEBUG
- #undef THIS_FILE
- static char THIS_FILE[]=__FILE__;
- #define new DEBUG_NEW
- #endif
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- CGameObj::CGameObj()
- {
- p=Point3f(0,0,0);
- v=Point3f(0,0,0);
- angle=0;
- av=0;
- axis=Point3f(0,0,1);
- active=true;
- B.r=1;
- }
- CGameObj::CGameObj(const Point3f &_p, const float _angle)
- {
- B.r=1;
- p=_p;
- v=Point3f(0,0,0);
- angle=_angle;
- av=0;
- axis=Point3f(0,0,1);
- active=true;
- }
- CGameObj::CGameObj(const Point3f &_p, const float _angle, const Point3f &_v)
- {
- B.r=1;
- p=_p;
- v=_v;
- angle=_angle;
- av=0;
- axis=Point3f(0,0,1);
- active=true;
- }
- CGameObj::~CGameObj()
- {
- }
- bool CGameObj::Collide(CGameObj *o)
- {
- B.c=p;
- o->B.c=o->p;
- return B.Intersect(o->B);
- }
- void CGameObj::DrawBound()
- {
- glPushMatrix();
- glTranslate(p);
- glutWireSphere(B.r,8,5);
- glPopMatrix();
- }