DriveHQ Start Menu
Cloud Drive Mapping
Folder Sync
Cloud Backup
True Drop Box
FTP/SFTP Hosting
Group Account
DriveHQ Start Menu
Online File Server
My Storage
|
Manage Shares
|
Publishes
|
Drop Boxes
|
Group Account
WebDAV Drive Mapping
Cloud Drive Home
|
WebDAV Guide
|
Drive Mapping Tool
|
Drive Mapping URL
Complete Data Backup
Backup Guide
|
Online Backup Tool
|
Cloud-to-Cloud Backup
FTP, Email & Web Service
FTP Home
|
FTP Hosting FAQ
|
Email Hosting
|
EmailManager
|
Web Hosting
Help & Resources
About
|
Enterprise Service
|
Partnership
|
Comparisons
|
Support
Quick Links
Security and Privacy
Download Software
Service Manual
Use Cases
Group Account
Online Help
Blog
Contact
Cloud Surveillance
Sign Up
Login
Features
Business Features
Online File Server
FTP Hosting
Cloud Drive Mapping
Cloud File Backup
Email Backup & Hosting
Cloud File Sharing
Folder Synchronization
Group Management
True Drop Box
Full-text Search
AD Integration/SSO
Mobile Access
IP Camera & DVR Solution
More...
Personal Features
Personal Cloud Drive
Backup All Devices
Mobile APPs
Personal Web Hosting
Sub-Account (for Kids)
Home/PC/Kids Monitoring
More...
Software
DriveHQ Drive Mapping Tool
DriveHQ FileManager
DriveHQ Online Backup
DriveHQ Mobile Apps
Pricing
Business Plans & Pricing
Personal Plans & Pricing
Price Comparison with Others
Feature Comparison with Others
Install Mobile App
Sign up
Creating account...
Invalid character in username! Only 0-9, a-z, A-Z, _, -, . allowed.
Username is required!
Invalid email address!
E-mail is required!
Password is required!
Password is invalid!
Password and confirmation do not match.
Confirm password is required!
I accept
Membership Agreement
Please read the Membership Agreement and check "I accept"!
Free Quick Sign-up
Sign-up Page
Log in
Signing in...
Username or e-mail address is required!
Password is required!
Keep me logged in
Quick Login
Forgot Password
Up
Upload
Download
Share
Publish
New Folder
New File
Copy
Cut
Delete
Paste
Rate
Upgrade
Rotate
Effect
Edit
Slide
History
#pragma once #include
#include
#include
namespace DarkBattle{ //tolua_begin class Vec3{ public: float x,y,z; static Vec3 make(){ return Vec3(); } static Vec3 make(float x,float y,float z){ return Vec3(x,y,z); } Vec3 operator+ (const Vec3 &op) const{ return Vec3(this->x+op.x,this->y+op.y,this->z+op.z); } Vec3 operator- (const Vec3 &op) const{ return Vec3(this->x-op.x,this->y-op.y,this->z-op.z); } Vec3 operator* (const float &op) const{ return Vec3(this->x*op,this->y*op,this->z*op); } Vec3 operator/ (const float &op) const{ return Vec3(this->x/op,this->y/op,this->z/op); } void Set(float px,float py,float pz){ x = px; y=py; z=pz; } void Set(Vec3 vec){ x=vec.x; y=vec.y; z=vec.z; } float Length() const { return sqrt(x*x+y*y+z*z); } float Length2D() const { return sqrt(x*x+y*y); } bool IsAt(Vec3 pos) const; //tolua_end ~Vec3(){}//tolua_export Vec3(){ x=y=z=0;} //tolua_export Vec3(float px,float py,float pz){ x = px;y=py;z=pz; } Vec3(btVector3 src){ x = src.getX(); y=src.getY(); z=src.getZ(); } Vec3(D3DXVECTOR3 src){ x= src.x; y=src.y;z=src.z; } btVector3 ToBtVector3() const{ return btVector3(x,y,z); } //Position(Position& pos){ // x = pos.x; y=pos.y; z=pos.z; //} //Position& operator= (const Position &op){ // return Position(op.x,op.y,op.z); //} };//tolua_export template
class Matrix{ protected: element* data; int sizeX,sizeY; inline int index(int x,int y){return x*sizeX+y;}; public: Matrix(int SizeX, int SizeY){sizeX=SizeX;sizeY=SizeY;data=new element[sizeX*sizeY];}; ~Matrix(){SAFE_DELETE_ARRAY(data);}; inline element get(int x,int y){return data[index(x,y)];}; inline void set(int x,int y, element val){data[index(x,y)]=val;}; void Fill(element value){ for(int i=0;i
{ public: inline bool IsClosed(int x,int y){return get(x,y);}; void Clean(){ for (int x=0;x
(sizeX,sizeY){}; }; class Vec2{ public: int x,y; Vec2(int X,int Y):x(X),y(Y){}; Vec2(){}; }; template
class PriorityElement{ public: float priority; DataType data; PriorityElement(float Priority, DataType Data):priority(Priority),data(Data){}; }; template
struct lessPriority { // functor for operator< inline bool operator()(const PriorityElement
& _Left, const PriorityElement
& _Right) const { // apply operator< to operands return (_Left.priority < _Right.priority); } }; class OpenListPriority{ private: priority_queue
,vector
>,lessPriority
> data; public: inline void Push(float priority,Vec2 pos){ data.push(PriorityElement
(-priority,pos));//to make the priority queue pop the smallest value } Vec2 Pop(){ Vec2 ret = data.top().data; data.pop(); return ret; } inline bool IsEmpty(){return data.empty();}; void Clean(){ while(!IsEmpty()){ data.pop(); } }; }; template
class MyQueue{ private: list
data; public: DataType Pop(){ DataType ret = data.back(); data.pop_back(); return ret; }; inline void Push(DataType pos){data.push_front(pos);}; inline void PushBack(DataType pos){data.push_back(pos);}; inline bool IsEmpty(){return data.empty();}; inline void Clean(){while (!data.empty()) data.pop_back();}; }; typedef MyQueue
Vec2Queue; typedef Matrix
DistanceMap; //Vec3Queue cannot be converted to template class because tolua doesn't support template class Vec3Queue{//tolua_export private: list
data; public: //tolua_begin Vec3 Pop(); inline void Push(Vec3 pos){data.push_front(pos);}; inline void PushBack(Vec3 pos){data.push_back(pos);}; inline bool IsEmpty(){return data.empty();}; inline void Clean(){while (!data.empty()) data.pop_back();}; inline int Size(){return data.size();}; //tolua_end };//tolua_export struct less_str { bool operator()(char* x, char* y) const { return (strcmp(x, y)>0); //differ } }; template
class MyIterator{ public: hash_map
::iterator iter; MyIterator(hash_map
::iterator iterator):iter(iterator){}; MyIterator(){hash_map
::iterator iterator;iter = hash_map
::iterator(iterator);}; void Next(){iter++;}; DataType* GetCurrent(){return (DataType*)iter->second;}; }; template
class MyHashTable{ private: hash_map
> mPool; public: DataType* Get(char* key){ return (DataType*)(mPool.find(key)->second); }; void Put(const char* key, const DataType* value){ char* localKey; CLONE_STR(localKey,key); mPool.insert(pair
(localKey,(void*)value)); }; bool Check(char* key){return mPool.find(key)!=mPool.end();}; MyIterator
Begin(){ return MyIterator
(mPool.begin()); } bool IsEnd(MyIterator
iter){ return iter.iter==mPool.end(); } }; }
DataTypes.h
Page URL
File URL
Prev
13/65
Next
Download
( 5 KB )
Note: The DriveHQ service banners will NOT be displayed if the file owner is a paid member.
Comments
Total ratings:
0
Average rating:
Not Rated
Would you like to comment?
Join DriveHQ
for a free account, or
Logon
if you are already a member.