DriveHQ Start Menu
Cloud Drive Mapping
Folder Sync
True Drop Box
FTP/SFTP Hosting
Group Account
Team Anywhere
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
|
Cloud-to-Cloud Backup
|
DVR/Camera Backup
FTP, Email & Web Service
FTP/SFTP Hosting
|
Email Hosting
|
Web Hosting
|
Webcam Hosting
Other Products & Services
Team Anywhere
|
Connect to Remote PC
|
Cloud Surveillance
|
Virtual CCTV NVR
Quick Links
Security and Privacy
Customer Support
Service Manual
Use Cases
Group Account
Online Help
Support Forum
Contact Us
About DriveHQ
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
Personal Features
Personal Cloud Drive
Backup All Devices
Mobile APPs
Personal Web Hosting
Sub-Account (for Kids)
Home/PC/Kids Monitoring
Other Features
Team Anywhere (Remote Desktop Service)
CameraFTP Cloud Surveillance
Software
DriveHQ Drive Mapping Tool
DriveHQ FileManager
DriveHQ Online Backup
DriveHQ Team Anywhere for Windows (Beta)
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 "DXUT.h" #include "DarkPuzzle.h" #include "Light.h" #include "GameEngine.h" namespace DarkBattle{ list
lightPool; list
::iterator currentIterator = lightPool.begin(); const char* Light::lightNames[] = {"LampPost","LightEye"}; int Light::identifyLightType(const char* name){ for (int i=0;i
GetTransformMatrix(); D3DXMATRIX trans; D3DXMatrixTranslation(&trans,0,0,15.0f); return ret*trans; } D3DXMATRIX Light::getLampPostTransform(){ D3DXMATRIX ret = pInstance->GetTransformMatrix(); D3DXMATRIX trans; D3DXMatrixTranslation(&trans,0,0,11.0f); return ret*trans; } Light* Light::CreateLight(const Game3DInstance* pInstance, int type){ assert(type
=0); return new Light(pInstance,lightNames[type]); } Light::Light(const Game3DInstance* pInstance, const char* name){ //this->currentIterator = NULL; this->pInstance = pInstance; assert(this->pInstance!=NULL); this->getTransform = NULL; this->lightFallOff = 0.5f; this->pLightRange = &GameEngine::PointLightRange; this->lightColor[0] = this->lightColor[1] = this->lightColor[2] = 1; this->isSpotLight = false; //parse the name, init the corresponding light parameters int lightType = identifyLightType(name); assert(lightType!=LIGHT_NOTLIGHT);//only valid light is added here if (lightType==LightTypesConst::LightEye){ this->isSpotLight = true; this->pLightRange = &GameEngine::SpotLightRange; this->lightColor[1] = this->lightColor[2] = 0; //red light this->lightFallOff = 0.2f; this->getTransform = &Light::getLightEyeTransform; }else if (lightType==LightTypesConst::LamPost){ this->lightColor[0] = this->lightColor[1] = 0; //blue light this->getTransform = &Light::getLampPostTransform; } assert(this->getTransform!=NULL); //add the light to the lightPool lightPool.push_back(this); } D3DXVECTOR3 Light::GetLightDirection(){ D3DXMATRIX matRot; D3DXMatrixRotationZ(&matRot, pInstance->GetAngle()); D3DXVECTOR3 ret = D3DXVECTOR3(0,-1,-1); D3DXVec3TransformCoord(&ret,&ret,&matRot); return ret; } Light* Light::IterationBegin(){ //assert(currentIterator==NULL); currentIterator = lightPool.begin(); assert(currentIterator!=lightPool.end());//there must be at least one light return *currentIterator; } bool Light::IterationEnd(){ if (currentIterator == lightPool.end()){ currentIterator = lightPool.begin(); return true; }else return false; } Light* Light::IterationNextElement(){ currentIterator++; if (currentIterator==lightPool.end()){ return NULL; } Light* ret = *currentIterator; assert(ret!=NULL); return ret; } float Light::GetLightRadius(){ return GameEngine::SpotLightRadius; } };
Light.cpp
Page URL
File URL
Prev
48/65
Next
Download
( 2 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.