/s/KRVector2/Vector2/

This commit is contained in:
Kearwood Kip Gilbert
2017-07-29 01:20:07 -07:00
parent 18b74bcbe4
commit 8cf3c742e3
30 changed files with 565 additions and 896 deletions

View File

@@ -436,374 +436,374 @@ void KRSetAUCanonical(AudioStreamBasicDescription &desc, UInt32 nChannels, bool
void KRAudioManager::initHRTF() void KRAudioManager::initHRTF()
{ {
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,000.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,000.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,005.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,005.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,010.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,010.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,015.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,015.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,020.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,020.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,025.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,025.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,030.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,030.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,035.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,035.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,040.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,040.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,045.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,045.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,050.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,050.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,055.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,055.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,060.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,060.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,065.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,065.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,070.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,070.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,075.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,075.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,080.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,080.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,085.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,085.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,090.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,090.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,095.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,095.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,100.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,100.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,105.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,105.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,110.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,110.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,115.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,115.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,120.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,120.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,125.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,125.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,130.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,130.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,135.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,135.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,140.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,140.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,145.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,145.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,150.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,150.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,155.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,155.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,160.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,160.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,165.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,165.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,170.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,170.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,175.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,175.0f));
m_hrtf_sample_locations.push_back(KRVector2(-10.0f,180.0f)); m_hrtf_sample_locations.push_back(Vector2(-10.0f,180.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,000.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,000.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,005.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,005.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,010.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,010.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,015.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,015.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,020.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,020.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,025.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,025.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,030.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,030.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,035.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,035.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,040.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,040.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,045.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,045.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,050.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,050.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,055.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,055.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,060.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,060.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,065.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,065.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,070.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,070.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,075.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,075.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,080.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,080.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,085.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,085.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,090.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,090.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,095.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,095.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,100.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,100.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,105.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,105.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,110.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,110.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,115.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,115.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,120.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,120.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,125.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,125.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,130.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,130.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,135.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,135.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,140.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,140.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,145.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,145.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,150.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,150.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,155.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,155.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,160.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,160.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,165.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,165.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,170.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,170.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,175.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,175.0f));
m_hrtf_sample_locations.push_back(KRVector2(-20.0f,180.0f)); m_hrtf_sample_locations.push_back(Vector2(-20.0f,180.0f));
m_hrtf_sample_locations.push_back(KRVector2(-30.0f,000.0f)); m_hrtf_sample_locations.push_back(Vector2(-30.0f,000.0f));
m_hrtf_sample_locations.push_back(KRVector2(-30.0f,006.0f)); m_hrtf_sample_locations.push_back(Vector2(-30.0f,006.0f));
m_hrtf_sample_locations.push_back(KRVector2(-30.0f,012.0f)); m_hrtf_sample_locations.push_back(Vector2(-30.0f,012.0f));
m_hrtf_sample_locations.push_back(KRVector2(-30.0f,018.0f)); m_hrtf_sample_locations.push_back(Vector2(-30.0f,018.0f));
m_hrtf_sample_locations.push_back(KRVector2(-30.0f,024.0f)); m_hrtf_sample_locations.push_back(Vector2(-30.0f,024.0f));
m_hrtf_sample_locations.push_back(KRVector2(-30.0f,030.0f)); m_hrtf_sample_locations.push_back(Vector2(-30.0f,030.0f));
m_hrtf_sample_locations.push_back(KRVector2(-30.0f,036.0f)); m_hrtf_sample_locations.push_back(Vector2(-30.0f,036.0f));
m_hrtf_sample_locations.push_back(KRVector2(-30.0f,042.0f)); m_hrtf_sample_locations.push_back(Vector2(-30.0f,042.0f));
m_hrtf_sample_locations.push_back(KRVector2(-30.0f,048.0f)); m_hrtf_sample_locations.push_back(Vector2(-30.0f,048.0f));
m_hrtf_sample_locations.push_back(KRVector2(-30.0f,054.0f)); m_hrtf_sample_locations.push_back(Vector2(-30.0f,054.0f));
m_hrtf_sample_locations.push_back(KRVector2(-30.0f,060.0f)); m_hrtf_sample_locations.push_back(Vector2(-30.0f,060.0f));
m_hrtf_sample_locations.push_back(KRVector2(-30.0f,066.0f)); m_hrtf_sample_locations.push_back(Vector2(-30.0f,066.0f));
m_hrtf_sample_locations.push_back(KRVector2(-30.0f,072.0f)); m_hrtf_sample_locations.push_back(Vector2(-30.0f,072.0f));
m_hrtf_sample_locations.push_back(KRVector2(-30.0f,078.0f)); m_hrtf_sample_locations.push_back(Vector2(-30.0f,078.0f));
m_hrtf_sample_locations.push_back(KRVector2(-30.0f,084.0f)); m_hrtf_sample_locations.push_back(Vector2(-30.0f,084.0f));
m_hrtf_sample_locations.push_back(KRVector2(-30.0f,090.0f)); m_hrtf_sample_locations.push_back(Vector2(-30.0f,090.0f));
m_hrtf_sample_locations.push_back(KRVector2(-30.0f,096.0f)); m_hrtf_sample_locations.push_back(Vector2(-30.0f,096.0f));
m_hrtf_sample_locations.push_back(KRVector2(-30.0f,102.0f)); m_hrtf_sample_locations.push_back(Vector2(-30.0f,102.0f));
m_hrtf_sample_locations.push_back(KRVector2(-30.0f,108.0f)); m_hrtf_sample_locations.push_back(Vector2(-30.0f,108.0f));
m_hrtf_sample_locations.push_back(KRVector2(-30.0f,114.0f)); m_hrtf_sample_locations.push_back(Vector2(-30.0f,114.0f));
m_hrtf_sample_locations.push_back(KRVector2(-30.0f,120.0f)); m_hrtf_sample_locations.push_back(Vector2(-30.0f,120.0f));
m_hrtf_sample_locations.push_back(KRVector2(-30.0f,126.0f)); m_hrtf_sample_locations.push_back(Vector2(-30.0f,126.0f));
m_hrtf_sample_locations.push_back(KRVector2(-30.0f,132.0f)); m_hrtf_sample_locations.push_back(Vector2(-30.0f,132.0f));
m_hrtf_sample_locations.push_back(KRVector2(-30.0f,138.0f)); m_hrtf_sample_locations.push_back(Vector2(-30.0f,138.0f));
m_hrtf_sample_locations.push_back(KRVector2(-30.0f,144.0f)); m_hrtf_sample_locations.push_back(Vector2(-30.0f,144.0f));
m_hrtf_sample_locations.push_back(KRVector2(-30.0f,150.0f)); m_hrtf_sample_locations.push_back(Vector2(-30.0f,150.0f));
m_hrtf_sample_locations.push_back(KRVector2(-30.0f,156.0f)); m_hrtf_sample_locations.push_back(Vector2(-30.0f,156.0f));
m_hrtf_sample_locations.push_back(KRVector2(-30.0f,162.0f)); m_hrtf_sample_locations.push_back(Vector2(-30.0f,162.0f));
m_hrtf_sample_locations.push_back(KRVector2(-30.0f,168.0f)); m_hrtf_sample_locations.push_back(Vector2(-30.0f,168.0f));
m_hrtf_sample_locations.push_back(KRVector2(-30.0f,174.0f)); m_hrtf_sample_locations.push_back(Vector2(-30.0f,174.0f));
m_hrtf_sample_locations.push_back(KRVector2(-30.0f,180.0f)); m_hrtf_sample_locations.push_back(Vector2(-30.0f,180.0f));
m_hrtf_sample_locations.push_back(KRVector2(-40.0f,000.0f)); m_hrtf_sample_locations.push_back(Vector2(-40.0f,000.0f));
m_hrtf_sample_locations.push_back(KRVector2(-40.0f,006.0f)); m_hrtf_sample_locations.push_back(Vector2(-40.0f,006.0f));
m_hrtf_sample_locations.push_back(KRVector2(-40.0f,013.0f)); m_hrtf_sample_locations.push_back(Vector2(-40.0f,013.0f));
m_hrtf_sample_locations.push_back(KRVector2(-40.0f,019.0f)); m_hrtf_sample_locations.push_back(Vector2(-40.0f,019.0f));
m_hrtf_sample_locations.push_back(KRVector2(-40.0f,026.0f)); m_hrtf_sample_locations.push_back(Vector2(-40.0f,026.0f));
m_hrtf_sample_locations.push_back(KRVector2(-40.0f,032.0f)); m_hrtf_sample_locations.push_back(Vector2(-40.0f,032.0f));
m_hrtf_sample_locations.push_back(KRVector2(-40.0f,039.0f)); m_hrtf_sample_locations.push_back(Vector2(-40.0f,039.0f));
m_hrtf_sample_locations.push_back(KRVector2(-40.0f,045.0f)); m_hrtf_sample_locations.push_back(Vector2(-40.0f,045.0f));
m_hrtf_sample_locations.push_back(KRVector2(-40.0f,051.0f)); m_hrtf_sample_locations.push_back(Vector2(-40.0f,051.0f));
m_hrtf_sample_locations.push_back(KRVector2(-40.0f,058.0f)); m_hrtf_sample_locations.push_back(Vector2(-40.0f,058.0f));
m_hrtf_sample_locations.push_back(KRVector2(-40.0f,064.0f)); m_hrtf_sample_locations.push_back(Vector2(-40.0f,064.0f));
m_hrtf_sample_locations.push_back(KRVector2(-40.0f,071.0f)); m_hrtf_sample_locations.push_back(Vector2(-40.0f,071.0f));
m_hrtf_sample_locations.push_back(KRVector2(-40.0f,077.0f)); m_hrtf_sample_locations.push_back(Vector2(-40.0f,077.0f));
m_hrtf_sample_locations.push_back(KRVector2(-40.0f,084.0f)); m_hrtf_sample_locations.push_back(Vector2(-40.0f,084.0f));
m_hrtf_sample_locations.push_back(KRVector2(-40.0f,090.0f)); m_hrtf_sample_locations.push_back(Vector2(-40.0f,090.0f));
m_hrtf_sample_locations.push_back(KRVector2(-40.0f,096.0f)); m_hrtf_sample_locations.push_back(Vector2(-40.0f,096.0f));
m_hrtf_sample_locations.push_back(KRVector2(-40.0f,103.0f)); m_hrtf_sample_locations.push_back(Vector2(-40.0f,103.0f));
m_hrtf_sample_locations.push_back(KRVector2(-40.0f,109.0f)); m_hrtf_sample_locations.push_back(Vector2(-40.0f,109.0f));
m_hrtf_sample_locations.push_back(KRVector2(-40.0f,116.0f)); m_hrtf_sample_locations.push_back(Vector2(-40.0f,116.0f));
m_hrtf_sample_locations.push_back(KRVector2(-40.0f,122.0f)); m_hrtf_sample_locations.push_back(Vector2(-40.0f,122.0f));
m_hrtf_sample_locations.push_back(KRVector2(-40.0f,129.0f)); m_hrtf_sample_locations.push_back(Vector2(-40.0f,129.0f));
m_hrtf_sample_locations.push_back(KRVector2(-40.0f,135.0f)); m_hrtf_sample_locations.push_back(Vector2(-40.0f,135.0f));
m_hrtf_sample_locations.push_back(KRVector2(-40.0f,141.0f)); m_hrtf_sample_locations.push_back(Vector2(-40.0f,141.0f));
m_hrtf_sample_locations.push_back(KRVector2(-40.0f,148.0f)); m_hrtf_sample_locations.push_back(Vector2(-40.0f,148.0f));
m_hrtf_sample_locations.push_back(KRVector2(-40.0f,154.0f)); m_hrtf_sample_locations.push_back(Vector2(-40.0f,154.0f));
m_hrtf_sample_locations.push_back(KRVector2(-40.0f,161.0f)); m_hrtf_sample_locations.push_back(Vector2(-40.0f,161.0f));
m_hrtf_sample_locations.push_back(KRVector2(-40.0f,167.0f)); m_hrtf_sample_locations.push_back(Vector2(-40.0f,167.0f));
m_hrtf_sample_locations.push_back(KRVector2(-40.0f,174.0f)); m_hrtf_sample_locations.push_back(Vector2(-40.0f,174.0f));
m_hrtf_sample_locations.push_back(KRVector2(-40.0f,180.0f)); m_hrtf_sample_locations.push_back(Vector2(-40.0f,180.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,000.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,000.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,005.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,005.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,010.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,010.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,015.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,015.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,020.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,020.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,025.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,025.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,030.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,030.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,035.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,035.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,040.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,040.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,045.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,045.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,050.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,050.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,055.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,055.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,060.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,060.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,065.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,065.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,070.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,070.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,075.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,075.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,080.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,080.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,085.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,085.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,090.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,090.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,095.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,095.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,100.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,100.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,105.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,105.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,110.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,110.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,115.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,115.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,120.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,120.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,125.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,125.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,130.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,130.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,135.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,135.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,140.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,140.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,145.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,145.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,150.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,150.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,155.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,155.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,160.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,160.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,165.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,165.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,170.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,170.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,175.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,175.0f));
m_hrtf_sample_locations.push_back(KRVector2(0.0f,180.0f)); m_hrtf_sample_locations.push_back(Vector2(0.0f,180.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,000.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,000.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,005.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,005.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,010.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,010.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,015.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,015.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,020.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,020.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,025.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,025.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,030.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,030.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,035.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,035.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,040.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,040.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,045.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,045.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,050.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,050.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,055.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,055.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,060.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,060.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,065.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,065.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,070.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,070.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,075.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,075.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,080.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,080.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,085.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,085.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,090.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,090.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,095.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,095.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,100.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,100.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,105.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,105.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,110.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,110.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,115.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,115.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,120.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,120.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,125.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,125.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,130.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,130.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,135.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,135.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,140.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,140.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,145.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,145.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,150.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,150.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,155.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,155.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,160.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,160.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,165.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,165.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,170.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,170.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,175.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,175.0f));
m_hrtf_sample_locations.push_back(KRVector2(10.0f,180.0f)); m_hrtf_sample_locations.push_back(Vector2(10.0f,180.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,000.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,000.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,005.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,005.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,010.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,010.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,015.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,015.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,020.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,020.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,025.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,025.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,030.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,030.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,035.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,035.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,040.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,040.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,045.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,045.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,050.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,050.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,055.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,055.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,060.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,060.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,065.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,065.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,070.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,070.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,075.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,075.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,080.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,080.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,085.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,085.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,090.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,090.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,095.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,095.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,100.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,100.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,105.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,105.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,110.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,110.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,115.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,115.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,120.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,120.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,125.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,125.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,130.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,130.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,135.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,135.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,140.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,140.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,145.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,145.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,150.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,150.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,155.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,155.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,160.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,160.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,165.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,165.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,170.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,170.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,175.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,175.0f));
m_hrtf_sample_locations.push_back(KRVector2(20.0f,180.0f)); m_hrtf_sample_locations.push_back(Vector2(20.0f,180.0f));
m_hrtf_sample_locations.push_back(KRVector2(30.0f,000.0f)); m_hrtf_sample_locations.push_back(Vector2(30.0f,000.0f));
m_hrtf_sample_locations.push_back(KRVector2(30.0f,006.0f)); m_hrtf_sample_locations.push_back(Vector2(30.0f,006.0f));
m_hrtf_sample_locations.push_back(KRVector2(30.0f,012.0f)); m_hrtf_sample_locations.push_back(Vector2(30.0f,012.0f));
m_hrtf_sample_locations.push_back(KRVector2(30.0f,018.0f)); m_hrtf_sample_locations.push_back(Vector2(30.0f,018.0f));
m_hrtf_sample_locations.push_back(KRVector2(30.0f,024.0f)); m_hrtf_sample_locations.push_back(Vector2(30.0f,024.0f));
m_hrtf_sample_locations.push_back(KRVector2(30.0f,030.0f)); m_hrtf_sample_locations.push_back(Vector2(30.0f,030.0f));
m_hrtf_sample_locations.push_back(KRVector2(30.0f,036.0f)); m_hrtf_sample_locations.push_back(Vector2(30.0f,036.0f));
m_hrtf_sample_locations.push_back(KRVector2(30.0f,042.0f)); m_hrtf_sample_locations.push_back(Vector2(30.0f,042.0f));
m_hrtf_sample_locations.push_back(KRVector2(30.0f,048.0f)); m_hrtf_sample_locations.push_back(Vector2(30.0f,048.0f));
m_hrtf_sample_locations.push_back(KRVector2(30.0f,054.0f)); m_hrtf_sample_locations.push_back(Vector2(30.0f,054.0f));
m_hrtf_sample_locations.push_back(KRVector2(30.0f,060.0f)); m_hrtf_sample_locations.push_back(Vector2(30.0f,060.0f));
m_hrtf_sample_locations.push_back(KRVector2(30.0f,066.0f)); m_hrtf_sample_locations.push_back(Vector2(30.0f,066.0f));
m_hrtf_sample_locations.push_back(KRVector2(30.0f,072.0f)); m_hrtf_sample_locations.push_back(Vector2(30.0f,072.0f));
m_hrtf_sample_locations.push_back(KRVector2(30.0f,078.0f)); m_hrtf_sample_locations.push_back(Vector2(30.0f,078.0f));
m_hrtf_sample_locations.push_back(KRVector2(30.0f,084.0f)); m_hrtf_sample_locations.push_back(Vector2(30.0f,084.0f));
m_hrtf_sample_locations.push_back(KRVector2(30.0f,090.0f)); m_hrtf_sample_locations.push_back(Vector2(30.0f,090.0f));
m_hrtf_sample_locations.push_back(KRVector2(30.0f,096.0f)); m_hrtf_sample_locations.push_back(Vector2(30.0f,096.0f));
m_hrtf_sample_locations.push_back(KRVector2(30.0f,102.0f)); m_hrtf_sample_locations.push_back(Vector2(30.0f,102.0f));
m_hrtf_sample_locations.push_back(KRVector2(30.0f,108.0f)); m_hrtf_sample_locations.push_back(Vector2(30.0f,108.0f));
m_hrtf_sample_locations.push_back(KRVector2(30.0f,114.0f)); m_hrtf_sample_locations.push_back(Vector2(30.0f,114.0f));
m_hrtf_sample_locations.push_back(KRVector2(30.0f,120.0f)); m_hrtf_sample_locations.push_back(Vector2(30.0f,120.0f));
m_hrtf_sample_locations.push_back(KRVector2(30.0f,126.0f)); m_hrtf_sample_locations.push_back(Vector2(30.0f,126.0f));
m_hrtf_sample_locations.push_back(KRVector2(30.0f,132.0f)); m_hrtf_sample_locations.push_back(Vector2(30.0f,132.0f));
m_hrtf_sample_locations.push_back(KRVector2(30.0f,138.0f)); m_hrtf_sample_locations.push_back(Vector2(30.0f,138.0f));
m_hrtf_sample_locations.push_back(KRVector2(30.0f,144.0f)); m_hrtf_sample_locations.push_back(Vector2(30.0f,144.0f));
m_hrtf_sample_locations.push_back(KRVector2(30.0f,150.0f)); m_hrtf_sample_locations.push_back(Vector2(30.0f,150.0f));
m_hrtf_sample_locations.push_back(KRVector2(30.0f,156.0f)); m_hrtf_sample_locations.push_back(Vector2(30.0f,156.0f));
m_hrtf_sample_locations.push_back(KRVector2(30.0f,162.0f)); m_hrtf_sample_locations.push_back(Vector2(30.0f,162.0f));
m_hrtf_sample_locations.push_back(KRVector2(30.0f,168.0f)); m_hrtf_sample_locations.push_back(Vector2(30.0f,168.0f));
m_hrtf_sample_locations.push_back(KRVector2(30.0f,174.0f)); m_hrtf_sample_locations.push_back(Vector2(30.0f,174.0f));
m_hrtf_sample_locations.push_back(KRVector2(30.0f,180.0f)); m_hrtf_sample_locations.push_back(Vector2(30.0f,180.0f));
m_hrtf_sample_locations.push_back(KRVector2(40.0f,000.0f)); m_hrtf_sample_locations.push_back(Vector2(40.0f,000.0f));
m_hrtf_sample_locations.push_back(KRVector2(40.0f,006.0f)); m_hrtf_sample_locations.push_back(Vector2(40.0f,006.0f));
m_hrtf_sample_locations.push_back(KRVector2(40.0f,013.0f)); m_hrtf_sample_locations.push_back(Vector2(40.0f,013.0f));
m_hrtf_sample_locations.push_back(KRVector2(40.0f,019.0f)); m_hrtf_sample_locations.push_back(Vector2(40.0f,019.0f));
m_hrtf_sample_locations.push_back(KRVector2(40.0f,026.0f)); m_hrtf_sample_locations.push_back(Vector2(40.0f,026.0f));
m_hrtf_sample_locations.push_back(KRVector2(40.0f,032.0f)); m_hrtf_sample_locations.push_back(Vector2(40.0f,032.0f));
m_hrtf_sample_locations.push_back(KRVector2(40.0f,039.0f)); m_hrtf_sample_locations.push_back(Vector2(40.0f,039.0f));
m_hrtf_sample_locations.push_back(KRVector2(40.0f,045.0f)); m_hrtf_sample_locations.push_back(Vector2(40.0f,045.0f));
m_hrtf_sample_locations.push_back(KRVector2(40.0f,051.0f)); m_hrtf_sample_locations.push_back(Vector2(40.0f,051.0f));
m_hrtf_sample_locations.push_back(KRVector2(40.0f,058.0f)); m_hrtf_sample_locations.push_back(Vector2(40.0f,058.0f));
m_hrtf_sample_locations.push_back(KRVector2(40.0f,064.0f)); m_hrtf_sample_locations.push_back(Vector2(40.0f,064.0f));
m_hrtf_sample_locations.push_back(KRVector2(40.0f,071.0f)); m_hrtf_sample_locations.push_back(Vector2(40.0f,071.0f));
m_hrtf_sample_locations.push_back(KRVector2(40.0f,077.0f)); m_hrtf_sample_locations.push_back(Vector2(40.0f,077.0f));
m_hrtf_sample_locations.push_back(KRVector2(40.0f,084.0f)); m_hrtf_sample_locations.push_back(Vector2(40.0f,084.0f));
m_hrtf_sample_locations.push_back(KRVector2(40.0f,090.0f)); m_hrtf_sample_locations.push_back(Vector2(40.0f,090.0f));
m_hrtf_sample_locations.push_back(KRVector2(40.0f,096.0f)); m_hrtf_sample_locations.push_back(Vector2(40.0f,096.0f));
m_hrtf_sample_locations.push_back(KRVector2(40.0f,103.0f)); m_hrtf_sample_locations.push_back(Vector2(40.0f,103.0f));
m_hrtf_sample_locations.push_back(KRVector2(40.0f,109.0f)); m_hrtf_sample_locations.push_back(Vector2(40.0f,109.0f));
m_hrtf_sample_locations.push_back(KRVector2(40.0f,116.0f)); m_hrtf_sample_locations.push_back(Vector2(40.0f,116.0f));
m_hrtf_sample_locations.push_back(KRVector2(40.0f,122.0f)); m_hrtf_sample_locations.push_back(Vector2(40.0f,122.0f));
m_hrtf_sample_locations.push_back(KRVector2(40.0f,129.0f)); m_hrtf_sample_locations.push_back(Vector2(40.0f,129.0f));
m_hrtf_sample_locations.push_back(KRVector2(40.0f,135.0f)); m_hrtf_sample_locations.push_back(Vector2(40.0f,135.0f));
m_hrtf_sample_locations.push_back(KRVector2(40.0f,141.0f)); m_hrtf_sample_locations.push_back(Vector2(40.0f,141.0f));
m_hrtf_sample_locations.push_back(KRVector2(40.0f,148.0f)); m_hrtf_sample_locations.push_back(Vector2(40.0f,148.0f));
m_hrtf_sample_locations.push_back(KRVector2(40.0f,154.0f)); m_hrtf_sample_locations.push_back(Vector2(40.0f,154.0f));
m_hrtf_sample_locations.push_back(KRVector2(40.0f,161.0f)); m_hrtf_sample_locations.push_back(Vector2(40.0f,161.0f));
m_hrtf_sample_locations.push_back(KRVector2(40.0f,167.0f)); m_hrtf_sample_locations.push_back(Vector2(40.0f,167.0f));
m_hrtf_sample_locations.push_back(KRVector2(40.0f,174.0f)); m_hrtf_sample_locations.push_back(Vector2(40.0f,174.0f));
m_hrtf_sample_locations.push_back(KRVector2(40.0f,180.0f)); m_hrtf_sample_locations.push_back(Vector2(40.0f,180.0f));
m_hrtf_sample_locations.push_back(KRVector2(50.0f,000.0f)); m_hrtf_sample_locations.push_back(Vector2(50.0f,000.0f));
m_hrtf_sample_locations.push_back(KRVector2(50.0f,008.0f)); m_hrtf_sample_locations.push_back(Vector2(50.0f,008.0f));
m_hrtf_sample_locations.push_back(KRVector2(50.0f,016.0f)); m_hrtf_sample_locations.push_back(Vector2(50.0f,016.0f));
m_hrtf_sample_locations.push_back(KRVector2(50.0f,024.0f)); m_hrtf_sample_locations.push_back(Vector2(50.0f,024.0f));
m_hrtf_sample_locations.push_back(KRVector2(50.0f,032.0f)); m_hrtf_sample_locations.push_back(Vector2(50.0f,032.0f));
m_hrtf_sample_locations.push_back(KRVector2(50.0f,040.0f)); m_hrtf_sample_locations.push_back(Vector2(50.0f,040.0f));
m_hrtf_sample_locations.push_back(KRVector2(50.0f,048.0f)); m_hrtf_sample_locations.push_back(Vector2(50.0f,048.0f));
m_hrtf_sample_locations.push_back(KRVector2(50.0f,056.0f)); m_hrtf_sample_locations.push_back(Vector2(50.0f,056.0f));
m_hrtf_sample_locations.push_back(KRVector2(50.0f,064.0f)); m_hrtf_sample_locations.push_back(Vector2(50.0f,064.0f));
m_hrtf_sample_locations.push_back(KRVector2(50.0f,072.0f)); m_hrtf_sample_locations.push_back(Vector2(50.0f,072.0f));
m_hrtf_sample_locations.push_back(KRVector2(50.0f,080.0f)); m_hrtf_sample_locations.push_back(Vector2(50.0f,080.0f));
m_hrtf_sample_locations.push_back(KRVector2(50.0f,088.0f)); m_hrtf_sample_locations.push_back(Vector2(50.0f,088.0f));
m_hrtf_sample_locations.push_back(KRVector2(50.0f,096.0f)); m_hrtf_sample_locations.push_back(Vector2(50.0f,096.0f));
m_hrtf_sample_locations.push_back(KRVector2(50.0f,104.0f)); m_hrtf_sample_locations.push_back(Vector2(50.0f,104.0f));
m_hrtf_sample_locations.push_back(KRVector2(50.0f,112.0f)); m_hrtf_sample_locations.push_back(Vector2(50.0f,112.0f));
m_hrtf_sample_locations.push_back(KRVector2(50.0f,120.0f)); m_hrtf_sample_locations.push_back(Vector2(50.0f,120.0f));
m_hrtf_sample_locations.push_back(KRVector2(50.0f,128.0f)); m_hrtf_sample_locations.push_back(Vector2(50.0f,128.0f));
m_hrtf_sample_locations.push_back(KRVector2(50.0f,136.0f)); m_hrtf_sample_locations.push_back(Vector2(50.0f,136.0f));
m_hrtf_sample_locations.push_back(KRVector2(50.0f,144.0f)); m_hrtf_sample_locations.push_back(Vector2(50.0f,144.0f));
m_hrtf_sample_locations.push_back(KRVector2(50.0f,152.0f)); m_hrtf_sample_locations.push_back(Vector2(50.0f,152.0f));
m_hrtf_sample_locations.push_back(KRVector2(50.0f,160.0f)); m_hrtf_sample_locations.push_back(Vector2(50.0f,160.0f));
m_hrtf_sample_locations.push_back(KRVector2(50.0f,168.0f)); m_hrtf_sample_locations.push_back(Vector2(50.0f,168.0f));
m_hrtf_sample_locations.push_back(KRVector2(50.0f,176.0f)); m_hrtf_sample_locations.push_back(Vector2(50.0f,176.0f));
m_hrtf_sample_locations.push_back(KRVector2(60.0f,000.0f)); m_hrtf_sample_locations.push_back(Vector2(60.0f,000.0f));
m_hrtf_sample_locations.push_back(KRVector2(60.0f,010.0f)); m_hrtf_sample_locations.push_back(Vector2(60.0f,010.0f));
m_hrtf_sample_locations.push_back(KRVector2(60.0f,020.0f)); m_hrtf_sample_locations.push_back(Vector2(60.0f,020.0f));
m_hrtf_sample_locations.push_back(KRVector2(60.0f,030.0f)); m_hrtf_sample_locations.push_back(Vector2(60.0f,030.0f));
m_hrtf_sample_locations.push_back(KRVector2(60.0f,040.0f)); m_hrtf_sample_locations.push_back(Vector2(60.0f,040.0f));
m_hrtf_sample_locations.push_back(KRVector2(60.0f,050.0f)); m_hrtf_sample_locations.push_back(Vector2(60.0f,050.0f));
m_hrtf_sample_locations.push_back(KRVector2(60.0f,060.0f)); m_hrtf_sample_locations.push_back(Vector2(60.0f,060.0f));
m_hrtf_sample_locations.push_back(KRVector2(60.0f,070.0f)); m_hrtf_sample_locations.push_back(Vector2(60.0f,070.0f));
m_hrtf_sample_locations.push_back(KRVector2(60.0f,080.0f)); m_hrtf_sample_locations.push_back(Vector2(60.0f,080.0f));
m_hrtf_sample_locations.push_back(KRVector2(60.0f,090.0f)); m_hrtf_sample_locations.push_back(Vector2(60.0f,090.0f));
m_hrtf_sample_locations.push_back(KRVector2(60.0f,100.0f)); m_hrtf_sample_locations.push_back(Vector2(60.0f,100.0f));
m_hrtf_sample_locations.push_back(KRVector2(60.0f,110.0f)); m_hrtf_sample_locations.push_back(Vector2(60.0f,110.0f));
m_hrtf_sample_locations.push_back(KRVector2(60.0f,120.0f)); m_hrtf_sample_locations.push_back(Vector2(60.0f,120.0f));
m_hrtf_sample_locations.push_back(KRVector2(60.0f,130.0f)); m_hrtf_sample_locations.push_back(Vector2(60.0f,130.0f));
m_hrtf_sample_locations.push_back(KRVector2(60.0f,140.0f)); m_hrtf_sample_locations.push_back(Vector2(60.0f,140.0f));
m_hrtf_sample_locations.push_back(KRVector2(60.0f,150.0f)); m_hrtf_sample_locations.push_back(Vector2(60.0f,150.0f));
m_hrtf_sample_locations.push_back(KRVector2(60.0f,160.0f)); m_hrtf_sample_locations.push_back(Vector2(60.0f,160.0f));
m_hrtf_sample_locations.push_back(KRVector2(60.0f,170.0f)); m_hrtf_sample_locations.push_back(Vector2(60.0f,170.0f));
m_hrtf_sample_locations.push_back(KRVector2(60.0f,180.0f)); m_hrtf_sample_locations.push_back(Vector2(60.0f,180.0f));
m_hrtf_sample_locations.push_back(KRVector2(70.0f,000.0f)); m_hrtf_sample_locations.push_back(Vector2(70.0f,000.0f));
m_hrtf_sample_locations.push_back(KRVector2(70.0f,015.0f)); m_hrtf_sample_locations.push_back(Vector2(70.0f,015.0f));
m_hrtf_sample_locations.push_back(KRVector2(70.0f,030.0f)); m_hrtf_sample_locations.push_back(Vector2(70.0f,030.0f));
m_hrtf_sample_locations.push_back(KRVector2(70.0f,045.0f)); m_hrtf_sample_locations.push_back(Vector2(70.0f,045.0f));
m_hrtf_sample_locations.push_back(KRVector2(70.0f,060.0f)); m_hrtf_sample_locations.push_back(Vector2(70.0f,060.0f));
m_hrtf_sample_locations.push_back(KRVector2(70.0f,075.0f)); m_hrtf_sample_locations.push_back(Vector2(70.0f,075.0f));
m_hrtf_sample_locations.push_back(KRVector2(70.0f,090.0f)); m_hrtf_sample_locations.push_back(Vector2(70.0f,090.0f));
m_hrtf_sample_locations.push_back(KRVector2(70.0f,105.0f)); m_hrtf_sample_locations.push_back(Vector2(70.0f,105.0f));
m_hrtf_sample_locations.push_back(KRVector2(70.0f,120.0f)); m_hrtf_sample_locations.push_back(Vector2(70.0f,120.0f));
m_hrtf_sample_locations.push_back(KRVector2(70.0f,135.0f)); m_hrtf_sample_locations.push_back(Vector2(70.0f,135.0f));
m_hrtf_sample_locations.push_back(KRVector2(70.0f,150.0f)); m_hrtf_sample_locations.push_back(Vector2(70.0f,150.0f));
m_hrtf_sample_locations.push_back(KRVector2(70.0f,165.0f)); m_hrtf_sample_locations.push_back(Vector2(70.0f,165.0f));
m_hrtf_sample_locations.push_back(KRVector2(70.0f,180.0f)); m_hrtf_sample_locations.push_back(Vector2(70.0f,180.0f));
m_hrtf_sample_locations.push_back(KRVector2(80.0f,000.0f)); m_hrtf_sample_locations.push_back(Vector2(80.0f,000.0f));
m_hrtf_sample_locations.push_back(KRVector2(80.0f,030.0f)); m_hrtf_sample_locations.push_back(Vector2(80.0f,030.0f));
m_hrtf_sample_locations.push_back(KRVector2(80.0f,060.0f)); m_hrtf_sample_locations.push_back(Vector2(80.0f,060.0f));
m_hrtf_sample_locations.push_back(KRVector2(80.0f,090.0f)); m_hrtf_sample_locations.push_back(Vector2(80.0f,090.0f));
m_hrtf_sample_locations.push_back(KRVector2(80.0f,120.0f)); m_hrtf_sample_locations.push_back(Vector2(80.0f,120.0f));
m_hrtf_sample_locations.push_back(KRVector2(80.0f,150.0f)); m_hrtf_sample_locations.push_back(Vector2(80.0f,150.0f));
m_hrtf_sample_locations.push_back(KRVector2(80.0f,180.0f)); m_hrtf_sample_locations.push_back(Vector2(80.0f,180.0f));
m_hrtf_sample_locations.push_back(KRVector2(90.0f,000.0f)); m_hrtf_sample_locations.push_back(Vector2(90.0f,000.0f));
if(m_hrtf_data) { if(m_hrtf_data) {
delete m_hrtf_data; delete m_hrtf_data;
@@ -815,8 +815,8 @@ void KRAudioManager::initHRTF()
} }
int sample_index=0; int sample_index=0;
for(std::vector<KRVector2>::iterator itr=m_hrtf_sample_locations.begin(); itr != m_hrtf_sample_locations.end(); itr++) { for(std::vector<Vector2>::iterator itr=m_hrtf_sample_locations.begin(); itr != m_hrtf_sample_locations.end(); itr++) {
KRVector2 pos = *itr; Vector2 pos = *itr;
KRAudioSample *sample = getHRTFSample(pos); KRAudioSample *sample = getHRTFSample(pos);
for(int channel=0; channel < 2; channel++) { for(int channel=0; channel < 2; channel++) {
KRDSP::SplitComplex spectral; KRDSP::SplitComplex spectral;
@@ -833,7 +833,7 @@ void KRAudioManager::initHRTF()
} }
KRAudioSample *KRAudioManager::getHRTFSample(const KRVector2 &hrtf_dir) KRAudioSample *KRAudioManager::getHRTFSample(const Vector2 &hrtf_dir)
{ {
//hrtf_kemar_H-10e000a.wav //hrtf_kemar_H-10e000a.wav
char szName[64]; char szName[64];
@@ -842,9 +842,9 @@ KRAudioSample *KRAudioManager::getHRTFSample(const KRVector2 &hrtf_dir)
return get(szName); return get(szName);
} }
KRDSP::SplitComplex KRAudioManager::getHRTFSpectral(const KRVector2 &hrtf_dir, const int channel) KRDSP::SplitComplex KRAudioManager::getHRTFSpectral(const Vector2 &hrtf_dir, const int channel)
{ {
KRVector2 dir = hrtf_dir; Vector2 dir = hrtf_dir;
int sample_channel = channel; int sample_channel = channel;
if(dir.y < 0) { if(dir.y < 0) {
dir.y = -dir.y; dir.y = -dir.y;
@@ -853,21 +853,21 @@ KRDSP::SplitComplex KRAudioManager::getHRTFSpectral(const KRVector2 &hrtf_dir, c
return m_hrtf_spectral[sample_channel][dir]; return m_hrtf_spectral[sample_channel][dir];
} }
KRVector2 KRAudioManager::getNearestHRTFSample(const KRVector2 &dir) Vector2 KRAudioManager::getNearestHRTFSample(const Vector2 &dir)
{ {
float elev_gran = 10.0f; float elev_gran = 10.0f;
KRVector2 dir_deg = dir * (180.0f / M_PI); Vector2 dir_deg = dir * (180.0f / M_PI);
float elevation = floor(dir_deg.x / elev_gran + 0.5f) * elev_gran; float elevation = floor(dir_deg.x / elev_gran + 0.5f) * elev_gran;
if(elevation < -40.0f) { if(elevation < -40.0f) {
elevation = -40.0f; elevation = -40.0f;
} }
KRVector2 min_direction; Vector2 min_direction;
bool first = true; bool first = true;
float min_distance = 360.0f; float min_distance = 360.0f;
for(std::vector<KRVector2>::iterator itr = m_hrtf_sample_locations.begin(); itr != m_hrtf_sample_locations.end(); itr++) { for(std::vector<Vector2>::iterator itr = m_hrtf_sample_locations.begin(); itr != m_hrtf_sample_locations.end(); itr++) {
if(first) { if(first) {
first = false; first = false;
min_direction = (*itr); min_direction = (*itr);
@@ -888,7 +888,7 @@ KRVector2 KRAudioManager::getNearestHRTFSample(const KRVector2 &dir)
return min_direction; return min_direction;
} }
void KRAudioManager::getHRTFMix(const KRVector2 &dir, KRVector2 &dir1, KRVector2 &dir2, KRVector2 &dir3, KRVector2 &dir4, float &mix1, float &mix2, float &mix3, float &mix4) void KRAudioManager::getHRTFMix(const Vector2 &dir, Vector2 &dir1, Vector2 &dir2, Vector2 &dir3, Vector2 &dir4, float &mix1, float &mix2, float &mix3, float &mix4)
{ {
float elev_gran = 10.0f; float elev_gran = 10.0f;
@@ -913,8 +913,8 @@ void KRAudioManager::getHRTFMix(const KRVector2 &dir, KRVector2 &dir1, KRVector2
bool first2 = true; bool first2 = true;
bool first3 = true; bool first3 = true;
bool first4 = true; bool first4 = true;
for(std::vector<KRVector2>::iterator itr = m_hrtf_sample_locations.begin(); itr != m_hrtf_sample_locations.end(); itr++) { for(std::vector<Vector2>::iterator itr = m_hrtf_sample_locations.begin(); itr != m_hrtf_sample_locations.end(); itr++) {
KRVector2 sample_pos = *itr; Vector2 sample_pos = *itr;
if(sample_pos.x == elev1) { if(sample_pos.x == elev1) {
if(sample_pos.y <= azimuth) { if(sample_pos.y <= azimuth) {
@@ -1493,11 +1493,11 @@ void KRAudioManager::startFrame(float deltaTime)
} }
} }
KRVector2 source_dir2 = KRVector2::Normalize(KRVector2(source_dir.x, source_dir.z)); Vector2 source_dir2 = Vector2::Normalize(Vector2(source_dir.x, source_dir.z));
float azimuth = -atan2(source_dir2.x, -source_dir2.y); float azimuth = -atan2(source_dir2.x, -source_dir2.y);
float elevation = atan( source_dir.y / sqrt(source_dir.x * source_dir.x + source_dir.z * source_dir.z)); float elevation = atan( source_dir.y / sqrt(source_dir.x * source_dir.x + source_dir.z * source_dir.z));
KRVector2 adjusted_source_dir = KRVector2(elevation, azimuth); Vector2 adjusted_source_dir = Vector2(elevation, azimuth);
if(!m_high_quality_hrtf) { if(!m_high_quality_hrtf) {
adjusted_source_dir = getNearestHRTFSample(adjusted_source_dir); adjusted_source_dir = getNearestHRTFSample(adjusted_source_dir);
@@ -1505,30 +1505,30 @@ void KRAudioManager::startFrame(float deltaTime)
// Click Removal - Add ramping of gain changes for audio sources that are continuing to play // Click Removal - Add ramping of gain changes for audio sources that are continuing to play
float gain_anticlick = 0.0f; float gain_anticlick = 0.0f;
std::pair<unordered_multimap<KRVector2, std::pair<KRAudioSource *, std::pair<float, float> > >::iterator, unordered_multimap<KRVector2, std::pair<KRAudioSource *, std::pair<float, float> > >::iterator> prev_range = m_prev_mapped_sources.equal_range(adjusted_source_dir); std::pair<unordered_multimap<Vector2, std::pair<KRAudioSource *, std::pair<float, float> > >::iterator, unordered_multimap<Vector2, std::pair<KRAudioSource *, std::pair<float, float> > >::iterator> prev_range = m_prev_mapped_sources.equal_range(adjusted_source_dir);
for(unordered_multimap<KRVector2, std::pair<KRAudioSource *, std::pair<float, float> > >::iterator prev_itr=prev_range.first; prev_itr != prev_range.second; prev_itr++) { for(unordered_multimap<Vector2, std::pair<KRAudioSource *, std::pair<float, float> > >::iterator prev_itr=prev_range.first; prev_itr != prev_range.second; prev_itr++) {
if( (*prev_itr).second.first == source) { if( (*prev_itr).second.first == source) {
gain_anticlick = (*prev_itr).second.second.second; gain_anticlick = (*prev_itr).second.second.second;
break; break;
} }
} }
m_mapped_sources.insert(std::pair<KRVector2, std::pair<KRAudioSource *, std::pair<float, float> > >(adjusted_source_dir, std::pair<KRAudioSource *, std::pair<float, float> >(source, std::pair<float, float>(gain_anticlick, gain)))); m_mapped_sources.insert(std::pair<Vector2, std::pair<KRAudioSource *, std::pair<float, float> > >(adjusted_source_dir, std::pair<KRAudioSource *, std::pair<float, float> >(source, std::pair<float, float>(gain_anticlick, gain))));
} }
} }
// Click Removal - Map audio sources for ramp-down of gain for audio sources that have been squelched by attenuation // Click Removal - Map audio sources for ramp-down of gain for audio sources that have been squelched by attenuation
for(unordered_multimap<KRVector2, std::pair<KRAudioSource *, std::pair<float, float> > >::iterator itr=m_prev_mapped_sources.begin(); itr != m_prev_mapped_sources.end(); itr++) { for(unordered_multimap<Vector2, std::pair<KRAudioSource *, std::pair<float, float> > >::iterator itr=m_prev_mapped_sources.begin(); itr != m_prev_mapped_sources.end(); itr++) {
KRAudioSource *source = (*itr).second.first; KRAudioSource *source = (*itr).second.first;
float source_prev_gain = (*itr).second.second.second; float source_prev_gain = (*itr).second.second.second;
if(source->isPlaying() && source_prev_gain > 0.0f) { if(source->isPlaying() && source_prev_gain > 0.0f) {
// Only create ramp-down channels for 3d sources that have been squelched by attenuation; this is not necessary if the sample has completed playing // Only create ramp-down channels for 3d sources that have been squelched by attenuation; this is not necessary if the sample has completed playing
KRVector2 source_position = (*itr).first; Vector2 source_position = (*itr).first;
std::pair<unordered_multimap<KRVector2, std::pair<KRAudioSource *, std::pair<float, float> > >::iterator, unordered_multimap<KRVector2, std::pair<KRAudioSource *, std::pair<float, float> > >::iterator> new_range = m_mapped_sources.equal_range(source_position); std::pair<unordered_multimap<Vector2, std::pair<KRAudioSource *, std::pair<float, float> > >::iterator, unordered_multimap<Vector2, std::pair<KRAudioSource *, std::pair<float, float> > >::iterator> new_range = m_mapped_sources.equal_range(source_position);
bool already_merged = false; bool already_merged = false;
for(unordered_multimap<KRVector2, std::pair<KRAudioSource *, std::pair<float, float> > >::iterator new_itr=new_range.first; new_itr != new_range.second; new_itr++) { for(unordered_multimap<Vector2, std::pair<KRAudioSource *, std::pair<float, float> > >::iterator new_itr=new_range.first; new_itr != new_range.second; new_itr++) {
if( (*new_itr).second.first == source) { if( (*new_itr).second.first == source) {
already_merged = true; already_merged = true;
break; break;
@@ -1537,7 +1537,7 @@ void KRAudioManager::startFrame(float deltaTime)
if(!already_merged) { if(!already_merged) {
// source gain becomes anticlick gain and gain becomes 0 for anti-click ramp-down. // source gain becomes anticlick gain and gain becomes 0 for anti-click ramp-down.
m_mapped_sources.insert(std::pair<KRVector2, std::pair<KRAudioSource *, std::pair<float, float> > >(source_position, std::pair<KRAudioSource *, std::pair<float, float> >(source, std::pair<float, float>(source_prev_gain, 0.0f)))); m_mapped_sources.insert(std::pair<Vector2, std::pair<KRAudioSource *, std::pair<float, float> > >(source_position, std::pair<KRAudioSource *, std::pair<float, float> >(source, std::pair<float, float>(source_prev_gain, 0.0f))));
} }
} }
} }
@@ -1585,10 +1585,10 @@ void KRAudioManager::renderHRTF()
for(int channel=0; channel<impulse_response_channels; channel++) { for(int channel=0; channel<impulse_response_channels; channel++) {
bool first_source = true; bool first_source = true;
unordered_multimap<KRVector2, std::pair<KRAudioSource *, std::pair<float, float> > >::iterator itr=m_mapped_sources.begin(); unordered_multimap<Vector2, std::pair<KRAudioSource *, std::pair<float, float> > >::iterator itr=m_mapped_sources.begin();
while(itr != m_mapped_sources.end()) { while(itr != m_mapped_sources.end()) {
// Batch together sound sources that are emitted from the same direction // Batch together sound sources that are emitted from the same direction
KRVector2 source_direction = (*itr).first; Vector2 source_direction = (*itr).first;
KRAudioSource *source = (*itr).second.first; KRAudioSource *source = (*itr).second.first;
float gain_anticlick = (*itr).second.second.first; float gain_anticlick = (*itr).second.second.first;
float gain = (*itr).second.second.second; float gain = (*itr).second.second.second;
@@ -1625,7 +1625,7 @@ void KRAudioManager::renderHRTF()
if(itr == m_mapped_sources.end()) { if(itr == m_mapped_sources.end()) {
end_of_group = true; end_of_group = true;
} else { } else {
KRVector2 next_direction = (*itr).first; Vector2 next_direction = (*itr).first;
end_of_group = next_direction != source_direction; end_of_group = next_direction != source_direction;
} }
@@ -1643,7 +1643,7 @@ void KRAudioManager::renderHRTF()
hrtf_spectral = *hrtf_accum; hrtf_spectral = *hrtf_accum;
float mix[4]; float mix[4];
KRVector2 dir[4]; Vector2 dir[4];
getHRTFMix(source_direction, dir[0], dir[1], dir[2], dir[3], mix[0], mix[1], mix[2], mix[3]); getHRTFMix(source_direction, dir[0], dir[1], dir[2], dir[3], mix[0], mix[1], mix[2], mix[3]);

View File

@@ -223,14 +223,14 @@ private:
void renderReverbImpulseResponse(int impulse_response_offset, int frame_count_log2); void renderReverbImpulseResponse(int impulse_response_offset, int frame_count_log2);
void renderLimiter(); void renderLimiter();
std::vector<KRVector2> m_hrtf_sample_locations; std::vector<Vector2> m_hrtf_sample_locations;
float *m_hrtf_data; float *m_hrtf_data;
unordered_map<KRVector2, KRDSP::SplitComplex> m_hrtf_spectral[2]; unordered_map<Vector2, KRDSP::SplitComplex> m_hrtf_spectral[2];
KRVector2 getNearestHRTFSample(const KRVector2 &dir); Vector2 getNearestHRTFSample(const Vector2 &dir);
void getHRTFMix(const KRVector2 &dir, KRVector2 &hrtf1, KRVector2 &hrtf2, KRVector2 &hrtf3, KRVector2 &hrtf4, float &mix1, float &mix2, float &mix3, float &mix4); void getHRTFMix(const Vector2 &dir, Vector2 &hrtf1, Vector2 &hrtf2, Vector2 &hrtf3, Vector2 &hrtf4, float &mix1, float &mix2, float &mix3, float &mix4);
KRAudioSample *getHRTFSample(const KRVector2 &hrtf_dir); KRAudioSample *getHRTFSample(const Vector2 &hrtf_dir);
KRDSP::SplitComplex getHRTFSpectral(const KRVector2 &hrtf_dir, const int channel); KRDSP::SplitComplex getHRTFSpectral(const Vector2 &hrtf_dir, const int channel);
unordered_map<std::string, siren_ambient_zone_weight_info> m_ambient_zone_weights; unordered_map<std::string, siren_ambient_zone_weight_info> m_ambient_zone_weights;
float m_ambient_zone_total_weight = 0.0f; // For normalizing zone weights float m_ambient_zone_total_weight = 0.0f; // For normalizing zone weights
@@ -244,7 +244,7 @@ private:
#endif #endif
unordered_multimap<KRVector2, std::pair<KRAudioSource *, std::pair<float, float> > > m_mapped_sources, m_prev_mapped_sources; unordered_multimap<Vector2, std::pair<KRAudioSource *, std::pair<float, float> > > m_mapped_sources, m_prev_mapped_sources;
bool m_anticlick_block; bool m_anticlick_block;
bool m_high_quality_hrtf; // If true, 4 HRTF samples will be interpolated; if false, the nearest HRTF sample will be used without interpolation bool m_high_quality_hrtf; // If true, 4 HRTF samples will be interpolated; if false, the nearest HRTF sample will be used without interpolation
}; };

View File

@@ -53,7 +53,7 @@ KRCamera::KRCamera(KRScene &scene, std::string name) : KRNode(scene, name) {
volumetricLightAccumulationBuffer = 0; volumetricLightAccumulationBuffer = 0;
volumetricLightAccumulationTexture = 0; volumetricLightAccumulationTexture = 0;
m_frame_times_filled = 0; m_frame_times_filled = 0;
m_downsample = KRVector2::One(); m_downsample = Vector2::One();
m_fade_color = KRVector4::Zero(); m_fade_color = KRVector4::Zero();
} }
@@ -113,7 +113,7 @@ void KRCamera::renderFrame(GLint defaultFBO, GLint renderBufferWidth, GLint rend
//KRMat4 viewMatrix = KRMat4::Invert(getModelMatrix()); //KRMat4 viewMatrix = KRMat4::Invert(getModelMatrix());
settings.setViewportSize(KRVector2(m_backingWidth, m_backingHeight)); settings.setViewportSize(Vector2(m_backingWidth, m_backingHeight));
KRMat4 projectionMatrix; KRMat4 projectionMatrix;
projectionMatrix.perspective(settings.perspective_fov, settings.m_viewportSize.x / settings.m_viewportSize.y, settings.perspective_nearz, settings.perspective_farz); projectionMatrix.perspective(settings.perspective_fov, settings.m_viewportSize.x / settings.m_viewportSize.y, settings.perspective_nearz, settings.perspective_farz);
m_viewport = KRViewport(settings.getViewportSize(), viewMatrix, projectionMatrix); m_viewport = KRViewport(settings.getViewportSize(), viewMatrix, projectionMatrix);
@@ -419,7 +419,7 @@ void KRCamera::renderFrame(GLint defaultFBO, GLint renderBufferWidth, GLint rend
GL_PUSH_GROUP_MARKER("Volumetric Lighting"); GL_PUSH_GROUP_MARKER("Volumetric Lighting");
KRViewport volumetricLightingViewport = KRViewport(KRVector2(volumetricBufferWidth, volumetricBufferHeight), m_viewport.getViewMatrix(), m_viewport.getProjectionMatrix()); KRViewport volumetricLightingViewport = KRViewport(Vector2(volumetricBufferWidth, volumetricBufferHeight), m_viewport.getViewMatrix(), m_viewport.getProjectionMatrix());
if(settings.volumetric_environment_downsample != 0) { if(settings.volumetric_environment_downsample != 0) {
// Set render target // Set render target
@@ -808,12 +808,12 @@ void KRCamera::renderPost()
int iTexCol = iChar % 16; int iTexCol = iChar % 16;
int iTexRow = 15 - (iChar - iTexCol) / 16; int iTexRow = 15 - (iChar - iTexCol) / 16;
KRVector2 top_left_pos = KRVector2(-1.0f + dScaleX * iCol, dScaleY * iRow - 1.0); Vector2 top_left_pos = Vector2(-1.0f + dScaleX * iCol, dScaleY * iRow - 1.0);
KRVector2 bottom_right_pos = KRVector2(-1.0 + dScaleX * (iCol + 1), dScaleY * iRow + dScaleY - 1.0); Vector2 bottom_right_pos = Vector2(-1.0 + dScaleX * (iCol + 1), dScaleY * iRow + dScaleY - 1.0);
top_left_pos += KRVector2(1.0f / 2048.0f * 0.5f, 1.0f / 1536.0f * 0.5f); top_left_pos += Vector2(1.0f / 2048.0f * 0.5f, 1.0f / 1536.0f * 0.5f);
bottom_right_pos += KRVector2(1.0f / 2048.0f * 0.5f, 1.0f / 1536.0f * 0.5f); bottom_right_pos += Vector2(1.0f / 2048.0f * 0.5f, 1.0f / 1536.0f * 0.5f);
KRVector2 top_left_uv = KRVector2(dTexScale * iTexCol, dTexScale * iTexRow); Vector2 top_left_uv = Vector2(dTexScale * iTexCol, dTexScale * iTexRow);
KRVector2 bottom_right_uv = KRVector2(dTexScale * iTexCol + dTexScale, dTexScale * iTexRow + dTexScale); Vector2 bottom_right_uv = Vector2(dTexScale * iTexCol + dTexScale, dTexScale * iTexRow + dTexScale);
vertex_data[vertex_count].x = top_left_pos.x; vertex_data[vertex_count].x = top_left_pos.x;
vertex_data[vertex_count].y = top_left_pos.y; vertex_data[vertex_count].y = top_left_pos.y;
@@ -1096,7 +1096,7 @@ const KRViewport &KRCamera::getViewport() const
} }
KRVector2 KRCamera::getDownsample() Vector2 KRCamera::getDownsample()
{ {
return m_downsample; return m_downsample;
} }

View File

@@ -66,7 +66,7 @@ public:
std::string getDebugText(); std::string getDebugText();
void flushSkybox(); // this will delete the skybox and cause the camera to reload a new skybox based on the settings void flushSkybox(); // this will delete the skybox and cause the camera to reload a new skybox based on the settings
KRVector2 getDownsample(); Vector2 getDownsample();
void setDownsample(float v); void setDownsample(float v);
void setFadeColor(const KRVector4 &fade_color); void setFadeColor(const KRVector4 &fade_color);
@@ -97,7 +97,7 @@ private:
float m_particlesAbsoluteTime; float m_particlesAbsoluteTime;
KRVector2 m_downsample; Vector2 m_downsample;
KRVector4 m_fade_color; KRVector4 m_fade_color;

View File

@@ -75,7 +75,7 @@ int KRDirectionalLight::configureShadowBufferViewports(const KRViewport &viewpor
matBias.bias(); matBias.bias();
matShadowProjection *= matBias; matShadowProjection *= matBias;
KRViewport newShadowViewport = KRViewport(KRVector2(KRENGINE_SHADOW_MAP_WIDTH, KRENGINE_SHADOW_MAP_HEIGHT), matShadowView, matShadowProjection); KRViewport newShadowViewport = KRViewport(Vector2(KRENGINE_SHADOW_MAP_WIDTH, KRENGINE_SHADOW_MAP_HEIGHT), matShadowView, matShadowProjection);
KRAABB prevShadowBounds = KRAABB(-KRVector3::One(), KRVector3::One(), KRMat4::Invert(m_shadowViewports[iShadow].getViewProjectionMatrix())); KRAABB prevShadowBounds = KRAABB(-KRVector3::One(), KRVector3::One(), KRMat4::Invert(m_shadowViewports[iShadow].getViewProjectionMatrix()));
KRAABB minimumShadowBounds = KRAABB(-KRVector3::One(), KRVector3::One(), KRMat4::Invert(newShadowViewport.getViewProjectionMatrix())); KRAABB minimumShadowBounds = KRAABB(-KRVector3::One(), KRVector3::One(), KRMat4::Invert(newShadowViewport.getViewProjectionMatrix()));
minimumShadowBounds.scale(1.0f / KRENGINE_SHADOW_BOUNDS_EXTRA_SCALE); minimumShadowBounds.scale(1.0f / KRENGINE_SHADOW_BOUNDS_EXTRA_SCALE);

View File

@@ -4,7 +4,7 @@
namespace kraken { namespace kraken {
void SetUniform(GLint location, const KRVector2 &v) void SetUniform(GLint location, const Vector2 &v)
{ {
if (location != -1) GLDEBUG(glUniform2f(location, v.x, v.y)); if (location != -1) GLDEBUG(glUniform2f(location, v.x, v.y));
} }

View File

@@ -17,7 +17,7 @@ float const PI = 3.141592653589793f;
float const D2R = PI * 2 / 360; float const D2R = PI * 2 / 360;
namespace kraken { namespace kraken {
void SetUniform(GLint location, const KRVector2 &v); void SetUniform(GLint location, const Vector2 &v);
void SetUniform(GLint location, const KRVector3 &v); void SetUniform(GLint location, const KRVector3 &v);
void SetUniform(GLint location, const KRVector4 &v); void SetUniform(GLint location, const KRVector4 &v);
void SetUniform(GLint location, const KRMat4 &v); void SetUniform(GLint location, const KRMat4 &v);

View File

@@ -263,7 +263,7 @@ void KRLight::render(KRCamera *pCamera, std::vector<KRPointLight *> &point_light
float slice_far = -pCamera->settings.volumetric_environment_max_distance; float slice_far = -pCamera->settings.volumetric_environment_max_distance;
float slice_spacing = (slice_far - slice_near) / slice_count; float slice_spacing = (slice_far - slice_near) / slice_count;
pFogShader->setUniform(KRShader::KRENGINE_UNIFORM_SLICE_DEPTH_SCALE, KRVector2(slice_near, slice_spacing)); pFogShader->setUniform(KRShader::KRENGINE_UNIFORM_SLICE_DEPTH_SCALE, Vector2(slice_near, slice_spacing));
pFogShader->setUniform(KRShader::KRENGINE_UNIFORM_LIGHT_COLOR, (m_color * pCamera->settings.volumetric_environment_intensity * m_intensity * -slice_spacing / 1000.0f)); pFogShader->setUniform(KRShader::KRENGINE_UNIFORM_LIGHT_COLOR, (m_color * pCamera->settings.volumetric_environment_intensity * m_intensity * -slice_spacing / 1000.0f));
KRDataBlock index_data; KRDataBlock index_data;
@@ -363,7 +363,7 @@ void KRLight::allocateShadowBuffers(int cBuffers) {
// Allocate newly required buffers // Allocate newly required buffers
for(int iShadow = 0; iShadow < cBuffers; iShadow++) { for(int iShadow = 0; iShadow < cBuffers; iShadow++) {
KRVector2 viewportSize = m_shadowViewports[iShadow].getSize(); Vector2 viewportSize = m_shadowViewports[iShadow].getSize();
if(!shadowDepthTexture[iShadow]) { if(!shadowDepthTexture[iShadow]) {
shadowValid[iShadow] = false; shadowValid[iShadow] = false;

View File

@@ -56,14 +56,14 @@ KRMaterial::KRMaterial(KRContext &context, const char *szName) : KRResource(cont
m_normalMap = ""; m_normalMap = "";
m_reflectionMap = ""; m_reflectionMap = "";
m_reflectionCube = ""; m_reflectionCube = "";
m_ambientMapOffset = KRVector2(0.0f, 0.0f); m_ambientMapOffset = Vector2(0.0f, 0.0f);
m_specularMapOffset = KRVector2(0.0f, 0.0f); m_specularMapOffset = Vector2(0.0f, 0.0f);
m_diffuseMapOffset = KRVector2(0.0f, 0.0f); m_diffuseMapOffset = Vector2(0.0f, 0.0f);
m_ambientMapScale = KRVector2(1.0f, 1.0f); m_ambientMapScale = Vector2(1.0f, 1.0f);
m_specularMapScale = KRVector2(1.0f, 1.0f); m_specularMapScale = Vector2(1.0f, 1.0f);
m_diffuseMapScale = KRVector2(1.0f, 1.0f); m_diffuseMapScale = Vector2(1.0f, 1.0f);
m_reflectionMapOffset = KRVector2(0.0f, 0.0f); m_reflectionMapOffset = Vector2(0.0f, 0.0f);
m_reflectionMapScale = KRVector2(1.0f, 1.0f); m_reflectionMapScale = Vector2(1.0f, 1.0f);
m_alpha_mode = KRMATERIAL_ALPHA_MODE_OPAQUE; m_alpha_mode = KRMATERIAL_ALPHA_MODE_OPAQUE;
} }
@@ -144,31 +144,31 @@ bool KRMaterial::save(KRDataBlock &data) {
return true; return true;
} }
void KRMaterial::setAmbientMap(std::string texture_name, KRVector2 texture_scale, KRVector2 texture_offset) { void KRMaterial::setAmbientMap(std::string texture_name, Vector2 texture_scale, Vector2 texture_offset) {
m_ambientMap = texture_name; m_ambientMap = texture_name;
m_ambientMapScale = texture_scale; m_ambientMapScale = texture_scale;
m_ambientMapOffset = texture_offset; m_ambientMapOffset = texture_offset;
} }
void KRMaterial::setDiffuseMap(std::string texture_name, KRVector2 texture_scale, KRVector2 texture_offset) { void KRMaterial::setDiffuseMap(std::string texture_name, Vector2 texture_scale, Vector2 texture_offset) {
m_diffuseMap = texture_name; m_diffuseMap = texture_name;
m_diffuseMapScale = texture_scale; m_diffuseMapScale = texture_scale;
m_diffuseMapOffset = texture_offset; m_diffuseMapOffset = texture_offset;
} }
void KRMaterial::setSpecularMap(std::string texture_name, KRVector2 texture_scale, KRVector2 texture_offset) { void KRMaterial::setSpecularMap(std::string texture_name, Vector2 texture_scale, Vector2 texture_offset) {
m_specularMap = texture_name; m_specularMap = texture_name;
m_specularMapScale = texture_scale; m_specularMapScale = texture_scale;
m_specularMapOffset = texture_offset; m_specularMapOffset = texture_offset;
} }
void KRMaterial::setNormalMap(std::string texture_name, KRVector2 texture_scale, KRVector2 texture_offset) { void KRMaterial::setNormalMap(std::string texture_name, Vector2 texture_scale, Vector2 texture_offset) {
m_normalMap = texture_name; m_normalMap = texture_name;
m_normalMapScale = texture_scale; m_normalMapScale = texture_scale;
m_normalMapOffset = texture_offset; m_normalMapOffset = texture_offset;
} }
void KRMaterial::setReflectionMap(std::string texture_name, KRVector2 texture_scale, KRVector2 texture_offset) { void KRMaterial::setReflectionMap(std::string texture_name, Vector2 texture_scale, Vector2 texture_offset) {
m_reflectionMap = texture_name; m_reflectionMap = texture_name;
m_reflectionMapScale = texture_scale; m_reflectionMapScale = texture_scale;
m_reflectionMapOffset = texture_offset; m_reflectionMapOffset = texture_offset;
@@ -307,8 +307,8 @@ bool KRMaterial::bind(KRCamera *pCamera, std::vector<KRPointLight *> &point_ligh
getTextures(); getTextures();
KRVector2 default_scale = KRVector2::One(); Vector2 default_scale = Vector2::One();
KRVector2 default_offset = KRVector2::Zero(); Vector2 default_offset = Vector2::Zero();
bool bHasReflection = m_reflectionColor != KRVector3::Zero(); bool bHasReflection = m_reflectionColor != KRVector3::Zero();
bool bDiffuseMap = m_pDiffuseMap != NULL && pCamera->settings.bEnableDiffuseMap; bool bDiffuseMap = m_pDiffuseMap != NULL && pCamera->settings.bEnableDiffuseMap;

View File

@@ -63,12 +63,12 @@ public:
virtual bool save(KRDataBlock &data); virtual bool save(KRDataBlock &data);
void setAmbientMap(std::string texture_name, KRVector2 texture_scale, KRVector2 texture_offset); void setAmbientMap(std::string texture_name, Vector2 texture_scale, Vector2 texture_offset);
void setDiffuseMap(std::string texture_name, KRVector2 texture_scale, KRVector2 texture_offset); void setDiffuseMap(std::string texture_name, Vector2 texture_scale, Vector2 texture_offset);
void setSpecularMap(std::string texture_name, KRVector2 texture_scale, KRVector2 texture_offset); void setSpecularMap(std::string texture_name, Vector2 texture_scale, Vector2 texture_offset);
void setReflectionMap(std::string texture_name, KRVector2 texture_scale, KRVector2 texture_offset); void setReflectionMap(std::string texture_name, Vector2 texture_scale, Vector2 texture_offset);
void setReflectionCube(std::string texture_name); void setReflectionCube(std::string texture_name);
void setNormalMap(std::string texture_name, KRVector2 texture_scale, KRVector2 texture_offset); void setNormalMap(std::string texture_name, Vector2 texture_scale, Vector2 texture_offset);
void setAmbient(const KRVector3 &c); void setAmbient(const KRVector3 &c);
void setDiffuse(const KRVector3 &c); void setDiffuse(const KRVector3 &c);
void setSpecular(const KRVector3 &c); void setSpecular(const KRVector3 &c);
@@ -105,16 +105,16 @@ private:
std::string m_reflectionCube; std::string m_reflectionCube;
std::string m_normalMap; std::string m_normalMap;
KRVector2 m_ambientMapScale; Vector2 m_ambientMapScale;
KRVector2 m_ambientMapOffset; Vector2 m_ambientMapOffset;
KRVector2 m_diffuseMapScale; Vector2 m_diffuseMapScale;
KRVector2 m_diffuseMapOffset; Vector2 m_diffuseMapOffset;
KRVector2 m_specularMapScale; Vector2 m_specularMapScale;
KRVector2 m_specularMapOffset; Vector2 m_specularMapOffset;
KRVector2 m_reflectionMapScale; Vector2 m_reflectionMapScale;
KRVector2 m_reflectionMapOffset; Vector2 m_reflectionMapOffset;
KRVector2 m_normalMapScale; Vector2 m_normalMapScale;
KRVector2 m_normalMapOffset; Vector2 m_normalMapOffset;
KRVector3 m_ambientColor; // Ambient rgb KRVector3 m_ambientColor; // Ambient rgb
KRVector3 m_diffuseColor; // Diffuse rgb KRVector3 m_diffuseColor; // Diffuse rgb

View File

@@ -228,8 +228,8 @@ bool KRMaterialManager::load(const char *szName, KRDataBlock *data) {
*pLastPeriod = '\0'; *pLastPeriod = '\0';
} }
KRVector2 texture_scale = KRVector2(1.0f, 1.0f); Vector2 texture_scale = Vector2(1.0f, 1.0f);
KRVector2 texture_offset = KRVector2(0.0f, 0.0f); Vector2 texture_offset = Vector2(0.0f, 0.0f);
int iScanSymbol = 2; int iScanSymbol = 2;
int iScaleParam = -1; int iScaleParam = -1;

View File

@@ -540,7 +540,7 @@ void KRMesh::LoadData(const KRMesh::mesh_info &mi, bool calculate_normals, bool
} }
if(use_short_uva) { if(use_short_uva) {
for(std::vector<KRVector2>::const_iterator itr=mi.uva.begin(); itr != mi.uva.end(); itr++) { for(std::vector<Vector2>::const_iterator itr=mi.uva.begin(); itr != mi.uva.end(); itr++) {
if(fabsf((*itr).x) > 1.0f || fabsf((*itr).y) > 1.0f) { if(fabsf((*itr).x) > 1.0f || fabsf((*itr).y) > 1.0f) {
use_short_uva = false; use_short_uva = false;
} }
@@ -548,7 +548,7 @@ void KRMesh::LoadData(const KRMesh::mesh_info &mi, bool calculate_normals, bool
} }
if(use_short_uvb) { if(use_short_uvb) {
for(std::vector<KRVector2>::const_iterator itr=mi.uvb.begin(); itr != mi.uvb.end(); itr++) { for(std::vector<Vector2>::const_iterator itr=mi.uvb.begin(); itr != mi.uvb.end(); itr++) {
if(fabsf((*itr).x) > 1.0f || fabsf((*itr).y) > 1.0f) { if(fabsf((*itr).x) > 1.0f || fabsf((*itr).y) > 1.0f) {
use_short_uvb = false; use_short_uvb = false;
} }
@@ -723,12 +723,12 @@ void KRMesh::LoadData(const KRMesh::mesh_info &mi, bool calculate_normals, bool
KRVector3 first_tangent = getVertexTangent(iVertex); KRVector3 first_tangent = getVertexTangent(iVertex);
if(first_tangent.x == 0.0f && first_tangent.y == 0.0f && first_tangent.z == 0.0f) { if(first_tangent.x == 0.0f && first_tangent.y == 0.0f && first_tangent.z == 0.0f) {
KRVector2 uv0 = getVertexUVA(iVertex); Vector2 uv0 = getVertexUVA(iVertex);
KRVector2 uv1 = getVertexUVA(iVertex + 1); Vector2 uv1 = getVertexUVA(iVertex + 1);
KRVector2 uv2 = getVertexUVA(iVertex + 2); Vector2 uv2 = getVertexUVA(iVertex + 2);
KRVector2 st1 = KRVector2(uv1.x - uv0.x, uv1.y - uv0.y); Vector2 st1 = Vector2(uv1.x - uv0.x, uv1.y - uv0.y);
KRVector2 st2 = KRVector2(uv2.x - uv0.x, uv2.y - uv0.y); Vector2 st2 = Vector2(uv2.x - uv0.x, uv2.y - uv0.y);
double coef = 1/ (st1.x * st2.y - st2.x * st1.y); double coef = 1/ (st1.x * st2.y - st2.x * st1.y);
KRVector3 tangent( KRVector3 tangent(
@@ -893,27 +893,27 @@ KRVector3 KRMesh::getVertexTangent(int index) const
} }
} }
KRVector2 KRMesh::getVertexUVA(int index) const Vector2 KRMesh::getVertexUVA(int index) const
{ {
if(has_vertex_attribute(KRENGINE_ATTRIB_TEXUVA_SHORT)) { if(has_vertex_attribute(KRENGINE_ATTRIB_TEXUVA_SHORT)) {
short *v = (short *)(getVertexData(index) + m_vertex_attribute_offset[KRENGINE_ATTRIB_TEXUVA_SHORT]); short *v = (short *)(getVertexData(index) + m_vertex_attribute_offset[KRENGINE_ATTRIB_TEXUVA_SHORT]);
return KRVector2((float)v[0] / 32767.0f, (float)v[1] / 32767.0f); return Vector2((float)v[0] / 32767.0f, (float)v[1] / 32767.0f);
} else if(has_vertex_attribute(KRENGINE_ATTRIB_TEXUVA)) { } else if(has_vertex_attribute(KRENGINE_ATTRIB_TEXUVA)) {
return KRVector2((float *)(getVertexData(index) + m_vertex_attribute_offset[KRENGINE_ATTRIB_TEXUVA])); return Vector2((float *)(getVertexData(index) + m_vertex_attribute_offset[KRENGINE_ATTRIB_TEXUVA]));
} else { } else {
return KRVector2::Zero(); return Vector2::Zero();
} }
} }
KRVector2 KRMesh::getVertexUVB(int index) const Vector2 KRMesh::getVertexUVB(int index) const
{ {
if(has_vertex_attribute(KRENGINE_ATTRIB_TEXUVB_SHORT)) { if(has_vertex_attribute(KRENGINE_ATTRIB_TEXUVB_SHORT)) {
short *v = (short *)(getVertexData(index) + m_vertex_attribute_offset[KRENGINE_ATTRIB_TEXUVB_SHORT]); short *v = (short *)(getVertexData(index) + m_vertex_attribute_offset[KRENGINE_ATTRIB_TEXUVB_SHORT]);
return KRVector2((float)v[0] / 32767.0f, (float)v[1] / 32767.0f); return Vector2((float)v[0] / 32767.0f, (float)v[1] / 32767.0f);
} else if(has_vertex_attribute(KRENGINE_ATTRIB_TEXUVB)) { } else if(has_vertex_attribute(KRENGINE_ATTRIB_TEXUVB)) {
return KRVector2((float *)(getVertexData(index) + m_vertex_attribute_offset[KRENGINE_ATTRIB_TEXUVB])); return Vector2((float *)(getVertexData(index) + m_vertex_attribute_offset[KRENGINE_ATTRIB_TEXUVB]));
} else { } else {
return KRVector2::Zero(); return Vector2::Zero();
} }
} }
@@ -962,7 +962,7 @@ void KRMesh::setVertexTangent(int index, const KRVector3 & v)
} }
} }
void KRMesh::setVertexUVA(int index, const KRVector2 &v) void KRMesh::setVertexUVA(int index, const Vector2 &v)
{ {
if(has_vertex_attribute(KRENGINE_ATTRIB_TEXUVA_SHORT)) { if(has_vertex_attribute(KRENGINE_ATTRIB_TEXUVA_SHORT)) {
short *vert = (short *)(getVertexData(index) + m_vertex_attribute_offset[KRENGINE_ATTRIB_TEXUVA_SHORT]); short *vert = (short *)(getVertexData(index) + m_vertex_attribute_offset[KRENGINE_ATTRIB_TEXUVA_SHORT]);
@@ -975,7 +975,7 @@ void KRMesh::setVertexUVA(int index, const KRVector2 &v)
} }
} }
void KRMesh::setVertexUVB(int index, const KRVector2 &v) void KRMesh::setVertexUVB(int index, const Vector2 &v)
{ {
if(has_vertex_attribute(KRENGINE_ATTRIB_TEXUVB_SHORT)) { if(has_vertex_attribute(KRENGINE_ATTRIB_TEXUVB_SHORT)) {
short *vert = (short *)(getVertexData(index) + m_vertex_attribute_offset[KRENGINE_ATTRIB_TEXUVB_SHORT]); short *vert = (short *)(getVertexData(index) + m_vertex_attribute_offset[KRENGINE_ATTRIB_TEXUVB_SHORT]);
@@ -1334,8 +1334,8 @@ void KRMesh::convertToIndexed()
for(int i=0; i < vertex_count; i++) { for(int i=0; i < vertex_count; i++) {
KRVector3 vertex_position = getVertexPosition(source_index); KRVector3 vertex_position = getVertexPosition(source_index);
KRVector2 vertex_uva = getVertexUVA(source_index); Vector2 vertex_uva = getVertexUVA(source_index);
KRVector2 vertex_uvb = getVertexUVB(source_index); Vector2 vertex_uvb = getVertexUVB(source_index);
KRVector3 vertex_normal = getVertexNormal(source_index); KRVector3 vertex_normal = getVertexNormal(source_index);
KRVector3 vertex_tangent = getVertexTangent(source_index); KRVector3 vertex_tangent = getVertexTangent(source_index);
std::vector<int> vertex_bone_indexes; std::vector<int> vertex_bone_indexes;

View File

@@ -99,8 +99,8 @@ public:
std::vector<KRVector3> vertices; std::vector<KRVector3> vertices;
std::vector<__uint16_t> vertex_indexes; std::vector<__uint16_t> vertex_indexes;
std::vector<std::pair<int, int> > vertex_index_bases; std::vector<std::pair<int, int> > vertex_index_bases;
std::vector<KRVector2> uva; std::vector<Vector2> uva;
std::vector<KRVector2> uvb; std::vector<Vector2> uvb;
std::vector<KRVector3> normals; std::vector<KRVector3> normals;
std::vector<KRVector3> tangents; std::vector<KRVector3> tangents;
std::vector<int> submesh_starts; std::vector<int> submesh_starts;
@@ -188,16 +188,16 @@ public:
KRVector3 getVertexPosition(int index) const; KRVector3 getVertexPosition(int index) const;
KRVector3 getVertexNormal(int index) const; KRVector3 getVertexNormal(int index) const;
KRVector3 getVertexTangent(int index) const; KRVector3 getVertexTangent(int index) const;
KRVector2 getVertexUVA(int index) const; Vector2 getVertexUVA(int index) const;
KRVector2 getVertexUVB(int index) const; Vector2 getVertexUVB(int index) const;
int getBoneIndex(int index, int weight_index) const; int getBoneIndex(int index, int weight_index) const;
float getBoneWeight(int index, int weight_index) const; float getBoneWeight(int index, int weight_index) const;
void setVertexPosition(int index, const KRVector3 &v); void setVertexPosition(int index, const KRVector3 &v);
void setVertexNormal(int index, const KRVector3 &v); void setVertexNormal(int index, const KRVector3 &v);
void setVertexTangent(int index, const KRVector3 & v); void setVertexTangent(int index, const KRVector3 & v);
void setVertexUVA(int index, const KRVector2 &v); void setVertexUVA(int index, const Vector2 &v);
void setVertexUVB(int index, const KRVector2 &v); void setVertexUVB(int index, const Vector2 &v);
void setBoneIndex(int index, int weight_index, int bone_index); void setBoneIndex(int index, int weight_index, int bone_index);
void setBoneWeight(int index, int weight_index, float bone_weight); void setBoneWeight(int index, int weight_index, float bone_weight);

View File

@@ -43,10 +43,10 @@ KRMeshQuad::KRMeshQuad(KRContext &context) : KRMesh(context, "__quad")
mi.vertices.push_back(KRVector3(-1.0f, 1.0f, 0.0f)); mi.vertices.push_back(KRVector3(-1.0f, 1.0f, 0.0f));
mi.vertices.push_back(KRVector3(1.0f, 1.0f, 0.0f)); mi.vertices.push_back(KRVector3(1.0f, 1.0f, 0.0f));
mi.uva.push_back(KRVector2(0.0f, 0.0f)); mi.uva.push_back(Vector2(0.0f, 0.0f));
mi.uva.push_back(KRVector2(1.0f, 0.0f)); mi.uva.push_back(Vector2(1.0f, 0.0f));
mi.uva.push_back(KRVector2(0.0f, 1.0f)); mi.uva.push_back(Vector2(0.0f, 1.0f));
mi.uva.push_back(KRVector2(1.0f, 1.0f)); mi.uva.push_back(Vector2(1.0f, 1.0f));
mi.submesh_starts.push_back(0); mi.submesh_starts.push_back(0);

View File

@@ -153,11 +153,11 @@ KRRenderSettings& KRRenderSettings::operator=(const KRRenderSettings &s)
return *this; return *this;
} }
const KRVector2 &KRRenderSettings::getViewportSize() { const Vector2 &KRRenderSettings::getViewportSize() {
return m_viewportSize; return m_viewportSize;
} }
void KRRenderSettings::setViewportSize(const KRVector2 &size) { void KRRenderSettings::setViewportSize(const Vector2 &size) {
m_viewportSize = size; m_viewportSize = size;
} }

View File

@@ -19,8 +19,8 @@ public:
// Overload assignment operator // Overload assignment operator
KRRenderSettings& operator=(const KRRenderSettings &s); KRRenderSettings& operator=(const KRRenderSettings &s);
const KRVector2 &getViewportSize(); const Vector2 &getViewportSize();
void setViewportSize(const KRVector2 &size); void setViewportSize(const Vector2 &size);
float getPerspectiveNearZ(); float getPerspectiveNearZ();
float getPerspectiveFarZ(); float getPerspectiveFarZ();
@@ -61,7 +61,7 @@ public:
float vignette_radius; float vignette_radius;
float vignette_falloff; float vignette_falloff;
KRVector2 m_viewportSize; Vector2 m_viewportSize;
int m_cShadowBuffers; int m_cShadowBuffers;

View File

@@ -1210,7 +1210,7 @@ void LoadMaterial(KRContext &context, FbxSurfaceMaterial *pMaterial) {
FbxFileTexture *pFileTexture = FbxCast<FbxFileTexture>(pTexture); FbxFileTexture *pFileTexture = FbxCast<FbxFileTexture>(pTexture);
if(pFileTexture) { if(pFileTexture) {
new_material->setDiffuseMap(KRResource::GetFileBase(pFileTexture->GetFileName()), KRVector2(pTexture->GetScaleU(), pTexture->GetScaleV()), KRVector2(pTexture->GetTranslationU(), pTexture->GetTranslationV())); new_material->setDiffuseMap(KRResource::GetFileBase(pFileTexture->GetFileName()), Vector2(pTexture->GetScaleU(), pTexture->GetScaleV()), Vector2(pTexture->GetTranslationU(), pTexture->GetTranslationV()));
} }
} }
@@ -1227,7 +1227,7 @@ void LoadMaterial(KRContext &context, FbxSurfaceMaterial *pMaterial) {
FbxTexture* pTexture = FbxCast <FbxTexture> (pProperty.GetSrcObject(FbxCriteria::ObjectType(FbxTexture::ClassId),0)); FbxTexture* pTexture = FbxCast <FbxTexture> (pProperty.GetSrcObject(FbxCriteria::ObjectType(FbxTexture::ClassId),0));
FbxFileTexture *pFileTexture = FbxCast<FbxFileTexture>(pTexture); FbxFileTexture *pFileTexture = FbxCast<FbxFileTexture>(pTexture);
if(pFileTexture) { if(pFileTexture) {
new_material->setSpecularMap(KRResource::GetFileBase(pFileTexture->GetFileName()), KRVector2(pTexture->GetScaleU(), pTexture->GetScaleV()), KRVector2(pTexture->GetTranslationU(), pTexture->GetTranslationV())); new_material->setSpecularMap(KRResource::GetFileBase(pFileTexture->GetFileName()), Vector2(pTexture->GetScaleU(), pTexture->GetScaleV()), Vector2(pTexture->GetTranslationU(), pTexture->GetTranslationV()));
} }
} }
@@ -1245,7 +1245,7 @@ void LoadMaterial(KRContext &context, FbxSurfaceMaterial *pMaterial) {
FbxTexture* pTexture = pProperty.GetSrcObject<FbxTexture>(0); FbxTexture* pTexture = pProperty.GetSrcObject<FbxTexture>(0);
FbxFileTexture *pFileTexture = FbxCast<FbxFileTexture>(pTexture); FbxFileTexture *pFileTexture = FbxCast<FbxFileTexture>(pTexture);
if(pFileTexture) { if(pFileTexture) {
new_material->setNormalMap(KRResource::GetFileBase(pFileTexture->GetFileName()), KRVector2(pTexture->GetScaleU(), pTexture->GetScaleV()), KRVector2(pTexture->GetTranslationU(), pTexture->GetTranslationV())); new_material->setNormalMap(KRResource::GetFileBase(pFileTexture->GetFileName()), Vector2(pTexture->GetScaleU(), pTexture->GetScaleV()), Vector2(pTexture->GetTranslationU(), pTexture->GetTranslationV()));
} }
} }
@@ -1382,8 +1382,8 @@ void LoadMesh(KRContext &context, FbxScene* pFbxScene, FbxGeometryConverter *pGe
// std::vector<std::vector<int> > bone_indexes; // std::vector<std::vector<int> > bone_indexes;
// //
// std::vector<KRVector3> vertices; // std::vector<KRVector3> vertices;
// std::vector<KRVector2> uva; // std::vector<Vector2> uva;
// std::vector<KRVector2> uvb; // std::vector<Vector2> uvb;
// std::vector<KRVector3> normals; // std::vector<KRVector3> normals;
// std::vector<KRVector3> tangents; // std::vector<KRVector3> tangents;
// std::vector<int> submesh_lengths; // std::vector<int> submesh_lengths;
@@ -1448,8 +1448,8 @@ void LoadMesh(KRContext &context, FbxScene* pFbxScene, FbxGeometryConverter *pGe
mi.bone_weights.push_back(vertex_bone_weights); mi.bone_weights.push_back(vertex_bone_weights);
} }
KRVector2 new_uva = KRVector2(0.0, 0.0); Vector2 new_uva = Vector2(0.0, 0.0);
KRVector2 new_uvb = KRVector2(0.0, 0.0); Vector2 new_uvb = Vector2(0.0, 0.0);
// ----====---- Read UVs ----====---- // ----====---- Read UVs ----====----
@@ -1462,7 +1462,7 @@ void LoadMesh(KRContext &context, FbxScene* pFbxScene, FbxGeometryConverter *pGe
bool unmapped = false; bool unmapped = false;
if(pMesh->GetPolygonVertexUV(iPolygon, iVertex, setName, uv, unmapped)) { if(pMesh->GetPolygonVertexUV(iPolygon, iVertex, setName, uv, unmapped)) {
if(!unmapped) { if(!unmapped) {
new_uva = KRVector2(uv[0], uv[1]); new_uva = Vector2(uv[0], uv[1]);
} }
} }
mi.uva.push_back(new_uva); mi.uva.push_back(new_uva);
@@ -1474,7 +1474,7 @@ void LoadMesh(KRContext &context, FbxScene* pFbxScene, FbxGeometryConverter *pGe
bool unmapped = false; bool unmapped = false;
if(pMesh->GetPolygonVertexUV(iPolygon, iVertex, setName, uv, unmapped)) { if(pMesh->GetPolygonVertexUV(iPolygon, iVertex, setName, uv, unmapped)) {
if(!unmapped) { if(!unmapped) {
new_uvb = KRVector2(uv[0], uv[1]); new_uvb = Vector2(uv[0], uv[1]);
} }
} }
mi.uvb.push_back(new_uvb); mi.uvb.push_back(new_uvb);

View File

@@ -102,7 +102,7 @@ std::vector<KRResource *> KRResource::LoadObj(KRContext &context, const std::str
assert(pFaces != NULL); assert(pFaces != NULL);
std::vector<KRVector3> indexed_vertices; std::vector<KRVector3> indexed_vertices;
std::vector<KRVector2> indexed_uva; std::vector<Vector2> indexed_uva;
std::vector<KRVector3> indexed_normals; std::vector<KRVector3> indexed_normals;
int *pFace = pFaces; int *pFace = pFaces;
@@ -163,7 +163,7 @@ std::vector<KRResource *> KRResource::LoadObj(KRContext &context, const std::str
u = strtof(pChar, &pChar); u = strtof(pChar, &pChar);
pChar = szSymbol[2]; pChar = szSymbol[2];
v = strtof(pChar, &pChar); v = strtof(pChar, &pChar);
indexed_uva.push_back(KRVector2(u,v)); indexed_uva.push_back(Vector2(u,v));
} else if(strcmp(szSymbol[0], "vn") == 0) { } else if(strcmp(szSymbol[0], "vn") == 0) {
// Vertex Normal (vn) // Vertex Normal (vn)
float x,y,z; float x,y,z;
@@ -253,8 +253,8 @@ std::vector<KRResource *> KRResource::LoadObj(KRContext &context, const std::str
KRVector3 prevFaceVertex; KRVector3 prevFaceVertex;
KRVector3 firstFaceNormal; KRVector3 firstFaceNormal;
KRVector3 prevFaceNormal; KRVector3 prevFaceNormal;
KRVector2 firstFaceUva; Vector2 firstFaceUva;
KRVector2 prevFaceUva; Vector2 prevFaceUva;
for(int iFaceVertex=0; iFaceVertex < cFaceVertexes; iFaceVertex++) { for(int iFaceVertex=0; iFaceVertex < cFaceVertexes; iFaceVertex++) {
if(iFaceVertex > 2) { if(iFaceVertex > 2) {
// There have already been 3 vertices. Now we need to split the quad into a second triangle composed of the 1st, 3rd, and 4th vertices // There have already been 3 vertices. Now we need to split the quad into a second triangle composed of the 1st, 3rd, and 4th vertices
@@ -269,7 +269,7 @@ std::vector<KRResource *> KRResource::LoadObj(KRContext &context, const std::str
mi.normals.push_back(prevFaceNormal); mi.normals.push_back(prevFaceNormal);
} }
KRVector3 vertex = indexed_vertices[pFace[iFaceVertex*3+1]]; KRVector3 vertex = indexed_vertices[pFace[iFaceVertex*3+1]];
KRVector2 new_uva; Vector2 new_uva;
if(pFace[iFaceVertex*3+2] >= 0) { if(pFace[iFaceVertex*3+2] >= 0) {
new_uva = indexed_uva[pFace[iFaceVertex*3+2]]; new_uva = indexed_uva[pFace[iFaceVertex*3+2]];
} }

View File

@@ -277,7 +277,7 @@ void KRShader::setUniform(int location, int value)
} }
} }
void KRShader::setUniform(int location, const KRVector2 &value) void KRShader::setUniform(int location, const Vector2 &value)
{ {
if(m_uniforms[location] != -1) { if(m_uniforms[location] != -1) {
int value_index = m_uniform_value_index[location]; int value_index = m_uniform_value_index[location];

View File

@@ -139,7 +139,7 @@ public:
std::vector<float> m_uniform_value_float; std::vector<float> m_uniform_value_float;
std::vector<int> m_uniform_value_int; std::vector<int> m_uniform_value_int;
std::vector<KRVector2> m_uniform_value_vector2; std::vector<Vector2> m_uniform_value_vector2;
std::vector<KRVector3> m_uniform_value_vector3; std::vector<KRVector3> m_uniform_value_vector3;
std::vector<KRVector4> m_uniform_value_vector4; std::vector<KRVector4> m_uniform_value_vector4;
std::vector<KRMat4> m_uniform_value_mat4; std::vector<KRMat4> m_uniform_value_mat4;
@@ -149,7 +149,7 @@ public:
void setUniform(int location, float value); void setUniform(int location, float value);
void setUniform(int location, int value); void setUniform(int location, int value);
void setUniform(int location, const KRVector2 &value); void setUniform(int location, const Vector2 &value);
void setUniform(int location, const KRVector3 &value); void setUniform(int location, const KRVector3 &value);
void setUniform(int location, const KRVector4 &value); void setUniform(int location, const KRVector4 &value);
void setUniform(int location, const KRMat4 &value); void setUniform(int location, const KRMat4 &value);

View File

@@ -1,215 +0,0 @@
//
// KRVector2.cpp
// KREngine
//
// Created by Kearwood Gilbert on 12-03-22.
// Copyright (c) 2012 Kearwood Software. All rights reserved.
//
#include "public/kraken.h"
namespace kraken {
KRVector2::KRVector2() {
x = 0.0;
y = 0.0;
}
KRVector2::KRVector2(float X, float Y) {
x = X;
y = Y;
}
KRVector2::KRVector2(float v) {
x = v;
y = v;
}
KRVector2::KRVector2(float *v) {
x = v[0];
y = v[1];
}
KRVector2::KRVector2(const KRVector2 &v) {
x = v.x;
y = v.y;
}
// KRVector2 swizzle getters
KRVector2 KRVector2::yx() const
{
return KRVector2(y,x);
}
// KRVector2 swizzle setters
void KRVector2::yx(const KRVector2 &v)
{
y = v.x;
x = v.y;
}
KRVector2 KRVector2::Min() {
return KRVector2(-std::numeric_limits<float>::max());
}
KRVector2 KRVector2::Max() {
return KRVector2(std::numeric_limits<float>::max());
}
KRVector2 KRVector2::Zero() {
return KRVector2(0.0f);
}
KRVector2 KRVector2::One() {
return KRVector2(1.0f);
}
KRVector2::~KRVector2() {
}
KRVector2& KRVector2::operator =(const KRVector2& b) {
x = b.x;
y = b.y;
return *this;
}
KRVector2 KRVector2::operator +(const KRVector2& b) const {
return KRVector2(x + b.x, y + b.y);
}
KRVector2 KRVector2::operator -(const KRVector2& b) const {
return KRVector2(x - b.x, y - b.y);
}
KRVector2 KRVector2::operator +() const {
return *this;
}
KRVector2 KRVector2::operator -() const {
return KRVector2(-x, -y);
}
KRVector2 KRVector2::operator *(const float v) const {
return KRVector2(x * v, y * v);
}
KRVector2 KRVector2::operator /(const float v) const {
float inv_v = 1.0f / v;
return KRVector2(x * inv_v, y * inv_v);
}
KRVector2& KRVector2::operator +=(const KRVector2& b) {
x += b.x;
y += b.y;
return *this;
}
KRVector2& KRVector2::operator -=(const KRVector2& b) {
x -= b.x;
y -= b.y;
return *this;
}
KRVector2& KRVector2::operator *=(const float v) {
x *= v;
y *= v;
return *this;
}
KRVector2& KRVector2::operator /=(const float v) {
float inv_v = 1.0f / v;
x *= inv_v;
y *= inv_v;
return *this;
}
bool KRVector2::operator ==(const KRVector2& b) const {
return x == b.x && y == b.y;
}
bool KRVector2::operator !=(const KRVector2& b) const {
return x != b.x || y != b.y;
}
bool KRVector2::operator >(const KRVector2& b) const
{
// Comparison operators are implemented to allow insertion into sorted containers such as std::set
if(x > b.x) {
return true;
} else if(x < b.x) {
return false;
} else if(y > b.y) {
return true;
} else {
return false;
}
}
bool KRVector2::operator <(const KRVector2& b) const
{
// Comparison operators are implemented to allow insertion into sorted containers such as std::set
if(x < b.x) {
return true;
} else if(x > b.x) {
return false;
} else if(y < b.y) {
return true;
} else {
return false;
}
}
float& KRVector2::operator[] (unsigned i) {
switch(i) {
case 0:
return x;
case 1:
default:
return y;
}
}
float KRVector2::operator[](unsigned i) const {
switch(i) {
case 0:
return x;
case 1:
default:
return y;
}
}
void KRVector2::normalize() {
float inv_magnitude = 1.0f / sqrtf(x * x + y * y);
x *= inv_magnitude;
y *= inv_magnitude;
}
float KRVector2::sqrMagnitude() const {
return x * x + y * y;
}
float KRVector2::magnitude() const {
return sqrtf(x * x + y * y);
}
KRVector2 KRVector2::Normalize(const KRVector2 &v) {
float inv_magnitude = 1.0f / sqrtf(v.x * v.x + v.y * v.y);
return KRVector2(v.x * inv_magnitude, v.y * inv_magnitude);
}
float KRVector2::Cross(const KRVector2 &v1, const KRVector2 &v2) {
return v1.x * v2.y - v1.y * v2.x;
}
float KRVector2::Dot(const KRVector2 &v1, const KRVector2 &v2) {
return v1.x * v2.x + v1.y * v2.y;
}
} // namepsace kraken

View File

@@ -66,82 +66,82 @@ KRVector3::KRVector3(double *v) {
z = (float)v[2]; z = (float)v[2];
} }
KRVector2 KRVector3::xx() const Vector2 KRVector3::xx() const
{ {
return KRVector2(x,x); return Vector2(x,x);
} }
KRVector2 KRVector3::xy() const Vector2 KRVector3::xy() const
{ {
return KRVector2(x,y); return Vector2(x,y);
} }
KRVector2 KRVector3::xz() const Vector2 KRVector3::xz() const
{ {
return KRVector2(x,z); return Vector2(x,z);
} }
KRVector2 KRVector3::yx() const Vector2 KRVector3::yx() const
{ {
return KRVector2(y,x); return Vector2(y,x);
} }
KRVector2 KRVector3::yy() const Vector2 KRVector3::yy() const
{ {
return KRVector2(y,y); return Vector2(y,y);
} }
KRVector2 KRVector3::yz() const Vector2 KRVector3::yz() const
{ {
return KRVector2(y,z); return Vector2(y,z);
} }
KRVector2 KRVector3::zx() const Vector2 KRVector3::zx() const
{ {
return KRVector2(z,x); return Vector2(z,x);
} }
KRVector2 KRVector3::zy() const Vector2 KRVector3::zy() const
{ {
return KRVector2(z,y); return Vector2(z,y);
} }
KRVector2 KRVector3::zz() const Vector2 KRVector3::zz() const
{ {
return KRVector2(z,z); return Vector2(z,z);
} }
void KRVector3::xy(const KRVector2 &v) void KRVector3::xy(const Vector2 &v)
{ {
x = v.x; x = v.x;
y = v.y; y = v.y;
} }
void KRVector3::xz(const KRVector2 &v) void KRVector3::xz(const Vector2 &v)
{ {
x = v.x; x = v.x;
z = v.y; z = v.y;
} }
void KRVector3::yx(const KRVector2 &v) void KRVector3::yx(const Vector2 &v)
{ {
y = v.x; y = v.x;
x = v.y; x = v.y;
} }
void KRVector3::yz(const KRVector2 &v) void KRVector3::yz(const Vector2 &v)
{ {
y = v.x; y = v.x;
z = v.y; z = v.y;
} }
void KRVector3::zx(const KRVector2 &v) void KRVector3::zx(const Vector2 &v)
{ {
z = v.x; z = v.x;
x = v.y; x = v.y;
} }
void KRVector3::zy(const KRVector2 &v) void KRVector3::zy(const Vector2 &v)
{ {
z = v.x; z = v.x;
y = v.y; y = v.y;

View File

@@ -14,14 +14,14 @@
KRViewport::KRViewport() KRViewport::KRViewport()
{ {
m_size = KRVector2::One(); m_size = Vector2::One();
m_matProjection = KRMat4(); m_matProjection = KRMat4();
m_matView = KRMat4(); m_matView = KRMat4();
m_lodBias = 0.0f; m_lodBias = 0.0f;
calculateDerivedValues(); calculateDerivedValues();
} }
KRViewport::KRViewport(const KRVector2 &size, const KRMat4 &matView, const KRMat4 &matProjection) KRViewport::KRViewport(const Vector2 &size, const KRMat4 &matView, const KRMat4 &matProjection)
{ {
m_size = size; m_size = size;
m_matView = matView; m_matView = matView;
@@ -48,7 +48,7 @@ KRViewport::~KRViewport()
} }
const KRVector2 &KRViewport::getSize() const const Vector2 &KRViewport::getSize() const
{ {
return m_size; return m_size;
} }
@@ -63,7 +63,7 @@ const KRMat4 &KRViewport::getProjectionMatrix() const
return m_matProjection; return m_matProjection;
} }
void KRViewport::setSize(const KRVector2 &size) void KRViewport::setSize(const Vector2 &size)
{ {
m_size = size; m_size = size;
} }
@@ -185,8 +185,8 @@ float KRViewport::coverage(const KRAABB &b) const
/* /*
KRVector2 screen_min; Vector2 screen_min;
KRVector2 screen_max; Vector2 screen_max;
// Loop through all corners and transform them to screen space // Loop through all corners and transform them to screen space
for(int i=0; i<8; i++) { for(int i=0; i<8; i++) {
KRVector3 screen_pos = KRMat4::DotWDiv(m_matViewProjection, KRVector3(i & 1 ? b.min.x : b.max.x, i & 2 ? b.min.y : b.max.y, i & 4 ? b.min.z : b.max.z)); KRVector3 screen_pos = KRMat4::DotWDiv(m_matViewProjection, KRVector3(i & 1 ? b.min.x : b.max.x, i & 2 ? b.min.y : b.max.y, i & 4 ? b.min.z : b.max.z));

View File

@@ -16,10 +16,10 @@ class KRLight;
class KRViewport { class KRViewport {
public: public:
KRViewport(); KRViewport();
KRViewport(const KRVector2 &size, const KRMat4 &matView, const KRMat4 &matProjection); KRViewport(const Vector2 &size, const KRMat4 &matView, const KRMat4 &matProjection);
~KRViewport(); ~KRViewport();
const KRVector2 &getSize() const; const Vector2 &getSize() const;
const KRMat4 &getViewMatrix() const; const KRMat4 &getViewMatrix() const;
const KRMat4 &getProjectionMatrix() const; const KRMat4 &getProjectionMatrix() const;
const KRMat4 &getViewProjectionMatrix() const; const KRMat4 &getViewProjectionMatrix() const;
@@ -29,7 +29,7 @@ public:
const KRVector3 &getCameraPosition() const; const KRVector3 &getCameraPosition() const;
const int *getFrontToBackOrder() const; const int *getFrontToBackOrder() const;
const int *getBackToFrontOrder() const; const int *getBackToFrontOrder() const;
void setSize(const KRVector2 &size); void setSize(const Vector2 &size);
void setViewMatrix(const KRMat4 &matView); void setViewMatrix(const KRMat4 &matView);
void setProjectionMatrix(const KRMat4 &matProjection); void setProjectionMatrix(const KRMat4 &matProjection);
float getLODBias() const; float getLODBias() const;
@@ -47,7 +47,7 @@ public:
float coverage(const KRAABB &b) const; float coverage(const KRAABB &b) const;
private: private:
KRVector2 m_size; Vector2 m_size;
KRMat4 m_matView; KRMat4 m_matView;
KRMat4 m_matProjection; KRMat4 m_matProjection;

View File

@@ -13,7 +13,7 @@
#include <functional> // for hash<> #include <functional> // for hash<>
#include "KRVector2.h" #include "Vector2.h"
#include "KRVector3.h" #include "KRVector3.h"
namespace kraken { namespace kraken {

View File

@@ -1,116 +0,0 @@
//
// KRVector2.h
// Kraken
//
// Copyright 2017 Kearwood Gilbert. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other materials
// provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY KEARWOOD GILBERT ''AS IS'' AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KEARWOOD GILBERT OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// The views and conclusions contained in the software and documentation are those of the
// authors and should not be interpreted as representing official policies, either expressed
// or implied, of Kearwood Gilbert.
//
#ifndef KRVECTOR2
#define KRVECTOR2
#include <functional> // for hash<>
namespace kraken {
class KRVector2 {
public:
union {
struct {
float x, y;
};
float c[2];
};
KRVector2();
KRVector2(float X, float Y);
KRVector2(float v);
KRVector2(float *v);
KRVector2(const KRVector2 &v);
~KRVector2();
// KRVector2 swizzle getters
KRVector2 yx() const;
// KRVector2 swizzle setters
void yx(const KRVector2 &v);
KRVector2& operator =(const KRVector2& b);
KRVector2 operator +(const KRVector2& b) const;
KRVector2 operator -(const KRVector2& b) const;
KRVector2 operator +() const;
KRVector2 operator -() const;
KRVector2 operator *(const float v) const;
KRVector2 operator /(const float v) const;
KRVector2& operator +=(const KRVector2& b);
KRVector2& operator -=(const KRVector2& b);
KRVector2& operator *=(const float v);
KRVector2& operator /=(const float v);
// Comparison operators are implemented to allow insertion into sorted containers such as std::set
bool operator >(const KRVector2& b) const;
bool operator <(const KRVector2& b) const;
bool operator ==(const KRVector2& b) const;
bool operator !=(const KRVector2& b) const;
float& operator[](unsigned i);
float operator[](unsigned i) const;
float sqrMagnitude() const;
float magnitude() const;
void normalize();
static KRVector2 Normalize(const KRVector2 &v);
static float Cross(const KRVector2 &v1, const KRVector2 &v2);
static float Dot(const KRVector2 &v1, const KRVector2 &v2);
static KRVector2 Min();
static KRVector2 Max();
static KRVector2 Zero();
static KRVector2 One();
};
} // namespace kraken
namespace std {
template<>
struct hash<kraken::KRVector2> {
public:
size_t operator()(const kraken::KRVector2 &s) const
{
size_t h1 = hash<float>()(s.x);
size_t h2 = hash<float>()(s.y);
return h1 ^ (h2 << 1);
}
};
}
#endif // KRVECTOR2_H

View File

@@ -29,8 +29,8 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KRVECTOR3_H #ifndef KRAKEN_VECTOR3_H
#define KRVECTOR3_H #define KRAKEN_VECTOR3_H
#include <functional> // for hash<> #include <functional> // for hash<>
@@ -57,24 +57,24 @@ public:
KRVector3(const KRVector4 &v); KRVector3(const KRVector4 &v);
~KRVector3(); ~KRVector3();
// KRVector2 swizzle getters // Vector2 swizzle getters
KRVector2 xx() const; Vector2 xx() const;
KRVector2 xy() const; Vector2 xy() const;
KRVector2 xz() const; Vector2 xz() const;
KRVector2 yx() const; Vector2 yx() const;
KRVector2 yy() const; Vector2 yy() const;
KRVector2 yz() const; Vector2 yz() const;
KRVector2 zx() const; Vector2 zx() const;
KRVector2 zy() const; Vector2 zy() const;
KRVector2 zz() const; Vector2 zz() const;
// KRVector2 swizzle setters // Vector2 swizzle setters
void xy(const KRVector2 &v); void xy(const Vector2 &v);
void xz(const KRVector2 &v); void xz(const Vector2 &v);
void yx(const KRVector2 &v); void yx(const Vector2 &v);
void yz(const KRVector2 &v); void yz(const Vector2 &v);
void zx(const KRVector2 &v); void zx(const Vector2 &v);
void zy(const KRVector2 &v); void zy(const Vector2 &v);
KRVector3& operator =(const KRVector3& b); KRVector3& operator =(const KRVector3& b);
KRVector3& operator =(const KRVector4& b); KRVector3& operator =(const KRVector4& b);
@@ -142,4 +142,4 @@ namespace std {
}; };
} }
#endif // KRVECTOR3_H #endif // KRAKEN_VECTOR3_H

View File

@@ -2,7 +2,7 @@
#define KRAKEN_H #define KRAKEN_H
#include "KRFloat.h" #include "KRFloat.h"
#include "KRVector2.h" #include "vector2.h"
#include "KRVector3.h" #include "KRVector3.h"
#include "KRVector4.h" #include "KRVector4.h"
#include "KRMat4.h" #include "KRMat4.h"

View File

@@ -195,7 +195,7 @@
<ClCompile Include="..\kraken\KRTriangle3.cpp" /> <ClCompile Include="..\kraken\KRTriangle3.cpp" />
<ClCompile Include="..\kraken\KRUnknown.cpp" /> <ClCompile Include="..\kraken\KRUnknown.cpp" />
<ClCompile Include="..\kraken\KRUnknownManager.cpp" /> <ClCompile Include="..\kraken\KRUnknownManager.cpp" />
<ClCompile Include="..\kraken\KRVector2.cpp" /> <ClCompile Include="..\kraken\vector2.cpp" />
<ClCompile Include="..\kraken\KRVector3.cpp" /> <ClCompile Include="..\kraken\KRVector3.cpp" />
<ClCompile Include="..\kraken\KRVector4.cpp" /> <ClCompile Include="..\kraken\KRVector4.cpp" />
<ClCompile Include="..\kraken\KRViewport.cpp" /> <ClCompile Include="..\kraken\KRViewport.cpp" />
@@ -277,7 +277,7 @@
<ClInclude Include="..\kraken\public\KRMat4.h" /> <ClInclude Include="..\kraken\public\KRMat4.h" />
<ClInclude Include="..\kraken\public\KRQuaternion.h" /> <ClInclude Include="..\kraken\public\KRQuaternion.h" />
<ClInclude Include="..\kraken\public\KRTriangle3.h" /> <ClInclude Include="..\kraken\public\KRTriangle3.h" />
<ClInclude Include="..\kraken\public\KRVector2.h" /> <ClInclude Include="..\kraken\public\vector2.h" />
<ClInclude Include="..\kraken\public\KRVector3.h" /> <ClInclude Include="..\kraken\public\KRVector3.h" />
<ClInclude Include="..\kraken\public\KRVector4.h" /> <ClInclude Include="..\kraken\public\KRVector4.h" />
<ClInclude Include="3rdparty\glew\glew-1.13.0\include\GL\glew.h" /> <ClInclude Include="3rdparty\glew\glew-1.13.0\include\GL\glew.h" />

View File

@@ -30,9 +30,6 @@
<ClCompile Include="..\3rdparty\forsyth\forsyth.cpp"> <ClCompile Include="..\3rdparty\forsyth\forsyth.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\kraken\KRVector2.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\kraken\KRVector3.cpp"> <ClCompile Include="..\kraken\KRVector3.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
@@ -252,6 +249,9 @@
<ClCompile Include="..\kraken\KRHelpers.cpp"> <ClCompile Include="..\kraken\KRHelpers.cpp">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\kraken\vector2.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\3rdparty\tinyxml2\tinyxml2.h"> <ClInclude Include="..\3rdparty\tinyxml2\tinyxml2.h">
@@ -479,9 +479,6 @@
<ClInclude Include="..\kraken\public\KRMat4.h"> <ClInclude Include="..\kraken\public\KRMat4.h">
<Filter>Header Files\public</Filter> <Filter>Header Files\public</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\kraken\public\KRVector2.h">
<Filter>Header Files\public</Filter>
</ClInclude>
<ClInclude Include="..\kraken\public\KRVector3.h"> <ClInclude Include="..\kraken\public\KRVector3.h">
<Filter>Header Files\public</Filter> <Filter>Header Files\public</Filter>
</ClInclude> </ClInclude>
@@ -500,5 +497,8 @@
<ClInclude Include="..\kraken\public\KRQuaternion.h"> <ClInclude Include="..\kraken\public\KRQuaternion.h">
<Filter>Header Files\public</Filter> <Filter>Header Files\public</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\kraken\public\vector2.h">
<Filter>Header Files\public</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
</Project> </Project>