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
SHIP.H
Package: openglsystem.rar [view]
Upload User: nthssl
Upload Date: 2022-04-05
Package Size: 25357k
Code Size: 2k
Category:
OpenCV
Development Platform:
Visual C++
- // Ship.h: interface for the CShip class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_SHIP_H__07856EA8_36D5_4778_9F75_6427623C444B__INCLUDED_)
- #define AFX_SHIP_H__07856EA8_36D5_4778_9F75_6427623C444B__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include "GameObj.h"
- #include "Bullet.h"
- class CShip : public CGameObj
- {
- public:
- CShip();
- virtual ~CShip();
- Point3f a;
- bool thrust;
- bool lthrust;
- bool rthrust;
- void Update(int t)
- {
- Point3f na;
- a=Point3f(0,0,0);
- if(thrust)
- {
- na=VDir();
- na*=20.0;
- a+=na;
- }
- if(lthrust)
- {
- na=VDir();
- na*=20.0;
- na=RotateZ(na,float(M_PI/2));
- a+=na;
- }
- if(rthrust)
- {
- na=VDir();
- na*=20.0;
- na=RotateZ(na,float(-M_PI/2));
- a+=na;
- }
- v += (t/1000.0f*a);
- CGameObj::Update(t);
- }
- void ThrustOn()
- {
- thrust=true;
- }
- void ThrustOff()
- {
- thrust=false;
- }
- void StartStrafeLeft(){lthrust=true;}
- void StartStrafeRight(){rthrust=true;}
- void StopStrafeLeft(){lthrust=false;}
- void StopStrafeRight(){rthrust=false;}
- void StartLeft(){av=180.0;}
- void StartRight(){av=-180.0;}
- void StopLeft(){av=0.0;}
- void StopRight(){av=0.0;}
- int Draw();
- int MaxBullet() {return 10;};
- void TerminateBullet(){ActiveBullet--;};
- virtual void Shoot(list<CBullet *> &LB)
- {
- if(ActiveBullet < MaxBullet())
- {
- ActiveBullet++;
- CBullet *bb =new CBullet(p,angle,v+VDir()*30);
- LB.push_back(bb);
- }
- }
- protected:
- int ActiveBullet;
- };
- #endif // !defined(AFX_SHIP_H__07856EA8_36D5_4778_9F75_6427623C444B__INCLUDED_)