diff --git a/mobile/ios/DeightonAR.xcodeproj/project.pbxproj b/mobile/ios/DeightonAR.xcodeproj/project.pbxproj index 13563fb..ee6c9fa 100644 --- a/mobile/ios/DeightonAR.xcodeproj/project.pbxproj +++ b/mobile/ios/DeightonAR.xcodeproj/project.pbxproj @@ -26,6 +26,10 @@ 52672F61206ADF52008EB6EA /* GoogleMapsCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52672F5F206ADF51008EB6EA /* GoogleMapsCore.framework */; }; 52672F62206ADF52008EB6EA /* GoogleMaps.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52672F60206ADF52008EB6EA /* GoogleMaps.framework */; }; 52672F64206ADFAF008EB6EA /* GoogleMaps.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 52672F63206ADFAF008EB6EA /* GoogleMaps.bundle */; }; + 52672FAA206AE69A008EB6EA /* libViroReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 52672FA9206AE69A008EB6EA /* libViroReact.a */; settings = {ATTRIBUTES = (Required, ); }; }; + 52672FAC206AE6EB008EB6EA /* libFreetype2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 52672FAB206AE6EB008EB6EA /* libFreetype2.a */; }; + 52672FAE206B0FFA008EB6EA /* ViroKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52672FAD206B0FF9008EB6EA /* ViroKit.framework */; settings = {ATTRIBUTES = (Required, ); }; }; + 52672FB0206B1471008EB6EA /* ViroKit.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 52672FAD206B0FF9008EB6EA /* ViroKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; }; 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */; }; @@ -293,6 +297,19 @@ }; /* End PBXContainerItemProxy section */ +/* Begin PBXCopyFilesBuildPhase section */ + 52672FAF206B145B008EB6EA /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 52672FB0206B1471008EB6EA /* ViroKit.framework in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; }; 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; }; @@ -317,6 +334,9 @@ 52672F5F206ADF51008EB6EA /* GoogleMapsCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = GoogleMapsCore.framework; sourceTree = ""; }; 52672F60206ADF52008EB6EA /* GoogleMaps.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = GoogleMaps.framework; sourceTree = ""; }; 52672F63206ADFAF008EB6EA /* GoogleMaps.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = GoogleMaps.bundle; path = GoogleMaps.framework/Resources/GoogleMaps.bundle; sourceTree = ""; }; + 52672FA9206AE69A008EB6EA /* libViroReact.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libViroReact.a; path = "../node_modules/react-viro/ios/dist/lib/libViroReact.a"; sourceTree = ""; }; + 52672FAB206AE6EB008EB6EA /* libFreetype2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libFreetype2.a; path = "../node_modules/react-viro/ios/dist/ViroRenderer/freetype/libFreetype2.a"; sourceTree = ""; }; + 52672FAD206B0FF9008EB6EA /* ViroKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = ViroKit.framework; sourceTree = ""; }; 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = ""; }; 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; @@ -331,6 +351,8 @@ 52672F5C206ADE32008EB6EA /* libAirMaps.a in Frameworks */, 52672F4E206ADBC1008EB6EA /* libReactNativeNavigation.a in Frameworks */, 52672F61206ADF52008EB6EA /* GoogleMapsCore.framework in Frameworks */, + 52672FAE206B0FFA008EB6EA /* ViroKit.framework in Frameworks */, + 52672FAA206AE69A008EB6EA /* libViroReact.a in Frameworks */, ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */, 5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */, 146834051AC3E58100842450 /* libReact.a in Frameworks */, @@ -346,6 +368,7 @@ 52672F5E206ADF2F008EB6EA /* GoogleMapsBase.framework in Frameworks */, 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, + 52672FAC206AE6EB008EB6EA /* libFreetype2.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -452,6 +475,9 @@ 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { isa = PBXGroup; children = ( + 52672FAD206B0FF9008EB6EA /* ViroKit.framework */, + 52672FAB206AE6EB008EB6EA /* libFreetype2.a */, + 52672FA9206AE69A008EB6EA /* libViroReact.a */, 52672F60206ADF52008EB6EA /* GoogleMaps.framework */, 52672F5F206ADF51008EB6EA /* GoogleMapsCore.framework */, 52672F5D206ADF2F008EB6EA /* GoogleMapsBase.framework */, @@ -566,6 +592,7 @@ 13B07F8C1A680F5B00A75B9A /* Frameworks */, 13B07F8E1A680F5B00A75B9A /* Resources */, 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, + 52672FAF206B145B008EB6EA /* CopyFiles */, ); buildRules = ( ); @@ -584,6 +611,11 @@ attributes = { LastUpgradeCheck = 0610; ORGANIZATIONNAME = Facebook; + TargetAttributes = { + 13B07F861A680F5B00A75B9A = { + DevelopmentTeam = 523GZPCZ3X; + }; + }; }; buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "DeightonAR" */; compatibilityVersion = "Xcode 3.2"; @@ -984,6 +1016,8 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CURRENT_PROJECT_VERSION = 1; DEAD_CODE_STRIPPING = NO; + DEVELOPMENT_TEAM = 523GZPCZ3X; + ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)", @@ -991,9 +1025,14 @@ HEADER_SEARCH_PATHS = ( "$(SRCROOT)/../node_modules/react-native-navigation/ios/**", "$(SRCROOT)/../node_modules/react-native-maps/lib/ios/AirMaps/**", + "$(SRCROOT)/../node_modules/react-viro/ios/dist/include", ); INFOPLIST_FILE = DeightonAR/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(SRCROOT)/../node_modules/react-viro/ios/dist/lib", + "$(SRCROOT)/../node_modules/react-viro/ios/dist/ViroRenderer/freetype", + ); OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -1009,6 +1048,8 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 523GZPCZ3X; + ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)", @@ -1016,9 +1057,14 @@ HEADER_SEARCH_PATHS = ( "$(SRCROOT)/../node_modules/react-native-navigation/ios/**", "$(SRCROOT)/../node_modules/react-native-maps/lib/ios/AirMaps/**", + "$(SRCROOT)/../node_modules/react-viro/ios/dist/include", ); INFOPLIST_FILE = DeightonAR/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(SRCROOT)/../node_modules/react-viro/ios/dist/lib", + "$(SRCROOT)/../node_modules/react-viro/ios/dist/ViroRenderer/freetype", + ); OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", diff --git a/mobile/ios/DeightonAR/AppDelegate.m b/mobile/ios/DeightonAR/AppDelegate.m index 4c29bb2..4536f04 100644 --- a/mobile/ios/DeightonAR/AppDelegate.m +++ b/mobile/ios/DeightonAR/AppDelegate.m @@ -20,9 +20,7 @@ // and https://gist.github.com/dmachat/412658416dc7dcf3f7a829b7a10c2583 @import GoogleMaps; -/* -#import -*/ +#import @implementation AppDelegate diff --git a/mobile/ios/DeightonAR/Info.plist b/mobile/ios/DeightonAR/Info.plist index 43e061b..a9c25ab 100644 --- a/mobile/ios/DeightonAR/Info.plist +++ b/mobile/ios/DeightonAR/Info.plist @@ -9,7 +9,7 @@ CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) + com.us.kss.$(PRODUCT_NAME:rfc1034identifier) CFBundleInfoDictionaryVersion 6.0 CFBundleName @@ -24,24 +24,7 @@ 1 LSRequiresIPhoneOS - UILaunchStoryboardName - LaunchScreen - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - NSLocationWhenInUseUsageDescription - NSAppTransportSecurity - NSExceptionDomains @@ -52,5 +35,24 @@ + NSLocationWhenInUseUsageDescription + + NSCameraUsageDescription + $(PRODUCT_NAME) camera use + NSPhotoLibraryUsageDescription + $(PRODUCT_NAME) photo use + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + + UIViewControllerBasedStatusBarAppearance + diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/Info.plist b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/Info.plist new file mode 100755 index 0000000..8479494 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/Info.plist differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ar.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ar.lproj/CardboardSDK.strings new file mode 100755 index 0000000..cdf62aa Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ar.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/arrowRight.png b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/arrowRight.png new file mode 100755 index 0000000..90c573a Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/arrowRight.png differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ca.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ca.lproj/CardboardSDK.strings new file mode 100755 index 0000000..28b2606 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ca.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/cardboardLogotype.png b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/cardboardLogotype.png new file mode 100755 index 0000000..207c086 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/cardboardLogotype.png differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/continueButton.png b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/continueButton.png new file mode 100755 index 0000000..e84d29f Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/continueButton.png differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/cs.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/cs.lproj/CardboardSDK.strings new file mode 100755 index 0000000..76b3085 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/cs.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/da.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/da.lproj/CardboardSDK.strings new file mode 100755 index 0000000..28d3950 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/da.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/de.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/de.lproj/CardboardSDK.strings new file mode 100755 index 0000000..4ccc062 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/de.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/el.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/el.lproj/CardboardSDK.strings new file mode 100755 index 0000000..0251f52 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/el.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/en.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/en.lproj/CardboardSDK.strings new file mode 100755 index 0000000..f2b07c3 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/en.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/en_AU.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/en_AU.lproj/CardboardSDK.strings new file mode 100755 index 0000000..057c9ca Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/en_AU.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/en_GB.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/en_GB.lproj/CardboardSDK.strings new file mode 100755 index 0000000..057c9ca Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/en_GB.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/en_IN.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/en_IN.lproj/CardboardSDK.strings new file mode 100755 index 0000000..057c9ca Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/en_IN.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/es.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/es.lproj/CardboardSDK.strings new file mode 100755 index 0000000..de9cf85 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/es.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/es_MX.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/es_MX.lproj/CardboardSDK.strings new file mode 100755 index 0000000..a5ca467 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/es_MX.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/fi.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/fi.lproj/CardboardSDK.strings new file mode 100755 index 0000000..2df0408 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/fi.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/fr.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/fr.lproj/CardboardSDK.strings new file mode 100755 index 0000000..b5041fb Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/fr.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/gearButton.png b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/gearButton.png new file mode 100755 index 0000000..bc726d7 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/gearButton.png differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/he.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/he.lproj/CardboardSDK.strings new file mode 100755 index 0000000..c03896d Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/he.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/hi.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/hi.lproj/CardboardSDK.strings new file mode 100755 index 0000000..f3d1767 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/hi.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/hr.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/hr.lproj/CardboardSDK.strings new file mode 100755 index 0000000..fdf8f80 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/hr.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/hu.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/hu.lproj/CardboardSDK.strings new file mode 100755 index 0000000..3a95880 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/hu.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_arrow_back_white@1x.png b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_arrow_back_white@1x.png new file mode 100755 index 0000000..d571552 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_arrow_back_white@1x.png differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_arrow_back_white@2x.png b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_arrow_back_white@2x.png new file mode 100755 index 0000000..151fe88 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_arrow_back_white@2x.png differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_arrow_back_white@3x.png b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_arrow_back_white@3x.png new file mode 100755 index 0000000..2adff59 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_arrow_back_white@3x.png differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_arrow_forward.png b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_arrow_forward.png new file mode 100755 index 0000000..552d40d Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_arrow_forward.png differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_arrow_forward@2x.png b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_arrow_forward@2x.png new file mode 100755 index 0000000..878b6e5 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_arrow_forward@2x.png differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_arrow_forward@3x.png b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_arrow_forward@3x.png new file mode 100755 index 0000000..a5042fd Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_arrow_forward@3x.png differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_cardboard.png b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_cardboard.png new file mode 100755 index 0000000..0d1cd17 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_cardboard.png differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_cardboard@2x.png b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_cardboard@2x.png new file mode 100755 index 0000000..3ee47e8 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_cardboard@2x.png differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_cardboard@3x.png b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_cardboard@3x.png new file mode 100755 index 0000000..234ddf0 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_cardboard@3x.png differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_fullscreen.png b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_fullscreen.png new file mode 100755 index 0000000..20fefe7 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_fullscreen.png differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_fullscreen@2x.png b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_fullscreen@2x.png new file mode 100755 index 0000000..4423c7c Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_fullscreen@2x.png differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_fullscreen@3x.png b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_fullscreen@3x.png new file mode 100755 index 0000000..9652e51 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_fullscreen@3x.png differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_fullscreen_exit.png b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_fullscreen_exit.png new file mode 100755 index 0000000..d4ae38c Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_fullscreen_exit.png differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_fullscreen_exit@2x.png b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_fullscreen_exit@2x.png new file mode 100755 index 0000000..364bad0 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_fullscreen_exit@2x.png differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_fullscreen_exit@3x.png b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_fullscreen_exit@3x.png new file mode 100755 index 0000000..5fb4d7b Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_fullscreen_exit@3x.png differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_help.png b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_help.png new file mode 100755 index 0000000..25d9989 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_help.png differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_help@2x.png b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_help@2x.png new file mode 100755 index 0000000..1ccd4f3 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_help@2x.png differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_help@3x.png b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_help@3x.png new file mode 100755 index 0000000..7cd312e Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_help@3x.png differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_info.png b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_info.png new file mode 100755 index 0000000..667316b Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_info.png differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_info@2x.png b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_info@2x.png new file mode 100755 index 0000000..a7c672d Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_info@2x.png differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_info@3x.png b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_info@3x.png new file mode 100755 index 0000000..ad0e6cd Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_info@3x.png differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_settings_white@1x.png b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_settings_white@1x.png new file mode 100755 index 0000000..cc88075 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_settings_white@1x.png differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_settings_white@2x.png b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_settings_white@2x.png new file mode 100755 index 0000000..3fcca05 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_settings_white@2x.png differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_settings_white@3x.png b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_settings_white@3x.png new file mode 100755 index 0000000..d9c9d81 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ic_settings_white@3x.png differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/id.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/id.lproj/CardboardSDK.strings new file mode 100755 index 0000000..2a7cdcc Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/id.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/it.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/it.lproj/CardboardSDK.strings new file mode 100755 index 0000000..b8bd7a9 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/it.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/iw.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/iw.lproj/CardboardSDK.strings new file mode 100755 index 0000000..c03896d Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/iw.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ja.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ja.lproj/CardboardSDK.strings new file mode 100755 index 0000000..0a39756 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ja.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ko.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ko.lproj/CardboardSDK.strings new file mode 100755 index 0000000..05d26ea Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ko.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/nb.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/nb.lproj/CardboardSDK.strings new file mode 100755 index 0000000..fcf40f4 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/nb.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/nl.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/nl.lproj/CardboardSDK.strings new file mode 100755 index 0000000..38d12fb Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/nl.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/pl.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/pl.lproj/CardboardSDK.strings new file mode 100755 index 0000000..85197a0 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/pl.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/pt.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/pt.lproj/CardboardSDK.strings new file mode 100755 index 0000000..32c99f6 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/pt.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/pt_PT.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/pt_PT.lproj/CardboardSDK.strings new file mode 100755 index 0000000..dbb12d9 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/pt_PT.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/qrSample@1x.png b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/qrSample@1x.png new file mode 100755 index 0000000..ceedc38 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/qrSample@1x.png differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/qrSample@2x.png b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/qrSample@2x.png new file mode 100755 index 0000000..4ed334a Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/qrSample@2x.png differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/qrSample@3x.png b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/qrSample@3x.png new file mode 100755 index 0000000..dcc2ad5 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/qrSample@3x.png differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ro.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ro.lproj/CardboardSDK.strings new file mode 100755 index 0000000..5de5926 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ro.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/rotateInstructions.mp4 b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/rotateInstructions.mp4 new file mode 100755 index 0000000..645d3c9 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/rotateInstructions.mp4 differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ru.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ru.lproj/CardboardSDK.strings new file mode 100755 index 0000000..2deefb1 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/ru.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/sk.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/sk.lproj/CardboardSDK.strings new file mode 100755 index 0000000..72b8cee Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/sk.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/sv.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/sv.lproj/CardboardSDK.strings new file mode 100755 index 0000000..efd5e1e Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/sv.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/th.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/th.lproj/CardboardSDK.strings new file mode 100755 index 0000000..0dabf41 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/th.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/tickmarks.png b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/tickmarks.png new file mode 100755 index 0000000..b298ead Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/tickmarks.png differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/tr.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/tr.lproj/CardboardSDK.strings new file mode 100755 index 0000000..9f34d8f Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/tr.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/uk.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/uk.lproj/CardboardSDK.strings new file mode 100755 index 0000000..a751aaa Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/uk.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/vi.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/vi.lproj/CardboardSDK.strings new file mode 100755 index 0000000..8e2fb27 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/vi.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/zh_CN.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/zh_CN.lproj/CardboardSDK.strings new file mode 100755 index 0000000..aff9e17 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/zh_CN.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/zh_HK.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/zh_HK.lproj/CardboardSDK.strings new file mode 100755 index 0000000..22126a0 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/zh_HK.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/CardboardSDK.bundle/zh_TW.lproj/CardboardSDK.strings b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/zh_TW.lproj/CardboardSDK.strings new file mode 100755 index 0000000..22126a0 Binary files /dev/null and b/mobile/ios/ViroKit.framework/CardboardSDK.bundle/zh_TW.lproj/CardboardSDK.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/ar.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/ar.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..70e0f60 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/ar.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/bg.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/bg.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..f278093 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/bg.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/ca.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/ca.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..d94a0a0 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/ca.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/cs.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/cs.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..3779b74 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/cs.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/da.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/da.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..8c8cfca Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/da.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/de.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/de.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..b833e36 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/de.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/el.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/el.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..6199e9d Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/el.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/en.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/en.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..adfde1a Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/en.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/en_AU.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/en_AU.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..f7f0f65 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/en_AU.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/en_GB.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/en_GB.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..f7f0f65 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/en_GB.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/en_IN.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/en_IN.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..f7f0f65 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/en_IN.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/es.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/es.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..07a256a Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/es.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/es_419.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/es_419.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..20436b0 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/es_419.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/es_MX.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/es_MX.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..20436b0 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/es_MX.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/fa.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/fa.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..bc84d62 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/fa.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/fi.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/fi.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..5f1f09a Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/fi.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/fr.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/fr.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..301dda7 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/fr.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/fr_CA.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/fr_CA.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..57be660 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/fr_CA.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/he.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/he.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..f1af56e Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/he.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/hi.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/hi.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..5710e27 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/hi.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/hr.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/hr.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..33aec09 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/hr.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/hu.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/hu.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..0c04bac Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/hu.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/hy.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/hy.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..014831c Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/hy.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/id.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/id.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..5491b9a Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/id.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/it.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/it.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..772e4c4 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/it.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/iw.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/iw.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..f1af56e Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/iw.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/ja.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/ja.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..d33d639 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/ja.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/ka.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/ka.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..b3d338e Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/ka.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/kk.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/kk.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..41dedcd Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/kk.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/km.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/km.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..7bc2412 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/km.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/ko.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/ko.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..9bd2829 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/ko.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/lo.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/lo.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..45be12b Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/lo.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/lt.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/lt.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..b3f1f04 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/lt.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/lv.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/lv.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..512104d Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/lv.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/mn.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/mn.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..7a5720d Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/mn.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/ms.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/ms.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..2634321 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/ms.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/nb.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/nb.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..76f06b5 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/nb.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/nl.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/nl.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..274b358 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/nl.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/no.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/no.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..76f06b5 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/no.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/pl.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/pl.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..62cb337 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/pl.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/pt.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/pt.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..b66c2f6 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/pt.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/pt_BR.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/pt_BR.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..b66c2f6 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/pt_BR.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/pt_PT.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/pt_PT.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..58869c1 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/pt_PT.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/ro.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/ro.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..1234970 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/ro.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/ru.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/ru.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..0835d51 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/ru.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/sk.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/sk.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..896aab1 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/sk.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/sq.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/sq.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..1e07b2a Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/sq.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/sr.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/sr.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..853c922 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/sr.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/sv.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/sv.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..8ad1750 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/sv.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/th.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/th.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..636968d Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/th.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/tr.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/tr.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..aac9832 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/tr.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/uk.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/uk.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..e1fcab9 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/uk.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/vi.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/vi.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..df4f057 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/vi.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/zh_CN.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/zh_CN.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..80916a8 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/zh_CN.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/zh_HK.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/zh_HK.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..911dd24 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/zh_HK.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/zh_TW.lproj/GoogleKitCore.strings b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/zh_TW.lproj/GoogleKitCore.strings new file mode 100755 index 0000000..050f7ec Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/Resources/zh_TW.lproj/GoogleKitCore.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_blue.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_blue.png new file mode 100755 index 0000000..813c430 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_blue.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_blue@2x.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_blue@2x.png new file mode 100755 index 0000000..08e0b22 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_blue@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_blue@3x.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_blue@3x.png new file mode 100755 index 0000000..7420a62 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_blue@3x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_blue_highlighted.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_blue_highlighted.png new file mode 100755 index 0000000..b74d7a6 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_blue_highlighted.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_blue_highlighted@2x.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_blue_highlighted@2x.png new file mode 100755 index 0000000..36a4137 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_blue_highlighted@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_blue_highlighted@3x.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_blue_highlighted@3x.png new file mode 100755 index 0000000..377d2b1 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_blue_highlighted@3x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_dark.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_dark.png new file mode 100755 index 0000000..6c6689e Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_dark.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_dark@2x.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_dark@2x.png new file mode 100755 index 0000000..78cbd31 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_dark@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_dark@3x.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_dark@3x.png new file mode 100755 index 0000000..2164ab8 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_dark@3x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_dark_highlighted.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_dark_highlighted.png new file mode 100755 index 0000000..aee9631 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_dark_highlighted.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_dark_highlighted@2x.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_dark_highlighted@2x.png new file mode 100755 index 0000000..6094bf7 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_dark_highlighted@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_dark_highlighted@3x.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_dark_highlighted@3x.png new file mode 100755 index 0000000..7afe528 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_dark_highlighted@3x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_light.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_light.png new file mode 100755 index 0000000..2e16188 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_light.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_light@2x.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_light@2x.png new file mode 100755 index 0000000..a49b5e5 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_light@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_light@3x.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_light@3x.png new file mode 100755 index 0000000..477ff6b Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_light@3x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_light_highlighted.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_light_highlighted.png new file mode 100755 index 0000000..1a736f8 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_light_highlighted.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_light_highlighted@2x.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_light_highlighted@2x.png new file mode 100755 index 0000000..776a4d8 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_light_highlighted@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_light_highlighted@3x.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_light_highlighted@3x.png new file mode 100755 index 0000000..214e84c Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_light_highlighted@3x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_red.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_red.png new file mode 100755 index 0000000..b302938 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_red.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_red@2x.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_red@2x.png new file mode 100755 index 0000000..181b608 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_red@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_red@3x.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_red@3x.png new file mode 100755 index 0000000..2fa8f71 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_red@3x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_red_highlighted.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_red_highlighted.png new file mode 100755 index 0000000..55b6d78 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_red_highlighted.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_red_highlighted@2x.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_red_highlighted@2x.png new file mode 100755 index 0000000..af28660 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_red_highlighted@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_red_highlighted@3x.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_red_highlighted@3x.png new file mode 100755 index 0000000..a3d95a4 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/button_red_highlighted@3x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/cell_background_selected_dark.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/cell_background_selected_dark.png new file mode 100755 index 0000000..fa26c86 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/cell_background_selected_dark.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/cell_background_selected_dark@2x.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/cell_background_selected_dark@2x.png new file mode 100755 index 0000000..abeb887 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/cell_background_selected_dark@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/cell_disclosure_accessory.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/cell_disclosure_accessory.png new file mode 100755 index 0000000..faa4714 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/cell_disclosure_accessory.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/cell_disclosure_accessory@2x.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/cell_disclosure_accessory@2x.png new file mode 100755 index 0000000..6f97479 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/cell_disclosure_accessory@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/cell_disclosure_accessory@3x.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/cell_disclosure_accessory@3x.png new file mode 100755 index 0000000..021c59a Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/cell_disclosure_accessory@3x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/cell_divider.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/cell_divider.png new file mode 100755 index 0000000..961dd81 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/cell_divider.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/cell_divider@2x.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/cell_divider@2x.png new file mode 100755 index 0000000..dd337e7 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/cell_divider@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/checkbox.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/checkbox.png new file mode 100755 index 0000000..b252138 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/checkbox.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/checkbox@2x.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/checkbox@2x.png new file mode 100755 index 0000000..99ec9b6 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/checkbox@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/checkbox_checked.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/checkbox_checked.png new file mode 100755 index 0000000..101ef3a Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/checkbox_checked.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/checkbox_checked@2x.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/checkbox_checked@2x.png new file mode 100755 index 0000000..808a2e2 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/checkbox_checked@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/checkmark.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/checkmark.png new file mode 100755 index 0000000..7640fb5 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/checkmark.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/checkmark@2x.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/checkmark@2x.png new file mode 100755 index 0000000..d740be0 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/checkmark@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/vertical_divider.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/vertical_divider.png new file mode 100755 index 0000000..6d9422a Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/vertical_divider.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/vertical_divider@2x.png b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/vertical_divider@2x.png new file mode 100755 index 0000000..4e998b2 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitCore.bundle/vertical_divider@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/ar.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/ar.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..5e452bd Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/ar.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/bg.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/bg.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..fc78321 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/bg.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/ca.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/ca.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..94914c2 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/ca.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/cs.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/cs.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..779ecc6 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/cs.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/da.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/da.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..ddf943d Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/da.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/de.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/de.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..4de8e4e Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/de.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/el.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/el.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..dea82db Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/el.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/en.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/en.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..e04a6e9 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/en.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/en_AU.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/en_AU.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..cead309 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/en_AU.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/en_GB.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/en_GB.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..cead309 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/en_GB.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/en_IN.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/en_IN.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..cead309 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/en_IN.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/es.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/es.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..eb04bf5 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/es.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/es_419.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/es_419.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..66f13bf Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/es_419.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/es_MX.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/es_MX.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..66f13bf Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/es_MX.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/fa.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/fa.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..9c57b0e Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/fa.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/fi.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/fi.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..d831fb4 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/fi.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/fr.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/fr.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..8f3916a Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/fr.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/fr_CA.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/fr_CA.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..b913d1e Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/fr_CA.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/he.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/he.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..0f00cc8 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/he.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/hi.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/hi.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..12213ee Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/hi.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/hr.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/hr.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..66326ed Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/hr.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/hu.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/hu.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..6c377fc Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/hu.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/hy.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/hy.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..e0cec93 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/hy.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/id.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/id.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..b9d1d7e Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/id.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/it.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/it.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..d768202 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/it.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/iw.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/iw.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..0f00cc8 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/iw.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/ja.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/ja.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..c673e34 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/ja.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/ka.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/ka.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..086171a Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/ka.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/kk.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/kk.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..417699b Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/kk.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/km.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/km.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..26c08c0 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/km.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/ko.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/ko.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..cfe6d14 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/ko.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/lo.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/lo.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..182ae16 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/lo.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/lt.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/lt.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..54a5755 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/lt.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/lv.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/lv.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..94a90ea Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/lv.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/mn.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/mn.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..9ca532a Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/mn.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/ms.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/ms.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..dfa49a9 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/ms.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/nb.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/nb.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..e29a338 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/nb.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/nl.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/nl.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..7e8f2dd Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/nl.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/no.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/no.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..e29a338 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/no.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/pl.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/pl.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..cdf6b1a Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/pl.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/pt.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/pt.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..ad41826 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/pt.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/pt_BR.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/pt_BR.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..ad41826 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/pt_BR.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/pt_PT.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/pt_PT.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..7b62ba6 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/pt_PT.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/ro.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/ro.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..4ef7a46 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/ro.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/ru.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/ru.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..b742dec Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/ru.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/sk.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/sk.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..2ce3a32 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/sk.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/sq.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/sq.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..dd09b67 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/sq.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/sr.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/sr.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..07df4bb Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/sr.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/sv.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/sv.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..f1b83ab Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/sv.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/th.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/th.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..880a9dd Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/th.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/tr.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/tr.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..4eced56 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/tr.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/uk.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/uk.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..0852636 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/uk.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/vi.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/vi.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..f1e9197 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/vi.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/zh_CN.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/zh_CN.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..4e4b118 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/zh_CN.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/zh_HK.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/zh_HK.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..ce99d44 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/zh_HK.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/zh_TW.lproj/GoogleKitDialogs.strings b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/zh_TW.lproj/GoogleKitDialogs.strings new file mode 100755 index 0000000..a59eaf9 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/Resources/zh_TW.lproj/GoogleKitDialogs.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/arrow_bottom.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/arrow_bottom.png new file mode 100755 index 0000000..f407eb1 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/arrow_bottom.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/arrow_bottom@2x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/arrow_bottom@2x.png new file mode 100755 index 0000000..f165f6a Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/arrow_bottom@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/arrow_left.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/arrow_left.png new file mode 100755 index 0000000..41412cf Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/arrow_left.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/arrow_left@2x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/arrow_left@2x.png new file mode 100755 index 0000000..baabb60 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/arrow_left@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/arrow_right.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/arrow_right.png new file mode 100755 index 0000000..2780fb5 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/arrow_right.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/arrow_right@2x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/arrow_right@2x.png new file mode 100755 index 0000000..f0f9c66 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/arrow_right@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/arrow_top.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/arrow_top.png new file mode 100755 index 0000000..852bab0 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/arrow_top.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/arrow_top@2x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/arrow_top@2x.png new file mode 100755 index 0000000..05cb6fe Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/arrow_top@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/background.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/background.png new file mode 100755 index 0000000..b8b6b34 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/background.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/background@2x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/background@2x.png new file mode 100755 index 0000000..ee9c248 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/background@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/bottom.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/bottom.png new file mode 100755 index 0000000..2226a73 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/bottom.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/bottom@2x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/bottom@2x.png new file mode 100755 index 0000000..ffd3725 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/bottom@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/corner_bottom_left.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/corner_bottom_left.png new file mode 100755 index 0000000..1f77447 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/corner_bottom_left.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/corner_bottom_left@2x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/corner_bottom_left@2x.png new file mode 100755 index 0000000..314f075 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/corner_bottom_left@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/corner_bottom_right.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/corner_bottom_right.png new file mode 100755 index 0000000..4d3f98e Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/corner_bottom_right.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/corner_bottom_right@2x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/corner_bottom_right@2x.png new file mode 100755 index 0000000..e309be6 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/corner_bottom_right@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/corner_top_left.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/corner_top_left.png new file mode 100755 index 0000000..39942ef Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/corner_top_left.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/corner_top_left@2x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/corner_top_left@2x.png new file mode 100755 index 0000000..d574d62 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/corner_top_left@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/corner_top_right.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/corner_top_right.png new file mode 100755 index 0000000..65e35c5 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/corner_top_right.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/corner_top_right@2x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/corner_top_right@2x.png new file mode 100755 index 0000000..9e16505 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/corner_top_right@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_check.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_check.png new file mode 100755 index 0000000..5e5e7cf Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_check.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_check@2x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_check@2x.png new file mode 100755 index 0000000..53c44e0 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_check@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_check@3x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_check@3x.png new file mode 100755 index 0000000..c9c0174 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_check@3x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_close.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_close.png new file mode 100755 index 0000000..40a1a84 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_close.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_close@2x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_close@2x.png new file mode 100755 index 0000000..24d9319 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_close@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_close@3x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_close@3x.png new file mode 100755 index 0000000..776a6c2 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_close@3x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_comment.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_comment.png new file mode 100755 index 0000000..00d6902 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_comment.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_comment@2x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_comment@2x.png new file mode 100755 index 0000000..7c9804b Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_comment@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_comment@3x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_comment@3x.png new file mode 100755 index 0000000..e96ccd2 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_comment@3x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_delete.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_delete.png new file mode 100755 index 0000000..999aa4c Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_delete.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_delete@2x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_delete@2x.png new file mode 100755 index 0000000..796ccd2 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_delete@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_delete@3x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_delete@3x.png new file mode 100755 index 0000000..6d7cb81 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_delete@3x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_email.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_email.png new file mode 100755 index 0000000..4325faf Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_email.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_email@2x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_email@2x.png new file mode 100755 index 0000000..70620e4 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_email@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_email@3x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_email@3x.png new file mode 100755 index 0000000..3d13627 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_email@3x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_file_download.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_file_download.png new file mode 100755 index 0000000..c2c845e Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_file_download.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_file_download@2x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_file_download@2x.png new file mode 100755 index 0000000..f5afb24 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_file_download@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_file_download@3x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_file_download@3x.png new file mode 100755 index 0000000..ce97c85 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_file_download@3x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_info.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_info.png new file mode 100755 index 0000000..5ef3dc0 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_info.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_info@2x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_info@2x.png new file mode 100755 index 0000000..46ed12a Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_info@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_info@3x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_info@3x.png new file mode 100755 index 0000000..a81eeb9 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_info@3x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_link.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_link.png new file mode 100755 index 0000000..67b2a9e Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_link.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_link@2x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_link@2x.png new file mode 100755 index 0000000..248782d Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_link@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_link@3x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_link@3x.png new file mode 100755 index 0000000..af03b85 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_link@3x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_message.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_message.png new file mode 100755 index 0000000..d58563f Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_message.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_message@2x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_message@2x.png new file mode 100755 index 0000000..7587b29 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_message@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_message@3x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_message@3x.png new file mode 100755 index 0000000..5456c42 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_message@3x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_mode_edit.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_mode_edit.png new file mode 100755 index 0000000..9efbaae Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_mode_edit.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_mode_edit@2x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_mode_edit@2x.png new file mode 100755 index 0000000..87f8de1 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_mode_edit@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_mode_edit@3x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_mode_edit@3x.png new file mode 100755 index 0000000..4af4ae6 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_mode_edit@3x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_open_in_browser.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_open_in_browser.png new file mode 100755 index 0000000..bbe5c14 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_open_in_browser.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_open_in_browser@2x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_open_in_browser@2x.png new file mode 100755 index 0000000..d87cbcc Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_open_in_browser@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_open_in_browser@3x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_open_in_browser@3x.png new file mode 100755 index 0000000..4324fbf Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_open_in_browser@3x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_photo_camera.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_photo_camera.png new file mode 100755 index 0000000..2ce3c5b Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_photo_camera.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_photo_camera@2x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_photo_camera@2x.png new file mode 100755 index 0000000..d83d658 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_photo_camera@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_photo_camera@3x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_photo_camera@3x.png new file mode 100755 index 0000000..6125fa2 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_photo_camera@3x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_photo_library.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_photo_library.png new file mode 100755 index 0000000..6fb2ad6 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_photo_library.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_photo_library@2x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_photo_library@2x.png new file mode 100755 index 0000000..5ab220f Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_photo_library@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_photo_library@3x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_photo_library@3x.png new file mode 100755 index 0000000..bd91f66 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_photo_library@3x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_post_gplus.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_post_gplus.png new file mode 100755 index 0000000..10c74ae Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_post_gplus.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_post_gplus@2x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_post_gplus@2x.png new file mode 100755 index 0000000..96e44b0 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_post_gplus@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_post_gplus@3x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_post_gplus@3x.png new file mode 100755 index 0000000..8b31508 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_post_gplus@3x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_print.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_print.png new file mode 100755 index 0000000..d29c76c Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_print.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_print@2x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_print@2x.png new file mode 100755 index 0000000..f5d0dee Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_print@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_print@3x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_print@3x.png new file mode 100755 index 0000000..f55abe0 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_print@3x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_report_problem.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_report_problem.png new file mode 100755 index 0000000..e768d11 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_report_problem.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_report_problem@2x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_report_problem@2x.png new file mode 100755 index 0000000..2ea6164 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_report_problem@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_report_problem@3x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_report_problem@3x.png new file mode 100755 index 0000000..ed36f70 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_report_problem@3x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_report_problem_red.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_report_problem_red.png new file mode 100755 index 0000000..a3799cc Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_report_problem_red.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_report_problem_red@2x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_report_problem_red@2x.png new file mode 100755 index 0000000..c35e7a2 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_report_problem_red@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_report_problem_red@3x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_report_problem_red@3x.png new file mode 100755 index 0000000..78fe386 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/ic_report_problem_red@3x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/left.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/left.png new file mode 100755 index 0000000..5c7567b Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/left.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/left@2x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/left@2x.png new file mode 100755 index 0000000..7e6e800 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/left@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/right.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/right.png new file mode 100755 index 0000000..23dd61e Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/right.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/right@2x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/right@2x.png new file mode 100755 index 0000000..f4d24c0 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/right@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/top.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/top.png new file mode 100755 index 0000000..ef95df5 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/top.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/top@2x.png b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/top@2x.png new file mode 100755 index 0000000..3315786 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitDialogs.bundle/top@2x.png differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/ar.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/ar.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..5bcdea6 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/ar.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/bg.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/bg.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..895eda5 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/bg.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/ca.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/ca.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..f6f37d5 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/ca.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/cs.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/cs.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..a0d736e Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/cs.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/da.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/da.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..44f6006 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/da.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/de.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/de.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..1584a0d Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/de.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/el.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/el.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..fcc8f2e Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/el.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/en.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/en.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..86b7bd5 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/en.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/en_AU.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/en_AU.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..30b9116 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/en_AU.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/en_GB.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/en_GB.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..30b9116 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/en_GB.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/en_IN.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/en_IN.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..30b9116 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/en_IN.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/es.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/es.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..4e698ac Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/es.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/es_419.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/es_419.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..44506d7 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/es_419.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/es_MX.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/es_MX.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..44506d7 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/es_MX.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/fa.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/fa.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..deb7795 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/fa.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/fi.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/fi.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..018ae87 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/fi.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/fr.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/fr.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..f1662e1 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/fr.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/fr_CA.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/fr_CA.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..c9a9098 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/fr_CA.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/he.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/he.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..fcf3527 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/he.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/hi.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/hi.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..4c1c697 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/hi.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/hr.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/hr.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..68d739b Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/hr.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/hu.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/hu.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..8cd3d6b Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/hu.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/hy.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/hy.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..5e8bd14 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/hy.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/id.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/id.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..853f0c5 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/id.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/it.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/it.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..868576a Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/it.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/iw.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/iw.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..fcf3527 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/iw.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/ja.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/ja.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..7fdfc08 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/ja.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/ka.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/ka.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..6362c54 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/ka.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/kk.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/kk.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..b68326a Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/kk.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/km.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/km.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..1091d79 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/km.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/ko.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/ko.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..b1dfc25 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/ko.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/lo.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/lo.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..9fd91e4 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/lo.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/lt.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/lt.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..069af76 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/lt.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/lv.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/lv.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..5ac80ae Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/lv.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/mn.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/mn.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..a3563ca Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/mn.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/ms.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/ms.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..8e89ace Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/ms.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/nb.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/nb.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..a1da1a2 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/nb.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/nl.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/nl.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..62044b9 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/nl.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/no.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/no.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..a1da1a2 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/no.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/pl.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/pl.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..be7577c Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/pl.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/pt.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/pt.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..110f619 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/pt.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/pt_BR.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/pt_BR.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..110f619 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/pt_BR.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/pt_PT.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/pt_PT.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..eb84193 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/pt_PT.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/ro.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/ro.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..7e306a5 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/ro.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/ru.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/ru.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..f062ae3 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/ru.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/sk.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/sk.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..d29a69e Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/sk.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/sq.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/sq.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..031d242 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/sq.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/sr.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/sr.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..ccff808 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/sr.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/sv.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/sv.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..fc0373a Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/sv.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/th.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/th.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..c0ba25f Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/th.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/tr.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/tr.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..da718c5 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/tr.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/uk.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/uk.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..c4a59fc Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/uk.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/vi.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/vi.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..4b2365d Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/vi.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/zh_CN.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/zh_CN.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..9eb12e4 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/zh_CN.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/zh_HK.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/zh_HK.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..a7848e8 Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/zh_HK.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/zh_TW.lproj/GoogleKitHUD.strings b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/zh_TW.lproj/GoogleKitHUD.strings new file mode 100755 index 0000000..969291d Binary files /dev/null and b/mobile/ios/ViroKit.framework/GoogleKitHUD.bundle/Resources/zh_TW.lproj/GoogleKitHUD.strings differ diff --git a/mobile/ios/ViroKit.framework/Headers/VROARAnchor.h b/mobile/ios/ViroKit.framework/Headers/VROARAnchor.h new file mode 100644 index 0000000..a70ce54 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROARAnchor.h @@ -0,0 +1,104 @@ +// +// VROARAnchor.h +// ViroKit +// +// Created by Raj Advani on 6/6/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROARAnchor_h +#define VROARAnchor_h + +#include "VROMatrix4f.h" +#include "VROVector3f.h" +#include "VROQuaternion.h" +#include "VROARNode.h" + +/* + Anchors are real world objects detected by the AR engine. Each time an + anchor is detected, the VROARSessionDelegate is given an opportunity to + create a VRONode with virtual content to attach to that anchor. The + ARSession will thereafter ensure that the virtual content is fused with + the real-world anchor, thereby enabling applications to 'augment' + reality with virtual content. + + For example, if a plane anchor is detected, the can use its corresponding + VRONode to place virtual objects for a table-top game. + + Anchors are regularly updated by the AR engine as the characteristics of + the anchor are further refined: for example, the AR engine may start with + an approximation of a surface, and later determine the surface's width and + height. + + VROARAnchor is subclassed by specific anchor types; planes, image targets, + etc. + */ +class VROARAnchor { +public: + + /* + Create a new anchor. + */ + VROARAnchor() {} + virtual ~VROARAnchor() {} + + /* + String representing the ID of the anchor in the underlying platform (ARKit/ARCore). + */ + std::string getId() const { + return _id; + } + void setId(std::string id) { + _id = id; + } + + /* + Transformation matrix encoding the position, orientation and scale of the + anchor in world coordinates. + */ + VROMatrix4f getTransform() const { + return _transform; + }; + void setTransform(VROMatrix4f transform) { + _transform = transform; + } + + /* + The node associated with the anchor. Updated alongside the anchor. + */ + const std::shared_ptr getARNode() const { + return _node; + } + void setARNode(std::shared_ptr node) { + _node = node; + updateNodeTransform(); + } + + /* + Update the anchor's node's transforms given the data in the anchor. + */ + void updateNodeTransform() { + if (_node && !_node->shouldPauseUpdates()) { + VROVector3f scale = getTransform().extractScale(); + VROQuaternion rotation = getTransform().extractRotation(scale); + VROVector3f position = getTransform().extractTranslation(); + + _node->setScale(scale); + _node->setRotation(rotation); + _node->setPosition(position); + } + } + +private: + + std::string _id; + VROMatrix4f _transform; + + /* + The node associated with this anchor. + */ + std::shared_ptr _node; + +}; + +#endif /* VROARAnchor_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROARCamera.h b/mobile/ios/ViroKit.framework/Headers/VROARCamera.h new file mode 100644 index 0000000..0b37acb --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROARCamera.h @@ -0,0 +1,78 @@ +// +// VROARCamera.h +// ViroKit +// +// Created by Raj Advani on 6/6/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROARCamera_h +#define VROARCamera_h + +#include + +class VROViewport; +class VROMatrix4f; +class VROVector3f; +class VROFieldOfView; + +enum class VROARTrackingState { + Unavailable, + Limited, + Normal, +}; + +/* + Provides reasons for why we are in Limited tracking state. + */ +enum class VROARTrackingStateReason { + None, + ExcessiveMotion, + InsufficientFeatures +}; + +/* + Contains information about the current camera position and imaging + characteristics. Updated periodically by the VROARSession. + */ +class VROARCamera { +public: + + VROARCamera() {} + virtual ~VROARCamera() {} + + /* + Get the quality of the tracking. If we are in limited tracking state, + getLimitedTrackingStateReason() will return the reason for this state. + */ + virtual VROARTrackingState getTrackingState() const = 0; + virtual VROARTrackingStateReason getLimitedTrackingStateReason() const = 0; + + /* + Get the position and rotation of the user in world space. These values + are derived from the AR camera's extrinsic matrix, acquired via visual and + inertial algorithms. They can be used to construct the view matrix for the + renderer. + */ + virtual VROMatrix4f getRotation() const = 0; + virtual VROVector3f getPosition() const = 0; + + /* + Get the projection matrix needed to render a 3D scene to match the image + captured by this AR camera. The returned matrix is a concatenation of the + AR camera's intrinsic matrix (3D space --> 2D space) and the renderer's + orthographic projection matrix (2D space --> normalized device space). + This function should also output the field of view in the provided output + variable. + */ + virtual VROMatrix4f getProjection(VROViewport viewport, float near, float far, VROFieldOfView *outFOV) const = 0; + + /* + Get the image size (width, height) for the camera. Stored in the + vector's x and y components. + */ + virtual VROVector3f getImageSize() const = 0; + +}; + +#endif /* VROARCamera_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROARConstraintMatcher.h b/mobile/ios/ViroKit.framework/Headers/VROARConstraintMatcher.h new file mode 100644 index 0000000..7354f6e --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROARConstraintMatcher.h @@ -0,0 +1,124 @@ +// +// VROARConstraintMatcher.h +// ViroKit +// +// Created by Andy Chu on 6/16/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROARConstraintMatcher_h +#define VROARConstraintMatcher_h + +#include "VROARSession.h" +#include +#include + +class VROARAnchor; +class VROARDeclarativeNode; +class VROARConstraintMatcherDelegate; + +/* + VROARConstraintMatcher handles matching declarative nodes with anchors that + meet their requirements. + */ +class VROARConstraintMatcher { +public: + VROARConstraintMatcher() {}; + virtual ~VROARConstraintMatcher() {}; + + void addARNode(std::shared_ptr node); + void removeARNode(std::shared_ptr node); + void updateARNode(std::shared_ptr node); + + void setDelegate(std::shared_ptr delegate); + + /* + This function will silently detach all the anchors from the given nodes. This + is currently used when ARScene is being detached. + */ + void detachAllNodes(std::vector> nodes); + + void anchorWasDetected(std::shared_ptr anchor); + void anchorDidUpdate(std::shared_ptr anchor); + void anchorWasRemoved(std::shared_ptr anchor); + +private: + + // Map between a string ID and the VROARAnchor with that ID. + std::map> _nativeAnchorMap; + std::shared_ptr getAnchorFromId(std::string id); + + std::weak_ptr _delegate; + + // Anchors without an associated Node + std::vector> _detachedAnchors; + + // Nodes w/o id's without an associated Anchor + std::vector> _detachedNodes; + + // Nodes w/ id's without an associated Anchor + std::vector> _detachedNodesWithID; + + /* + Returns a detached anchor that is suitable for the given node. + */ + std::shared_ptr findDetachedAnchor(std::shared_ptr node); + + /* + Returns a detached node satisfied by the given anchor. + */ + std::shared_ptr findDetachedNode(std::shared_ptr anchor); + + /* + This function either attaches the detached node to an anchor or adds the node to + _detachedNodes. + */ + void processDetachedNode(std::shared_ptr node); + + /* + This function either attaches the detached anchor to an node or adds the anchor to + _detachedAnchors. + */ + void processDetachedAnchor(std::shared_ptr anchor); + + /* + This function handles the logic and updating required for attaching a node to an anchor + */ + void attachNodeToAnchor(std::shared_ptr node, std::shared_ptr anchor); + + /* + This function handles detaching a node from an anchor + */ + void detachNodeFromAnchor(std::shared_ptr anchor); + + /* + Functions to abstract out the notification of the delegate + */ + void notifyAnchorWasAttached(std::shared_ptr anchor); + void notifyAnchorWasDetached(std::shared_ptr anchor); + + /* + Helper functions to remove the given objects from the _detached* vectors + */ + void removeFromDetachedList(std::shared_ptr node); + void removeFromDetachedList(std::shared_ptr anchor); +}; + +class VROARConstraintMatcherDelegate { +public: + + /* + Invoked when an anchor is attached to node. + */ + virtual void anchorWasAttached(std::shared_ptr anchor) = 0; + + /* + Invoked when an anchor is detached from a node. + */ + virtual void anchorWasDetached(std::shared_ptr anchor) = 0; + +}; + +#endif /* VROARConstraintMatcher_h */ + + diff --git a/mobile/ios/ViroKit.framework/Headers/VROARDeclarativeImageNode.h b/mobile/ios/ViroKit.framework/Headers/VROARDeclarativeImageNode.h new file mode 100644 index 0000000..bc612c7 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROARDeclarativeImageNode.h @@ -0,0 +1,43 @@ +// +// VROARDeclarativeImageNode.h +// ViroKit +// +// Created by Andy Chu on 1/30/18. +// Copyright © 2018 Viro Media. All rights reserved. +// + +#ifndef VROARDeclarativeImageNode_h +#define VROARDeclarativeImageNode_h + +#include "VROARImageAnchor.h" +#include "VROARDeclarativeNode.h" +#include "VROARImageTarget.h" + +class VROARDeclarativeImageNode : public VROARDeclarativeNode { +public: + + VROARDeclarativeImageNode() {} + virtual ~VROARDeclarativeImageNode() {} + + /* + Returns whether or not the given VROARAnchor fulfills this image marker's requirements. + */ + bool hasRequirementsFulfilled(std::shared_ptr candidate) { + std::shared_ptr imageAnchor = std::dynamic_pointer_cast(candidate); + // a VROARImageAnchor matches an VROAR*ImageNode if they share the same VROImageTarget + return imageAnchor && _imageTarget == imageAnchor->getImageTarget(); + } + + void setImageTarget(std::shared_ptr imageTarget) { + _imageTarget = imageTarget; + } + + std::shared_ptr getImageTarget() { + return _imageTarget; + } + +private: + std::shared_ptr _imageTarget; +}; + +#endif /* VROARDeclarativeImageNode_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROARDeclarativeNode.h b/mobile/ios/ViroKit.framework/Headers/VROARDeclarativeNode.h new file mode 100644 index 0000000..f1df1d3 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROARDeclarativeNode.h @@ -0,0 +1,130 @@ +// +// VROARDeclarativeNode.h +// ViroKit +// +// Created by Raj Advani on 11/3/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROARDeclarativeNode_h +#define VROARDeclarativeNode_h + +#include "VROARNode.h" +#include "VROARDeclarativeNodeDelegate.h" + +/* + Declarative AR nodes implement a *declarative* system for working with AR anchors. + Instead of waiting for an anchor to appear and implementing the control flow yourself, + you can use these nodes to simply specify the constraints of the anchor you desire, + and the system will find the first available ARAnchor that meets those constraints + and assign them to the node. + + For example, you can use VROARDeclarativePlane to specify the minimum width and height + of the desired plane on which to play a table-top game. + */ +class VROARDeclarativeNode : public VROARNode { +public: + + VROARDeclarativeNode() : _isAttached(false), _internalHidden(false) { + } + virtual ~VROARDeclarativeNode() {} + + /* + Returns true if the given anchor fulfills the requirements for this declarative + AR node. + */ + virtual bool hasRequirementsFulfilled(std::shared_ptr candidate) = 0; + + /* + Set an anchor ID to override the constraint system. The VROARConstraintMatcher will + first match nodes to anchors that have matching IDs, prior to checking constraints. + */ + void setAnchorId(std::string anchorId) { + _anchorId = anchorId; + } + std::string getAnchorId() { + return _anchorId; + } + + /* + Set a delegate to respond to the node being attached/detached/updated. + */ + void setARNodeDelegate(std::shared_ptr delegate) { + _arNodeDelegate = delegate; + } + std::shared_ptr getARNodeDelegate() { + return _arNodeDelegate.lock(); + } + + /* + Declarative AR nodes are kept hidden until they find a matching anchor. + */ + virtual void setHidden(bool hidden) { + _internalHidden = hidden; + VRONode::setHidden(!_isAttached || _internalHidden); + } + + /* + Set whether this declarative AR node is attached to an anchor. + */ + void setAttached(bool attached) { + _isAttached = attached; + // set hidden again when the _isAttached changes. + setHidden(_internalHidden); + } + + /* + Invoked internally by the VROARConstraintMatcher. + */ + virtual void onARAnchorAttached() { + setAttached(true); + std::shared_ptr delegate = getARNodeDelegate(); + if (delegate) { + delegate->onARAnchorAttached(getAnchor()); + } + } + + virtual void onARAnchorUpdated() { + std::shared_ptr delegate = getARNodeDelegate(); + if (delegate) { + delegate->onARAnchorUpdated(getAnchor()); + } + } + + virtual void onARAnchorRemoved() { + setAttached(false); + std::shared_ptr delegate = getARNodeDelegate(); + if (delegate) { + delegate->onARAnchorRemoved(); + } + } + +private: + + /* + It is possible to override the declarative system and directly set an anchor ID. + The VROARConstraintMatcher will first match nodes to anchors that have matching + IDs, prior to checking constraints. + */ + std::string _anchorId; + + /* + True if the VROARConstraintMatcher has found a match for this node. + */ + bool _isAttached; + + /* + Declarative AR nodes are kept hidden until they find a matching anchor. This way + their contents are not displayed to the user until they've been correctly anchored + to the real world. This is achieved by overriding VRONode::setHidden(). + */ + bool _internalHidden; + + /* + Delegate to respond to this node being attached / detached. + */ + std::weak_ptr _arNodeDelegate; + +}; + +#endif /* VROARDeclarativeNode_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROARDeclarativeNodeDelegate.h b/mobile/ios/ViroKit.framework/Headers/VROARDeclarativeNodeDelegate.h new file mode 100644 index 0000000..e9eed9d --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROARDeclarativeNodeDelegate.h @@ -0,0 +1,38 @@ +// +// VROARNodeDelegate.h +// ViroKit +// +// Created by Andy Chu on 7/3/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROARNodeDelegate_h +#define VROARNodeDelegate_h + +class VROARAnchor; + +class VROARDeclarativeNodeDelegate { +public: + + VROARDeclarativeNodeDelegate() {} + virtual ~VROARDeclarativeNodeDelegate() {} + + /* + Notifies the delegate that the node was attached to the given anchor. The + delegate should NOT hold onto the anchor. + */ + virtual void onARAnchorAttached(std::shared_ptr anchor) = 0; + + /* + Notifies the delegate that the underlying anchor was updated. The + delegate should NOT hold onto the anchor. + */ + virtual void onARAnchorUpdated(std::shared_ptr anchor) = 0; + + /* + Notifies the delegate that the underlying anchor was removed. + */ + virtual void onARAnchorRemoved() = 0; +}; + +#endif /* VROARNodeDelegate_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROARDeclarativePlane.h b/mobile/ios/ViroKit.framework/Headers/VROARDeclarativePlane.h new file mode 100644 index 0000000..a9d3e09 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROARDeclarativePlane.h @@ -0,0 +1,115 @@ +// +// VROARPlaneNode.h +// ViroRenderer +// +// Created by Andy Chu on 6/17/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROARPlaneNode_h +#define VROARPlaneNode_h + +#include "VROARPlaneAnchor.h" +#include "VROARDeclarativeNode.h" + +/* + This class is a nice container that associates the virtual (VRONode), the real (VROARAnchor) and + the constraints that bind them together. + */ +class VROARDeclarativePlane : public VROARDeclarativeNode { +public: + VROARDeclarativePlane(float minWidth, float minHeight, VROARPlaneAlignment alignment) : + _minWidth(minWidth), + _minHeight(minHeight), + _alignment(alignment) + {} + + virtual ~VROARDeclarativePlane() {} + + /* + Returns whether or not the given VROARAnchor fulfills this plane's requirements. + */ + bool hasRequirementsFulfilled(std::shared_ptr candidate) { + std::shared_ptr planeAnchor = std::dynamic_pointer_cast(candidate); + if (!planeAnchor) { + return false; + } + + if (planeAnchor->getExtent().x < _minWidth || planeAnchor->getExtent().z < _minHeight) { + return false; + } + + /* + The below alignment logic follows this table: + + Anchor Alignment | Android - ViroARPlane | iOS - ViroARPlane + Horizontal | n/a | Horizontal, Up, Down + Up | Up, Horizontal | n/a + Down | Down, Horizontal | n/a + Vertical | n/a | Vertical + + */ +#if VRO_PLATFORM_IOS + // For iOS, there's no differentiation between upwards and downwards plane, so + // they'll match "Horizontal" alignments. + switch (_alignment) { + case VROARPlaneAlignment::Horizontal: + case VROARPlaneAlignment::HorizontalUpward: + case VROARPlaneAlignment::HorizontalDownward: + if (planeAnchor->getAlignment() != VROARPlaneAlignment::Horizontal) { + return false; + } + break; + case VROARPlaneAlignment::Vertical: + if (planeAnchor->getAlignment() != VROARPlaneAlignment::Vertical) { + return false; + } + break; + } +#elif VRO_PLATFORM_ANDROID + // Android really only has 2 types of plane alignments, up and down. + switch (planeAnchor->getAlignment()) { + case VROARPlaneAlignment::HorizontalUpward: + if (_alignment != VROARPlaneAlignment::Horizontal + && _alignment != VROARPlaneAlignment::HorizontalUpward) { + return false; + } + break; + case VROARPlaneAlignment::HorizontalDownward: + if (_alignment != VROARPlaneAlignment::Horizontal + && _alignment != VROARPlaneAlignment::HorizontalDownward) { + return false; + } + } +#endif + + return true; + } + + void setMinWidth(float minWidth) { + _minWidth = minWidth; + } + float getMinWidth() { + return _minWidth; + } + + void setMinHeight(float minHeight) { + _minHeight = minHeight; + } + float getMinHeight() { + return _minHeight; + } + + void setAlignment(VROARPlaneAlignment alignment) { + _alignment = alignment; + } + VROARPlaneAlignment getAlignment() { + return _alignment; + } + +private: + float _minWidth; + float _minHeight; + VROARPlaneAlignment _alignment; +}; +#endif /* VROARPlaneNode_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROARDeclarativeSession.h b/mobile/ios/ViroKit.framework/Headers/VROARDeclarativeSession.h new file mode 100644 index 0000000..da54126 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROARDeclarativeSession.h @@ -0,0 +1,88 @@ +// +// VROARDeclarativeSession.h +// ViroKit +// +// Created by Raj Advani on 11/3/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROARDeclarativeSession_h +#define VROARDeclarativeSession_h + +#include "VROARSession.h" +#include "VROARConstraintMatcher.h" + +class VROARScene; +class VROARDeclarativeSessionDelegate; + +/* + VROARDeclarativeSession controls the 'declarative' style API for using AR. + In this paradigm, instead of directly responding to ARSessionDelegate methods, + the user simply specifies the requirements of the ARAnchor they're interested in + via a VROARDeclarativeNode, and then the user can immediately start adding + content to that node. Once an ARAnchor meeting the constraints is found, the + node (and all of its content) will be made visible. + + This largely simplifies the state handling with AR objects. To use this: + + 1. Create the VROARDeclarativeNode and set its requirements (e.g. min width and + height for a plane). + 2. Add the node to the VROARDeclarativeSession via addARNode. This adds the node + to the declarative session where it find an anchor that matches with it. + 3. Add the node to the VROARScene via VROARScene::addNode. This physically adds + the node to the scene. + + To use the declarative session you must first call VROARScene->initDeclarativeSession(). + */ +class VROARDeclarativeSession : public VROARSessionDelegate, public VROARConstraintMatcherDelegate, + public std::enable_shared_from_this { +public: + + VROARDeclarativeSession(); + virtual ~VROARDeclarativeSession(); + + void init(); + void setDelegate(std::shared_ptr delegate); + void setARSession(std::shared_ptr session); + + void addARImageTarget(std::shared_ptr target); + void removeARImageTarget(std::shared_ptr target); + + void addARNode(std::shared_ptr plane); + void removeARNode(std::shared_ptr plane); + void updateARNode(std::shared_ptr plane); + + void sceneWillAppear(); + void sceneWillDisappear(); + + // VROARSessionDelegate methods + virtual void anchorWasDetected(std::shared_ptr anchor); + virtual void anchorWillUpdate(std::shared_ptr anchor); + virtual void anchorDidUpdate(std::shared_ptr anchor); + virtual void anchorWasRemoved(std::shared_ptr anchor); + + // VROARConstraintMatcherDelegate methods + void anchorWasAttached(std::shared_ptr anchor); + void anchorWasDetached(std::shared_ptr anchor); + +private: + + std::weak_ptr _arSession; + std::weak_ptr _delegate; + std::shared_ptr _constraintMatcher; + std::vector> _nodes; + std::vector> _imageTargets; + +}; + +class VROARDeclarativeSessionDelegate { +public: + + virtual void anchorWasDetected(std::shared_ptr anchor) = 0; + virtual void anchorWillUpdate(std::shared_ptr anchor) = 0; + virtual void anchorDidUpdate(std::shared_ptr anchor) = 0; + virtual void anchorWasRemoved(std::shared_ptr anchor) = 0; + +}; + +#endif /* VROARDeclarativeSession_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROARFrame.h b/mobile/ios/ViroKit.framework/Headers/VROARFrame.h new file mode 100644 index 0000000..c1eb6fe --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROARFrame.h @@ -0,0 +1,90 @@ +// +// VROARFrame.h +// ViroKit +// +// Created by Raj Advani on 6/6/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROARFrame_h +#define VROARFrame_h + +#include "VROARPointCloud.h" + +#include +#include +#include + +class VROARCamera; +class VROARAnchor; +class VROARHitTestResult; +class VROMatrix4f; +enum class VROARHitTestResultType; +enum class VROCameraOrientation; + +/* + The continual output of a VROARSession. These frames contain the current camera + video image, camera parameters, and updated anchors. + */ +class VROARFrame { +public: + + VROARFrame() {} + virtual ~VROARFrame() {} + + /* + Get the timestamp, in seconds. + */ + virtual double getTimestamp() const = 0; + + /* + Contains information about the camera position, orientation, and imaging + parameters for this frame. + */ + virtual const std::shared_ptr &getCamera() const = 0; + + /* + Perform a hit test on the given point in the viewport. The coordinate + system is viewport pixels (e.g. the coordinate system in which + VROViewport is defined). + */ + virtual std::vector hitTest(int x, int y, std::set types) = 0; + + /* + Returns the affine transform to move from viewport space to camera + image space. Camera image space is the texture coordinate space of + the camera's image, ranging from (0,0) at the upper left to (1,1) on + the lower right. Viewport space is the coordinate space of the current + viewport, taking into account the current orientation. + + To render the camera image, either this transform should be applied to + the camera background's texture coordinates, or the *inverse* of this + transform should be applied to the camera background's vertices. + This ensures the camera image maps correctly to the current viewport and + orientation. + */ + virtual VROMatrix4f getViewportToCameraImageTransform() = 0; + + /* + Return the estimated intensity of ambient light in the physical scene. + */ + virtual float getAmbientLightIntensity() const = 0; + + /* + Return the estimate color temperature of ambient light in the physical scene. + */ + virtual float getAmbientLightColorTemperature() const = 0; + + /* + Get all the anchors representing tracked positions and objects in the + scene. + */ + virtual const std::vector> &getAnchors() const = 0; + + /* + Retrieves the point cloud from this frame. + */ + virtual std::shared_ptr getPointCloud() = 0; +}; + +#endif /* VROARFrame_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROARHitTestResult.h b/mobile/ios/ViroKit.framework/Headers/VROARHitTestResult.h new file mode 100644 index 0000000..6dca4dd --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROARHitTestResult.h @@ -0,0 +1,83 @@ +// +// VROARHitTestResult.h +// ViroRenderer +// +// Created by Raj Advani on 6/12/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROARHitTestResult_h +#define VROARHitTestResult_h + +#include +#include "VROARAnchor.h" + +/* + Types of hit test results: + + ExistingPlaneUsingExtent: Hit test found a plane for which we have an anchor, + and the hit location was within the plane's estimated + extent. + ExistingPlane: Hit test found a plane for which we have an anchor, but our hit + test did not take into account the estimated extent. The hit point + may be outside the actual extent of the surface. + EstimatedHorizontalPlane: Hit test found a plane, but one for which we have no + anchor. + Feature Point: Hit test found a point that the AR session believes is part of a + continuous surface. This surface may not be horizontal. + */ +enum class VROARHitTestResultType { + ExistingPlaneUsingExtent, + ExistingPlane, + EstimatedHorizontalPlane, + FeaturePoint, +}; + +/* + Return value of AR hit tests. AR hit tests determine anchors or + less defined features the user hits in the camera view. + */ +class VROARHitTestResult { +public: + + VROARHitTestResult(VROARHitTestResultType type, std::shared_ptr anchor, float distance, + VROMatrix4f worldTransform, VROMatrix4f localTransform) : + _type(type), _anchor(anchor), _distance(distance), _worldTransform(worldTransform), _localTransform(localTransform) {} + + /* + Get the type of hit test result. + */ + VROARHitTestResultType getType() const { return _type; } + + /* + Return the anchor associated with the hit test, if any. + */ + const std::shared_ptr getAnchor() const { return _anchor; } + + /* + Get the distance from the camera to the hit test result. + */ + float getDistance() const { return _distance; } + + /* + Get the position and orientation of the hit test result surface, in world coordinates. + */ + VROMatrix4f getWorldTransform() const { return _worldTransform; } + + /* + Get the position and orientation of the hit test result surface, in the coordinate + space of the anchor. Undefined if there is no anchor associated with this result. + */ + VROMatrix4f getLocalTransform() const { return _localTransform; } + +private: + + VROARHitTestResultType _type; + std::shared_ptr _anchor; + float _distance; + VROMatrix4f _worldTransform; + VROMatrix4f _localTransform; + +}; + +#endif /* VROARHitTestResult_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROARImageAnchor.h b/mobile/ios/ViroKit.framework/Headers/VROARImageAnchor.h new file mode 100644 index 0000000..689842c --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROARImageAnchor.h @@ -0,0 +1,32 @@ +// +// VROARImageAnchor.h +// ViroKit +// +// Created by Andy Chu on 1/30/18. +// Copyright © 2018 Viro Media. All rights reserved. +// + +#ifndef VROARImageAnchor_h +#define VROARImageAnchor_h + +#include "VROARAnchor.h" +#include "VROARImageTarget.h" + +class VROARImageAnchor : public VROARAnchor { + +public: + + VROARImageAnchor(std::shared_ptr imageTarget) : + _imageTarget(imageTarget) {} + virtual ~VROARImageAnchor() {} + + std::shared_ptr getImageTarget() { + return _imageTarget; + } + +private: + std::shared_ptr _imageTarget; + +}; + +#endif /* VROARImageAnchor_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROARImageTarget.h b/mobile/ios/ViroKit.framework/Headers/VROARImageTarget.h new file mode 100644 index 0000000..ab34c69 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROARImageTarget.h @@ -0,0 +1,45 @@ +// +// VROARImageTarget.h +// ViroKit +// +// Created by Andy Chu on 1/30/18. +// Copyright © 2018 Viro Media. All rights reserved. +// + +#ifndef VROARImageTarget_h +#define VROARImageTarget_h + +#include +#include "VROARSession.h" + +/* + The orientation of the given target image. + */ +enum class VROImageOrientation { + Up, + Down, + Left, + Right +}; + +class VROARImageTarget { +public: + + VROARImageTarget() {} + virtual ~VROARImageTarget() {} + + virtual void initWithTrackingImpl(VROImageTrackingImpl impl) = 0; + + void setAnchor(std::shared_ptr anchor) { + _anchor = anchor; + } + + std::shared_ptr getAnchor() { + return _anchor.lock(); + } + +private: + std::weak_ptr _anchor; +}; + +#endif /* VROARImageTarget_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROARImageTargetiOS.h b/mobile/ios/ViroKit.framework/Headers/VROARImageTargetiOS.h new file mode 100644 index 0000000..428a468 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROARImageTargetiOS.h @@ -0,0 +1,46 @@ +// +// VROARImageTargetiOS.h +// ViroKit +// +// Created by Andy Chu on 1/30/18. +// Copyright © 2018 Viro Media. All rights reserved. +// + +#ifndef VROARImageTargetiOS_h +#define VROARImageTargetiOS_h + +#include "VROARImageTarget.h" +#include + +@class ARReferenceImage; + +class VROARImageTargetiOS : public VROARImageTarget { +public: + VROARImageTargetiOS(UIImage *sourceImage, VROImageOrientation orientation, float physicalWidth); + + virtual ~VROARImageTargetiOS(); + + void initWithTrackingImpl(VROImageTrackingImpl impl); + + UIImage *getSourceImage() { + return _sourceImage; + } + +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110300 + ARReferenceImage *getARReferenceImage(); +#endif +private: + UIImage *_sourceImage; + VROImageOrientation _orientation; + float _physicalWidth; + + VROImageTrackingImpl _currentImpl; + +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110300 + ARReferenceImage *_referenceImage; +#endif +}; + + +#endif /* VROARImageTargetiOS_h */ + diff --git a/mobile/ios/ViroKit.framework/Headers/VROARNode.h b/mobile/ios/ViroKit.framework/Headers/VROARNode.h new file mode 100644 index 0000000..f5c7b99 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROARNode.h @@ -0,0 +1,46 @@ +// +// VROARNode.h +// ViroKit +// +// Created by Andy Chu on 6/16/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROARNode_h +#define VROARNode_h + +#include "VRONode.h" + +class VROARAnchor; + +/* + ARNode is a specialized Node that corresponds to a detected ARAnchor. Each ARNode is + continually updated to stay in sync with its corresponding ARAnchor: if the anchor's + position, orientation, or other detected properties change, the ARNode will be changed + as well. + */ +class VROARNode : public VRONode { +public: + VROARNode() : _pauseUpdates(false) {} + virtual ~VROARNode() {} + + void setAnchor(std::shared_ptr anchor) { + _anchor = anchor; + } + std::shared_ptr getAnchor() { + return _anchor.lock(); + } + + void setPauseUpdates(bool pauseUpdates); + bool shouldPauseUpdates() { + return _pauseUpdates; + } + +protected: + + std::weak_ptr _anchor; + bool _pauseUpdates; + +}; + +#endif /* VROARNode_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROARNodeDelegateiOS.h b/mobile/ios/ViroKit.framework/Headers/VROARNodeDelegateiOS.h new file mode 100644 index 0000000..ea1994b --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROARNodeDelegateiOS.h @@ -0,0 +1,46 @@ +// +// VROARNodeDelegateiOS.h +// ViroKit +// +// Created by Andy Chu on 7/3/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROARNodeDelegateiOS_h +#define VROARNodeDelegateiOS_h + +#import "VROARDeclarativeNodeDelegate.h" +#import + +@protocol VROARNodeDelegateProtocol +@required +- (void)onARAnchorAttached:(std::shared_ptr) anchor; +- (void)onARAnchorUpdated:(std::shared_ptr) anchor; +- (void)onARAnchorRemoved; +@end + +class VROARNodeDelegateiOS : public VROARDeclarativeNodeDelegate { +public: + VROARNodeDelegateiOS(id delegate) : + _delegate(delegate) {} + + virtual ~VROARNodeDelegateiOS() {} + + virtual void onARAnchorAttached(std::shared_ptr anchor) { + [_delegate onARAnchorAttached:anchor]; + } + + virtual void onARAnchorUpdated(std::shared_ptr anchor) { + [_delegate onARAnchorUpdated:anchor]; + } + + virtual void onARAnchorRemoved() { + [_delegate onARAnchorRemoved]; + } + +private: + __weak id _delegate; + +}; +#endif /* VROARNodeDelegateiOS_h */ + diff --git a/mobile/ios/ViroKit.framework/Headers/VROARPlaneAnchor.h b/mobile/ios/ViroKit.framework/Headers/VROARPlaneAnchor.h new file mode 100644 index 0000000..1a2ba39 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROARPlaneAnchor.h @@ -0,0 +1,84 @@ +// +// VROARPlaneAnchor.h +// ViroRenderer +// +// Created by Raj Advani on 6/11/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROARPlaneAnchor_h +#define VROARPlaneAnchor_h + +#include "VROARAnchor.h" +#include "VROVector3f.h" + +enum class VROARPlaneAlignment { + Horizontal = 0x1, + HorizontalUpward = 0x11, + HorizontalDownward = 0x101, + Vertical = 0x10, + NonHorizontal = 0x0 +}; + +/* + Anchor representing a planar surface. + */ +class VROARPlaneAnchor : public VROARAnchor { + +public: + + VROARPlaneAnchor() {} + virtual ~VROARPlaneAnchor() {} + + /* + The approximate alignment of the detected plane. + */ + VROARPlaneAlignment getAlignment() const { + return _alignment; + } + void setAlignment(VROARPlaneAlignment alignment) { + _alignment = alignment; + } + + /* + The center point of the detected plane. Relative to the parent + anchor position. + */ + VROVector3f getCenter() const { + return _center; + } + void setCenter(VROVector3f center) { + _center = center; + } + + /* + The width and length of the detected plane. + */ + VROVector3f getExtent() const { + return _extent; + } + void setExtent(VROVector3f extent) { + _extent = extent; + } + +private: + + /* + The approximate alignment of the detected plane. + */ + VROARPlaneAlignment _alignment; + + /* + The center point of the detected plane. Relative to the parent + anchor position. + */ + VROVector3f _center; + + /* + The width and length of the detected plane. + */ + VROVector3f _extent; + +}; + +#endif /* VROARPlaneAnchor_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROARPointCloud.h b/mobile/ios/ViroKit.framework/Headers/VROARPointCloud.h new file mode 100644 index 0000000..5ad6375 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROARPointCloud.h @@ -0,0 +1,48 @@ +// +// VROARPointCloud.h +// ViroKit +// +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROARPointCloud_h +#define VROARPointCloud_h + +#include +#include + +class VROVector4f; +class VROMatrix3f; + +// TODO: possible need to guard uint64_t usage with #ifdef UINT64_MAX, seems fine on iOS/Android +class VROARPointCloud { +public: + VROARPointCloud() {} + VROARPointCloud(std::vector points, std::vector identifiers) : + _points(points), + _identifiers(identifiers) {} + + ~VROARPointCloud() {} + + /* + Retrieves the point that make up this point cloud. Note: the 4th value in the + vector is a "confidence" value only available on Android. + */ + std::vector getPoints() { + return _points; + } + + /* + Retrieves the identifiers corresponding to each point. Note: iOS only (it's empty + on Android). + */ + std::vector getIdentifiers() { + return _identifiers; + } + +private: + std::vector _points; + std::vector _identifiers; // used only on iOS (Android does not provide identifiers). +}; + +#endif /* VROARPointCloud_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROARScene.h b/mobile/ios/ViroKit.framework/Headers/VROARScene.h new file mode 100644 index 0000000..e1d07ba --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROARScene.h @@ -0,0 +1,120 @@ +// +// VROARScene.h +// ViroKit +// +// Created by Andy Chu on 6/13/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROARScene_h +#define VROARScene_h + +#include +#include "VROARSession.h" +#include "VROScene.h" + +class VROARAnchor; +class VROARDeclarativeSession; +class VROARImperativeSession; +class VROPointCloudEmitter; + +class VROARSceneDelegate { +public: + virtual void onTrackingInitialized() = 0; + virtual void onAmbientLightUpdate(float ambientLightIntensity, float colorTemperature) = 0; +}; + +class VROARScene : public VROScene { +public: + VROARScene() : + _hasTrackingInitialized(false), + _displayPointCloud(false), + _pointCloudSurfaceScale(VROVector3f(.01, .01, 1)), + _pointCloudMaxPoints(500) { + _pointCloudNode = std::make_shared(); + _detectionTypes = { VROAnchorDetection::PlanesHorizontal }; //default is horizontal + }; + virtual ~VROARScene(); + + void initDeclarativeSession(); + void initImperativeSession(); + std::shared_ptr getSessionDelegate(); + + void setARSession(std::shared_ptr arSession); + void setDriver(std::shared_ptr driver); + + /* + Add AR nodes. These are directly added to the root node. + */ + void addNode(std::shared_ptr node); + + /* + The set of anchor detection types we want to enable for this scene. + */ + void setAnchorDetectionTypes(std::set detectionTypes); + + /* + Set true to display/render the point cloud particles. + */ + void displayPointCloud(bool display); + + /* + Reset the point cloud surface to the default. + */ + void resetPointCloudSurface(); + + /* + Set the surface to use for the individual point cloud particles. + */ + void setPointCloudSurface(std::shared_ptr surface); + + /* + Set the scale of the individual point cloud particles. + */ + void setPointCloudSurfaceScale(VROVector3f scale); + + /* + Sets the max number of point cloud points to display/render at any one time. + */ + void setPointCloudMaxPoints(int maxPoints); + + void setDelegate(std::shared_ptr delegate); + void trackingHasInitialized(); + void updateAmbientLight(float intensity, float colorTemperature); + + void willAppear(); + void willDisappear(); + + std::shared_ptr getDeclarativeSession() { + return _declarativeSession; + } + std::shared_ptr getImperativeSession() { + return _imperativeSession; + } + +private: + std::set _detectionTypes; + + std::weak_ptr _arSession; + std::weak_ptr _driver; + std::shared_ptr _declarativeSession; + std::shared_ptr _imperativeSession; + + std::shared_ptr _pointCloudNode; + std::shared_ptr _pointCloudEmitter; + std::weak_ptr _delegate; + bool _hasTrackingInitialized; + + /* Point Cloud Properties */ + bool _displayPointCloud; + std::shared_ptr _pointCloudSurface; + VROVector3f _pointCloudSurfaceScale; + int _pointCloudMaxPoints; + + /* + Creates an instance of VROPointCloudEmitter if possible. + */ + std::shared_ptr createPointCloudEmitter(); +}; + +#endif /* VROARScene_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROARSceneController.h b/mobile/ios/ViroKit.framework/Headers/VROARSceneController.h new file mode 100644 index 0000000..0ae25ec --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROARSceneController.h @@ -0,0 +1,25 @@ +// +// VROARSceneController.h +// ViroKit +// +// Created by Andy Chu on 6/14/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROARSceneController_h +#define VROARSceneController_h + +#include "VROSceneController.h" +#include "VROARScene.h" +#include "VROARDeclarativeSession.h" + +class VROARSceneController : public VROSceneController { +public: + VROARSceneController(); + virtual ~VROARSceneController(); + + virtual void onSceneWillAppear(VRORenderContext *context, std::shared_ptr driver); + virtual void onSceneWillDisappear(VRORenderContext *context, std::shared_ptr driver); +}; + +#endif /* VROARSceneController_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROARSceneDelegateiOS.h b/mobile/ios/ViroKit.framework/Headers/VROARSceneDelegateiOS.h new file mode 100644 index 0000000..fbcb51a --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROARSceneDelegateiOS.h @@ -0,0 +1,59 @@ +// +// VROARSceneDelegateiOS.h +// ViroKit +// +// Created by Andy Chu on 7/10/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROARSceneDelegateiOS_h +#define VROARSceneDelegateiOS_h + +#import "VROARScene.h" +#import "VROARDeclarativeSession.h" +#import + +@protocol VROARSceneDelegateProtocol +@required +- (void)onTrackingInitialized; +- (void)onAmbientLightUpdate:(float)intensity colorTemperature:(float)colorTemperature; +- (void)onAnchorFound:(std::shared_ptr)anchor; +- (void)onAnchorUpdated:(std::shared_ptr)anchor; +- (void)onAnchorRemoved:(std::shared_ptr)anchor; +@end + +class VROARSceneDelegateiOS : public VROARSceneDelegate, public VROARDeclarativeSessionDelegate { +public: + VROARSceneDelegateiOS(id delegate) : + _delegate(delegate) {} + + virtual ~VROARSceneDelegateiOS() {} + + virtual void onTrackingInitialized() { + [_delegate onTrackingInitialized]; + } + + virtual void anchorWasDetected(std::shared_ptr anchor) { + [_delegate onAnchorFound:anchor]; + } + + virtual void anchorWillUpdate(std::shared_ptr anchor) { + + } + + virtual void anchorDidUpdate(std::shared_ptr anchor) { + [_delegate onAnchorUpdated:anchor]; + } + + virtual void anchorWasRemoved(std::shared_ptr anchor) { + [_delegate onAnchorRemoved:anchor]; + } + + virtual void onAmbientLightUpdate(float intensity, float colorTemperature) { + [_delegate onAmbientLightUpdate:intensity colorTemperature:colorTemperature]; + } + +private: + __weak id _delegate; +}; +#endif /* VROARSceneDelegateiOS_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROARSession.h b/mobile/ios/ViroKit.framework/Headers/VROARSession.h new file mode 100644 index 0000000..6b3e65f --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROARSession.h @@ -0,0 +1,253 @@ +// +// VROARSession.h +// ViroKit +// +// Created by Raj Advani on 6/6/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROARSession_h +#define VROARSession_h + +#include +#include +#include "VROLog.h" +#include "VROMatrix4f.h" + +class VROARAnchor; +class VROARFrame; +class VROTexture; +class VROViewport; +class VROScene; +class VROARNode; +class VRONode; +class VROARSessionDelegate; +class VROARImageTarget; +enum class VROCameraOrientation; //defined in VROCameraTexture.h + +/* + Determines if the AR session tracks orientation only, or + tracks position and orientation. + */ +enum class VROTrackingType { + DOF3, + DOF6 +}; + +/* + The types of objects the AR session should scan each frame + to detect. A VROARAnchor is created for each detected object. + */ +enum class VROAnchorDetection { + None, + PlanesHorizontal, + PlanesVertical +}; + +/* + The world alignment chosen at the start of the AR Session. + */ +enum class VROWorldAlignment { + Gravity, + GravityAndHeading, + Camera +}; + +/* + The video quality that the ARSession should *attempt* to use. + */ +enum class VROVideoQuality { + Low, + High +}; + +/* + The implementation of image tracking to use. + */ +enum class VROImageTrackingImpl { + ARKit, + Viro // not available for devs to use yet. +}; + +/* + Manages the device camera and motion tracking for AR. + */ +class VROARSession { +public: + + VROARSession(VROTrackingType trackingType, VROWorldAlignment worldAlignment) : + _trackingType(trackingType), + _worldAlignment(worldAlignment), + _imageTrackingImpl(VROImageTrackingImpl::ARKit) {} + virtual ~VROARSession() {} + + VROTrackingType getTrackingType() const { + return _trackingType; + } + + VROWorldAlignment getWorldAlignment() const { + return _worldAlignment; + } + + VROImageTrackingImpl getImageTrackingImpl() const { + return _imageTrackingImpl; + } + + /* + The scene associated with this session. + */ + const std::shared_ptr getScene() const { + return _scene; + } + virtual void setScene(std::shared_ptr scene) { + _scene = scene; + } + + /* + The delegate set by the application to respond to events from the + AR session. + */ + std::shared_ptr getDelegate() { + return _delegate.lock(); + } + virtual void setDelegate(std::shared_ptr delegate) { + _delegate = delegate; + } + + /* + Start the session. The session cannot be started until its + scene, viewport, and orientation have been set. + */ + virtual void run() = 0; + + /* + Pause the session. No new frames will be created. + */ + virtual void pause() = 0; + + /* + Resets the VROARSession depending on the given boolean flags. If no flags + are set to true, then nothing will happen. + */ + virtual void resetSession(bool resetTracking, bool removeAnchors) = 0; + + /* + Returns true if at least one frame has been generated. + */ + virtual bool isReady() const = 0; + + /* + Set what anchors will be auto-detected by the AR session. Returns true if successful (e.g. + if the device supports these forms of anchor detection). + */ + virtual bool setAnchorDetection(std::set types) = 0; + + /* + Adds an image target that should be tracked by this session. + */ + virtual void addARImageTarget(std::shared_ptr target) = 0; + + /* + Removes an image target that should no longer be tracked by this session and the + corresponding anchor that matched with the target. If the image target has not + been found yet, then the given anchor should be nullptr + */ + virtual void removeARImageTarget(std::shared_ptr target) = 0; + + /* + Add or remove anchors from the session. These methods are used for + placing anchors that are *not* auto-detected. The AR session will + not keep these anchors up to date; that is the responsibility of the + system that added the anchor. + */ + virtual void addAnchor(std::shared_ptr anchor) = 0; + virtual void removeAnchor(std::shared_ptr anchor) = 0; + + /* + Invoke to update the anchor's node with the latest transformation + data contained in the anchor, alerting delegates in the process. + */ + virtual void updateAnchor(std::shared_ptr anchor) = 0; + + /* + Invoke each rendering frame. Updates the AR session with the latest + AR data, and returns this in a VROARFrame. The camera background is + updated at this point as well. + */ + virtual std::unique_ptr &updateFrame() = 0; + + /* + Get the last frame that was generated via updateFrame(). + */ + virtual std::unique_ptr &getLastFrame() = 0; + + /* + Get the background texture for this AR session. The contents of this + texture are updated after each call to updateFrame(). + */ + virtual std::shared_ptr getCameraBackgroundTexture() = 0; + + /* + Invoke when the viewport changes. The AR engine may adjust its camera + background and projection matrices in response to a viewport change. + */ + virtual void setViewport(VROViewport viewport) = 0; + + /* + Invoke when orientation changes, so the AR engine can make the + necessary adjustments. + */ + virtual void setOrientation(VROCameraOrientation orientation) = 0; + + /* + Sets AR world origin to the given transform. + */ + virtual void setWorldOrigin(VROMatrix4f relativeTransform) = 0; + + /* + Sets whether or not to enable autofocus. + */ + virtual void setAutofocus(bool enabled) = 0; + + /* + Sets the video quality to use. + */ + virtual void setVideoQuality(VROVideoQuality quality) = 0; + +private: + + VROTrackingType _trackingType; + VROWorldAlignment _worldAlignment; + VROImageTrackingImpl _imageTrackingImpl; + std::shared_ptr _scene; + std::weak_ptr _delegate; + +}; + +class VROARSessionDelegate { +public: + + /* + Invoked whenever an anchor is detected by the AR session, or when an + anchor is manually added to the session via addAnchor(). The application + can choose to add a VROARNode to associate virtual content with this + anchor by setting a VROARNode on the anchor. + */ + virtual void anchorWasDetected(std::shared_ptr anchor) = 0; + + /* + Invoked just before and after the anchor's node's properties are updated + to match the current state of the anchor. + */ + virtual void anchorWillUpdate(std::shared_ptr anchor) = 0; + virtual void anchorDidUpdate(std::shared_ptr anchor) = 0; + + /* + Invoked when an anchor is removed from the AR session, along with its + corresponding node (now detached from the scene). + */ + virtual void anchorWasRemoved(std::shared_ptr anchor) = 0; + +}; + +#endif /* VROARSession_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROARShadow.h b/mobile/ios/ViroKit.framework/Headers/VROARShadow.h new file mode 100644 index 0000000..cfe5d59 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROARShadow.h @@ -0,0 +1,43 @@ +// +// VROARTransparentShadow.h +// ViroKit +// +// Created by Raj Advani on 8/23/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROARTShadow_h +#define VROARTShadow_h + +#include + +class VROMaterial; +class VROShaderModifier; + +/* + Apply this to any material to turn it into a "transparent shadow" + material. These materials are transparent but able to receive shadows + from the shadow-mapping system. + + They achieve this through a combination of shader modifiers that: + + 1. Make the color of the surface black, with alpha 0, + 2. Increase the alpha if the surface is in shadow. + + This is used to cast virtual shadows on real-world scenes. + */ +class VROARShadow { +public: + + static void apply(std::shared_ptr material); + static void remove(std::shared_ptr material); + +private: + + static std::shared_ptr createSurfaceModifier(); + static std::shared_ptr createFragmentModifier(); + static std::shared_ptr createLightingModifier(); + +}; + +#endif /* VROARShadow_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROAction.h b/mobile/ios/ViroKit.framework/Headers/VROAction.h new file mode 100644 index 0000000..23104f6 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROAction.h @@ -0,0 +1,191 @@ +// +// VROAction.h +// ViroRenderer +// +// Created by Raj Advani on 1/12/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROAction_h +#define VROAction_h + +#include +#include +#include "VROTime.h" +#include "VROTimingFunction.h" + +class VRONode; + +static const int VROActionRepeatForever = -1; + +enum class VROActionType { + PerFrame, + Timed, + Animated +}; + +enum class VROActionDurationType { + Count, + Seconds +}; + +/* + Actions are callbacks that can be set to run on VRONodes. They can + be used to animate properties of nodes, or to set repeating actions. + */ +class VROAction : public std::enable_shared_from_this { + +public: + + /* + For per-frame actions, the given function will be run once per frame. These will + run either perpetually, or for the given number of frames or actions. + */ + static std::shared_ptr perpetualPerFrameAction(std::function action); + static std::shared_ptr repeatedPerFrameActionFrames(std::function action, int repeatCount); + static std::shared_ptr repeatedPerFrameActionSeconds(std::function action, float duration); + + /* + For timed actions, the given function will be run each frame until the given number of + seconds. The function takes a variable t that runs from [0,1] over the course of the duration, + transformed by the provided timing function. + */ + static std::shared_ptr timedAction(std::function action, + VROTimingFunctionType timingFunction, + float duration); + + /* + For animated actions, the given function will be run once, within a VROTransaction configured + to use the given timing function and duration. These are merely helper functions that sit over + the VROTransaction animation framework. + */ + static std::shared_ptr perpetualAnimatedAction(std::function action, + VROTimingFunctionType timingFunction, + float duration); + static std::shared_ptr repeatedAnimatedAction(std::function action, + VROTimingFunctionType timingFunction, + float duration, int repeatCount); + + VROAction(VROActionType type, VROActionDurationType durationType) : + _type(type), + _durationType(durationType), + _executed(false), + _aborted(false) + {} + virtual ~VROAction() {} + + VROActionType getType() const { + return _type; + } + float getDuration() const { + return _duration; + } + bool shouldRepeat() const { + if (_aborted) { + return false; + } + else if (_durationType == VROActionDurationType::Count) { + return _repeatCount > 0 || _repeatCount == VROActionRepeatForever; + } + else { + return (VROTimeCurrentSeconds() - _startTime) < _duration; + } + } + + /* + Internal: executes the action. + */ + virtual void execute(VRONode *node) = 0; + +protected: + + VROActionType _type; + VROActionDurationType _durationType; + + /* + True after the action has been executed at least once. + */ + bool _executed; + + /* + Duration of the action, in seconds. Only valid for animated actions, + defines the duration of *each* repetition of the animation. + */ + float _duration; + + /* + The number of frames to repeat this action, or the number of seconds to + repeat the action. + */ + int _repeatCount; + float _repeatDuration; + + /* + The time at which the action was first executed. + */ + float _startTime; + + /* + True if the action was manually aborted by way of a callback returning + false. + */ + bool _aborted; + + /* + Internal: called bfore and after executing the action. Decrements repeat count. + */ + void preExecute(VRONode *node); + void postExecute(VRONode *node); + +}; + +class VROActionPerFrame : public VROAction { +public: + + VROActionPerFrame(std::function action, VROActionDurationType durationType) : + VROAction(VROActionType::PerFrame, durationType), + _action(action) + {} + virtual ~VROActionPerFrame() {} + virtual void execute(VRONode *node); + +private: + std::function _action; + +}; + +class VROActionTimed : public VROAction { +public: + + VROActionTimed(std::function action, VROTimingFunctionType timingFunctionType) : + VROAction(VROActionType::Timed, VROActionDurationType::Seconds), + _action(action), + _timingFunction(VROTimingFunction::forType(timingFunctionType)) + {} + virtual ~VROActionTimed() {} + virtual void execute(VRONode *node); + +private: + std::function _action; + std::unique_ptr _timingFunction; +}; + +class VROActionAnimated : public VROAction { +public: + + VROActionAnimated(std::function action, VROTimingFunctionType timingFunctionType) : + VROAction(VROActionType::Animated, VROActionDurationType::Count), + _action(action), + _timingFunctionType(timingFunctionType) + {} + virtual ~VROActionAnimated() {} + virtual void execute(VRONode *node); + +private: + std::function _action; + VROTimingFunctionType _timingFunctionType; +}; + + + +#endif /* VROAction_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROAllocationTracker.h b/mobile/ios/ViroKit.framework/Headers/VROAllocationTracker.h new file mode 100644 index 0000000..04fe8fa --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROAllocationTracker.h @@ -0,0 +1,72 @@ +// +// VROAllocationTracker.h +// ViroRenderer +// +// Created by Raj Advani on 10/21/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef __VROAllocationTracker__ +#define __VROAllocationTracker__ + +#include + +#define TRACK_MEMORY_ALLOCATIONS 0 + +#if TRACK_MEMORY_ALLOCATIONS + #define ALLOCATION_TRACKER_SET(x, bytes) VROAllocationTracker::set(VROAllocationBucket::x, bytes) + #define ALLOCATION_TRACKER_ADD(x, bytes) VROAllocationTracker::add(VROAllocationBucket::x, bytes) + #define ALLOCATION_TRACKER_SUB(x, bytes) VROAllocationTracker::subtract(VROAllocationBucket::x, bytes) + #define ALLOCATION_TRACKER_RESIZE(x, bytesOld, bytesNew) VROAllocationTracker::resize(VROAllocationBucket::x, bytesOld, bytesNew) + #define ALLOCATION_TRACKER_PRINT() VROAllocationTracker::print() + #define ALLOCATION_TRACKER_PRINT_NOW() VROAllocationTracker::printNow() + + #define VRO_MALLOC(x, bytes) malloc(bytes), ALLOCATION_TRACKER_ADD(x, bytes) + #define VRO_FREE(x, ptr, bytes) free(ptr), ALLOCATION_TRACKER_SUB(x, bytes) + #define VRO_REALLOC(x, ptr, bytesOld, bytesNew) realloc(ptr, bytesNew), ALLOCATION_TRACKER_RESIZE(x, bytesOld, bytesNew) +#else + #define ALLOCATION_TRACKER_SET(x, bytes) ((void)0) + #define ALLOCATION_TRACKER_ADD(x, bytes) ((void)0) + #define ALLOCATION_TRACKER_SUB(x, bytes) ((void)0) + #define ALLOCATION_TRACKER_RESIZE(x, bytesOld, bytesNew) ((void)0) + #define ALLOCATION_TRACKER_PRINT() ((void)0) + #define ALLOCATION_TRACKER_PRINT_NOW() ((void)0) + #define VRO_MALLOC(x, bytes) malloc(bytes) + #define VRO_FREE(x, ptr, bytes) free(ptr) + #define VRO_REALLOC(x, ptr, bytesOld, bytesNew) realloc(ptr, bytesNew) +#endif + +enum class VROAllocationBucket { + Scenes, + Nodes, + Geometry, + Materials, + MaterialSubstrates, + Textures, + TextureSubstrates, + Shaders, + ShaderModifiers, + VideoTextures, + VideoTextureCaches, + Typefaces, + Glyphs, + RenderTargets, + NUM_BUCKETS +}; + +enum class VROLayerType : int8_t; + +class VROAllocationTracker { + +public: + static void set(VROAllocationBucket bucket, uint32_t bytes); + static void add(VROAllocationBucket bucket, uint32_t bytes); + static void subtract(VROAllocationBucket bucket, uint32_t bytes); + static void resize(VROAllocationBucket bucket, uint32_t bytesOld, uint32_t bytesNew); + + static void print(); + static void printNow(); + +}; + +#endif /* defined(__VROAllocationTracker__) */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROAnimatable.h b/mobile/ios/ViroKit.framework/Headers/VROAnimatable.h new file mode 100644 index 0000000..f543a9d --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROAnimatable.h @@ -0,0 +1,33 @@ +// +// VROAnimatable.h +// ViroRenderer +// +// Created by Raj Advani on 12/17/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VROAnimatable_h +#define VROAnimatable_h + +#include +#include +#include "VROVector3f.h" +#include +#include + +class VROAnimation; + +/* + Marker class for objects that have animatable properties. + */ +class VROAnimatable : public std::enable_shared_from_this { +public: + + void animate(std::shared_ptr animation); + + virtual void onAnimationFinished(){ + //No-op + } +}; + +#endif /* VROAnimatable_hpp */ \ No newline at end of file diff --git a/mobile/ios/ViroKit.framework/Headers/VROAnimation.h b/mobile/ios/ViroKit.framework/Headers/VROAnimation.h new file mode 100644 index 0000000..82effb0 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROAnimation.h @@ -0,0 +1,85 @@ +// +// VROAnimation.h +// ViroRenderer +// +// Created by Raj Advani on 12/15/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VROAnimation_h +#define VROAnimation_h + +#include +#include +#include +#include "VROAnimatable.h" + +/* + Represents the animation of a property. Subclasses identify the type + of the property (e.g. animating a floating point value, animating a + VROVector3f, etc.). + */ +class VROAnimation { + +public: + + VROAnimation() {} + VROAnimation(std::function finishCallback) : + _finishCallback(finishCallback) + {} + + virtual ~VROAnimation() {} + + /* + Set the animatable. This is typically the object holding the + property to be animated. It is stored by a weak_ptr so we can + ensure it hasn't been deallocated before invoking the animation + each frame. + */ + void setAnimatable(std::shared_ptr animatable) { + _animatable = animatable; + } + + /* + Set a function to invoke when the animation completes. + */ + void setFinishCallback(std::function callback) { + _finishCallback = callback; + } + + /* + Move the property to its value corresponding to t [0, 1]. + */ + virtual void processAnimationFrame(float t) = 0; + + /* + Immediately finish this animation by moving its value to the + end state. + */ + virtual void finish() = 0; + + /* + Invoke after the animation is completed. + */ + void onTermination() { + finish(); + + std::shared_ptr animatable = _animatable.lock(); + if (animatable == nullptr){ + return; + } + + animatable->onAnimationFinished(); + if (_finishCallback) { + _finishCallback(animatable.get()); + } + } + +protected: + + std::weak_ptr _animatable; + std::function _finishCallback; + +}; + +#endif /* VROAnimation_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROAnimationChain.h b/mobile/ios/ViroKit.framework/Headers/VROAnimationChain.h new file mode 100644 index 0000000..aac5dc9 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROAnimationChain.h @@ -0,0 +1,62 @@ +// +// VROAnimationChain.h +// ViroRenderer +// +// Created by Raj Advani on 12/28/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROAnimationChain_h +#define VROAnimationChain_h + +#include +#include "VROExecutableAnimation.h" + +enum class VROAnimationChainExecution { + Serial, + Parallel +}; + +/* + An animation chain is a list of animation groups that execute + serially. This follows the composite pattern. + */ +class VROAnimationChain : public VROExecutableAnimation, public std::enable_shared_from_this { + +public: + + VROAnimationChain(std::vector> &animations, + VROAnimationChainExecution execution) : + _animations(animations), + _execution(execution), + _numComplete(0) {} + virtual ~VROAnimationChain() {} + + std::shared_ptr copy(); + + void execute(std::shared_ptr node, + std::function onFinished); + + // This function adds an animation to the end of the chain. + void addAnimation(std::shared_ptr animation); + void pause(); + void resume(); + void terminate(bool jumpToEnd); + + std::string toString() const; + +private: + + void executeSerial(std::shared_ptr node, int groupIndex, + std::function onFinished); + void executeParallel(std::shared_ptr node, + std::function onFinished); + void animateGroup(int groupIndex); + + std::vector> _animations; + VROAnimationChainExecution _execution; + int _numComplete; + +}; + +#endif /* VROAnimationChain_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROAnimationFloat.h b/mobile/ios/ViroKit.framework/Headers/VROAnimationFloat.h new file mode 100644 index 0000000..f74998e --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROAnimationFloat.h @@ -0,0 +1,80 @@ +// +// VROAnimationFloat.h +// ViroRenderer +// +// Created by Raj Advani on 12/17/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VROAnimationFloat_h +#define VROAnimationFloat_h + +#include "VROAnimation.h" +#include "VROAnimatable.h" +#include "VROMath.h" + +class VROAnimationFloat : public VROAnimation { + +public: + + VROAnimationFloat(std::function method, + float start, float end) : + VROAnimation(), + _keyTimes({ 0, 1 }), + _keyValues({ start, end }), + _method(method) + {} + + VROAnimationFloat(std::function method, + float start, + float end, + std::function finishCallback) : + VROAnimation(finishCallback), + _keyTimes({ 0, 1 }), + _keyValues({ start, end }), + _method(method) + {} + + VROAnimationFloat(std::function method, + std::vector keyTimes, std::vector keyValues) : + VROAnimation(), + _keyTimes(keyTimes), + _keyValues(keyValues), + _method(method) + {} + + VROAnimationFloat(std::function method, + std::vector keyTimes, + std::vector keyValues, + std::function finishCallback) : + VROAnimation(finishCallback), + _keyTimes(keyTimes), + _keyValues(keyValues), + _method(method) + {} + + void processAnimationFrame(float t) { + float value = VROMathInterpolateKeyFrame(t, _keyTimes, _keyValues); + + std::shared_ptr animatable = _animatable.lock(); + if (animatable) { + _method(animatable.get(), value); + } + } + + void finish() { + std::shared_ptr animatable = _animatable.lock(); + if (animatable) { + _method(animatable.get(), _keyValues.back()); + } + } + +private: + + std::vector _keyTimes; + std::vector _keyValues; + std::function _method; + +}; + +#endif /* VROAnimationFloat_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROAnimationGroup.h b/mobile/ios/ViroKit.framework/Headers/VROAnimationGroup.h new file mode 100644 index 0000000..63cf89f --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROAnimationGroup.h @@ -0,0 +1,78 @@ +// +// VROAnimationGroup.h +// ViroRenderer +// +// Created by Raj Advani on 12/28/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROAnimationGroup_h +#define VROAnimationGroup_h + +#include +#include +#include +#include "VROPropertyAnimation.h" +#include "VROMaterialAnimation.h" +#include "VROTimingFunction.h" +#include "VROExecutableAnimation.h" + +class VRONode; +class VROLazyMaterial; + +/* + An animation group is a set of property and material animations that + execute simultaneously. + */ +class VROAnimationGroup : public VROExecutableAnimation, public std::enable_shared_from_this { + +public: + + static std::shared_ptr parse(float duration, float delay, std::string functionName, + std::map &properties, + std::vector> materials); + + VROAnimationGroup(float durationSeconds, float delaySeconds, + VROTimingFunctionType timingFunction, + std::map> &propertyAnimations, + std::vector> &materialAnimations) : + _duration(durationSeconds), + _delay(delaySeconds), + _timingFunctionType(timingFunction), + _propertyAnimations(propertyAnimations), + _materialAnimations(materialAnimations) {} + virtual ~VROAnimationGroup() {} + + std::shared_ptr copy(); + + void execute(std::shared_ptr node, + std::function onFinished); + + void pause(); + void resume(); + void terminate(bool jumpToEnd); + std::string toString() const; + +private: + + static VROTimingFunctionType parseTimingFunction(std::string &name); + + float _duration; + float _delay; + VROTimingFunctionType _timingFunctionType; + + std::shared_ptr _transaction; + + void animatePosition(std::shared_ptr &node); + void animateScale(std::shared_ptr &node); + void animateColor(std::shared_ptr &node); + void animateOpacity(std::shared_ptr &node); + void animateRotation(std::shared_ptr &node); + void animateMaterial(std::shared_ptr &node); + + std::map> _propertyAnimations; + std::vector> _materialAnimations; + +}; + +#endif /* VROAnimationGroup_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROAnimationQuaternion.h b/mobile/ios/ViroKit.framework/Headers/VROAnimationQuaternion.h new file mode 100644 index 0000000..a20bdd0 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROAnimationQuaternion.h @@ -0,0 +1,84 @@ +// +// VROAnimationQuaternion.h +// ViroRenderer +// +// Created by Raj Advani on 12/28/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VROAnimationQuaternion_h +#define VROAnimationQuaternion_h + +#include +#include "VROQuaternion.h" +#include "VROAnimation.h" +#include "VROAnimatable.h" +#include "VROMath.h" + +class VROAnimationQuaternion : public VROAnimation { + +public: + + VROAnimationQuaternion(std::function method, + VROQuaternion start, + VROQuaternion end) : + VROAnimation(), + _keyTimes({ 0, 1 }), + _keyValues({ start, end }), + _method(method) + {} + + VROAnimationQuaternion(std::function method, + VROQuaternion start, + VROQuaternion end, + std::function finishCallback) : + VROAnimation(finishCallback), + _keyTimes({ 0, 1 }), + _keyValues({ start, end }), + _method(method) + {} + + VROAnimationQuaternion(std::function method, + std::vector keyTimes, + std::vector keyValues) : + VROAnimation(), + _keyTimes(keyTimes), + _keyValues(keyValues), + _method(method) + {} + + VROAnimationQuaternion(std::function method, + std::vector keyTimes, + std::vector keyValues, + std::function finishCallback) : + VROAnimation(finishCallback), + _keyTimes(keyTimes), + _keyValues(keyValues), + _method(method) + {} + + void processAnimationFrame(float t) { + VROQuaternion value = VROMathInterpolateKeyFrameQuaternion(t, _keyTimes, _keyValues); + + std::shared_ptr animatable = _animatable.lock(); + if (animatable) { + _method(animatable.get(), value); + } + } + + void finish() { + std::shared_ptr animatable = _animatable.lock(); + if (animatable) { + _method(animatable.get(), _keyValues.back()); + } + } + +private: + + std::vector _keyTimes; + std::vector _keyValues; + std::function _method; + +}; + +#endif /* VROAnimationQuaternion_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROAnimationVector3f.h b/mobile/ios/ViroKit.framework/Headers/VROAnimationVector3f.h new file mode 100644 index 0000000..6baec07 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROAnimationVector3f.h @@ -0,0 +1,84 @@ +// +// VROAnimationVector3f.h +// ViroRenderer +// +// Created by Raj Advani on 12/17/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VROAnimationVector3f_h +#define VROAnimationVector3f_h + +#include +#include "VROVector3f.h" +#include "VROAnimation.h" +#include "VROAnimatable.h" +#include "VROMath.h" + +class VROAnimationVector3f : public VROAnimation { + +public: + + VROAnimationVector3f(std::function method, + VROVector3f start, + VROVector3f end) : + VROAnimation(), + _keyTimes({ 0, 1 }), + _keyValues({ start, end }), + _method(method) + {} + + VROAnimationVector3f(std::function method, + VROVector3f start, + VROVector3f end, + std::function finishCallback) : + VROAnimation(finishCallback), + _keyTimes({ 0, 1 }), + _keyValues({ start, end }), + _method(method) + {} + + VROAnimationVector3f(std::function method, + std::vector keyTimes, + std::vector keyValues) : + VROAnimation(), + _keyTimes(keyTimes), + _keyValues(keyValues), + _method(method) + {} + + VROAnimationVector3f(std::function method, + std::vector keyTimes, + std::vector keyValues, + std::function finishCallback) : + VROAnimation(finishCallback), + _keyTimes(keyTimes), + _keyValues(keyValues), + _method(method) + {} + + void processAnimationFrame(float t) { + VROVector3f value = VROMathInterpolateKeyFrameVector3f(t, _keyTimes, _keyValues); + + std::shared_ptr animatable = _animatable.lock(); + if (animatable) { + _method(animatable.get(), value); + } + } + + void finish() { + std::shared_ptr animatable = _animatable.lock(); + if (animatable) { + _method(animatable.get(), _keyValues.back()); + } + } + +private: + + std::vector _keyTimes; + std::vector _keyValues; + std::function _method; + +}; + +#endif /* VROAnimationVector3f_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROAudioPlayer.h b/mobile/ios/ViroKit.framework/Headers/VROAudioPlayer.h new file mode 100644 index 0000000..63ed2c9 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROAudioPlayer.h @@ -0,0 +1,40 @@ +// +// VROAudioPlayer.h +// ViroRenderer +// +// Created by Raj Advani on 3/22/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROAudioPlayer_h +#define VROAudioPlayer_h + +#include +#include +#include "VROSoundDelegateInternal.h" + +class VROData; + +class VROAudioPlayer { + +public: + + virtual ~VROAudioPlayer() {} + + virtual void setup() = 0; + virtual void setDelegate(std::shared_ptr delegate) { + _delegate = delegate; + } + + virtual void setLoop(bool loop) = 0; + virtual void play() = 0; + virtual void pause() = 0; + virtual void setVolume(float volume) = 0; + virtual void setMuted(bool muted) = 0; + virtual void seekToTime(float seconds) = 0; + +protected: + std::shared_ptr _delegate; +}; + +#endif /* VROAudioPlayer_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROAudioPlayeriOS.h b/mobile/ios/ViroKit.framework/Headers/VROAudioPlayeriOS.h new file mode 100644 index 0000000..6631bb0 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROAudioPlayeriOS.h @@ -0,0 +1,89 @@ +// +// VROAudioPlayeriOS.h +// ViroRenderer +// +// Created by Raj Advani on 11/6/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROAudioPlayeriOS_h +#define VROAudioPlayeriOS_h + +#include "VROAudioPlayer.h" +#include "VROSoundDataDelegate.h" +#include "VROSoundData.h" +#include + +/* + Simple object that wraps a VROSoundDelegateInternal object and acts as a delegate for the AVAudioPlayer + */ +@interface VROAudioPlayerDelegate : NSObject + +- (id)initWithSoundDelegate:(std::shared_ptr)soundDelegate; +- (void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag; + +@end + +class VROAudioPlayeriOS : public VROAudioPlayer, public VROSoundDataDelegate, public std::enable_shared_from_this { + +public: + + VROAudioPlayeriOS(std::string url, bool isLocalUrl); + VROAudioPlayeriOS(std::shared_ptr data); + VROAudioPlayeriOS(std::shared_ptr data); + virtual ~VROAudioPlayeriOS(); + + /* + Must be invoke after construction, after setting the delegate. + */ + void setup(); + void setDelegate(std::shared_ptr delegate); + + void setLoop(bool loop); + void play(); + void pause(); + void setVolume(float volume); + void setMuted(bool muted); + void seekToTime(float seconds); + +#pragma mark VROSoundDataDelegate Implementation + + void dataIsReady(); + void dataError(std::string error); + +private: + + /* + Underlying iOS audio player. The delegate is only kept here so that + it's retained. + */ + AVAudioPlayer *_player; + VROAudioPlayerDelegate *_audioDelegate; + + /* + Generic settings. + */ + float _playVolume; + bool _muted; + bool _paused; + bool _loop; + bool _isLocal; + + /* + Source audio. + */ + std::string _url; + std::shared_ptr _data; + + /* + Update the underlying iOS player with the various properties set on this + player (e.g. muted, loop, volume, etc.) + */ + void updatePlayerProperties(); + + void doFadeThenPause(); + void doFadeThenStop(); + +}; + +#endif /* VROAudioPlayeriOS_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROBillboardConstraint.h b/mobile/ios/ViroKit.framework/Headers/VROBillboardConstraint.h new file mode 100644 index 0000000..99b789f --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROBillboardConstraint.h @@ -0,0 +1,40 @@ +// +// VROBillboardConstraint.h +// ViroRenderer +// +// Created by Raj Advani on 3/9/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROBillboardConstraint_h +#define VROBillboardConstraint_h + +#include "VROConstraint.h" + +enum class VROBillboardAxis { + X, + Y, + Z, + All +}; + +class VROBillboardConstraint : public VROConstraint { + +public: + + VROBillboardConstraint(VROBillboardAxis freeAxis) : + _freeAxis(freeAxis) {} + + VROMatrix4f getTransform(const VRORenderContext &context, + VROMatrix4f transform); + +private: + + VROBillboardAxis _freeAxis; + + VROQuaternion computeAxisRotation(VROVector3f lookAt, VROVector3f defaultAxis, + VROVector3f objToCamProj); + +}; + +#endif /* VROBillboardConstraint_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROBoundingBox.h b/mobile/ios/ViroKit.framework/Headers/VROBoundingBox.h new file mode 100644 index 0000000..2c61116 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROBoundingBox.h @@ -0,0 +1,183 @@ +// +// VROBoundingBox.h +// ViroRenderer +// +// Created by Raj Advani on 10/15/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VROBOUNDINGBOX_H_ +#define VROBOUNDINGBOX_H_ + +#include +#include +#include "VROVector3f.h" +#include "VROMatrix4f.h" +#include +#include + +class VROFrustum; + +enum VROBoxPlane { + VROBoxPlaneMinX = 0, + VROBoxPlaneMaxX = 1, + VROBoxPlaneMinY = 2, + VROBoxPlaneMaxY = 3, + VROBoxPlaneMinZ = 4, + VROBoxPlaneMaxZ = 5 +}; + +class VROBoundingBox { +public: + + /* + Constructors. + */ + VROBoundingBox() noexcept; + VROBoundingBox(float left, float right, float bottom, float top, float zmin, float zmax); + + /* + Ray intersection. The intersection result will be stored in *intPt. If there are multiple intersection + points, only one will be returned. + */ + bool intersectsRay(const VROVector3f &ray, const VROVector3f &origin, VROVector3f *intPt); + + /* + Point containment functions. The first function checks for full containment; the remaining functions + only check for containment along the indicated axes. + */ + bool containsPoint(const VROVector3f &point) const; + bool containsPointXY(const VROVector3f &point) const; + bool containsPointXZ(const VROVector3f &point) const; + bool containsPointYZ(const VROVector3f &point) const; + + /* + Distance from the point to the bounding box. + */ + float getDistanceToPoint(VROVector3f p) const; + + /* + Distance from the point to the furthest point on the bounding box. + */ + float getFurthestDistanceToPoint(VROVector3f p) const; + + /* + Bounding-box to bounding-box containment and intersections. + */ + bool containsBox(const VROBoundingBox &box) const; + bool intersectsBox(const VROBoundingBox &box) const; + + /* + Get the coordinates and extent of the bounding box. + */ + float getMinX() const { + return _planes[VROBoxPlaneMinX]; + } + float getMaxX() const { + return _planes[VROBoxPlaneMaxX]; + } + float getMaxY() const { + return _planes[VROBoxPlaneMaxY]; + } + float getMinY() const { + return _planes[VROBoxPlaneMinY]; + } + float getMaxZ() const { + return _planes[VROBoxPlaneMaxZ]; + } + float getMinZ() const { + return _planes[VROBoxPlaneMinZ]; + } + float getX() const { + return (_planes[VROBoxPlaneMaxX] + _planes[VROBoxPlaneMinX]) / 2; + } + float getY() const { + return (_planes[VROBoxPlaneMaxY] + _planes[VROBoxPlaneMinY]) / 2; + } + float getZ() const { + return (_planes[VROBoxPlaneMaxZ] + _planes[VROBoxPlaneMinZ]) / 2; + } + float getSpanX() const { + return _planes[VROBoxPlaneMaxX] - _planes[VROBoxPlaneMinX]; + } + float getSpanY() const { + return _planes[VROBoxPlaneMaxY] - _planes[VROBoxPlaneMinY]; + } + float getSpanZ() const { + return _planes[VROBoxPlaneMaxZ] - _planes[VROBoxPlaneMinZ]; + } + VROVector3f getCenter() const { + return { getX(), getY(), getZ() }; + } + VROVector3f getExtents() const { + return { getSpanX(), getSpanY(), getSpanZ() }; + } + + /* + Set the coordinates of the bounding box. + */ + void setMinX(float minX) { + _planes[VROBoxPlaneMinX] = minX; + } + void setMaxX(float maxX) { + _planes[VROBoxPlaneMaxX] = maxX; + } + void setMinY(float minY) { + _planes[VROBoxPlaneMinY] = minY; + } + void setMaxY(float maxY) { + _planes[VROBoxPlaneMaxY] = maxY; + } + void setMinZ(float minZ) { + _planes[VROBoxPlaneMinZ] = minZ; + } + void setMaxZ(float maxZ) { + _planes[VROBoxPlaneMaxZ] = maxZ; + } + + const float *getPlanes() const { + return _planes; + } + + /* + Scale by a relative amount (scaleBy) or an absolute amount (expandBy). Scales about the center of the + box. + */ + void scaleBy(float scale); + void expandBy(float amount); + + /* + Transform this bounding box by the given matrix. Note that since this is + an AABB box, rotations can have significant impact on the size of the box. + */ + VROBoundingBox transform(VROMatrix4f transform) const; + + /* + Optimized set functions. + */ + void set(const float *dimensions); + void set(float xMin, float xMax, float yMin, float yMax, float zMin, float zMax); + void copy(const VROBoundingBox &box); + + VROBoundingBox unionWith(const VROBoundingBox &box); + + /* + Union this bounding box with the supplied box, updating our member + variables to be a bounding box that contains all points we previously + contained, and any points the supplied box contains. + */ + void unionDestructive(const VROBoundingBox &box); + void center(float *center) const; + + std::string toString() const; + +private: + + /* + The [xmin, xmax, ymin, ymax, zmin, zmax] extremities of this bounding-box. + */ + float _planes[6]; + +}; + +#endif /* VROBOUNDINGBOX_H_ */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROBox.h b/mobile/ios/ViroKit.framework/Headers/VROBox.h new file mode 100644 index 0000000..06fb92f --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROBox.h @@ -0,0 +1,39 @@ +// +// VROBox.h +// ViroRenderer +// +// Created by Raj Advani on 12/7/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VROBox_h +#define VROBox_h + +#include "VROGeometry.h" +#include "VROShapeUtils.h" +#include + +class VROBox : public VROGeometry { + +public: + + static std::shared_ptr createBox(float width, float height, float length); + virtual ~VROBox(); + + void setWidth(float width); + void setHeight(float height); + void setLength(float length); + + virtual void setMaterials(std::vector> materials); + +private: + + float _width, _height, _length; + VROBox(float width, float height, float length); + + void updateBox(); + void buildBoxVAR(VROShapeVertexLayout *vertexLayout); + +}; + +#endif /* VROBox_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROByteBuffer.h b/mobile/ios/ViroKit.framework/Headers/VROByteBuffer.h new file mode 100644 index 0000000..bd9dd7b --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROByteBuffer.h @@ -0,0 +1,239 @@ +// +// VROByteBuffer.h +// ViroRenderer +// +// Created by Raj Advani on 10/21/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VROBYTEBUFFER_H_ +#define VROBYTEBUFFER_H_ + +#include +#include +#include +#include +#include +#include +#include + +class VROByteBuffer final { +public: + + /* + Default writing constructor, creating a new byte array of default + length. + */ + VROByteBuffer(); + + /* + Writing constructor, creating a new byte array of the given length. + */ + VROByteBuffer(size_t capacity); + + /* + Read constructor. Wrap the given array of bytes of the given length. Set copy to true + to copy the bytes into this VROByteBuffer. If false, then the bytes will continue to be + owned by the caller and will not be deleted when this VROByteBuffer is destroyed. + */ + VROByteBuffer(const void *bytes, size_t length, bool copy = true); + + /* + Wrap the given string with a VROByteBuffer. + + !!DANGER!! + + The caller must ensure that the passed-in string stays in scope throughout the + lifetime of this buffer. The string is NOT copied into this object (for perf + reasons). + */ + VROByteBuffer(const std::string &byteString); + + /* + Copy semantics + */ + VROByteBuffer(VROByteBuffer *toCopy); + VROByteBuffer(const VROByteBuffer& toCopy) = delete; + VROByteBuffer& operator=(const VROByteBuffer& rhs) = delete; + + /* + Move semantics + */ + VROByteBuffer(VROByteBuffer&& moveFrom); + VROByteBuffer& operator=(VROByteBuffer&& moveFrom); + + ~VROByteBuffer(); + + size_t capacity() const { + return _capacity; + } + + /* + Read methods. + */ + bool readBool(); + float readHalf(); + float readFloat(); + double readDouble(); + int readInt(); + uint64_t readUInt64(); + short readShort(); + unsigned short readUnsignedShort(); + signed char readByte(); + unsigned char readUnsignedByte(); + void * readPointer(); + + /* + Read strings, allocating new space. + */ + std::string readSTLStringUTF8NullTerm(); + std::string readSTLString(); + std::string readSTLStringUTF8(); + std::string readSTLText(); + std::string readSTLTextUTF8(); + + /* + Read the next null-terminated string. + */ + void readStringNullTerm(char *result); + std::string readStringNullTerm(); + + size_t getPosition() const { + return _pos; + } + void setPosition(size_t position); + void skip(size_t bytes); + + /* + Underlying data manipulation and retrieval. + */ + char* getData(); + char* getDataFromPosition(size_t position); + + /* + Create a byte-buffer from a subrange of this byte-buffer, using absolute position and length. + The underlying bytes will be copied, and the resultant buffer will own said bytes. + */ + VROByteBuffer *split(size_t offset, size_t length); + + /* + Peek methods. + */ + signed char peekByte(); + int peekInt(); + + /* + Batch read methods. + */ + void copyBytes(void *dest, int numBytes); + void copyChars(char *dest, int numChars); + void copyShorts(short *dest, int numShorts); + void copyInts(int *dest, int numInts); + void copyFloats(float *dest, int numFloats); + void copyLongs(uint64_t *dest, int numLongs); + signed char *readNumChars(int numChars); + short *readNumShorts(int numShorts); + + /* + Grow the byte-buffer to fit the given number of additional bytes PAST the + current position of the buffer. If the buffer has space remaining, do not + necesarily grow the buffer. + */ + void grow(size_t additionalBytesRequired); + + /* + Shrink the buffer down to the given size. + */ + void shrink(size_t size); + + /* + Fill the buffer with zeros. + */ + void clear(); + + /* + Set position to zero. + */ + void rewind(); + + /* + Invoke to make the ByteBuffer *not* delete its underlying bytes when + deallocated. This is useful when we want to move the data to another + container like VROData without performing a copy. + */ + void releaseBytes() { + _freeOnDealloc = false; + } + + /* + Write methods. + */ + void writeBool(bool value); + void writeByte(char value); + void writeShort(short value); + void writeInt(int value); + void writeHalf(float value); + void writeFloat(float value); + void writeFloats(float *pValues, const int numFloats); + void writeDouble(double value); + void writeLong(uint64_t value); + void writeStringNullTerm(const char *value); + void writeBytes(const void *bytes, size_t length); + void writeBuffer(VROByteBuffer *src, size_t length); + void writeChars(const char *value); + void writePointer(void *pointer); + + /* + Fill the buffer with the given value, repeated across the given number of bytes. Equivalent + to a memset. The buffer must be large enough to fit numBytes; it will not be automatically grown. + */ + void fill(unsigned char value, size_t numBytes); + + /* + Write the given number of bytes from this buffer to the destination, incrementing + the position of both buffers. + */ + void writeToBuffer(VROByteBuffer *dest, size_t length); + + /* + Write the given number of bytes from this buffer to the destination, incrementing + the position of the destination buffer and rewinding this buffer to it's position + before the call to this function. + */ + void writeToBufferAndRewind(VROByteBuffer *dest, size_t length) const; + + /* + Write the entirety of the buffer (from position 0 to capacity) to the given file. + Create the file if it does not exist. The second function writes length bytes starting + at the given offset. + */ + void writeToFile(const char *path); + void writeToFile(const std::string &path); + void writeToFile(const char *path, size_t offset, size_t length); + void writeToFile(const std::string &path, size_t offset, size_t length); + +private: + + /* + The current position (in bytes) in the data. Incremented as we read. + */ + size_t _pos; + + /* + The total capacity of the buffer (in bytes). + */ + size_t _capacity; + + /* + The inner buffer containing the data. + */ + char *_buffer; + + /* + True if the underlying bytes should be freed when this buffer is deallocated. + */ + bool _freeOnDealloc; + +}; + +#endif /* VROBYTEBUFFER_H_ */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROCamera.h b/mobile/ios/ViroKit.framework/Headers/VROCamera.h new file mode 100644 index 0000000..bc4508f --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROCamera.h @@ -0,0 +1,158 @@ +// +// VROCamera.h +// ViroRenderer +// +// Created by Raj Advani on 11/13/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VROCamera_h +#define VROCamera_h + +#include "VROVector3f.h" +#include "VROQuaternion.h" +#include "VROMatrix4f.h" +#include "VROViewport.h" +#include "VROFrustum.h" +#include "VROFieldOfView.h" + +enum class VROCameraRotationType { + Standard, + Orbit +}; + +/* + The default forward and up vectors. These are rotated by the base and head + rotation to derive the actual forward and up vectors. + */ +static const VROVector3f kBaseForward = { 0, 0, -1 }; +static const VROVector3f kBaseUp = { 0, 1, 0 }; + +class VROCamera { + +public: + + VROCamera(); + virtual ~VROCamera(); + + void setPosition(VROVector3f position); + void setHeadRotation(VROMatrix4f headRotation); + void setBaseRotation(VROMatrix4f baseRotation); + void setViewport(VROViewport viewport); + void setFOV(VROFieldOfView fov); + void setProjection(VROMatrix4f projection); + + VROVector3f getPosition() const { + return _position; + } + VROVector3f getForward() const { + return _forward; + } + VROVector3f getUp() const { + return _up; + } + VROQuaternion getRotation() const { + return _rotation; + } + VROMatrix4f getLookAtMatrix() const { + return _lookAtMatrix; + } + VROMatrix4f getProjection() const { + return _projection; + } + const VROFrustum &getFrustum() const { + return _frustum; + } + VROFieldOfView getFieldOfView() const { + return _fov; + } + VROViewport getViewport() const { + return _viewport; + } + float getNCP() const { + return _ncp; + } + float getFCP() const { + return _fcp; + } + void computeLookAtMatrix(); + void computeFrustum(); + + float getWorldPerScreen(float distance) const; +private: + + VROVector3f _position; + + /* + The camera forward vector. Normalized vector indicating where the camera + is pointing. + */ + VROVector3f _forward; + + /* + The camera up vector. Normalized vector indicating which direction is 'up'. + */ + VROVector3f _up; + + /* + The camera quaternion represents the rotation from (0, 0, -1) required to + achieve the camera's current orientation. This factors in both base + rotation and head rotation. + */ + VROQuaternion _rotation; + + /* + The current head rotation. Head rotation is set by the user's HMD orientation. + Total rotation is head rotation plus base rotation. + */ + VROMatrix4f _headRotation; + + /* + The base rotation. This is set by the application. Total rotation is head + rotation plus base rotation. + */ + VROMatrix4f _baseRotation; + + /* + The last computed lookAt matrix for this camera. This matrix combines all rotation + and position information into one unified view matrix. Note like all matrices in + the VROCamera, this is eye-independent (the eyeFromHeadMatrix is not considered). + */ + VROMatrix4f _lookAtMatrix; + + /* + The projection matrix associated with this camera. + */ + VROMatrix4f _projection; + + /* + The frustum associated with this camera. Derived from the lookAtMatrix and the + projection matrix. + */ + VROFrustum _frustum; + + /* + The current viewport and FOV. + */ + VROViewport _viewport; + VROFieldOfView _fov; + + /* + The camera's near and far clipping planes. + */ + float _ncp, _fcp; + + void onRotationChanged(); + +}; + +class VROCameraDelegate { +public: + VROCameraDelegate() {}; + virtual ~VROCameraDelegate() {}; + virtual void onCameraTransformationUpdate(VROVector3f pos, + VROVector3f rot, + VROVector3f forward) = 0; +}; + +#endif /* VROCamera_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROCameraTexture.h b/mobile/ios/ViroKit.framework/Headers/VROCameraTexture.h new file mode 100644 index 0000000..856abfe --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROCameraTexture.h @@ -0,0 +1,69 @@ +// +// VROCameraTexture.hpp +// ViroRenderer +// +// Created by Raj Advani on 3/22/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROCameraTexture_hpp +#define VROCameraTexture_hpp + +#include "VROTexture.h" +#include + +class VRORenderContext; +class VROFrameSynchronizer; +class VRODriver; +class VROVector3f; + +enum class VROCameraPosition { + Front, + Back +}; + +enum class VROCameraOrientation { + Portrait, + PortraitUpsideDown, + LandscapeLeft, + LandscapeRight, +}; + +class VROCameraTexture : public VROTexture { + +public: + + VROCameraTexture(VROTextureType type) : + VROTexture(type, VROTextureInternalFormat::RGBA8) {} + virtual ~VROCameraTexture() {} + + /* + Initialize this texture to display the contents of the camera. + The texture will not display until play() is invoked. Returns + true if successful, false on failure. + */ + virtual bool initCamera(VROCameraPosition position, VROCameraOrientation orientation, + std::shared_ptr driver) = 0; + + /* + Play and pause. + */ + virtual void pause() = 0; + virtual void play() = 0; + virtual bool isPaused() = 0; + + /* + Get the horizontal FOV used by the camera. This should return the + FOV from edge to edge, in degrees. + */ + virtual float getHorizontalFOV() const = 0; + + /* + Get the image size (width, height) for the camera. Stored in the + vector's x and y components. + */ + virtual VROVector3f getImageSize() const = 0; + +}; + +#endif /* VROCameraTexture_hpp */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROCameraTextureiOS.h b/mobile/ios/ViroKit.framework/Headers/VROCameraTextureiOS.h new file mode 100644 index 0000000..0145875 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROCameraTextureiOS.h @@ -0,0 +1,83 @@ +// +// VROCameraTextureiOS.h +// ViroRenderer +// +// Created by Raj Advani on 3/22/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROCameraTextureiOS_h +#define VROCameraTextureiOS_h + +#include "VROCameraTexture.h" +// #include "VROTrackingHelper.h" +#import +#import + +@class VROCameraCaptureDelegate; +@class VROCameraOrientationListener; +class VROVideoTextureCache; + +class VROCameraTextureiOS : public VROCameraTexture { + +public: + + VROCameraTextureiOS(VROTextureType type); + virtual ~VROCameraTextureiOS(); + + bool initCamera(VROCameraPosition position, VROCameraOrientation orientation, std::shared_ptr driver); + void pause(); + void play(); + bool isPaused(); + + float getHorizontalFOV() const; + VROVector3f getImageSize() const; + + void displayPixelBuffer(std::unique_ptr substrate); + void updateOrientation(VROCameraOrientation orientation); + +private: + + /* + Capture session and delegate used for live video playback. + */ + AVCaptureSession *_captureSession; + VROCameraCaptureDelegate *_delegate; + VROCameraOrientationListener *_orientationListener; + + /* + True if paused. + */ + bool _paused; + + /* + Video texture cache used for transferring camera content to OpenGL. + */ + std::shared_ptr _videoTextureCache; + +}; + +/* + Delegate for capturing video from cameras. + */ +@interface VROCameraCaptureDelegate : NSObject + +// @property (nonatomic, strong) VROTrackingHelper* trackingHelper; + +- (id)initWithCameraTexture:(std::shared_ptr)texture + cache:(std::shared_ptr)cache + driver:(std::shared_ptr)driver; + +@end + +/* + Delegate for listening to orientation changes. + */ +@interface VROCameraOrientationListener : NSObject + +- (id)initWithCameraTexture:(std::shared_ptr)texture; +- (void)orientationDidChange:(NSNotification *)notification; + +@end + +#endif /* VROCameraTextureiOS_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROConcurrentBuffer.h b/mobile/ios/ViroKit.framework/Headers/VROConcurrentBuffer.h new file mode 100644 index 0000000..cebf6fb --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROConcurrentBuffer.h @@ -0,0 +1,68 @@ +// +// VROConcurrentBuffer.h +// ViroRenderer +// +// Created by Raj Advani on 2/3/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROConcurrentBuffer_h +#define VROConcurrentBuffer_h + +#include "VRODefines.h" +#if VRO_METAL + +#include +#include "VROEye.h" +#include +#include + +static const int kMaxBuffersInFlight = 3; + +/* + Wraps a Metal buffer that's used by both the GPU and the CPU. + The section of the buffer being used (written to by the CPU) changes + with each frame, so that the CPU and GPU never collide. + */ +class VROConcurrentBuffer { + +public: + + VROConcurrentBuffer(int size, NSString *label, id device); + virtual ~VROConcurrentBuffer(); + + /* + Get the underlying MTLBuffer. + */ + id getMTLBuffer(VROEyeType eye) { + return _buffer[(int)eye]; + } + + void *getWritableContents(VROEyeType eye, int frame) { + return (void *) ((char *)[_buffer[(int)eye] contents] + getWriteOffset(frame)); + } + + /* + Get the CPU write offset into the MTLBuffer, based on the current + frame. + */ + int getWriteOffset(int frame) { + return _size * (frame % kMaxBuffersInFlight); + } + +private: + + /* + The underlying Metal buffer for each eye. + */ + id _buffer[2]; + + /* + The size of each section in the MTLBuffer. + */ + int _size; + +}; + +#endif +#endif /* VROConcurrentBuffer_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROConstraint.h b/mobile/ios/ViroKit.framework/Headers/VROConstraint.h new file mode 100644 index 0000000..e722867 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROConstraint.h @@ -0,0 +1,30 @@ +// +// VROConstraint.h +// ViroRenderer +// +// Created by Raj Advani on 3/9/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROConstraint_h +#define VROConstraint_h + +#include +#include + +class VRONode; +class VROMatrix4f; +class VROQuaternion; +class VROVector3f; +class VRORenderContext; + +class VROConstraint { + +public: + + virtual VROMatrix4f getTransform(const VRORenderContext &context, + VROMatrix4f transform) = 0; + +}; + +#endif /* VROConstraint_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROData.h b/mobile/ios/ViroKit.framework/Headers/VROData.h new file mode 100644 index 0000000..4272f61 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROData.h @@ -0,0 +1,66 @@ +// +// VROData.h +// ViroRenderer +// +// Created by Raj Advani on 11/17/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VROData_h +#define VROData_h + +#include +#include +#include + +/* + Defines how the VROData holds onto its underlying data. + + Copy: data is copied on construction, freed on destruction + Move: data is assigned on construction, freed on destruction + Wrap: data is assigned on construction + */ +enum class VRODataOwnership { + Copy, + Move, + Wrap +}; + +/* + Holds onto an arbitrary block of bytes. + */ +class VROData { + +public: + + /* + Construct a new VROData. Default ownership semanatics are + Copy. + */ + VROData(void *data, int dataLength, VRODataOwnership ownership = VRODataOwnership::Copy); + + /* + Construct a new VROData, copying the bytes into this object. + (allows for const data input). + */ + VROData(const void *data, int dataLength); + + ~VROData(); + + void *const getData() { + return _data; + } + int getDataLength() const { + return _dataLength; + } + +private: + + void *_data; + int _dataLength; + + VRODataOwnership _ownership; + +}; + +#endif /* VROData_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VRODefines.h b/mobile/ios/ViroKit.framework/Headers/VRODefines.h new file mode 100644 index 0000000..eac3a01 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VRODefines.h @@ -0,0 +1,22 @@ +// +// VRODefines.h +// ViroRenderer +// +// Created by Raj Advani on 11/1/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VRODefines_h +#define VRODefines_h + +#ifndef __OBJC__ +#define VRO_PLATFORM_ANDROID 1 +#define VRO_PLATFORM_IOS 0 +#else +#define VRO_PLATFORM_ANDROID 0 +#define VRO_PLATFORM_IOS 1 +#endif + +#define VRO_METAL 0 + +#endif /* VRODefines_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VRODriver.h b/mobile/ios/ViroKit.framework/Headers/VRODriver.h new file mode 100644 index 0000000..be64db3 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VRODriver.h @@ -0,0 +1,192 @@ +// +// VRODriver.h +// ViroRenderer +// +// Created by Raj Advani on 4/21/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VRODriver_h +#define VRODriver_h + +#include +#include "VRODefines.h" +#include "VROSoundData.h" + +class VROGeometry; +class VROMaterial; +class VROGeometrySubstrate; +class VROMaterialSubstrate; +class VROTextureSubstrate; +class VROData; +class VROImage; +class VROVideoTextureCache; +class VROSound; +class VROAudioPlayer; +class VROTypeface; +class VROFrameTimer; +class VRORenderTarget; +class VRORenderContext; +class VROShaderProgram; +class VROImagePostProcess; + +enum class VROSoundType; +enum class VROTextureType; +enum class VROTextureFormat; +enum class VROTextureInternalFormat; +enum class VROWrapMode; +enum class VROFilterMode; +enum class VROMipmapMode; +enum class VRORenderTargetType; +enum class VROFace; +enum class VROCullMode; +enum class VROBlendMode; +enum class VROResourceType; + +/* + The type of the GPU can be used to modify rendering for compatibility with older + GPUs, or it can be used to gate access to advanced rendering features that only + work with some subset of GPUs. + */ +enum class VROGPUType { + /* + Covers properly functioning GPUs. + */ + Normal, + + /* + This type is used for GPUs that supposedly support OpenGL 3.0 but can't handle + simple 3D graphics without serious errors. This is primarily used for the Adreno 330 + and earlier, which have issues with structs in GLSL programs. The inclusion of structs can + cause textures to corrupt (EGL textures gain a purple tint), and shaders to sporadically fail + compilation. + + Since these GPUs are generally legacy and can't support AR and VR, instead of writing + an entirely new set of shaders to support them, we instead force these GPUs to always + use a simple constant shader, and modify the expand the Surface struct into separate + variables. + */ + Adreno330OrOlder, +}; + +/* + The color mode used when rendering. + + NonLinear: textures are sampled in RGB (gamma-corrected) space, shader operations + are performed in this non-linear space, and rendered straight to the frame + buffer without conversion. In other words, inputs are gamma corrected and + output is gamma corrected. Less color accuracy. + + Linear: textures are sampled as sRGB, meaning they are converted to a linear + colorspace by the underlying hardware. Colors remain in linear color space + until the *final* framebuffer render, at which point they are gamma + corrected by the hardware (by rendering into an sRGB-configured framebuffer) + + LinearSoftware: textures are sampled as sRGB, as with Linear, but the final framebuffer + is gamma-corrected via shader code. This is typically used in situations + where we are unable to allocate an sRGB framebuffer for the final render. + */ +enum class VROColorRenderingMode { + NonLinear, + Linear, + LinearSoftware, +}; + +/* + The driver is used to interface with the rendering subsystem (OpenGL, + Metal, etc.). + */ +class VRODriver { + +public: + + virtual ~VRODriver() {} + + /* + Provides the driver an opportunity to update any sub-components + with per-frame state. The willRenderFrame method is invoked just + prior to rendering, and didRenderFrame is invoked afterward. The + VROFrameTimer can be used by the driver to timebox its tasks so + as not to overrun frame time. + */ + virtual void willRenderFrame(const VRORenderContext &context) = 0; + virtual void didRenderFrame(const VROFrameTimer &timer, const VRORenderContext &context) = 0; + + /* + Invoked when the renderer is paused and resumed. + */ + virtual void pause() = 0; + virtual void resume() = 0; + + /* + Read the GPU type, which may be necessary to support old GPUs that are not to + specification, or to control whether or not to use advanced features only supported + by a subset of GPUs. + */ + virtual void readGPUType() = 0; + + /* + Get the GPU type, after it has been read by the system. + */ + virtual VROGPUType getGPUType() = 0; + + /* + Read the ID of the display's framebuffer. May not be required on all + platforms. This way we're able to re-bind to the display during a multi-pass + alogrithm. + */ + virtual void readDisplayFramebuffer() = 0; + + /* + The driver controls context-wide state change. The implementation + should store a CPU copy of current state to avoid sending unnecessary + instructions to the GPU. + */ + virtual void setDepthWritingEnabled(bool enabled) = 0; + virtual void setDepthReadingEnabled(bool enabled) = 0; + virtual void setStencilTestEnabled(bool enabled) = 0; + virtual void setCullMode(VROCullMode cullMode) = 0; + virtual void setColorWritingEnabled(bool enabled) = 0; + virtual void bindShader(std::shared_ptr program) = 0; + virtual void unbindShader() = 0; + virtual void bindRenderTarget(std::shared_ptr target) = 0; + virtual void unbindRenderTarget() = 0; + + /* + Indicates how we handle linear rendering and gamma-correction for this device + and platform. Features like HDR are only enabled in linear space. + */ + virtual VROColorRenderingMode getColorRenderingMode() = 0; + + /* + Return true if bloom rendering is enabled. If so, materials that exceed their + bloom threshold will glow. + */ + virtual bool isBloomSupported() = 0; + + virtual VROGeometrySubstrate *newGeometrySubstrate(const VROGeometry &geometry) = 0; + virtual VROMaterialSubstrate *newMaterialSubstrate(VROMaterial &material) = 0; + virtual VROTextureSubstrate *newTextureSubstrate(VROTextureType type, + VROTextureFormat format, + VROTextureInternalFormat internalFormat, bool sRGB, + VROMipmapMode mipmapMode, + std::vector> &data, + int width, int height, std::vector mipSizes, + VROWrapMode wrapS, VROWrapMode wrapT, + VROFilterMode minFilter, VROFilterMode magFilter, VROFilterMode mipFilter) = 0; + virtual std::shared_ptr newRenderTarget(VRORenderTargetType type, int numAttachments, int numImages, + bool enableMipmaps) = 0; + virtual std::shared_ptr getDisplay() = 0; + virtual std::shared_ptr newImagePostProcess(std::shared_ptr shader) = 0; + virtual std::shared_ptr newVideoTextureCache() = 0; + virtual std::shared_ptr newSound(std::shared_ptr data, VROSoundType type) = 0; + virtual std::shared_ptr newSound(std::string resource, VROResourceType resourceType, VROSoundType type) = 0; + virtual std::shared_ptr newAudioPlayer(std::shared_ptr data) = 0; + virtual std::shared_ptr newAudioPlayer(std::string path, bool isLocal) = 0; + virtual std::shared_ptr newTypeface(std::string typeface, int size) = 0; + virtual void setSoundRoom(float sizeX, float sizeY, float sizeZ, std::string wallMaterial, + std::string ceilingMaterial, std::string floorMaterial) = 0; + virtual void setBlendingMode(VROBlendMode mode) = 0; +}; + +#endif /* VRODriver_hpp */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROEventDelegate.h b/mobile/ios/ViroKit.framework/Headers/VROEventDelegate.h new file mode 100644 index 0000000..f254e45 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROEventDelegate.h @@ -0,0 +1,215 @@ +// +// VROEventDelegate.h +// ViroRenderer +// +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROEventDelegate_h +#define VROEventDelegate_h + +#include +#include +#include +#include +#include +#include +#include "VROVector3f.h" +#include "VROHitTestResult.h" + +#include +class VROARHitTestResult; +class VROARPointCloud; + +static const float kOnFuseReset = std::numeric_limits::max(); + +/* + Class for both registering for and implementing event delegate callbacks. + */ +class VROEventDelegate { +public: + /* + Enum EventAction types that are supported by this delegate, used for + describing InputSources from InputTypes.h. For example, an OnClick + action may originate from a ViroDayDream AppButton inputSource. + + IMPORTANT: Enum values should match EventAction within EventDelegateJni.java + as the standard format to be passed through the JNI layer. + Do Not change the Enum Values!!! Simply add additional event types as need be. + */ + enum EventAction { + OnHover = 1, + OnClick = 2, + OnTouch = 3, + OnMove = 4, + OnControllerStatus = 5, + OnSwipe = 6, + OnScroll = 7, + OnDrag = 8, + OnFuse = 9, + OnPinch = 10, + OnRotate = 11, + OnCameraARHitTest = 12, + OnARPointCloudUpdate = 13, + }; + + /* + ClickState enum describing the OnClick Event action. + */ + enum ClickState { + ClickDown = 1, + ClickUp = 2, + Clicked = 3 + }; + + /* + TouchState enum describing the OnTouch Event action. + */ + enum TouchState { + TouchDown = 1, + TouchDownMove = 2, + TouchUp = 3, + }; + + enum PinchState { + PinchStart = 1, + PinchMove = 2, + PinchEnd = 3, + }; + + enum RotateState { + RotateStart = 1, + RotateMove = 2, + RotateEnd = 3, + }; + + enum SwipeState { + SwipeUp = 1, + SwipeDown = 2, + SwipeLeft = 3, + SwipeRight = 4 + }; + + /* + Enum ControllerStatus types describing the availability status of the + current input controller. + + IMPORTANT: Enum values should match EventSource within EventDelegateJni.java + as the standard format to be passed through the JNI layer. + Do Not change the Enum Values!!! Simply add additional event types as need be. + */ + enum ControllerStatus { + Unknown = 1, + Connecting = 2, + Connected = 3, + Disconnected = 4, + Error = 5 + }; + + // Disable all event callbacks by default + VROEventDelegate() { + _enabledEventMap[VROEventDelegate::EventAction::OnHover] = false; + _enabledEventMap[VROEventDelegate::EventAction::OnClick] = false; + _enabledEventMap[VROEventDelegate::EventAction::OnTouch] = false; + _enabledEventMap[VROEventDelegate::EventAction::OnMove] = false; + _enabledEventMap[VROEventDelegate::EventAction::OnControllerStatus] = false; + _enabledEventMap[VROEventDelegate::EventAction::OnSwipe] = false; + _enabledEventMap[VROEventDelegate::EventAction::OnScroll] = false; + _enabledEventMap[VROEventDelegate::EventAction::OnDrag] = false; + _enabledEventMap[VROEventDelegate::EventAction::OnFuse] = false; + _enabledEventMap[VROEventDelegate::EventAction::OnPinch] = false; + _enabledEventMap[VROEventDelegate::EventAction::OnRotate] = false; + _enabledEventMap[VROEventDelegate::EventAction::OnCameraARHitTest] = false; + _enabledEventMap[VROEventDelegate::EventAction::OnARPointCloudUpdate] = false; + } + + /* + Informs the renderer to enable / disable the triggering of + specific EventSource delegate callbacks. + */ + void setEnabledEvent(VROEventDelegate::EventAction type, bool enabled) { + _enabledEventMap[type] = enabled; + } + + bool isEventEnabled(VROEventDelegate::EventAction type) { + return _enabledEventMap[type]; + } + + /* + Delegate events triggered by the VROInputControllerBase. + */ + virtual void onHover(int source, std::shared_ptr node, bool isHovering, std::vector position) { + //No-op + } + + virtual void onClick(int source, std::shared_ptr node, ClickState clickState, std::vector position) { + //No-op + } + + virtual void onTouch(int source, std::shared_ptr node, TouchState touchState, float x, float y) { + //No-op + } + + virtual void onMove(int source, std::shared_ptr node, VROVector3f rotation, VROVector3f position, VROVector3f forwardVec) { + //No-op + } + + virtual void onControllerStatus(int source, ControllerStatus status) { + //No-op + } + + virtual void onGazeHit(int source, std::shared_ptr node, const VROHitTestResult &hit) { + //No-op + } + + virtual void onSwipe(int source, std::shared_ptr node, SwipeState swipeState) { + //No-op + } + + virtual void onScroll(int source, std::shared_ptr node, float x, float y) { + //No-op + } + + virtual void onDrag(int source, std::shared_ptr node, VROVector3f newPosition) { + //No-op + } + + virtual void onFuse(int source, std::shared_ptr node, float timeToFuseRatio) { + //No-op + } + + virtual void onPinch(int source, std::shared_ptr node, float scaleFactor, PinchState pinchState) { + //No-op + } + + virtual void onRotate(int source, std::shared_ptr node, float rotationRadians, RotateState rotateState) { + //No-op + } + + virtual void onCameraARHitTest(std::vector results) { + //No-op + } + + virtual void onARPointCloudUpdate(std::shared_ptr pointCloud) { + //No-op + } + + void setTimeToFuse(float durationInMillis){ + _timeToFuseDuration = durationInMillis; + } + + float getTimeToFuse(){ + return _timeToFuseDuration; + } + +private: + + std::map _enabledEventMap; + + /* + Duration used to count down from for triggering onFuse events, in milliseconds. + Defaults to 2000 milliseconds. + */ + float _timeToFuseDuration = 2000; +}; +#endif diff --git a/mobile/ios/ViroKit.framework/Headers/VROEventDelegateiOS.h b/mobile/ios/ViroKit.framework/Headers/VROEventDelegateiOS.h new file mode 100644 index 0000000..357aac5 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROEventDelegateiOS.h @@ -0,0 +1,90 @@ +// +// VRORenderDelegateiOS.h +// ViroRenderer +// +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROEventDelegateiOS_h +#define VROEventDelegateiOS_h +#import "VROEventDelegate.h" +#import +#import "VROARPointCloud.h" + +/* + Protocol to be implemented by objective C controls to be + set on VROEventDelegateiOS for the notification of + input events. + */ +@protocol VROEventDelegateProtocol +@required +- (void)onHover:(int)source node:(std::shared_ptr)node isHovering:(bool)isHovering hoverLocation:(std::vector)location; +- (void)onClick:(int)source node:(std::shared_ptr)node clickState:(VROEventDelegate::ClickState)clickState clickLocation:(std::vector)location; +- (void)onFuse:(int)source node:(std::shared_ptr)node; +- (void)onDrag:(int)source node:(std::shared_ptr)node posX:(float)x posY:(float)y posZ:(float)y; +- (void)onPinch:(int)source node:(std::shared_ptr)node scaleFactor:(float)scale pinchState:(VROEventDelegate::PinchState)pinchState; +- (void)onRotate:(int)source node:(std::shared_ptr)node rotationRadians:(float)rotationRadians rotateState:(VROEventDelegate::RotateState)rotateState; +- (void)onCameraARHitTest:(std::vector) results; +- (void)onARPointCloudUpdate:(std::shared_ptr) pointCloud; +@end + +/* + iOS implementation of VROEventDelegate for the notification + of delegate events across the bridge. + */ +class VROEventDelegateiOS : public VROEventDelegate { +public: + VROEventDelegateiOS(id delegate) : + _delegate(delegate) {} + virtual ~VROEventDelegateiOS() {} + + /* + Delegate events triggered by the EventManager. + */ + virtual void onHover(int source, std::shared_ptr node, bool isHovering, std::vector location) { + [_delegate onHover:source node:node isHovering:isHovering hoverLocation:location]; + } + + virtual void onClick(int source, std::shared_ptr node, ClickState clickState, std::vector location) { + [_delegate onClick:source node:node clickState:clickState clickLocation:location]; + } + + virtual void onFuse(int source, std::shared_ptr node, float timeToFuseRatio) { + /* + As onFuse is also used by internal components to update ui based + on timeToFuse ratio, we only want to notify our bridge components + if we have successfully fused (if timeToFuseRatio has counted down to 0). + */ + if (timeToFuseRatio > 0.0f){ + return; + } + [_delegate onFuse:source node:node]; + } + + virtual void onCameraARHitTest(std::vector results) { + [_delegate onCameraARHitTest:results]; + } + + virtual void onDrag(int source, std::shared_ptr node, VROVector3f position) { + [_delegate onDrag:source node:node posX:position.x posY:position.y posZ:position.z]; + } + + virtual void onPinch(int source, std::shared_ptr node, float scale, PinchState pinchState) { + [_delegate onPinch:source node:node scaleFactor:scale pinchState:pinchState]; + } + + virtual void onRotate(int source, std::shared_ptr node, float rotationRadians, RotateState rotateState) { + [_delegate onRotate:source node:node rotationRadians:rotationRadians rotateState:rotateState]; + } + + virtual void onARPointCloudUpdate(std::shared_ptr pointCloud) { + [_delegate onARPointCloudUpdate:pointCloud]; + } + + +private: + + __weak id _delegate; + +}; +#endif /* VROEventDelegateiOS_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROExecutableAnimation.h b/mobile/ios/ViroKit.framework/Headers/VROExecutableAnimation.h new file mode 100644 index 0000000..48af819 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROExecutableAnimation.h @@ -0,0 +1,44 @@ +// +// VROExecutableAnimation.h +// ViroRenderer +// +// Created by Raj Advani on 1/4/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROExecutableAnimation_h +#define VROExecutableAnimation_h + +#include +#include + +class VRONode; +class VROTransaction; + +class VROExecutableAnimation { + +public: + VROExecutableAnimation() {} + virtual ~VROExecutableAnimation() {} + + /* + Produce a copy of this animation. + */ + virtual std::shared_ptr copy() = 0; + + /* + Execute this animation. The onFinished() callback will be invoked when the + animation is fully executed (if it has children, this is when the last child + finishes executing). + */ + virtual void execute(std::shared_ptr node, + std::function onFinished) = 0; + + virtual void pause() = 0; + virtual void resume() = 0; + virtual void terminate(bool jumpToEnd) = 0; + + virtual std::string toString() const = 0; +}; + +#endif /* VROExecutableAnimation_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROFBXLoader.h b/mobile/ios/ViroKit.framework/Headers/VROFBXLoader.h new file mode 100644 index 0000000..ec16233 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROFBXLoader.h @@ -0,0 +1,101 @@ +// +// VROFBXLoader.h +// ViroRenderer +// +// Created by Raj Advani on 5/1/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROFBXLoader_h +#define VROFBXLoader_h + +#include +#include +#include +#include +#include +#include "VROGeometrySource.h" +#include "VROGeometryElement.h" +#include "VROMaterial.h" +#include "VROModelIOUtil.h" + +class VRONode; +class VROTexture; +class VROGeometry; +class VROSkinner; +class VROSkeleton; +class VROSkeletalAnimation; +class VROKeyframeAnimation; + +namespace viro { + class Node; + class Node_Geometry; + class Node_Skeleton; + class Node_Geometry_Skin; + class Node_SkeletalAnimation; + class Node_KeyframeAnimation; +} + +class VROFBXLoader { + +public: + + /* + Load the FBX node subgraph at the given resource, into the given node. + For all dependent resources (e.g. textures) found, locate them in the + parent folder of the resource. + + If async is true, the FBX is loaded in the background. Afterward, the + geometry and child-nodes are injected into the node on the main (rendering) + thread, and the given callback is invoked. + + If async is false, the callback is still executed. + */ + static void loadFBXFromResource(std::string file, VROResourceType type, std::shared_ptr destination, + bool async = false, std::function node, bool success)> onFinish = nullptr); + static void loadFBXFromResources(std::string file, VROResourceType type, std::shared_ptr destination, + std::map resourceMap, + bool async = false, std::function node, bool success)> onFinish = nullptr); + +private: + + static void injectFBX(std::shared_ptr fbxNode, std::shared_ptr node, + std::function node, bool success)> onFinish); + + /* + Load the FBX subgraph for the given file. The top-level node returned here is a dummy; all the + data is stored in its children. + */ + static std::shared_ptr loadFBX(std::string file, std::string base, VROResourceType type, + const std::map *resourceMap); + + static std::shared_ptr loadFBXNode(const viro::Node &node_pb, + std::shared_ptr skeleton, + std::string base, VROResourceType type, + const std::map *resourceMap, + std::map> &textureCache); + + static std::shared_ptr loadFBXGeometry(const viro::Node_Geometry &geo_pb, + std::string base, VROResourceType type, + const std::map *resourceMap, + std::map> &textureCache); + + static std::shared_ptr loadFBXSkeleton(const viro::Node_Skeleton &skeleton_pb); + static std::unique_ptr loadFBXSkinner(const viro::Node_Geometry_Skin &skin_pb, + std::shared_ptr skeleton); + static std::shared_ptr loadFBXSkeletalAnimation(const viro::Node_SkeletalAnimation &animation_pb, + std::shared_ptr skeleton); + static std::shared_ptr loadFBXKeyframeAnimation(const viro::Node_KeyframeAnimation &animation_pb); + + /* + Remove nodes that do not have any geometry in their sub-graph. These nodes + are empty cruft that do not need to be loaded into the renderer (in fact if + they are loaded in, they can cause significant CPU churn as we recurse down + them each frame). + */ + static void trimEmptyNodes(std::shared_ptr node); + static bool nodeHasGeometryRecursive(std::shared_ptr node); + +}; + +#endif /* VROFBXLoader_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROFieldOfView.h b/mobile/ios/ViroKit.framework/Headers/VROFieldOfView.h new file mode 100644 index 0000000..c3ccac4 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROFieldOfView.h @@ -0,0 +1,107 @@ +// +// VROFieldOfView.cpp +// ViroRenderer +// +// Created by Raj Advani on 10/23/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VROFieldOfView_h +#define VROFieldOfView_h + +#include "VROMath.h" + +enum class VROFieldOfViewAxis { + X, Y +}; + +/* + Represents the field of view in each direction, in degrees. + */ +class VROFieldOfView { + +public: + + VROFieldOfView() : + _left(s_defaultViewAngle), + _right(s_defaultViewAngle), + _bottom(s_defaultViewAngle), + _top(s_defaultViewAngle) + {} + + VROFieldOfView(float left, float right, float bottom, float top) : + _left(left), + _right(right), + _bottom(bottom), + _top(top) + {} + + VROFieldOfView(const VROFieldOfView *other) : + _left(other->_left), + _right(other->_right), + _bottom(other->_bottom), + _top(other->_top) + {} + + void setLeft(float left) { + _left = left; + } + float getLeft() const { + return _left; + } + + void setRight(float right) { + _right = right; + } + float getRight() const { + return _right; + } + + void setBottom(float bottom) { + _bottom = bottom; + } + float getBottom() const { + return _bottom; + } + + void setTop(float top) { + _top = top; + } + float getTop() const { + return _top; + } + + VROMatrix4f toPerspectiveProjection(float near, float far) { + float left = -tanf(degrees_to_radians(_left)) * near; + float right = tanf(degrees_to_radians(_right)) * near; + float bottom = -tanf(degrees_to_radians(_bottom)) * near; + float top = tanf(degrees_to_radians(_top)) * near; + + return VROMathComputeFrustum(left, right, bottom, top, near, far); + } + + bool equals(const VROFieldOfView *other) const { + if (other == nullptr) { + return false; + } + else if (other == this) { + return true; + } + return (_left == other->_left) && + (_right == other->_right) && + (_bottom == other->_bottom) && + (_top == other->_top); + } + +private: + + constexpr static float s_defaultViewAngle = 40.0f; + + float _left; + float _right; + float _bottom; + float _top; + +}; + +#endif diff --git a/mobile/ios/ViroKit.framework/Headers/VROFrameListener.h b/mobile/ios/ViroKit.framework/Headers/VROFrameListener.h new file mode 100644 index 0000000..99decde --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROFrameListener.h @@ -0,0 +1,29 @@ +// +// VROFrameListener.h +// ViroRenderer +// +// Created by Raj Advani on 1/7/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROFrameListener_h +#define VROFrameListener_h + +#include +class VRORenderContext; + +/* + Interface for responding to frame begin and end events. + */ +class VROFrameListener { + +public: + + virtual ~VROFrameListener() {} + + virtual void onFrameWillRender(const VRORenderContext &context) = 0; + virtual void onFrameDidRender(const VRORenderContext &context) = 0; + +}; + +#endif /* VROFrameListener_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROFrameScheduler.h b/mobile/ios/ViroKit.framework/Headers/VROFrameScheduler.h new file mode 100644 index 0000000..ad57cad --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROFrameScheduler.h @@ -0,0 +1,77 @@ +// +// VROFrameScheduler.h +// ViroRenderer +// +// Created by Raj Advani on 4/5/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROFrameScheduler_h +#define VROFrameScheduler_h + +#include "VROFrameTimer.h" +#include +#include +#include +#include +#include + +struct VROFrameTask { + std::string key; + std::function functor; +}; + +/* + Schedules tasks to be run on the rendering thread. Unlike + VROPlatformDispatchRenderer, these tasks are run in a time-limited + queue; they are scheduled to run only when time is available in + the current frame. Time remaining in a frame is determined by a + set milliseconds-per-frame (mpf) target. + */ +class VROFrameScheduler { + +public: + + VROFrameScheduler(); + virtual ~VROFrameScheduler(); + + /* + Schedule a new task to be completed in the time-limited + queue. The key should uniquely identify the task, and is used + to de-dupe tasks that are scheduled multiple times. + */ + void scheduleTask(std::string key, std::function task); + + /* + Process as many tasks as allowed given the remaining frame + time. + */ + void processTasks(const VROFrameTimer &timer); + +private: + + /* + The number of frames that have passed, during which we had at + lease one task to process but no time to process any. + */ + int _starvationFrameCount; + + /* + Guards the _taskQueue and _queuedTasks set. + */ + std::recursive_mutex _taskQueueMutex; + + /* + The actual queue we use to process tasks in FIFO order. + */ + std::queue _taskQueue; + + /* + Set used to prevent the same task from being queued + multiple times, based on its ID. + */ + std::set _queuedTasks; + +}; + +#endif /* VROFrameScheduler_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROFrameSynchronizer.h b/mobile/ios/ViroKit.framework/Headers/VROFrameSynchronizer.h new file mode 100644 index 0000000..7b14053 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROFrameSynchronizer.h @@ -0,0 +1,27 @@ +// +// VROFrameSynchronizer.h +// ViroRenderer +// +// Created by Raj Advani on 4/27/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROFrameSynchronizer_h +#define VROFrameSynchronizer_h + +#include + +class VROFrameListener; + +class VROFrameSynchronizer { + +public: + + virtual ~VROFrameSynchronizer() {} + + virtual void addFrameListener(std::shared_ptr listener) = 0; + virtual void removeFrameListener(std::shared_ptr listener) = 0; + +}; + +#endif /* VROFrameSynchronizer_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROFrameTimer.h b/mobile/ios/ViroKit.framework/Headers/VROFrameTimer.h new file mode 100644 index 0000000..b73169a --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROFrameTimer.h @@ -0,0 +1,70 @@ +// +// VROFrameTimer.h +// ViroRenderer +// +// Created by Raj Advani on 4/5/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROFrameTimer_h +#define VROFrameTimer_h + +#include "VROTime.h" + +/* + Startup frames have unlimited processing time; process-only + frames are frames in which we only process and do not render. + */ +enum class VROFrameType { + Normal, + Startup, + ProcessOnly +}; + +/* + Tracks how much time remains in the current frame for processing + tasks. + */ +class VROFrameTimer { + +public: + + VROFrameTimer(VROFrameType frameType, double timeForProcessing, double lastFrameEndTime) : + _frameType(frameType), + _timeForProcessing(timeForProcessing), + _lastFrameEndTime(lastFrameEndTime) { + } + + /* + Returns true if there is time remaining for any processing operations in the + current frame. + */ + bool isTimeRemainingInFrame() const { + return _frameType == VROFrameType::Startup || getTimeRemainingInFrame() > 0; + } + + double getTimeRemainingInFrame() const { + return _timeForProcessing - (VROTimeCurrentMillis() - _lastFrameEndTime); + } + +private: + + /* + The frame 'type'. Startup frames have unlimited processing time; process-only + frames are frames in which we only process() and do not render(). + */ + const VROFrameType _frameType; + + /* + The time available for processing this frame, in ms. + */ + const double _timeForProcessing; + + /* + The end time of the last frame, in ms. + */ + const double _lastFrameEndTime; + +}; + +#endif /* VROFrameTimer_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROFrustum.h b/mobile/ios/ViroKit.framework/Headers/VROFrustum.h new file mode 100644 index 0000000..6b1c834 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROFrustum.h @@ -0,0 +1,96 @@ +// +// VROFrustum.h +// ViroRenderer +// +// Created by Raj Advani on 10/15/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VROFRUSTUM_H_ +#define VROFRUSTUM_H_ + +#include "VROFrustumPlane.h" +#include "VROVector3f.h" +#include "VROFrustumBoxIntersectionMetadata.h" + +/* + Plane identifiers. + */ +enum class VROFrustumSide : int { + Left = 0, + Right = 1, + Bottom = 2, + Top = 3, + Near = 4, + Far = 5 +}; + +/* + Enum for intersection testing results. + */ +enum class VROFrustumResult { + Inside, + Intersects, + Outside +}; + +class VROFrustum { +public: + + /* + Create a new frustum. + */ + explicit VROFrustum(); + virtual ~VROFrustum(); + + /* + Generic initialization. + */ + void fitToModelView(const float *view, const float *projection, + const float bufferSides, const float bufferNear, const float bufferFar); + + /* + Intersection testing (automatically chooses best method). + */ + VROFrustumResult intersect(const VROBoundingBox &box, VROFrustumBoxIntersectionMetadata *metadata) const; + + /* + Intersect this frustum with a bounding box, utilizing the far points optimization and + temporal coherency optimizations. + */ + VROFrustumResult intersectAllOpt(const VROBoundingBox &box, VROFrustumBoxIntersectionMetadata *metadata) const; + + /* + Frustum intersection using the "far point" optimization. The far point optimization enables us + to determine if there's an intersection between a frustum and an AABB using only two plane->point + distance calculations per frustum plane. + */ + VROFrustumResult intersectWithFarPointsOpt(const VROBoundingBox &box) const; + + /* + Robust frustum intersection, using no optimizations. + */ + VROFrustumResult intersectNoOpt(const VROBoundingBox &box) const; + + /* + Check if the given point is contained by this frustum. + */ + bool containsPoint(const VROVector3f &point) const; + + /* + Get the distance of the given point from the near or far clipping plane of this + frustum. + */ + float distanceFromFCP(VROVector3f pt) const; + float distanceFromNCP(VROVector3f pt) const; + +private: + + /* + The planes composing this frustum: left, right, bottom, top, near, far. + */ + VROFrustumPlane _planes[6]; + +}; + +#endif /* VROFRUSTUM_H_ */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROFrustumBoxIntersectionMetadata.h b/mobile/ios/ViroKit.framework/Headers/VROFrustumBoxIntersectionMetadata.h new file mode 100644 index 0000000..73cee1a --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROFrustumBoxIntersectionMetadata.h @@ -0,0 +1,46 @@ +// +// VROFrustumBoxIntersectionMetadata.hpp +// ViroRenderer +// +// Created by Raj Advani on 4/17/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROFrustumBoxIntersectionMetadata_h +#define VROFrustumBoxIntersectionMetadata_h + +#include +#include + +class VROFrustum; + +/* + Stores metadata about the intersection between a given VROFrustum + and VROBoundingBox, which can be utilized to accelerate intersection + computations between the same frustum and box in subsequent + frames. + */ +class VROFrustumBoxIntersectionMetadata { + +public: + + VROFrustumBoxIntersectionMetadata(); + ~VROFrustumBoxIntersectionMetadata(); + + uint8_t getPlaneLastOutside() const { + return _planeLastOutside; + } + void setPlaneLastOutside(uint8_t plane) { + _planeLastOutside = plane; + } + +private: + + /* + The plane of the frustum the bounding-box was last outside. + */ + uint8_t _planeLastOutside; + +}; + +#endif /* VROFrustumBoxIntersectionMetadata_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROFrustumPlane.h b/mobile/ios/ViroKit.framework/Headers/VROFrustumPlane.h new file mode 100644 index 0000000..dc3cd3b --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROFrustumPlane.h @@ -0,0 +1,36 @@ +// +// VROFrustumPlane.h +// ViroRenderer +// +// Created by Raj Advani on 10/15/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VROFRUSTUMPLANE_H_ +#define VROFRUSTUMPLANE_H_ + +#include "VROPlane.h" +#include "VROBoundingBox.h" + +typedef enum { + VROFarPointPosX = 0, + VROFarPointPosY = 1, + VROFarPointPosZ = 2, + VROFarPointNegX = 3, + VROFarPointNegY = 4, + VROFarPointNegZ = 5 +} VROFarPoint; + +class VROFrustumPlane : public VROPlane { +public: + + VROBoxPlane farPoints[6]; + + VROFrustumPlane(); + virtual ~VROFrustumPlane(); + + void refreshFarPoints(); + +}; + +#endif /* VROFRUSTUMPLANE_H_ */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROGeometry.h b/mobile/ios/ViroKit.framework/Headers/VROGeometry.h new file mode 100644 index 0000000..37a90d2 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROGeometry.h @@ -0,0 +1,287 @@ +// +// VROGeometry.h +// ViroRenderer +// +// Created by Raj Advani on 11/17/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VROGeometry_h +#define VROGeometry_h + +#include +#include +#include +#include +#include "VRORenderContext.h" +#include "VRODriver.h" +#include "VROSortKey.h" +#include "VROBoundingBox.h" +#include "VROAnimatable.h" +#include "VROSkinner.h" +#include "VROAllocationTracker.h" + +class VRONode; +class VROLight; +class VROSortKey; +class VROMaterial; +class VROTexture; +class VROGeometryElement; +class VROGeometrySource; +class VROGeometrySubstrate; +class VROMatrix4f; +class VROInstancedUBO; +class VRORenderMetadata; +enum class VROGeometrySourceSemantic; + +/* + Represents a three-dimensional shape, a collection of vertices, normals and texture coordinates + that define a surface, also known as a model or mesh. Geometries attached to VRONode objects form + the visible elements of a scene, and VROMaterial objects attached to a geometry determine its + appearance. + */ +class VROGeometry : public VROAnimatable { + +public: + + /* + Construct a new geometry with the given sources and elements. + */ + VROGeometry(std::vector> sources, + std::vector> elements) : + _geometrySources(sources), + _geometryElements(elements), + _cameraEnclosure(false), + _screenSpace(false), + _bounds(nullptr), + _substrate(nullptr), + _instancedUBO(nullptr){ + + ALLOCATION_TRACKER_ADD(Geometry, 1); + } + + /* + Construct a new geometry with no sources or elements. These are expected + to be set by the subclass. + */ + VROGeometry() : + _cameraEnclosure(false), + _screenSpace(false), + _bounds(nullptr), + _substrate(nullptr) { + + ALLOCATION_TRACKER_ADD(Geometry, 1); + } + + /* + Copy the given geometry. The materials will *not* be copied, and the + underlying immutable geometry data will be shared. + */ + VROGeometry(std::shared_ptr geometry) : + _geometrySources(geometry->_geometrySources), + _geometryElements(geometry->_geometryElements) { + + ALLOCATION_TRACKER_ADD(Geometry, 1); + } + + virtual ~VROGeometry(); + + /* + Delete any rendering resources. Invoked prior to destruction, on the + rendering thread. + */ + void deleteGL(); + + /* + Get the geometry ready for usage now, in advance of when it's visible. If not invoked, + the geometry will be initialized when it is made visible. + */ + void prewarm(std::shared_ptr driver); + + /* + Render the given element of the geometry with full texturing and + lighting. Assumes the material's shader and geometry-independent + properties have already been bound. + */ + void render(int elementIndex, + const std::shared_ptr &material, + VROMatrix4f transform, + VROMatrix4f normalMatrix, + float opacity, + const VRORenderContext &context, + std::shared_ptr &driver); + + /* + Render the silhouette of the entire geometry (all elements). Renders + using the given material, which is assumed to already be bound, ignoring + texturing and lighting. Typically this is used for rendering to a stencil + buffer or shadow map. + */ + void renderSilhouette(VROMatrix4f transform, + std::shared_ptr &material, + const VRORenderContext &context, + std::shared_ptr &driver); + + /* + Render the silhouette of the given element of the given geometry. + Renders using the provided material, which is assumed to already be + bound, and binds its associated texture. + */ + void renderSilhouetteTextured(int element, + VROMatrix4f transform, + std::shared_ptr &material, + const VRORenderContext &context, + std::shared_ptr &driver); + + void updateSortKeys(VRONode *node, uint32_t hierarchyId, uint32_t hierarchyDepth, + uint32_t lightsHash, const std::vector> &lights, + float opacity, float distanceFromCamera, float zFar, + std::shared_ptr &metadata, + const VRORenderContext &context, + std::shared_ptr &driver); + void getSortKeys(std::vector *outKeys); + + std::shared_ptr &getMaterialForElement(int elementIndex) { + return _materials[elementIndex % _materials.size()]; + } + + virtual void setMaterials(std::vector> materials) { + _materials = materials; + } + const std::vector> &getMaterials() { + return _materials; + } + + const std::vector> &getGeometrySources() const { + return _geometrySources; + } + const std::vector> &getGeometryElements() const { + return _geometryElements; + } + + const VROBoundingBox &getBoundingBox(); + void updateBoundingBox(); + VROVector3f getCenter(); + + bool isCameraEnclosure() const { + return _cameraEnclosure; + } + void setCameraEnclosure(bool enabled) { + _cameraEnclosure = enabled; + } + + bool isScreenSpace() const { + return _screenSpace; + } + void setScreenSpace(bool screenSpace) { + _screenSpace = screenSpace; + } + + std::string getName() const { + return _name; + } + void setName(std::string name) { + _name = name; + } + + const std::unique_ptr &getSkinner() const { + return _skinner; + } + void setSkinner(std::unique_ptr skinner) { + _skinner = std::move(skinner); + } + + std::vector> getGeometrySourcesForSemantic(VROGeometrySourceSemantic semantic) const; + + void setInstancedUBO(std::shared_ptr instancedUBO) { + _instancedUBO = instancedUBO; + } + + const std::shared_ptr &getInstancedUBO() const{ + return _instancedUBO; + } +protected: + + void setSources(std::vector> sources) { + _geometrySources = sources; + updateSubstrate(); + } + void setElements(std::vector> elements) { + _geometryElements = elements; + updateSubstrate(); + } + +private: + /* + User-assigned name of this geometry. + */ + std::string _name; + + /* + The materials, which define the surface appearance (color, lighting, texture, and effects) + of each geometry element. + + If a geometry has the same number of materials as it has geometry elements, the material + index corresponds to the element index. For geometries with fewer materials than elements, + the material index for each element is determined by calculating the index of that element + modulo the number of materials. For example, in a geometry with six elements and three materials, + the element at index 5 is rendered using the material at index 5 % 3 = 2. + */ + std::vector> _materials; + std::vector> _geometrySources; + std::vector> _geometryElements; + + /* + Used for sorting the elements prior to rendering. + */ + std::vector _sortKeys; + + /* + True if this geometry is a camera enclosure, e.g. a skybox. Camera enclosures follow + the camera and ignore interlens distance (since they generally simulate far away objects). + */ + bool _cameraEnclosure; + + /* + True if this geometry's coordinates are specified in screen space; e.g., the coordinates of + the viewport. If true, then the geometry will be rendered orthographically (ignoring perspective) + and with an identity view matrix (ignoring the camera). The geometry may still have + node transforms. + */ + bool _screenSpace; + + /* + The bounding box of this geometry. Created on demand, then cached. + */ + VROBoundingBox *_bounds; + + /* + Representation of this geometry in the underlying graphics library. + */ + VROGeometrySubstrate *_substrate; + + /* + The skinner ties this geometry to a skeleton, enabling skeletal animation. + */ + std::unique_ptr _skinner; + + /* + If this geometry has no source data installed (_geometrySources and _geometryElements), + then returns false. + */ + bool isRenderable() const; + + /* + Invoke when the substrate needs to be refreshed (typically when underlying + geometry sources or elements change). + */ + void updateSubstrate(); + + /* + If set, this geometry is instanced rendered with the configurations set by this + instancedUBO. + */ + std::shared_ptr _instancedUBO; +}; + +#endif /* VROGeometry_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROGeometryElement.h b/mobile/ios/ViroKit.framework/Headers/VROGeometryElement.h new file mode 100644 index 0000000..591533e --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROGeometryElement.h @@ -0,0 +1,94 @@ +// +// VROGeometryElement.h +// ViroRenderer +// +// Created by Raj Advani on 11/17/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VROGeometryElement_h +#define VROGeometryElement_h + +#include +#include +#include +#include +#include +#include "VROData.h" +#include "VROTriangle.h" + +class VROGeometrySource; + +enum class VROGeometryPrimitiveType { + Triangle, + TriangleStrip, + Line, + Point +}; + +/* + Describes how vertices are connected to form the surface of a three-dimensional object, or geometry. + Used in conjunction with VROGeometrySource. + */ +class VROGeometryElement { + +public: + + VROGeometryElement(std::shared_ptr data, + VROGeometryPrimitiveType primitiveType, + int primitiveCount, + int bytesPerIndex) : + _primitiveType(primitiveType), + _primitiveCount(primitiveCount), + _data(data), + _bytesPerIndex(bytesPerIndex) + {} + + std::shared_ptr getData() const { + return _data; + } + VROGeometryPrimitiveType getPrimitiveType() const { + return _primitiveType; + } + int getPrimitiveCount() const { + return _primitiveCount; + } + int getBytesPerIndex() const { + return _bytesPerIndex; + } + + /* + Read through the indices in this element, read the corresponding vertices + from the given geometry source, and invoke the provided function once per + triangle. + */ + void processTriangles(std::function function, + std::shared_ptr geometrySource) const; + + /* + Read the indexes in this element, one by one. + */ + void processIndices(std::function function) const; + +private: + + /* + The type of the primitives we should create from the associated geometry + source using the indices in this element. + */ + VROGeometryPrimitiveType _primitiveType; + + /* + The number of triangles, triangle strips, etc. + */ + const int _primitiveCount; + + /* + The index data, and the size of each index. + */ + std::shared_ptr _data; + const int _bytesPerIndex; + +}; + +#endif /* VROGeometryElement_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROGeometrySource.h b/mobile/ios/ViroKit.framework/Headers/VROGeometrySource.h new file mode 100644 index 0000000..d7f6f24 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROGeometrySource.h @@ -0,0 +1,158 @@ +// +// VROGeometrySource.h +// ViroRenderer +// +// Created by Raj Advani on 11/17/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VROGeometrySource_h +#define VROGeometrySource_h + +#include +#include +#include +#include "VROData.h" +#include "VROBoundingBox.h" + +enum class VROGeometrySourceSemantic { + Vertex, + Normal, + Color, + Texcoord, + Tangent, + VertexCrease, + EdgeCrease, + BoneWeights, + BoneIndices, + Invalid +}; + +/* + Specifies per-vertex data for the set of vertices forming the surface of a three-dimensional + object, or geometry. Used together with VROGeometryElement objects to define custom VROGeometry objects + or to inspect the data that composes an existing geometry. + */ +class VROGeometrySource { + +public: + + VROGeometrySource(std::shared_ptr data, + VROGeometrySourceSemantic semantic, + int vertexCount, + bool floatComponents, + int componentsPerVertex, + int bytesPerComponent, + int dataOffset, + int dataStride) : + _data(data), + _semantic(semantic), + _vertexCount(vertexCount), + _floatComponents(floatComponents), + _componentsPerVertex(componentsPerVertex), + _bytesPerComponent(bytesPerComponent), + _dataOffset(dataOffset), + _dataStride(dataStride) + {} + + VROGeometrySource(std::shared_ptr data, + std::shared_ptr templateSource) : + _data(data), + _semantic(templateSource->getSemantic()), + _vertexCount(templateSource->getVertexCount()), + _floatComponents(templateSource->isFloatComponents()), + _componentsPerVertex(templateSource->getComponentsPerVertex()), + _bytesPerComponent(templateSource->getBytesPerComponent()), + _dataOffset(templateSource->getDataOffset()), + _dataStride(templateSource->getDataStride()) + {} + + std::shared_ptr getData() const { + return _data; + } + VROGeometrySourceSemantic getSemantic() const { + return _semantic; + } + int getVertexCount() const { + return _vertexCount; + } + int getComponentsPerVertex() const { + return _componentsPerVertex; + } + int getBytesPerComponent() const { + return _bytesPerComponent; + } + int getDataOffset() const { + return _dataOffset; + } + int getDataStride() const { + return _dataStride; + } + bool isFloatComponents() const { + return _floatComponents; + } + + /* + Read through all the vertices in this data source and invoke the provided + callback for each. + */ + void processVertices(std::function function) const; + + /* + Read through all vertices in this data source and modify them. + */ + void modifyVertices(std::function function) const; + + /* + Retrieves the bounding box for the values associated with this + geometry source. Generally only makes sense to invoke this method + for VROGeometrySourceSemantic::Vertex. + */ + VROBoundingBox getBoundingBox() const; + +private: + + /* + The interleaved raw vertex data. + */ + std::shared_ptr _data; + + /* + The attribute the geometry source is describing for each vertex. + */ + VROGeometrySourceSemantic _semantic; + + /* + The number of vertices described in the _data array. + */ + int _vertexCount; + + /* + True if the components are floating point. False if integer. + */ + bool _floatComponents; + + /* + The number of scalar components per vertex (i.e. x, y, z for position). + */ + int _componentsPerVertex; + + /* + The number of bytes per scalar component (i.e. 4 for floats). + */ + int _bytesPerComponent; + + /* + The offset in the data array at which point this source's data begins. Used + for interleaving a vertex array. + */ + int _dataOffset; + + /* + The number of bytes from one vertex in the data to the next. + */ + int _dataStride; + +}; + +#endif /* VROGeometrySource_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROGeometryUtil.h b/mobile/ios/ViroKit.framework/Headers/VROGeometryUtil.h new file mode 100644 index 0000000..e4b219b --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROGeometryUtil.h @@ -0,0 +1,52 @@ +// +// VROGeometryUtil.h +// ViroRenderer +// +// Created by Raj Advani on 3/2/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROGeometryUtil_h +#define VROGeometryUtil_h + +#include +#include +#include + +class VROData; +class VROVector3f; +class VROGeometryElement; +class VROGeometrySource; +class VRONode; +enum class VROGeometrySourceSemantic; +enum class VROGeometryPrimitiveType; + +/* + Return one VRONode per VROGeometryElement. The position of the node will be set + to the center of each element's vertices. + */ +std::vector> VROGeometryUtilSplitNodeByGeometryElements(std::shared_ptr node); + +/* + Find the vertices used by the geometry element in the given source and center them. + Return the newly allocated, centered vertex data. Store the center in the given out + variable. + */ +std::shared_ptr VROGeometryUtilExtractAndCenter(std::shared_ptr element, + std::shared_ptr geometrySource, + VROVector3f *outCenter); + +/* + Get how many indices are required to render the given number of primitives of the + given type, and vice-versa. + */ +int VROGeometryUtilGetIndicesCount(int primitiveCount, VROGeometryPrimitiveType primitiveType); +int VROGeometryUtilGetPrimitiveCount(int indicesCount, VROGeometryPrimitiveType primitiveType); + + +/* + Parse the attribute index for the given semantic. + */ +int VROGeometryUtilParseAttributeIndex(VROGeometrySourceSemantic semantic); + +#endif /* VROGeometryUtil_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROHDRLoader.h b/mobile/ios/ViroKit.framework/Headers/VROHDRLoader.h new file mode 100644 index 0000000..be5be73 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROHDRLoader.h @@ -0,0 +1,38 @@ +// +// VROHDRLoader.h +// ViroKit +// +// Created by Raj Advani on 1/22/18. +// Copyright © 2018 Viro Media. All rights reserved. +// + +#ifndef VROHDRLoader_h +#define VROHDRLoader_h + +#include +#include +#include + +class VROTexture; +enum class VROTextureInternalFormat; + +/* + Converts HDR images to RGB9_E5 format so that they can be read by OpenGL ES. + */ +class VROHDRLoader { +public: + + /* + Loads the Radiance HDR texture (.hdr) at the given path. The data will + be internally stored in RGB9_E5 format. + */ + static std::shared_ptr loadRadianceHDRTexture(std::string hdrPath); + +private: + + static std::shared_ptr loadTexture(float *data, int width, int height, + int componentsPerPixel); + +}; + +#endif /* VROHDRLoader_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROHitTestResult.h b/mobile/ios/ViroKit.framework/Headers/VROHitTestResult.h new file mode 100644 index 0000000..c1a7fb6 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROHitTestResult.h @@ -0,0 +1,63 @@ +// +// VROHitTestResult.h +// ViroRenderer +// +// Created by Raj Advani on 1/13/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROHitTestResult_h +#define VROHitTestResult_h + +#include "VROVector3f.h" +#include "VROCamera.h" +#include + +class VRONode; + +class VROHitTestResult { + +public: + + VROHitTestResult(std::shared_ptr node, VROVector3f location, float distance, bool background, + const VROCamera &camera) : + _node(node), + _location(location), + _distance(distance), + _background(background), + _camera(camera) + {} + + ~VROHitTestResult() {} + + std::shared_ptr getNode() const { + return _node; + } + + VROVector3f getLocation() const { + return _location; + } + + float getDistance() const { + return _distance; + } + + bool isBackgroundHit() const { + return _background; + } + + const VROCamera &getCamera() const { + return _camera; + } + +private: + + std::shared_ptr _node; + VROVector3f _location; + float _distance; + bool _background; + VROCamera _camera; + +}; + +#endif /* VROHitTestResult_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROHoverDistanceListener.h b/mobile/ios/ViroKit.framework/Headers/VROHoverDistanceListener.h new file mode 100644 index 0000000..e5b1f5b --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROHoverDistanceListener.h @@ -0,0 +1,27 @@ +// +// VROHoverDistanceListener.h +// ViroRenderer +// +// Created by Raj Advani on 4/1/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROHoverDistanceListener_h +#define VROHoverDistanceListener_h + +#include + +/* + Attaches to a VROHoverController and receives a notification each + time the hover distance changes (the distance of the point on the object + hovered from the camera). + */ +class VROHoverDistanceListener { + +public: + + virtual void onHoverDistanceChanged(float distance, const VRORenderContext &context) = 0; + +}; + +#endif /* VROHoverDistanceListener_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROImage.h b/mobile/ios/ViroKit.framework/Headers/VROImage.h new file mode 100644 index 0000000..7bfab51 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROImage.h @@ -0,0 +1,52 @@ +// +// VROImage.hpp +// ViroRenderer +// +// Created by Raj Advani on 11/3/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROImage_h +#define VROImage_h + +#include +#include "VRODefines.h" +#include "VROTexture.h" + +class VROImage { + +public: + + VROImage() {} + virtual ~VROImage() {} + + virtual int getWidth() const = 0; + virtual int getHeight() const = 0; + + /* + The data returned must be compatible with (convertible to) _format, + as per the table in the OpenGL ES spec: + + https://www.khronos.org/registry/OpenGL-Refpages/es3.0/html/glTexImage2D.xhtml + + E.g., if internal format is RGB565, the data returned should be RGB8 or + RGB565. If internal format is RGBA8 or RGBA4, the data returned should be + RGBA8, etc. + */ + virtual unsigned char *getData(size_t *length) = 0; + + VROTextureFormat getFormat() { + return _format; + } + +protected: + + /* + The format of the data returned by getData. + */ + VROTextureFormat _format; + + +}; + +#endif /* VROImage_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROImageUtil.h b/mobile/ios/ViroKit.framework/Headers/VROImageUtil.h new file mode 100644 index 0000000..baaf5ca --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROImageUtil.h @@ -0,0 +1,29 @@ +// +// VROImageUtil.h +// ViroRenderer +// +// Created by Raj Advani on 10/21/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VROImageUtil_h +#define VROImageUtil_h + +#include +#include +#include "VRODefines.h" + +#if VRO_PLATFORM_IOS +#import +#endif + +class VRORenderContext; +class VROTexture; + +void initBlankTexture(const VRORenderContext &context); +std::shared_ptr getBlankTexture(); + +void initPointCloudTexture(); +std::shared_ptr getPointCloudTexture(); + +#endif /* VROImageUtil_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROImageiOS.h b/mobile/ios/ViroKit.framework/Headers/VROImageiOS.h new file mode 100644 index 0000000..eee03ab --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROImageiOS.h @@ -0,0 +1,45 @@ +// +// VROImageiOS.h +// ViroRenderer +// +// Created by Raj Advani on 11/3/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROImageiOS_h +#define VROImageiOS_h + +#import "VROImage.h" +#import + +class VROImageiOS : public VROImage { + +public: + + /* + Construct a new VROImage from the given UIImage. The data will + be extracted from the UIImage into a format compatible with the + given target internal format. + */ + VROImageiOS(UIImage *image, VROTextureInternalFormat format); + virtual ~VROImageiOS(); + + int getWidth() const { + return _width; + } + int getHeight() const { + return _height; + } + unsigned char *getData(size_t *length); + +private: + + bool hasAlpha(UIImage *image); + + int _width, _height; + int _dataLength; + unsigned char *_data; + +}; + +#endif /* VROImageiOS_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROInputControllerBase.h b/mobile/ios/ViroKit.framework/Headers/VROInputControllerBase.h new file mode 100644 index 0000000..d1fc122 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROInputControllerBase.h @@ -0,0 +1,296 @@ +// +// VROInputControllerBase.h +// ViroRenderer +// +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROInputControllerBase_h +#define VROInputControllerBase_h + +#include +#include +#include +#include +#include +#include +#include "VROInputPresenter.h" +#include "VROScene.h" +#include "VRORenderContext.h" +#include "VROEventDelegate.h" +#include "VROHitTestResult.h" +#include "VRONode.h" +#include "VROGeometry.h" + +static const float ON_DRAG_DISTANCE_THRESHOLD = 0.01; +static const float ON_PINCH_SCALE_THRESHOLD = 0.02; +static const float ON_ROTATE_THRESHOLD = 0.01; // in radians (~.5729 degrees) +static float kSceneBackgroundDistance = 8; + +/* + Responsible for mapping generalized input data from a controller, to a unified + set of VROEventDelegate.EventTypes. It then notifies corresponding VROEventDelegates + in the current scene about the event type that has been triggered. + + For example, VROInputControllerDaydream maps the onTouchPadClick event onto + a Viro onPrimaryClick event type within VROInputControllerBase, of which then notifies all + VROEventDelegates about such an event. + */ +class VROInputControllerBase { +public: + VROInputControllerBase(); + virtual ~VROInputControllerBase(){} + + /* + For testing background reticle distance. + */ + void debugMoveReticle(); + + /* + onProcess is to be implemented by derived classes to drive the processing + of platform-specific input events and map them to viro-specific input events. + */ + virtual void onProcess(const VROCamera &camera) { + //No-op + } + + /* + Called when the renderer is about to be backgrounded within Android's lifecycle. + */ + virtual void onPause() { + // No-op + } + + /* + Called when the renderer is about to be foregrounded within Android's lifecycle. + */ + virtual void onResume() { + // No-op + } + + void attachScene(std::shared_ptr scene) { + _scene = scene; + } + void detachScene() { + _scene = nullptr; + } + + /* + Set the current view and projection matrices. + */ + void setView(VROMatrix4f view); + void setProjection(VROMatrix4f projection); + + /* + Get the presenter, creating it if it does not yet exist. Must be invoked on the + rendering thread. + */ + std::shared_ptr getPresenter() { + if (!_controllerPresenter) { + _controllerPresenter = createPresenter(); + registerEventDelegate(_controllerPresenter); + } + return _controllerPresenter; + } + + virtual std::string getHeadset() = 0; + virtual std::string getController() = 0; + + /* + For notifying components outside the scene tree, we specifically register + them here to be tracked by the VROEventManager. Calling registerEventDelegate + twice with the same delegate will only have callbacks be triggered once. + */ + void registerEventDelegate(std::shared_ptr delegate){ + _delegates.insert(delegate); + } + void removeEventDelegate(std::shared_ptr delegate){ + _delegates.erase(delegate); + } + + /* + Below are Viro-specific input events to be trigged by derived Input Controller + classes; these are the Viro-sepcific events that platform-specific events + are mapped to. + */ + void onControllerStatus(int source, VROEventDelegate::ControllerStatus status); + void onButtonEvent(int source, VROEventDelegate::ClickState clickAction); + void onTouchpadEvent(int source, VROEventDelegate::TouchState touchAction, float lastKnownX, float lastKnownY); + + /* + The following position, rotation and forward are all in world coordinates. + */ + void onMove(int source, VROVector3f position, VROQuaternion rotation, VROVector3f forward); + void onSwipe(int source, VROEventDelegate::SwipeState swipeState); + void onScroll(int source, float x, float y); + + /* + Pinch event that passes scale factor indicting the change in the pinch ratio + since the pinch started. Scale factor begins at 1 when pinch starts with + PinchState::PinchStart. + */ + void onPinch(int source, float scaleFactor, VROEventDelegate::PinchState pinchState); + + void onRotate(int source, float rotationRadians, VROEventDelegate::RotateState rotateState); + +protected: + + virtual std::shared_ptr createPresenter(){ + perror("Error: Derived class should create a presenter for BaseInputController to consume!"); + return nullptr; + } + + /* + This function returns the forward offset used in drag + */ + virtual VROVector3f getDragForwardOffset() = 0; + + /* + Status of the current controller, for example if it's Connected / Disconnected. + */ + VROEventDelegate::ControllerStatus _currentControllerStatus; + + /* + Update the hit node, performing an intersection from the camera's position + toward the given direction. + */ + void updateHitNode(const VROCamera &camera, VROVector3f origin, VROVector3f ray); + + /* + VRODraggedObject encapsulates all the information that needs to be tracked + and processed for onDrag events for a given dragged node. + */ + struct VRODraggedObject{ + std::shared_ptr _draggedNode; + VROVector3f _originalHitLocation; + VROVector3f _originalDraggedNodePosition; + VROVector3f _forwardOffset; + float _draggedDistanceFromController; + }; + + /* + Last hit result that we are performing a drag event on. + */ + std::shared_ptr _lastDraggedNode; + + /* + This function is meant to be called to run the dragging logic after onMove + deals with other events, etc. This allows for the dragging logic to be overridden. + */ + virtual void processDragging(int source); + + /* + Last result that was returned from the hit test. + */ + std::shared_ptr _hitResult; + + /* + Last known posiiton of the controller. + */ + VROVector3f _lastKnownPosition; + + /* + Last known position of the node that was dragged previously by this controller. + */ + VROVector3f _lastDraggedNodePosition; + + /* + The pointer's normalized forward vector indicating where the controller + is pointing. + */ + VROVector3f _lastKnownForward; + + /* + Last known pinch scale value. + */ + float _lastPinchScale; + + /* + Last known rotation value in radians. + */ + float _lastRotation; + + /* + The view and projection matrices, updated each render cycle. + */ + VROMatrix4f _view, _projection; + + /* + Delegates registered within the manager to be notified of events + to an element that is outside the scene tree. + */ + std::set> _delegates; + + std::shared_ptr _scene; + + /* + Returns the hit test result for the closest node that was hit. + */ + VROHitTestResult hitTest(const VROCamera &camera, VROVector3f origin, VROVector3f ray, bool boundsOnly); + + virtual void processGazeEvent(int source); + +private: + + /* + UI presenter for this input controller. + */ + std::shared_ptr _controllerPresenter; + + /* + Last known position that a TouchEvent occured on. + */ + VROVector3f _lastTouchedPosition; + + /* + The controller's quaternion that represents the rotation from (0, 0, -1) required to + achieve the controller's current orientation. + */ + VROQuaternion _lastKnownRotation; + + /* + Last node that we have clicked down on. + */ + std::shared_ptr _lastClickedNode; + + /* + Last known that was successfully hovered upon. + */ + std::shared_ptr _lastHoveredNode; + + /* + Returns the first node that is able to handle the event action by bubbling it up. + If nothing is able to handle the event, nullptr is returned. + */ + std::shared_ptr getNodeToHandleEvent(VROEventDelegate::EventAction action, + std::shared_ptr startingNode); + + /* + Current node that we are fusing on. + */ + std::shared_ptr _currentFusedNode; + + /* + Current node that we are pinching on. + */ + std::shared_ptr _currentPinchedNode; + + /* + Current node that we are rotating on. + */ + std::shared_ptr _currentRotateNode; + + /* + Time at which the onFuse event is triggered, in milliseconds. + */ + double _fuseTriggerAtMillis = -1; + + /* + True if we have already notified delegates about the onFuse event. + */ + bool _haveNotifiedOnFuseTriggered; + void processOnFuseEvent(int source, std::shared_ptr node); + void notifyOnFuseEvent(int source, float timeToFuseRatio); +}; + +#endif diff --git a/mobile/ios/ViroKit.framework/Headers/VROInputControllerCardboardiOS.h b/mobile/ios/ViroKit.framework/Headers/VROInputControllerCardboardiOS.h new file mode 100644 index 0000000..23deefd --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROInputControllerCardboardiOS.h @@ -0,0 +1,37 @@ +// +// VROInputControllerCardboardiOS.h +// ViroRenderer +// +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROInputControllerCardboardiOS_H +#define VROInputControllerCardboardiOS_H + +#include +#include "VRORenderContext.h" +#include "VROInputControllerBase.h" +#include "VROInputPresenterCardboardiOS.h" + +class VROInputControllerCardboardiOS : public VROInputControllerBase { + +public: + VROInputControllerCardboardiOS(){} + virtual ~VROInputControllerCardboardiOS(){} + virtual VROVector3f getDragForwardOffset(); + void onProcess(const VROCamera &camera); + void onScreenClicked(); + std::string getHeadset(); + std::string getController(); + +protected: + std::shared_ptr createPresenter() { + return std::make_shared(); + } + +private: + + void updateOrientation(const VROCamera &camera); + +}; +#endif diff --git a/mobile/ios/ViroKit.framework/Headers/VROInputPresenter.h b/mobile/ios/ViroKit.framework/Headers/VROInputPresenter.h new file mode 100644 index 0000000..f2b4336 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROInputPresenter.h @@ -0,0 +1,226 @@ +// +// VROInputPresenter.h +// ViroRenderer +// +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROInputPresenter_H +#define VROInputPresenter_H + +#include +#include +#include "VROEventDelegate.h" +#include "VRORenderContext.h" +#include "VROReticle.h" +#include "VRONode.h" +#include "VROMath.h" +#include "VROInputType.h" +#include "VROThreadRestricted.h" + +static const float kReticleSizeMultiple = 3; +static const bool kDebugSceneBackgroundDistance = false; + +/* + VROInputPresenter contains all UI view implementations to be displayed for a given + VROInputController. + */ +class VROInputPresenter : public VROEventDelegate, public VROThreadRestricted { +public: + + VROInputPresenter() : VROThreadRestricted(VROThreadName::Renderer) { + _reticle = nullptr; + _rootNode = std::make_shared(); + } + + ~VROInputPresenter() {} + + std::shared_ptr getRootNode(){ + return _rootNode; + } + + void setEventDelegate(std::shared_ptr delegate){ + _eventDelegateWeak = delegate; + } + + virtual void onHover(int source, std::shared_ptr node, bool isHovering, std::vector position) { + passert_thread(); + + std::shared_ptr delegate = getDelegate(); + if (delegate != nullptr && delegate->isEventEnabled(VROEventDelegate::EventAction::OnHover)){ + delegate->onHover(source, node, isHovering, position); + } + } + + virtual void onClick(int source, std::shared_ptr node, ClickState clickState, std::vector position) { + passert_thread(); + + std::shared_ptr delegate = getDelegate(); + if (delegate != nullptr && delegate->isEventEnabled(VROEventDelegate::EventAction::OnClick)){ + delegate->onClick(source, node, clickState, position); + } + } + + virtual void onTouch(int source, std::shared_ptr node, TouchState state, float x, float y){ + passert_thread(); + + std::shared_ptr delegate = getDelegate(); + if (delegate != nullptr && delegate->isEventEnabled(VROEventDelegate::EventAction::OnTouch)){ + delegate->onTouch(source, node, state, x, y); + } + } + + virtual void onMove(int source, std::shared_ptr node, + VROVector3f rotation, VROVector3f position, VROVector3f forwardVec) { + passert_thread(); + _lastKnownForward.store(forwardVec); + std::shared_ptr delegate = getDelegate(); + if (delegate != nullptr && delegate->isEventEnabled(VROEventDelegate::EventAction::OnMove)){ + delegate->onMove(source, node, rotation, position, forwardVec); + } + } + + virtual void onControllerStatus(int source, ControllerStatus status) { + passert_thread(); + + std::shared_ptr delegate = getDelegate(); + if (delegate != nullptr && delegate->isEventEnabled(VROEventDelegate::EventAction::OnControllerStatus)){ + delegate->onControllerStatus(source, status); + } + } + + virtual void onSwipe(int source, std::shared_ptr node, SwipeState swipeState) { + passert_thread(); + + std::shared_ptr delegate = getDelegate(); + if (delegate != nullptr && delegate->isEventEnabled(VROEventDelegate::EventAction::OnSwipe)){ + delegate->onSwipe(source, node, swipeState); + } + } + + virtual void onScroll(int source, std::shared_ptr node, float x, float y) { + passert_thread(); + + std::shared_ptr delegate = getDelegate(); + if (delegate != nullptr && delegate->isEventEnabled(VROEventDelegate::EventAction::OnScroll)){ + delegate->onScroll(source, node, x, y); + } + } + + virtual void onGazeHit(int source, std::shared_ptr node, const VROHitTestResult &hit) { + //No-op + } + + virtual void onDrag(int source, std::shared_ptr node, VROVector3f newPosition) { + passert_thread(); + + std::shared_ptr delegate = getDelegate(); + if (delegate != nullptr && delegate->isEventEnabled(VROEventDelegate::EventAction::OnDrag)){ + delegate->onDrag(source, node, newPosition); + } + } + + virtual void onFuse(int source, std::shared_ptr node, float timeToFuseRatio) { + passert_thread(); + if (_reticle == nullptr) { + return; + } + + std::shared_ptr delegate = getDelegate(); + if (delegate != nullptr && delegate->isEventEnabled(VROEventDelegate::EventAction::OnFuse)) { + delegate->onFuse(source, node, timeToFuseRatio); + } + + // TimeToFuseRatio is (time that has passed since fuse began) / (total time to fuse). + // When the timeToFuseRatio reaches 1, it is an indication that the node has been "onFused". + if (timeToFuseRatio == kOnFuseReset) { + _reticle->stopFuseAnimation(); + } else { + _reticle->animateFuse(1 - timeToFuseRatio); + } + } + + std::shared_ptr getReticle() { + return _reticle; + } + + void setReticle(std::shared_ptr reticle){ + _reticle = reticle; + _reticleInitialPositionSet = false; + } + + VROVector3f getLastKnownForward(){ + return _lastKnownForward.load(); + } + + void updateLastKnownForward(VROVector3f forward) { + _lastKnownForward.store(forward); + } + +protected: + + std::shared_ptr _rootNode; + + void onReticleGazeHit(const VROHitTestResult &hit) { + passert_thread(); + if (_reticle == nullptr) { + return; + } + + float depth = -hit.getDistance(); + + if (!_reticle->isHeadlocked()) { + _reticle->setPosition(hit.getLocation()); + + float worldPerScreen = hit.getCamera().getWorldPerScreen(depth); + float radius = fabs(worldPerScreen) * kReticleSizeMultiple; + _reticle->setRadius(radius); + } + else { + // Lock the Reticle's position to the center of the screen + // for fixed pointer mode (usually Cardboard). The reticle is + // rendered as HUD object, with view matrix identity (e.g. it + // always follows the headset) + + // Set the 'depth' of the reticle to the object it is hovering + // over, then set the radius to compensate for that distance so + // that the reticle stays the same size. The depth effectively + // determines the difference in reticle position between the two + // eyes. + + // Only use the background depth if this is our first time + // positioning the reticle. Otherwise we maintain the current + // reticle depth, to avoid reticle 'popping' that occurs when + // the user moves from an actual focused object to the background. + // The background has no 'actual' depth so this is ok. + if (!_reticleInitialPositionSet || !hit.isBackgroundHit() || kDebugSceneBackgroundDistance) { + _reticle->setPosition(VROVector3f(0, 0, depth)); + _reticleInitialPositionSet = true; + + float worldPerScreen = hit.getCamera().getWorldPerScreen(depth); + float radius = fabs(worldPerScreen) * kReticleSizeMultiple; + _reticle->setRadius(radius); + } + } + } + +private: + + std::weak_ptr _eventDelegateWeak; + + std::shared_ptr _reticle; + bool _reticleInitialPositionSet; + std::atomic _lastKnownForward; + + /* + Event delegate for triggering calls back to Controller_JNI. + */ + std::shared_ptr getDelegate(){ + if (_eventDelegateWeak.expired()){ + return nullptr; + } + return _eventDelegateWeak.lock(); + } + +}; +#endif diff --git a/mobile/ios/ViroKit.framework/Headers/VROInputPresenterCardboardiOS.h b/mobile/ios/ViroKit.framework/Headers/VROInputPresenterCardboardiOS.h new file mode 100644 index 0000000..0f05a02 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROInputPresenterCardboardiOS.h @@ -0,0 +1,40 @@ +// +// VROControllerPresenterCardboard.h +// ViroRenderer +// +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROControllerPresenterCardboardiOS_H +#define VROControllerPresenterCardboardiOS_H + +#include +#include +#include +#include "VRORenderContext.h" +#include "VROInputControllerBase.h" +#include "VROEventDelegate.h" +#include "VROHitTestResult.h" + +class VROInputPresenterCardboardiOS : public VROInputPresenter { +public: + + VROInputPresenterCardboardiOS() { + setReticle(std::make_shared(nullptr)); + getReticle()->setPointerFixed(true); + } + virtual ~VROInputPresenterCardboardiOS() {} + + void onClick(int source, std::shared_ptr node, ClickState clickState, std::vector clickedPosition) { + VROInputPresenter::onClick(source, node, clickState, clickedPosition); + if (clickState == ClickState::ClickUp){ + getReticle()->trigger(); + } + } + + void onGazeHit(int source, std::shared_ptr node, const VROHitTestResult &hit) { + VROInputPresenter::onReticleGazeHit(hit); + } +}; + +#endif diff --git a/mobile/ios/ViroKit.framework/Headers/VROInputType.h b/mobile/ios/ViroKit.framework/Headers/VROInputType.h new file mode 100644 index 0000000..e5c1526 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROInputType.h @@ -0,0 +1,47 @@ +// +// VROControllerInputType.h +// ViroRenderer +// +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROInputType_h +#define VROInputType_h + +#include +#include +#include +#include +#include +#include + +/** + * Header file containing sets of input sources that are grouped to + * a VR platform. + */ +namespace ViroDayDream{ + enum InputSource{ + Controller = 1, + TouchPad = 2, + AppButton = 3, + HomeButton = 4, + VolUpButton = 5, + VolDownButton = 6 + }; +} + +namespace ViroCardBoard{ + enum InputSource{ + Controller=1, + ViewerButton = 2 + }; +} + +namespace ViroOculus{ + enum InputSource{ + Controller = 1, + TouchPad = 2, + BackButton = 3 + }; +} +#endif diff --git a/mobile/ios/ViroKit.framework/Headers/VROLazyMaterial.h b/mobile/ios/ViroKit.framework/Headers/VROLazyMaterial.h new file mode 100644 index 0000000..d015400 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROLazyMaterial.h @@ -0,0 +1,28 @@ +// +// VROLazyMaterial.h +// ViroRenderer +// +// Created by Raj Advani on 2/14/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROLazyMaterial_h +#define VROLazyMaterial_h + +#include + +class VROMaterial; + +/* + Interface for a lazy-loading material. Enables the animation system + to retrieve target materials lazily at the start of material animations. + */ +class VROLazyMaterial { + +public: + + virtual std::shared_ptr get() = 0; + +}; + +#endif /* VROLazyMaterial_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROLight.h b/mobile/ios/ViroKit.framework/Headers/VROLight.h new file mode 100644 index 0000000..66840de --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROLight.h @@ -0,0 +1,372 @@ +// +// VROLight.h +// ViroRenderer +// +// Created by Raj Advani on 12/7/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VROLight_h +#define VROLight_h + +#include +#include +#include +#include +#include +#include "VROVector3f.h" +#include "VROVector4f.h" +#include "VROMatrix4f.h" +#include "VROAnimatable.h" + +static std::atomic_int sLightId; +class VROTexture; +class VROPencil; +class VROLightingUBO; + +enum class VROLightType { + Ambient, + Directional, + Omni, + Spot +}; + +enum class VROShadowMode { + Forward, + Deferred, + Modulated +}; + +class VROLight : public VROAnimatable { + +public: + + static uint32_t hashLights(const std::vector> &lights); + + VROLight(VROLightType type); + ~VROLight() {} + + uint32_t getLightId() const { + return _lightId; + } + + VROLightType getType() const { + return _type; + } + +#pragma mark - Light Properties + + void setColor(VROVector3f color); + VROVector3f getColor() const { + return _color; + } + + void setIntensity(float intensity); + float getIntensity() const { + return _intensity; + } + + void setTemperature(float temperature); + float getTemperature() const { + return _temperature; + } + VROVector3f getColorFromTemperature() const { + return _colorFromTemperature; + } + + void setName(std::string name) { + this->_name = name; + } + std::string getName() const { + return _name; + } + + void setPosition(VROVector3f position); + VROVector3f getPosition() const { + return _position; + } + + void setDirection(VROVector3f direction); + VROVector3f getDirection() const { + return _direction; + } + + void setAttenuationStartDistance(float attenuationStartDistance); + float getAttenuationStartDistance() const { + return _attenuationStartDistance; + } + + void setAttenuationEndDistance(float attenuationEndDistance); + float getAttenuationEndDistance() const { + return _attenuationEndDistance; + } + + void setAttenuationFalloffExponent(float attenuationFalloffExponent); + float getAttenuationFalloffExponent() const { + return _attenuationFalloffExponent; + } + + void setSpotInnerAngle(float spotInnerAngle); + float getSpotInnerAngle() const { + return _spotInnerAngle; + } + + void setSpotOuterAngle(float spotOuterAngle); + float getSpotOuterAngle() const { + return _spotOuterAngle; + } + + void setInfluenceBitMask(int influenceBitMask) { + _influenceBitMask = influenceBitMask; + } + int getInfluenceBitMask() const { + return _influenceBitMask; + } + +#pragma mark - Shadow Properties + + void setCastsShadow(bool castsShadow); + bool getCastsShadow() const { + return _castsShadow; + } + + void setShadowOpacity(float shadowOpacity); + float getShadowOpacity() const { + return _shadowOpacity; + } + + void setShadowMapSize(int shadowMapSize) { + _shadowMapSize = shadowMapSize; + } + int getShadowMapSize() const { + return _shadowMapSize; + } + + void setShadowBias(float shadowBias) { + _updatedFragmentData = true; + _shadowBias = shadowBias; + } + float getShadowBias() const { + return _shadowBias; + } + + void setShadowOrthographicSize(float size) { + _shadowOrthographicSize = size; + } + float getShadowOrthographicSize() const { + return _shadowOrthographicSize; + } + + void setShadowNearZ(float nearZ) { + _shadowNearZ = nearZ; + } + float getShadowNearZ() const { + return _shadowNearZ; + } + + void setShadowFarZ(float farZ) { + _shadowFarZ = farZ; + } + float getShadowFarZ() const { + return _shadowFarZ; + } + +#pragma mark - Light Implementation + + /* + Lights hold onto their UBOs so that they can propagate their + updates to them. Each time a light is updated, it pushes the + update to all of its parent UBOs. + */ + void addUBO(std::shared_ptr ubo) { + _ubos.push_back(ubo); + } + void propagateFragmentUpdates(); + void propagateVertexUpdates(); + + void setTransformedPosition(VROVector3f position); + VROVector3f getTransformedPosition() const { + return _transformedPosition; + } + +#pragma mark - Shadow Implementation + + int getShadowMapIndex() const { + return _shadowMapIndex; + } + void setShadowMapIndex(int shadowMapIndex) { + _updatedFragmentData = true; + _shadowMapIndex = shadowMapIndex; + } + + VROMatrix4f getShadowViewMatrix() const { + return _shadowViewMatrix; + } + VROMatrix4f getShadowProjectionMatrix() const { + return _shadowProjectionMatrix; + } + + void setShadowViewMatrix(VROMatrix4f shadowViewMatrix) { + _updatedVertexData = true; + _shadowViewMatrix = shadowViewMatrix; + } + void setShadowProjectionMatrix(VROMatrix4f shadowProjectionMatrix) { + _updatedVertexData = true; + _shadowProjectionMatrix = shadowProjectionMatrix; + } + +#pragma mark - Debugging + + void drawLightFrustum(std::shared_ptr pencil); + +private: + + uint32_t _lightId; + VROLightType _type; + + /* + RGB color of the light. + */ + VROVector3f _color; + + /* + Luminous flux of the light, ranging from 0 to 1000. Modulates the color of the + light. + */ + float _intensity; + + /* + The temperature of the light, in Kelvin. Viro will derive a hue from this temperature + and multiply it by _color. To model a physical light, you can leave _color set to + (1.0, 1.0, 1.0) and set the temperature only. The default value is 6500K, which + represents pure white light. + */ + float _temperature; + + /* + The color as derived from _temperature. + */ + VROVector3f _colorFromTemperature; + + std::string _name; + bool _updatedFragmentData; + bool _updatedVertexData; + + /* + The position of the light. For omnidirectional and spotlights, this represents + the position from which the light emanates. For directional lights there is no + position, but we still use this field to indicate where the directional light's + shadow map should be centered. + */ + VROVector3f _position; + + /* + Attenuation parameters for omni and spot lights. + */ + float _attenuationStartDistance; + float _attenuationEndDistance; + float _attenuationFalloffExponent; + + /* + Diffuse parameters. + */ + VROVector3f _direction; + + /* + Spot parameters. The inner angle is the angle from edge to edge of + the 'full strength' light cone. The lighting is at maximum intensity + within this cone, and begins to attenuate outside of it. + + The outer angle is the angle from edge to edge of the "attenuated" + light cone. The lighting declines in strength betewen the inner angle + and outer angle. Outside of the outer angle the light attenuates to + zero, resulting in no light. + + Both of these are specified in degrees. + */ + float _spotInnerAngle; + float _spotOuterAngle; + + /* + Internal. The position of the light after all its supernode + transforms have been applied. + */ + VROVector3f _transformedPosition; + + /* + Weak refs to all UBOs that use this light. Needed so that when this + light is updated, we can flag the UBO as a whole as requiring an + update. + */ + std::vector> _ubos; + + /* + True if this light casts shadows. + */ + bool _castsShadow; + + /* + The opacity of the shadow. 1.0 implies a pitch black shadow. + */ + float _shadowOpacity; + + /* + The size of the depth map to use to render shadows. Larger sizes produce + more detailed shadows at higher cost to rendering performance. Lower sizes + are faster but result in pixelation at the edges. + */ + int _shadowMapSize; + + /* + The amount of bias to apply to the Z coordinate when performing the shadow + depth comparison. This reduces shadow acne, but large biases can increase + "peter panning". + */ + float _shadowBias; + + /* + This property only applies to directional lights, where an orthographic + projection is used to render the shadow map. The orthographic size determines + the width and height of the area, centered at _position, that should be rendered + to the shadow map. + + A larger value means more of the scene will be shadowed, but + at lower resolution. + */ + float _shadowOrthographicSize; + + /* + The near and far clipping planes to use when rendering shadows. Shadows are + only cast by surfaces within these planes. + */ + float _shadowNearZ, _shadowFarZ; + + /* + The index into the shadow render target's texture array where we can find this + light's shadow map. + */ + int _shadowMapIndex; + + /* + Bit mask that is ANDed with each node's lightReceivingBitMask and shadowCastingBitMask + to determine what objects are illuminated by, and cast shadows from, this light. + + Default is 1. + */ + int _influenceBitMask; + + /* + The view and projection matrices used to transform any point in world + space into its corresponding texcoord in the light's shadow depth map. + */ + VROMatrix4f _shadowViewMatrix; + VROMatrix4f _shadowProjectionMatrix; + + /* + Derive the RGB color (hue) from the given temperature in Kelvin. + */ + VROVector3f deriveRGBFromTemperature(float temperature); + +}; + +#endif /* VROLight_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROLineSegment.h b/mobile/ios/ViroKit.framework/Headers/VROLineSegment.h new file mode 100644 index 0000000..42efdf3 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROLineSegment.h @@ -0,0 +1,231 @@ +// +// VROTriangle.h +// ViroRenderer +// +// Created by Raj Advani on 10/12/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROLINESEGMENT_H_ +#define VROLINESEGMENT_H_ + +#include "VROVector3f.h" + +enum class VROOrientation { + Colinear = 0, + Left = 1, + Right = -1 +}; + +class VROLineSegment { +public: + + /* + Construct a new {@link LineSegment}. + + @param A + First point. + @param B + Second point. + */ + VROLineSegment(VROVector3f A, VROVector3f B); + + /* + Get the start and end of this segment. + */ + VROVector3f getA() const; + VROVector3f getB() const; + + /* + Get a ray representation of the segment, the midpoint or the length. + */ + VROVector3f ray() const; + VROVector3f midpoint() const; + float length() const; + float lengthApprox() const; + + /* + Flip the orientation of this segment (set A to B and vice-versa). + */ + VROLineSegment flip() const; + + /* + Returns the orientation (as a VROOrientation) of the direction of the point p relative + to this segment. + */ + VROOrientation orientationOfPoint(VROVector3f q) const; + + /* + Test if this segment intersects the given 2D segment or 2D box. + */ + bool intersectsSegment2D(VROLineSegment other) const; + bool intersectsSegment2D(VROLineSegment other, VROVector3f *result) const; + bool intersectsBox2D(float left, float right, float bottom, float top) const; + + /* + Test if the line represented by this segment intersects the line represented by the + given segment. This function treats both segments as infinitely extending lines. + */ + bool intersectsLine(VROLineSegment other, VROVector3f *result) const; + + /* + Test if this line segment intersects plane defined by the given point and normal. + Return true if so, storing the intersection point in the given out vector. + */ + bool intersectsPlane(VROVector3f point, VROVector3f normal, VROVector3f *outIntersectionPoint) const; + + /* + Get the angle this segment makes with the given other line-segment, + normalized to the range [0, PI/2]. Note that this method ignores the + direction of the line-segment (we do not treat line-segments like + rays). + */ + float angleWithSegment(VROLineSegment other) const; + float angle2DWithSegment(VROLineSegment other) const; + + /* + Get the angle this segment makes with the given other line-segment, + normalized to the range [-PI, PI]. Note that this method takes into + account the direction of the line-segment. A positive angle is + taken to mean the other segment is that many radians + counter-clockwise from this segment. Likewise, a negative angle + implies clockwise rotation. + + For example, the angle between the segment [(0, -1) -> (0, 0)] and [(0, + 0) -> (1,1)] is -45 degrees, as the latter is 45 degrees clockwise from + the former. + */ + float directedAngleWithSegment(VROLineSegment other) const; + + /* + Compute the angle, in the same manner as directedAngleWithSegment, that this + segment makes with the given ray. + */ + float directedAngleWithRay(VROVector3f ray) const; + + /* + Translate the segment by the given amount. + */ + VROLineSegment translate(VROVector3f translation) const; + + /* + Rotate this line segment counter-clockwise about its center by the given + amount and return the result. Does not mutate this segment. + */ + VROLineSegment rotate(float radians) const; + + /* + Rotate this line segment counter-clockwise about its start point, by the + given number of radians, and store the result. Does not mutate this + segment. + */ + VROLineSegment pivot(float radians) const; + + /* + Scale this segment out by the given factor. This will essentially just + grow the segment, keeping its angle and midpoint the same. + */ + VROLineSegment scale(float scale) const; + + /* + Get the normal unit vector in the positive or negative + direction for this line segment. This is a 2D calculation, + so the z-values in the line segment are ignored and the + z-value in the returned vector will be zero. + + The returned vector will be <0, 0, 0> if this line + segment has an 2D-length of 0. + */ + VROVector3f normal2DUnitVector(bool positive) const; + + /* + Extend this segment out by the given amount. This + essentially just pushes out the B endpoint in the direction of the segment. + The second function will push out the A endpoint in the reverse direction + of the segment, and the third does both. + */ + VROLineSegment extend(float amount) const; + VROLineSegment extendBackwards(float amount) const; + VROLineSegment extendForwardAndBackward(float amount) const; + + /* + Shift the line segment by the given amount. This pushes out the A + and B endpoints in the direction of the segment. + */ + VROLineSegment shift(float amount) const; + + /* + Traverse the line-segment by the given distance from the start-point and + return the result. If we overshoot either endpoint of the segment, just + interpolate away. The distance may be negative to go backward (from B to A + instead of A to B). + */ + VROVector3f traverseFromStart(float distance) const; + VROVector3f traverseFromEnd(float distance) const; + + /* + Returns the 't' that gives the closest point on this line to + the given point 'p' for the vector operation 'AB * t + A', note + that this may be off of the actual line segment if t is not in + [0, 1] + + see: * http://mathworld.wolfram.com/Point-LineDistance3-Dimensional.html + */ + float parameterOfClosestPoint(VROVector3f p) const; + + /* + Find the point on the line segment defined that is closest to + the given point. Call the closest point on the line P. Observe + that the vector formed by P and the given point is orthogonal + to the line defined by p1 and p2. Thus the dot product of these + two vectors is zero. From there we can calculate the x, y, and + z of the point P (after a lot of hairy algebra). + */ + VROVector3f pointOnLineSegmentClosestTo(VROVector3f p) const; + float distanceToPoint(VROVector3f v) const; + float distanceToPointSigned(VROVector3f v) const; + + /* + Find the point on the infinite line given by this line segment + that is closest to the given point 'p'. + */ + VROVector3f pointOnLineClosestTo(VROVector3f p) const; + + /* + Offset this line-segment by the given amount, and store the result in the + given segment. Positive distance offsets to the left, negative to the right. + */ + void offsetByDistance(double distance, VROLineSegment *result) const; + + /* + Return a string representation of this segment. + */ + std::string toString() const; + + inline bool operator==(const VROLineSegment &other) const { + return other.__A == __A && other.__B == __B; + } + +private: + + // Note: we use double underscores here (__A, __B, etc.) because _B is a + // reserved macro on some platforms (Android NDK) + + /* + The two points joined by this segment. + */ + VROVector3f __A, __B; + + /* + Useful values for intermediate calculations. + */ + float __ABx, __ABy, __ABz; + + /* + Square of the length. + */ + float _lengthSq; + +}; + +#endif /* VROLINESEGMENT_H_ */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROLog.h b/mobile/ios/ViroKit.framework/Headers/VROLog.h new file mode 100644 index 0000000..793f9f1 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROLog.h @@ -0,0 +1,741 @@ +// +// VROLog.h +// ViroRenderer +// +// Created by Raj Advani on 10/21/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#include "VRODefines.h" + +#pragma once +//// Test debug defines +//#ifdef NDEBUG +//#pragma message "NDEBUG is #defined." +//#else +//#pragma message "NDEBUG is not #defined." +//#endif + +#undef PASSERT_INNERLOOPS_ENABLED // Do not define, unless you want passert_innerloop() asserts +// to run, which are passert_msg() calls that are made inside inner loops, which would slow down +// the app massively if on. Used for debugging those particular loops only, and left off to not slow +// the app down for other developers. + +///////////////////////////////////////////////////////////////////////////////// +// +// Android: Logging +// +///////////////////////////////////////////////////////////////////////////////// +#pragma mark - +#pragma mark Android Logging + +#if VRO_PLATFORM_ANDROID + +#include +#include +#include + +// -------------------------------- +// Escape sequences for logging color: +// 16-color = 4-bits = [highlight][blue][green][red] +// These are #defines instead of const char [] so they can be used more easily in perr() and pfatal(). +// http://en.wikipedia.org/wiki/ANSI_escape_code + +// -------- +// special +#define ANSINoColor "\e[0m" // reset / normal +#define ANSIBold "\e[1m" // bold + +// NOTE: the following uses 0 (reset) and 1 (bold) for intensities, +// which is used by BOTH foreground and background, +// and 0 will reset BOTH the foreground and background, +// thus this doesn't work: ANSIBackBlue ANSICyan +// since the "0" in Cyan is a reset, which resets the background. + +// -------- +// foreground +// light colors +#define ANSIBlack "\e[0;30m" +#define ANSIRed "\e[0;31m" +#define ANSIGreen "\e[0;32m" +#define ANSIBrown "\e[0;33m" +#define ANSIDarkYellow "\e[0;33m" +#define ANSIBlue "\e[0;34m" +#define ANSIMagenta "\e[0;35m" +#define ANSICyan "\e[0;36m" +#define ANSILightGray "\e[0;37m" +// bright colors +#define ANSIDarkGray "\e[1;30m" +#define ANSILightRed "\e[1;31m" +#define ANSILightGreen "\e[1;32m" +#define ANSIYellow "\e[1;33m" +#define ANSILightBlue "\e[1;34m" +#define ANSILightMagenta "\e[1;35m" +#define ANSILightCyan "\e[1;36m" +#define ANSIWhite "\e[1;37m" +// default text color +#define ANSIDefault "\e[1;39m" + +// -------- +// background +// light colors +#define ANSIBackBlack "\e[0;40m" +#define ANSIBackRed "\e[0;41m" +#define ANSIBackGreen "\e[0;42m" +#define ANSIBackBrown "\e[0;43m" +#define ANSIBackBlue "\e[0;44m" +#define ANSIBackMagenta "\e[0;45m" +#define ANSIBackCyan "\e[0;46m" +#define ANSIBackLightGray "\e[0;47m" +// bright colors +#define ANSIBackDarkGray "\e[1;40m" +#define ANSIBackLightRed "\e[1;41m" +#define ANSIBackLightGreen "\e[1;42m" +#define ANSIBackYellow "\e[1;43m" +#define ANSIBackLightBlue "\e[1;44m" +#define ANSIBackLightMagenta "\e[1;45m" +#define ANSIBackLightCyan "\e[1;46m" +#define ANSIBackWhite "\e[1;47m" +// default background color +#define ANSIBackDefault "\e[1;49m" + +#elif VRO_PLATFORM_IOS + +#include "VROOpenGL.h" // For pglpush and pglpop implementations + +/* + ANSI colors don't resolve on the iOS debug console, so we + deactivate them. + */ +#define ANSINoColor "" +#define ANSIBold "" +#define ANSIBlack "" +#define ANSIRed "" +#define ANSIGreen "" +#define ANSIBrown "" +#define ANSIDarkYellow "" +#define ANSIBlue "" +#define ANSIMagenta "" +#define ANSICyan "" +#define ANSILightGray "" +#define ANSIDarkGray "" +#define ANSILightRed "" +#define ANSILightGreen "" +#define ANSIYellow "" +#define ANSILightBlue "" +#define ANSILightMagenta "" +#define ANSILightCyan "" +#define ANSIWhite "" +#define ANSIDefault "" +#define ANSIBackBlack "" +#define ANSIBackRed "" +#define ANSIBackGreen "" +#define ANSIBackBrown "" +#define ANSIBackBlue "" +#define ANSIBackMagenta "" +#define ANSIBackCyan "" +#define ANSIBackLightGray "" +#define ANSIBackDarkGray "" +#define ANSIBackLightRed "" +#define ANSIBackLightGreen "" +#define ANSIBackYellow "" +#define ANSIBackLightBlue "" +#define ANSIBackLightMagenta "" +#define ANSIBackLightCyan "" +#define ANSIBackWhite "" +#define ANSIBackDefault "" + +#endif + +///////////////////////////////////////////////////////////////////////////////// +// +// Android: Logging +// +///////////////////////////////////////////////////////////////////////////////// +#pragma mark - +#pragma mark Android Logging + +// define LOG_TAG, if not already defined +#ifndef LOG_TAG +#define LOG_TAG "Viro" +#endif + +#if VRO_PLATFORM_ANDROID + +// Why do-while(0)? +// -------------------- +// It allows this: +// 1. protects against multiple statements when the #define, when it is called like a single-statement. +// 2. the while loop doesn't have a ; at the end, so that it doesn't end an if-statement with the #define called inside. +// 3. it also allows local variables to not interfere with ones on the outside. +// https://www.securecoding.cert.org/confluence/display/seccode/PRE10-C.+Wrap+multistatement+macros+in+a+do-while+loop + +#if NDEBUG + // Release build + #define pverbose(...) ((void)0) + #define cpverbose(tag, ...) ((void)0) + #define pdebug(...) ((void)0) + #define cpdebug(tag, ...) ((void)0) +#else + // Debug build + + // verbose: + #define pverbose(...) \ + do { \ + __android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__); \ + } while (0) + + #define cpverbose(tag, ...) \ + do { \ + __android_log_print(ANDROID_LOG_VERBOSE, tag, __VA_ARGS__); \ + } while (0) + + // debug: + #define pdebug(...) \ + do { \ + __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__); \ + } while (0) + + #define cpdebug(tag, ...) \ + do { \ + __android_log_print(ANDROID_LOG_DEBUG, tag, __VA_ARGS__); \ + } while (0) +#endif + +// info: +#define pinfo(...) \ + do { \ + __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__); \ + } while (0) + +#define cpinfo(tag, ...) \ + do { \ + __android_log_print(ANDROID_LOG_INFO, tag, __VA_ARGS__); \ + } while (0) + +// warn: +#define pwarn(...) \ + do { \ + __android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__); \ + } while (0) + +#define cpwarn(tag, ...) \ + do { \ + __android_log_print(ANDROID_LOG_WARN, tag, __VA_ARGS__); \ + } while (0) + +// error: +#define perr(message, ...) \ + do { \ + __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, \ + ANSILightRed "ERROR: [%s: %s(), line %d]%s\n%sERROR: %s%s" message ANSINoColor, \ + __FILE__, __FUNCTION__, __LINE__, ANSINoColor, ANSILightRed, ANSINoColor, ANSIYellow, \ + ##__VA_ARGS__); \ + } while (0) + +#define cperr(tag, message, ...) \ + do { \ + __android_log_print(ANDROID_LOG_ERROR, tag, \ + ANSILightRed "ERROR: [%s: %s(), line %d]%s\n%sERROR: %s%s" message ANSINoColor, \ + __FILE__, __FUNCTION__, __LINE__, ANSINoColor, ANSILightRed, ANSINoColor, ANSIYellow, \ + ##__VA_ARGS__); \ + } while (0) + +// fatal: +#define pfatal(message, ...) \ + do { \ + __android_log_print(ANDROID_LOG_FATAL, LOG_TAG, \ + ANSILightRed "FATAL ERROR: [%s:%d]%s\n%sFATAL ERROR: %s%s" message ANSINoColor, \ + __FILE__, __LINE__, ANSINoColor, ANSILightRed, ANSINoColor, ANSIYellow, \ + ##__VA_ARGS__); \ + abort(); \ + } while (0) + +#define cpfatal(tag, message, ...) \ + do { \ + __android_log_print(ANDROID_LOG_FATAL, tag, \ + ANSILightRed "FATAL ERROR: [%s:%d]%s\n%sFATAL ERROR: %s%s" message ANSINoColor, \ + __FILE__, __LINE__, ANSINoColor, ANSILightRed, ANSINoColor, ANSIYellow, \ + ##__VA_ARGS__); \ + abort(); \ + } while (0) + +#define pgllabel(message,...) ((void)0) +#define pglpush(message,...) ((void)0) +#define pglpop() ((void)0) + +// __android_log_assert(): +// Log an assertion failure and SIGTRAP the process to have a chance +// to inspect it. This uses the FATAL priority. +#define passert(condition) \ + do \ + { \ + if (!(condition)) { \ + _pabort(__FILE__, __LINE__, __func__, \ + "ASSERTION FAILED\n" \ + " Expression: %s", \ + #condition); \ + } \ + } while (0) + +#if VRO_THREADPOOL_LOG + #define pthreadpool(message,...) \ + do { \ + __android_log_print(ANDROID_LOG_VERBOSE, threadPoolName.c_str(), "%s%s(): "#message" %s", ANSILightMagenta, __FUNCTION__, ##__VA_ARGS__, ANSINoColor); \ + } while (0) + + #define pthreadtask(message,...) \ + do { \ + __android_log_print(ANDROID_LOG_VERBOSE, threadIdentifier.c_str(), " %s%s(): "#message" %s", ANSILightCyan, __FUNCTION__, ##__VA_ARGS__, ANSINoColor); \ + } while (0) + + #define pthreadtaskexe(message,...) \ + do { \ + __android_log_print(ANDROID_LOG_VERBOSE, threadIdentifier.c_str(), " %s%s(): "#message" %s", ANSILightBlue, __FUNCTION__, ##__VA_ARGS__, ANSINoColor); \ + } while(0) + + #define pthreadtaskerror(message,...) \ + do { \ + __android_log_print(ANDROID_LOG_VERBOSE, threadIdentifier.c_str(), " %s%s(): "#message" %s", ANSIRed, __FUNCTION__, ##__VA_ARGS__, ANSINoColor); \ + } while(0) +#else + #define pthreadpool(message,...) ((void)0) + #define pthreadtask(message,...) ((void)0) + #define pthreadtaskexe(message,...) ((void)0) + #define pthreadtaskerror(message,...) ((void)0) +#endif + +#define VERBOSE_LOGGING 0 // turn this on during development as needed + +#if NDEBUG + // Release build + #define DEBUG_LOGGING 0 +#else + // Debug build + #define DEBUG_LOGGING 1 +#endif + +static inline int +toLevel(const char* value) { + switch (value[0]) { + case 'V': return ANDROID_LOG_VERBOSE; + case 'D': return ANDROID_LOG_DEBUG; + case 'I': return ANDROID_LOG_INFO; + case 'W': return ANDROID_LOG_WARN; + case 'E': return ANDROID_LOG_ERROR; + case 'A': return ANDROID_LOG_FATAL; + case 'S': return ANDROID_LOG_SILENT; + } + return ANDROID_LOG_INFO; +} + +#define isLoggable(tag, level) \ + ({ \ + char value[PROP_VALUE_MAX]; \ + __system_property_get("log.tag." tag, value); \ + int logLevel = toLevel(value); \ + logLevel != ANDROID_LOG_SILENT && level >= logLevel; \ + }) + +#elif VRO_PLATFORM_IOS + +///////////////////////////////////////////////////////////////////////////////// +// +// iOS: Logging +// +///////////////////////////////////////////////////////////////////////////////// +#pragma mark - +#pragma mark iOS Logging + +#include +#include + +#define passert(condition) (assert(condition)) + +#define cpverbose(tag, ...) ((void)0) +#define cpdebug(tag, ...) ((void)0) +#define pverbose(message,...) ((void)0) + +#define pdebug(message,...) \ +do { \ +\ +} while (0) + +#define pinfo(message,...) \ +do { \ +NSLog(@#message, ##__VA_ARGS__); \ +} while (0) + +#define pwarn(message,...) \ +do { \ +NSLog(@#message, ##__VA_ARGS__); \ +} while (0) + +#define perr(message,...) \ +do { \ +NSLog(@"Error: "#message, ##__VA_ARGS__); \ +} while (0) + +#define pfatal(message,...) \ +do { \ +NSLog(@"Fatal Error: "#message, ##__VA_ARGS__); \ +} while (0) + +#if VRO_THREADPOOL_LOG +#define pthreadpool(message,...) \ +do { \ +NSLog(@"[%s]%s(): "#message, threadPoolName.c_str(), __FUNCTION__, ##__VA_ARGS__); \ +} while (0) + +#define pthreadtask(message,...) \ +do { \ +NSLog(@"[%s]%s(): "#message, threadIdentifier.c_str(), __FUNCTION__, ##__VA_ARGS__); \ +} while (0) + +#define pthreadtaskexe(message,...) \ +do { \ +NSLog(@"[%s]%s(): "#message, threadIdentifier.c_str(), __FUNCTION__, ##__VA_ARGS__); \ +} while (0) + +#define pthreadtaskerror(message,...) \ +do { \ +NSLog(@"[%s]%s(): "#message, threadIdentifier.c_str(), __FUNCTION__, ##__VA_ARGS__); \ +} while (0) +#else +#define pthreadpool(message,...) ((void)0) +#define pthreadtask(message,...) ((void)0) +#define pthreadtaskexe(message,...) ((void)0) +#define pthreadtaskerror(message,...) ((void)0) +#endif + +#define pgllabel(message,...) \ +do { \ +char str[1024]; \ +sprintf(str, #message, ##__VA_ARGS__); \ +glInsertEventMarkerEXT(0, str); \ +} while (0) + +#define pglpush(message,...) \ +do { \ +char str[1024]; \ +sprintf(str, #message, ##__VA_ARGS__); \ +glPushGroupMarkerEXT(0, str); \ +} while (0) + +#define pglpop() \ +do { \ +glPopGroupMarkerEXT(); \ +} while (0) + +#define cpinfo(tag, ...) \ +do { \ +\ +} while (0) + +#endif + +///////////////////////////////////////////////////////////////////////////////// +// +// Common: Logging +// +///////////////////////////////////////////////////////////////////////////////// +#pragma mark - +#pragma mark Common (Android & iOS) Logging + +// -------------------------------- +// variables: +#define pStringifyBool(boolExpression) ((boolExpression) ? "true" : "false") +#define pStringifyNull(stringExpression) ((stringExpression) ? stringExpression : "null") +#define pbool(b) pinfo("%s%s()%s: "#b" = %s%s%s.", ANSILightMagenta, __FUNCTION__, ANSINoColor, ANSILightBlue, pStringifyBool(b), ANSINoColor); +#define pboolean(b) pbool(b); +#define pbyte(b) pinfo("%s%s()%s: "#b" = %s%d = 0x%02X = %d%d%d%d%d%d%d%d%s.", \ + ANSILightMagenta, __FUNCTION__, ANSINoColor, ANSILightBlue, b, b, \ + static_cast((b&(1<<7))!=0), \ + static_cast((b&(1<<6))!=0), \ + static_cast((b&(1<<5))!=0), \ + static_cast((b&(1<<4))!=0), \ + static_cast((b&(1<<3))!=0), \ + static_cast((b&(1<<2))!=0), \ + static_cast((b&(1<<1))!=0), \ + static_cast((b&(1<<0))!=0), ANSINoColor) +#define pint(i) pinfo("%s%s()%s: "#i" = %s%d%s.", ANSILightMagenta, __FUNCTION__, ANSINoColor, ANSILightBlue, i, ANSINoColor) +#define puint(i) pinfo("%s%s()%s: "#i" = %s%u%s.", ANSILightMagenta, __FUNCTION__, ANSINoColor, ANSILightBlue, i, ANSINoColor) +#define pbits(bitfield) pinfo("%s%s()%s: "#bitfield \ + " = %s%d = 0x%08X = %d%d%d%d%d%d%d%d-%d%d%d%d%d%d%d%d-%d%d%d%d%d%d%d%d-%d%d%d%d%d%d%d%d%s.", \ + ANSILightMagenta, __FUNCTION__, ANSINoColor, ANSILightBlue, bitfield, bitfield, \ + static_cast((bitfield&(1<<31))!=0), \ + static_cast((bitfield&(1<<30))!=0), \ + static_cast((bitfield&(1<<29))!=0), \ + static_cast((bitfield&(1<<28))!=0), \ + static_cast((bitfield&(1<<27))!=0), \ + static_cast((bitfield&(1<<26))!=0), \ + static_cast((bitfield&(1<<25))!=0), \ + static_cast((bitfield&(1<<24))!=0), \ + static_cast((bitfield&(1<<23))!=0), \ + static_cast((bitfield&(1<<22))!=0), \ + static_cast((bitfield&(1<<21))!=0), \ + static_cast((bitfield&(1<<20))!=0), \ + static_cast((bitfield&(1<<19))!=0), \ + static_cast((bitfield&(1<<18))!=0), \ + static_cast((bitfield&(1<<17))!=0), \ + static_cast((bitfield&(1<<16))!=0), \ + static_cast((bitfield&(1<<15))!=0), \ + static_cast((bitfield&(1<<14))!=0), \ + static_cast((bitfield&(1<<13))!=0), \ + static_cast((bitfield&(1<<12))!=0), \ + static_cast((bitfield&(1<<11))!=0), \ + static_cast((bitfield&(1<<10))!=0), \ + static_cast((bitfield&(1<<9))!=0), \ + static_cast((bitfield&(1<<8))!=0), \ + static_cast((bitfield&(1<<7))!=0), \ + static_cast((bitfield&(1<<6))!=0), \ + static_cast((bitfield&(1<<5))!=0), \ + static_cast((bitfield&(1<<4))!=0), \ + static_cast((bitfield&(1<<3))!=0), \ + static_cast((bitfield&(1<<2))!=0), \ + static_cast((bitfield&(1<<1))!=0), \ + static_cast((bitfield&(1<<0))!=0), ANSINoColor) +#define pfloat(f) pinfo("%s%s()%s: "#f" = %s%f%s.", ANSILightMagenta, __FUNCTION__, ANSINoColor, ANSILightBlue, f, ANSINoColor) +#define pdouble(d) pinfo("%s%s()%s: "#d" = %s%f%s.", ANSILightMagenta, __FUNCTION__, ANSINoColor, ANSILightBlue, d, ANSINoColor) +#define ppointer(p) pinfo("%s%s()%s: "#p" = %s%p%s", ANSILightMagenta, __FUNCTION__, ANSINoColor, ANSILightBlue, (void*)p, ANSINoColor) +// Note: cannot use pptr(), as it is used in boost. + +// -------------------------------- +// complex types or combos: +#define pxy(x,y) pinfo("%s%s()%s: ("#x", "#y") = (%s%f, %f%s).", ANSILightMagenta, __FUNCTION__, ANSINoColor, ANSILightBlue, x, y, ANSINoColor) +#define pintxy(x,y) pinfo("%s%s()%s: ("#x", "#y") = (%s%d, %d%s).", ANSILightMagenta, __FUNCTION__, ANSINoColor, ANSILightBlue, x, y, ANSINoColor) + +/* + Logs an init array. + 13 characters per float = 11 for "+1000111222", 2 for ", ". + Note the length of the arary is +1, so that snprintf() has + room to write the NULL terminater, though we adjust it + for the last index anyway. + */ +#define pintarray(pIntArray, size) \ + do \ + { \ + int const numCharsPerInt = 13; \ + char str[size * numCharsPerInt + 1]; \ + for (int i=0; itoString().c_str(), ANSINoColor); \ + } while (0) + +/* + Logs a 4X4 matrix. + */ +#define pmatrix(m) \ + do \ + { \ + pinfo("%s%s()%s: "#m"[] =", ANSILightMagenta, __FUNCTION__, ANSINoColor); \ + pinfo("%s[%6.3f, %6.3f, %6.3f, %6.3f,%s", ANSILightBlue, m[0], m[4], m[8], m[12], ANSINoColor); \ + pinfo("%s %6.3f, %6.3f, %6.3f, %6.3f,%s", ANSILightBlue, m[1], m[5], m[9], m[13], ANSINoColor); \ + pinfo("%s %6.3f, %6.3f, %6.3f, %6.3f,%s", ANSILightBlue, m[2], m[6], m[10], m[14], ANSINoColor); \ + pinfo("%s %6.3f, %6.3f, %6.3f, %6.3f]%s", ANSILightBlue, m[3], m[7], m[11], m[15], ANSINoColor); \ + } while (0) + +/* + Logs a VROBoundingBox. + */ +#define pbb(bb) \ + do \ + { \ + pinfo("%s%s()%s: "#bb" = %s%s%s", \ + ANSILightMagenta, __FUNCTION__, ANSINoColor, \ + ANSILightBlue, (bb).toString().c_str(), ANSINoColor); \ + } while (0) + +// -------------------------------- +// markers +#define plocation() pinfo("[%s%s:%s %s%s()%s, %sline %d%s]", \ + ANSILightCyan, __FILE__, ANSINoColor, \ + ANSILightMagenta, __FUNCTION__, ANSINoColor, \ + ANSILightBlue, __LINE__, ANSINoColor) +#define pcr() pinfo(" ") +#define pline() pline1() +#define cpline(tag) cpinfo(tag, "----------------------------------------------------------------") +#define pline1() pinfo("----------------------------------------------------------------") +#define pline2() pinfo("================================================================") +#define predline() pinfo("%s################################################################%s", ANSILightRed, ANSINoColor); +#define pyellowline() pinfo("%s################################################################%s", ANSIYellow, ANSINoColor); +#define phighlight(color) pinfo("%s****************************************************************%s", color, ANSINoColor) +#define pfunc() \ + do \ + { \ + pinfo("%s%s()----------------------------------------------------------------%s", ANSILightMagenta, __FUNCTION__, ANSINoColor); \ + } while (0) +#define pfuncfull() \ + do \ + { \ + pinfo("%s%s ----------------------------------------------------------------%s", ANSILightMagenta, __func__, ANSINoColor); \ + } while (0) +#define pfunction() \ + do \ + { \ + pinfo("%s%s:%s():%s%d%s", ANSILightMagenta, __FILE__, __FUNCTION__, ANSIMagenta, __LINE__, ANSINoColor); \ + } while (0) +#define pfuncstart() \ + do \ + { \ + pinfo("%s%s() starting...%s", ANSILightMagenta, __FUNCTION__, ANSILightGreen, ANSINoColor); \ + } while (0) +#define pfuncend() \ + do \ + { \ + pinfo("%s%s() %sending.%s", ANSILightMagenta, __FUNCTION__, ANSILightGreen, ANSINoColor); \ + } while (0) +#define pmarker() \ + do \ + { \ + pinfo("%s%s(): %sLine %d.%s", ANSILightMagenta, __FUNCTION__, ANSILightGreen, __LINE__, ANSINoColor); \ + } while (0) + +#if VRO_SECURITY_LOG +#define psecurityinfo(message,...) pinfo("Viro-Security:: "#message, ##__VA_ARGS__) +#define psecurityerr(message,...) perr("Viro-Security:: "#message, ##__VA_ARGS__) +#else +#define psecurityinfo(message,...) ((void)0) +#define psecurityerr(message,...) ((void)0) +#endif + +///////////////////////////////////////////////////////////////////////////////// +// +// Common: Stack Trace +// +///////////////////////////////////////////////////////////////////////////////// +#pragma mark - +#pragma mark (Common) Stack Trace + +/* + Print out a message and a stacktrace, including the current stackframe + */ +void pstack(const char *fmt, ...) + __attribute__ ((format(printf, 1, 2))); + +/* + Print out a stacktrace, including the current stackframe + */ +void pstack(); + +///////////////////////////////////////////////////////////////////////////////// +// +// Common: Abort +// +///////////////////////////////////////////////////////////////////////////////// +#pragma mark - +#pragma mark Common: Abort + +/* + Abort the program. + Print out a stacktrace; then cause a SEG fault to halt execution. + SEG fault will be at 0xdecafbad. + */ +#define pabort(...) _pabort(__FILE__, __LINE__, __func__, ## __VA_ARGS__) + +void _pabort(const char *file, int line, const char *func) __attribute__((noreturn)); +void _pabort(const char* file, int line, const char *func, const char *fmt, ...) + __attribute__ ((format(printf, 4, 5), noreturn)); + +///////////////////////////////////////////////////////////////////////////////// +// +// Common: Assert with Message +// +///////////////////////////////////////////////////////////////////////////////// +#pragma mark - +#pragma mark Common: Assert with Message + +/* + Abort the program if 'condition' is false. + Print out a stacktrace and formatted message; then cause a SEG fault to halt execution. + SEG fault will be at 0xdecafbad. + */ +# define passert_msg(condition, ...) \ + do { \ + if (! (condition)) \ + _pabort(__FILE__, __LINE__, __func__, ## __VA_ARGS__); \ + } while (false) + +/* + Only defined, *even in DEBUG builds*, if the follow is #defined: PASSERT_INNERLOOPS + */ +#if (PASSERT_INNERLOOPS_ENABLED && !NDEBUG) + // Debug build with inner loop assert enabled. + /* + Defined for Debug mode, and if we want inner loop assertions. + */ +# define passert_innerloop(condition, ...) \ + do { \ + if (! (condition)) \ + _pabort(__FILE__, __LINE__, __func__, ## __VA_ARGS__); \ + } while (false) + +#else + /* + Prevent any code generation. + */ +# define passert_innerloop(...) ((void)(0)) +#endif + +/* + Dev only passert_msg. Asserts using this will not run in release builds. + Meant for cases where in development we want to abort, but in production we + want to continue (and there is code to handle that case). + */ +#if !NDEBUG +# define passert_msg_dev(condition, ...) \ + do { \ + if (! (condition)) \ + _pabort(__FILE__, __LINE__, __func__, ## __VA_ARGS__); \ + } while (false) + + +#else + /* + Prevent any code generation. + */ +# define passert_msg_dev(...) ((void)(0)) +#endif diff --git a/mobile/ios/ViroKit.framework/Headers/VROMaterial.h b/mobile/ios/ViroKit.framework/Headers/VROMaterial.h new file mode 100644 index 0000000..beacd7c --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROMaterial.h @@ -0,0 +1,421 @@ +// +// VROMaterial.h +// ViroRenderer +// +// Created by Raj Advani on 11/17/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VROMaterial_h +#define VROMaterial_h + +#include +#include "VROMaterialVisual.h" +#include "VROAnimatable.h" +#include "VROStringUtil.h" + +enum class VROFace { + Front, + Back, + FrontAndBack +}; + +enum class VROCullMode { + Back, + Front, + None +}; + +enum class VROBlendMode { + None, + Alpha, + Add, + Multiply, // Note: Unimplemented mode + Subtract, // Note: Unimplemented mode + Screen, // Note: Unimplemented mode +}; + +enum class VROTransparencyMode { + AOne, + RGBZero +}; + +enum class VROLightingModel { + Phong, + Blinn, + Lambert, + Constant, + PhysicallyBased +}; + +class VROLight; +class VRODriver; +class VROSortKey; +class VROMaterialSubstrate; +class VROShaderModifier; + +/* + Manages the lighting and shading attributes associated with the surface of a geometry that + define its appearance when rendered. When you create a material, you define a collection of + visual attributes and their options, which you can then reuse for multiple geometries + in a scene. + */ +class VROMaterial : public VROAnimatable { + +public: + + VROMaterial(); + virtual ~VROMaterial(); + + /* + Delete any rendering resources. Invoked prior to destruction, on the + rendering thread. + */ + void deleteGL(); + + /* + Copy constructor for this material. Texture contents use shared references. + */ + VROMaterial(std::shared_ptr material); + + /* + Copy function, to write over all properties of this material with the + properties of the given material. + */ + void copyFrom(std::shared_ptr material); + + /* + Set a name for this material. No functionality, only used for + debugging. + */ + void setName(std::string name) { + _name = name; + } + std::string getName() const { + return _name; + } + + uint32_t getMaterialId() const { + return _materialId; + } + + /* + Bind shader and properties. These must be called in order: material properties + cannot be bound until the shader is bound. + + Lights are passed into bindShader because the shader used by a material + is a function both of that material's properties and of the desired lighting + configuration. + */ + void bindShader(int lightsHash, + const std::vector> &lights, + const VRORenderContext &context, + std::shared_ptr &driver); + void bindProperties(std::shared_ptr &driver); + + VROMaterialVisual &getDiffuse() const { + return *_diffuse; + } + VROMaterialVisual &getRoughness() const { + return *_roughness; + } + VROMaterialVisual &getMetalness() const { + return *_metalness; + } + VROMaterialVisual &getSpecular() const { + return *_specular; + } + VROMaterialVisual &getNormal() const { + return *_normal; + } + VROMaterialVisual &getReflective() const { + return *_reflective; + } + VROMaterialVisual &getEmission() const { + return *_emission; + } + VROMaterialVisual &getMultiply() const { + return *_multiply; + } + VROMaterialVisual &getAmbientOcclusion() const { + return *_ambientOcclusion; + } + VROMaterialVisual &getSelfIllumination() const { + return *_selfIllumination; + } + + void setShininess(float shininess); + float getShininess() const { + return _shininess; + } + + void setFresnelExponent(float fresnelExponent); + float getFresnelExponent() const { + return _fresnelExponent; + } + + void setTransparency(float transparency); + float getTransparency() const { + return _transparency; + } + + void setTransparencyMode(VROTransparencyMode mode) { + _transparencyMode = mode; + } + VROTransparencyMode getTransparencyMode() const { + return _transparencyMode; + } + + void setLightingModel(VROLightingModel model) { + _lightingModel = model; + } + VROLightingModel getLightingModel() const { + return _lightingModel; + } + + void setCullMode(VROCullMode cullMode) { + _cullMode = cullMode; + } + VROCullMode getCullMode() const { + return _cullMode; + } + + bool isLitPerPixel() const { + return _litPerPixel; + } + + VROBlendMode getBlendMode() const { + return _blendMode; + } + void setBlendMode(VROBlendMode mode){ + _blendMode = mode; + } + + bool getWritesToDepthBuffer() const { + return _writesToDepthBuffer; + } + bool getReadsFromDepthBuffer() const { + return _readsFromDepthBuffer; + } + + void setWritesToDepthBuffer(bool writesToDepthBuffer) { + _writesToDepthBuffer = writesToDepthBuffer; + updateSubstrate(); + } + void setReadsFromDepthBuffer(bool readsFromDepthBuffer) { + _readsFromDepthBuffer = readsFromDepthBuffer; + updateSubstrate(); + } + + void setBloomThreshold(float threshold) { + bool needsSubstrateUpdate = (_bloomThreshold >= 0 && threshold < 0) || (_bloomThreshold < 0 && threshold >= 0); + _bloomThreshold = threshold; + + if (needsSubstrateUpdate) { + updateSubstrate(); + } + } + float getBloomThreshold() const { + return _bloomThreshold; + } + bool isBloomSupported() const { + return _bloomThreshold >= 0; + } + + void setReceivesShadows(bool receivesShadows) { + _receivesShadows = receivesShadows; + updateSubstrate(); + } + bool getReceivesShadows() const { + return _receivesShadows; + } + + void addShaderModifier(std::shared_ptr modifier); + void removeShaderModifier(std::shared_ptr modifier); + bool hasShaderModifier(std::shared_ptr modifier); + const std::vector> &getShaderModifiers() const { + return _shaderModifiers; + } + void removeAllShaderModifiers() { + _shaderModifiers.clear(); + } + + /* + Make a snapshot of this material and cross-fade that snapshot out, + bringing in the current material. Used to animate material changes. + No effect if there is no active animation transaction. + */ + void fadeSnapshot(); + std::shared_ptr getOutgoing() const { + return _outgoing; + } + + /* + Check if the material has been updated since the last substrate was + created. + */ + bool isUpdated() { + return _substrate == nullptr; + } + + /* + Force the substrate of this material to update on the next render cycle. + */ + void updateSubstrate(); + + /* + Faster than updateSubstrate(), used only when the textures of this material are + updated. + */ + void updateSubstrateTextures(); + + /* + Get the representation of this material in the underlying graphics + technology. + */ + VROMaterialSubstrate *const getSubstrate(std::shared_ptr &driver); + + /* + Update the given sort key with fields from this material, if the given + lights are used in the render. + */ + void updateSortKey(VROSortKey &key, const std::vector> &lights, + const VRORenderContext &context, + std::shared_ptr &driver); + + /* + Returns a VROBlendMode for the given string. If no matching blend modes were found, + VROBlendMode::None is returned. + */ + static VROBlendMode getBlendModeFromString(std::string strType) { + if (VROStringUtil::strcmpinsensitive(strType, "Alpha")) { + return VROBlendMode::Alpha; + } else if (VROStringUtil::strcmpinsensitive(strType, "Add")) { + return VROBlendMode::Add; + } else if (VROStringUtil::strcmpinsensitive(strType, "Multiply")) { + return VROBlendMode::Multiply; + } else if (VROStringUtil::strcmpinsensitive(strType, "Subtract")) { + return VROBlendMode::Subtract; + } else if (VROStringUtil::strcmpinsensitive(strType, "Screen")) { + return VROBlendMode::Screen; + } else if (VROStringUtil::strcmpinsensitive(strType, "None")) { + return VROBlendMode::None; + } + return VROBlendMode::None; + } + +private: + + uint32_t _materialId; + + /* + Properties used for PBR. + */ + VROMaterialVisual *_diffuse; + VROMaterialVisual *_roughness; + VROMaterialVisual *_metalness; + VROMaterialVisual *_ambientOcclusion; + + /* + Properties used for standard lighting. + */ + VROMaterialVisual *_specular; + VROMaterialVisual *_reflective; + + /* + Properties used for special effects. + */ + VROMaterialVisual *_normal; + VROMaterialVisual *_emission; // Unsupported (TODO VIRO-1188) + VROMaterialVisual *_multiply; // Unsupported (TODO VIRO-1190) + + /* + Currently unsupported. This will be used to override the Scene's overall environment + map with a material-specific environment map. + */ + VROMaterialVisual *_selfIllumination; + + /* + User-provided name of the material. + */ + std::string _name; + + /* + The sharpness of specular highlights. + */ + float _shininess; + + /* + Factor affecting material reflectivity. + */ + float _fresnelExponent; + + /* + Uniform transparency of the material. + */ + float _transparency; + + /* + The mode used to calculate transparency. + */ + VROTransparencyMode _transparencyMode; + + /* + The lighting model to use to compute the interaction between + the lights in the scene and this material's visual properties. + */ + VROLightingModel _lightingModel; + + /* + True means use per-pixel lighting, false means use per-vertex lighting. + */ + bool _litPerPixel; + + /* + Set to cull back faces, front faces, or none. + */ + VROCullMode _cullMode; + + /* + Determines how pixel colors rendered using this material blend with + pixel colors already in the render target. + */ + VROBlendMode _blendMode; + + /* + Depth write and read settings. + */ + bool _writesToDepthBuffer, _readsFromDepthBuffer; + + /* + Version of this material that's being animated away. Populated with the current + values of this material whenever this material is changed. + */ + std::shared_ptr _outgoing; + + /* + Modifiers to alter the shader code. + */ + std::vector> _shaderModifiers; + + /* + If fragments of this material exceed this value, then those fragments will + glow. If less than 0, bloom will be disabled. Defaults to -1. + */ + float _bloomThreshold; + + /* + True if this material receives shadows. Defaults to true. + */ + bool _receivesShadows; + + /* + Representation of this material in the underlying graphics hardware. + */ + VROMaterialSubstrate *_substrate; + + void removeOutgoingMaterial(); + +}; + +#endif /* VROMaterial_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROMaterialAnimation.h b/mobile/ios/ViroKit.framework/Headers/VROMaterialAnimation.h new file mode 100644 index 0000000..e992ff4 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROMaterialAnimation.h @@ -0,0 +1,39 @@ +// +// VROMaterialAnimation.hpp +// ViroRenderer +// +// Created by Raj Advani on 2/14/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROMaterialAnimation_h +#define VROMaterialAnimation_h + +#include +#include "VROLazyMaterial.h" + +class VROMaterial; + +/* + Represents a single material animation. + */ +class VROMaterialAnimation { + +public: + + VROMaterialAnimation(int index, std::shared_ptr lazyMaterial) : + _index(index), + _lazyMaterial(lazyMaterial) {} + virtual ~VROMaterialAnimation() {} + + int getIndex() const { return _index; } + std::shared_ptr getMaterial() const { return _lazyMaterial->get(); } + +private: + + const int _index; + std::shared_ptr _lazyMaterial; + +}; + +#endif /* VROMaterialAnimation_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROMaterialSubstrate.h b/mobile/ios/ViroKit.framework/Headers/VROMaterialSubstrate.h new file mode 100644 index 0000000..063f7c9 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROMaterialSubstrate.h @@ -0,0 +1,81 @@ +// +// VROMaterialSubstrate.h +// ViroRenderer +// +// Created by Raj Advani on 12/29/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VROMaterialSubstrate_h +#define VROMaterialSubstrate_h + +#include +#include +#include + +class VROSortKey; +class VROLight; +class VRORenderContext; +class VRODriver; +class VROGeometry; +class VROVector3f; +class VROMatrix4f; +enum class VROEyeType; + +class VROMaterialSubstrate { +public: + virtual ~VROMaterialSubstrate() {} + + /* + Update the textures used by this substrate. Invoked when the material's + textures are updated, in lieu of regenerating the entire substrate. + */ + virtual void updateTextures() = 0; + + /* + Update the given sort key with the properties in this material, if the + given lights are used. + */ + virtual void updateSortKey(VROSortKey &key, const std::vector> &lights, + const VRORenderContext &context, + std::shared_ptr driver) = 0; + + /* + Bind the shader used in this material to the active rendering context. + This is kept independent of the bindProperties() function because shader changes + are expensive, so we want to manage them independent of materials in the + render loop. + + The shader used is a function both of the underlying material properties + and of the desired lighting configuration. + */ + virtual void bindShader(int lightsHash, + const std::vector> &lights, + const VRORenderContext &context, + std::shared_ptr &driver) = 0; + + /* + Bind the properties of this material to the active rendering context. + These properties should be node and geometry independent. The shader + should always be bound first (via bindShader()). + */ + virtual void bindProperties() = 0; + + /* + Bind the properties of the given geometry to the active rendering context. + These are material properties (e.g. shader uniforms) that are dependent + on properties of the geometry. + */ + virtual void bindGeometry(float opacity, const VROGeometry &geometry) = 0; + + /* + Bind the properties of the view and projection to the active rendering + context. + */ + virtual void bindView(VROMatrix4f modelMatrix, VROMatrix4f viewMatrix, + VROMatrix4f projectionMatrix, VROMatrix4f normalMatrix, + VROVector3f cameraPosition, VROEyeType eyeType) = 0; + +}; + +#endif /* VROMaterialSubstrate_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROMaterialVisual.h b/mobile/ios/ViroKit.framework/Headers/VROMaterialVisual.h new file mode 100644 index 0000000..d1bf824 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROMaterialVisual.h @@ -0,0 +1,124 @@ +// +// VROMaterialVisual.hpp +// ViroRenderer +// +// Created by Raj Advani on 11/17/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VROMaterialVisual_h +#define VROMaterialVisual_h + +#include "VROVector4f.h" +#include "VROMatrix4f.h" +#include "VROTexture.h" +#include "VROImageUtil.h" +#include "VROAnimatable.h" +#include + +class VROMaterial; + +class VROMaterialVisual { + +public: + + VROMaterialVisual(VROMaterial &material, int permissibleContentsMask) : + _material(material), + _permissibleContentsMask(permissibleContentsMask), + _contentsColor({ 1.0, 1.0, 1.0, 1.0 }), + _intensity(1.0) + {} + + /* + Copy constructor. Texture references are shared. + */ + VROMaterialVisual(const VROMaterialVisual &visual); + + /* + Delete any rendering resources. Invoked prior to destruction, on the + rendering thread. + */ + void deleteGL(); + + /* + Copy from the given visual to this one. Does NOT copy the + parent material, however. + */ + void copyFrom(const VROMaterialVisual &visual); + + void clear(); + void setColor(VROVector4f contents); + void setTexture(std::shared_ptr texture); + + /* + Used to replace a texture quickly without regenerating the + entire substrate. If this is the first time adding a texture, + then the substrate must be replaced. In this case we return + true. + */ + bool swapTexture(std::shared_ptr texture); + + VROTextureType getTextureType() const { + if (_contentsTexture) { + return _contentsTexture->getType(); + } + else { + return VROTextureType::None; + } + } + + VROVector4f getColor() const { + return _contentsColor; + } + + std::shared_ptr getTexture() const { + if (_contentsTexture) { + return _contentsTexture; + } + else { + return getBlankTexture(); + } + } + + void setIntensity(float intensity); + float getIntensity() const { + return _intensity; + } + +private: + + /* + Parent material. + */ + VROMaterial &_material; + + /* + Bit mask of VROContentsType that indicates which contents types are + permissible to be set for this visual. + */ + int _permissibleContentsMask; + + /* + The color component of the visual. + */ + VROVector4f _contentsColor; + + /* + The texture component of the visual. + */ + std::shared_ptr _contentsTexture; + + /* + Modulates the impact of this visual on the overall material appearance. + */ + float _intensity; + + /* + Transformation applied to the texture coordinates provided by the geometry object + the material is attached to. + */ + VROMatrix4f _contentsTransform; + +}; + +#endif /* VROMaterialVisual_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROMath.h b/mobile/ios/ViroKit.framework/Headers/VROMath.h new file mode 100644 index 0000000..71b2afe --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROMath.h @@ -0,0 +1,181 @@ +// +// VROMath.h +// ViroRenderer +// +// Created by Raj Advani on 10/15/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VROMath_h +#define VROMath_h + +#include +#include +#include +#include "VROVector3f.h" +#include "VROVector4f.h" +#include "VROMatrix4f.h" +#include "VROQuaternion.h" +#include "VROBoundingBox.h" +#include "VRODefines.h" + +static float kRoundingErrorFloat = 0.00001; +static float kEpsilon = 0.00000001; + +VROMatrix4f matrix_from_scale(float sx, float sy, float sz); +VROMatrix4f matrix_from_translation(float x, float y, float z); +VROMatrix4f matrix_from_perspective_fov_aspectLH(const float fovY, const float aspect, + const float nearZ, const float farZ); + +/* + Compute a look-at matrix for a right handed coordinate system. + */ +VROMatrix4f VROMathComputeLookAtMatrix(VROVector3f eye, VROVector3f forward, VROVector3f up); + +/* + Compute a frustum or perspective projection for a right handed coordinate system. + */ +VROMatrix4f VROMathComputeFrustum(float left, float right, float bottom, float top, + float znear, float zfar); +VROMatrix4f VROMathComputePerspectiveProjection(float fovyInDegrees, float aspectRatio, + float znear, float zfar); + +/* + Compute an orthographic projection for a right handed coordinate system. + */ +VROMatrix4f VROMathComputeOrthographicProjection(float left, float right, float bottom, float top, + float near, float far); + +double degrees_to_radians(double degrees); +double radians_to_degrees(double radians); + +float clamp(float val, float min, float max); +float random(float min, float max); +VROVector3f random(VROVector3f min, VROVector3f max); + +/* + 4x4 column-major matrix operations. + */ +void VROMathMultVectorByMatrix(const float *matrix, const float *input, float *output); +void VROMathMultVectorByMatrix_d(const double *matrix, const double *input, double *output); +void VROMathMultVectorByMatrix_fd(const float *matrix, const double *input, double *output); + +void VROMathMultMatrices(const float *a, const float *b, float *r); +void VROMathMultMatrices_d(const double *a, const double *b, double *r); +void VROMathMultMatrices_dff(const double *a, const float *b, float *r); +void VROMathMultMatrices_ddf(const double *a, const double *b, float *r); +void VROMathMultMatrices_fdf(const float *a, const double *b, float *r); +void VROMathMultMatrices_dfd(const double *a, const float *b, double *r); +void VROMathMultMatrices_fdd(const float *a, const double *b, double *r); +void VROMathMultMatrices_ffd(const float *a, const float *b, double *r); + +void VROMathMakeIdentity(float *m); +void VROMathMakeIdentity_d(double *m); + +void VROMathTransposeMatrix(const float *src, float *transpose); + +bool VROMathInvertMatrix(const float *src, float *inverse); +bool VROMathInvertMatrix_d(const double *src, double *inverse); + +/* + 4x4 special matrix ops. + */ +void VROMathMultMatricesOptScale(const float *m1, const float *m0, float *d); +void VROMathMultMVP(const float *m1, const float *m0, float *d); +void VROMathMultVX(const float *vx, const float *m0, float *d); + +/* + Interpolation functions. + */ +float VROMathInterpolate(float input, float inMin, float inMax, float outMin, float outMax); +double VROMathInterpolate_d(double input, double inMin, double inMax, double outMin, double outMax); +float VROMathInterpolateKeyFrame(float input, const std::vector &inputs, const std::vector &outputs); +VROVector3f VROMathInterpolateKeyFrameVector3f(float input, const std::vector &inputs, const std::vector &outputs); +VROQuaternion VROMathInterpolateKeyFrameQuaternion(float input, const std::vector &inputs, const std::vector &outputs); +VROMatrix4f VROMathInterpolateKeyFrameMatrix4f(float input, const std::vector &inputs, const std::vector &outputs); +void VROMathInterpolatePoint(const float *bottom, const float *top, float amount, int size, float *result); + +/* + * Clamps input between min and max + */ +double VROMathClamp(double input, double min, double max); + +/* + Array math + */ +float VROMathMin(const float values[], int count); +float VROMathMax(const float values[], int count); + +/* + Angle conversion. + */ +float toRadians(float degrees); +float toDegrees(float radians); + +/* + Rotation. + */ +void VROMathRotateAroundX(const VROVector3f &vector, float radians, VROVector3f *result); +void VROMathRotateAroundZ(const VROVector3f &vector, float radians, VROVector3f *result); + +/* + Normalize the given angle between [0,2PI] or [-PI,PI], and find the distance between two angles. + */ +float VROMathNormalizeAngle2PI(float rad); +float VROMathNormalizeAnglePI(float rad); +float VROMathAngleDistance(float radA, float radB); + +/* + Normalize the angles in the given vector between [0, 2PI]. + */ +VROVector3f VROMathNormalizeAngles2PI(VROVector3f vector); + +/* + Take the fast (inverse) square root of the given number. + */ +float VROMathFastSquareRoot(float x); + +/* + Fast sin/cos methods. An input angle between [-PI, PI] will skip a + range reduction step, and may perform slightly faster, but is + unnessisary. + */ +void VROMathFastSinCos(float x, float r[2]); + +void VROMathFastSinCos2x(const float *angles, float * r); + +/** + Determine whether point (x,y) is within polygon (x1,y1 to x2,y2 to x3,y3 to x4,y4 to x1,y1) + Point on edge is considered within. + Only for use with convex polygons. + */ +bool VROMathPointIsInPolygon(float x, float y, float x1, float y1, + float x2, float y2, float x3, float y3, + float x4, float y4); + +/* + Get the point on segment AB that is closest to p. + */ +VROVector3f VROMathGetClosestPointOnSegment(const VROVector3f A, const VROVector3f B, const VROVector3f p); + +/* return the power of 2 that is equal or greater to the given value */ +static inline uint32_t +power2_ceil(const uint32_t v) { + return (v < 2) ? v + 1 : 1 << (sizeof(uint32_t) * 8 - __builtin_clz(v - 1)); +} + +float VROMathReciprocal(float value); +float VROMathReciprocalSquareRoot(float value); + +bool VROMathIsZero(const float a, const float tolerance = kRoundingErrorFloat); +bool VROMathEquals(const float a, const float b, const float tolerance = kRoundingErrorFloat); + +float VROFloat16ToFloat(short fltInt16); +short VROFloatToFloat16(float value); + +VROVector3f VROMathGetCenter(std::vector &vertices); +VROBoundingBox VROMathGetBoundingBox(std::vector &vertices); + +uint32_t VROMathRoundUpToNextPow2(uint32_t v); + +#endif /* VROMath_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROMatrix4f.h b/mobile/ios/ViroKit.framework/Headers/VROMatrix4f.h new file mode 100644 index 0000000..58e6b5f --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROMatrix4f.h @@ -0,0 +1,100 @@ +// +// VROMatrix4f.h +// ViroRenderer +// +// Created by Raj Advani on 10/15/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VROMATRIX_H_ +#define VROMATRIX_H_ + +#include +#include +#include +#include "glm/glm.hpp" +#include "glm/gtc/matrix_transform.hpp" + +class VROVector3f; +class VROVector4f; +class VROQuaternion; + +class VROMatrix4f { +public: + + static VROMatrix4f identity(); + + float &operator[] (const int index) { + return _mtx[index]; + } + float const &operator[](int index) const { + return _mtx[index]; + } + + VROMatrix4f() noexcept; + VROMatrix4f(const float *matrix); + VROMatrix4f(const glm::mat4x4 mat); + + void toIdentity(); + void copy(const VROMatrix4f ©); + + /* + Scale. + */ + void scale(float x, float y, float z); + + /* + Rotation. + */ + void rotateX(float angleRad); + void rotateY(float angleRad); + void rotateZ(float angleRad); + void rotate(float angleRad, const VROVector3f &origin, const VROVector3f &dir); + void setRotationCenter(const VROVector3f ¢er, const VROVector3f &translation); + + /* + Translation. + */ + void translate(float x, float y, float z); + void translate(const VROVector3f &vector); + + /* + Multiplication. + */ + VROMatrix4f multiply(const VROMatrix4f &matrix) const; + VROVector3f multiply(const VROVector3f &vector) const; + VROVector4f multiply(const VROVector4f &vector) const; + + /* + Decomposition into affine transforms. These methods only work on affine + matrices. To extract rotation, the scale factors are required. + */ + VROVector3f extractScale() const; + VROQuaternion extractRotation(VROVector3f scale) const; + VROVector3f extractTranslation() const; + + /* + Other operations. + */ + VROMatrix4f transpose() const; + VROMatrix4f invert() const; + const float *getArray() const { + return _mtx; + } + + std::string toString() const; + +private: + + /* + The 16-float data for this matrix. + */ + float _mtx[16]; + +}; + +inline VROMatrix4f operator*(const VROMatrix4f &lhs, const VROMatrix4f &rhs) { + return lhs.multiply(rhs); +} + +#endif /* VROMATRIX_H_ */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROModelIOUtil.h b/mobile/ios/ViroKit.framework/Headers/VROModelIOUtil.h new file mode 100644 index 0000000..3e005d8 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROModelIOUtil.h @@ -0,0 +1,61 @@ +// +// VROModelIOUtil.h +// ViroRenderer +// +// Created by Raj Advani on 5/2/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROModelIOUtil_h +#define VROModelIOUtil_h + +#include +#include +#include + +class VROTexture; + +/* + The type of file within which the model is stored. On Android, use URL with file:///android-asset/ + to load assets. + */ +enum class VROResourceType { + LocalFile, // Local file path + URL, // URL (remote or local) + BundledResource, // App-bundled resource +}; + +/* + Static utilities for Model IO. + */ +class VROModelIOUtil { + +public: + + /* + Load the texture with the given name, from the given base path (or base URL). First check + if the texture exists in the provided resourceMap or cache. If the texture could not be + loaded, returns an empty shared_ptr. + + Set sRGB to true to gamma-uncorrect the texture into linear RGB when sampling. This should + only be used for color (diffuse) textures, and not for textures that are *already* linear + (e.g. specular, normal, etc.). + */ + static std::shared_ptr loadTexture(const std::string &name, std::string &base, VROResourceType type, bool sRGB, + const std::map *resourceMap, + std::map> &cache); + + /* + Copy the resource or map of resources into a location where they can be loaded by the model + loader, and return the new paths. + + This performs no action on local files. + */ + static std::string processResource(std::string resource, VROResourceType type, bool *isTemp, + bool *success); + static std::map processResourceMap(const std::map &resourceMap, + VROResourceType type); + +}; + +#endif /* VROModelIOUtil_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VRONode.h b/mobile/ios/ViroKit.framework/Headers/VRONode.h new file mode 100644 index 0000000..d74beac --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VRONode.h @@ -0,0 +1,915 @@ +// +// VRONode.h +// ViroRenderer +// +// Created by Raj Advani on 11/15/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VRONode_h +#define VRONode_h + +#include +#include +#include +#include +#include +#include +#include +#include +#include "optional.hpp" +#include "VROMatrix4f.h" +#include "VROQuaternion.h" +#include "VRORenderContext.h" +#include "VRODriver.h" +#include "VRORenderParameters.h" +#include "VROAnimatable.h" +#include "VROBoundingBox.h" +#include "VROSortKey.h" +#include "VROLog.h" +#include "VROEventDelegate.h" +#include "VROSound.h" +#include "VROFrustumBoxIntersectionMetadata.h" +#include "VROThreadRestricted.h" +#include "VROPhysicsBody.h" + +class VROGeometry; +class VROLight; +class VROScene; +class VROAction; +class VROTexture; +class VROPortal; +class VRONodeCamera; +class VROHitTestResult; +class VROConstraint; +class VROExecutableAnimation; +class VROTransformDelegate; +class VROTransaction; +class VRORenderMetadata; +class VROParticleEmitter; + +extern bool kDebugSortOrder; +extern const std::string kDefaultNodeTag; + +enum class VRONodeType { + Normal, + Portal, + PortalFrame, +}; + +enum class VROSilhouetteMode { + Flat, // Render silhouettes with constant lighting, no textures + Textured, // Render silhouettes with constant lighting and textures +}; + +enum class VRODragType { + FixedDistance, // Drags objects with a fixed distance to camera/controller/etc. + FixedToWorld, // Currently available to AR only. Attempts to drag object w.r.t. the real world. +}; + + +class VRONode : public VROAnimatable, public VROThreadRestricted { + +public: + + static void resetDebugSortIndex(); + +#pragma mark - Initialization + + /* + Default constructor. + */ + VRONode(); + + /* + Copy constructor. This copies the node but *not* the underlying + geometries or lights. Instead, these are shared by reference with the + copied node. Additionally, this constructor will not copy child nodes. + + To copy child nodes recursively, invoke the clone() function. + */ + VRONode(const VRONode &node); + virtual ~VRONode(); + + /* + Delete any rendering resources. Invoked prior to destruction, on the + rendering thread. + + Recurses down the tree. + */ + virtual void deleteGL(); + + /* + Copy constructor that recursively copies all child nodes. This copies + the node but *not* the underlying geometries or lights. Instead, these + are shared by reference with the copied node. + */ + std::shared_ptr clone(); + + /* + Get a unique ID for this VRONode. + */ + int getUniqueID() { return _uniqueID; } + +#pragma mark - Render Cycle + + /* + Recursive function that recomputes the transforms of this node. This includes: + + _computedTransform, + _computedRotation, + _computedPosition, + _computedBoundingBox + */ + void computeTransforms(VROMatrix4f parentTransform, VROMatrix4f parentRotation); + + /* + Sets both the local position and rotation of this node in terms of world coordinates. + A computeTransform pass is then performed to update the node's bounding boxes + and as well as its child's node transforms recursively. + */ + void setWorldTransform(VROVector3f finalPosition, VROQuaternion finalRotation); + + /* + Update the visibility status of this node, using the camera in the current render + context. This will update the _visible flag. Recurses to children. + */ + void updateVisibility(const VRORenderContext &context); + + /* + Update the particle emitters attached to this node. Recurses to children. + */ + void updateParticles(const VRORenderContext &context); + + /* + Recursively applies transformation constraints (e.g. billboarding) to this node + and its children. + */ + void applyConstraints(const VRORenderContext &context, VROMatrix4f parentTransform, + bool parentUpdated); + + /* + Recursively sets the atomic properties computed during a render pass. Should be + called after the computation occurs. + */ + void setAtomicRenderProperties(); + + /* + Update the position of each light in this node, and add to the outLights vector. + Recurses down the tree. + */ + void collectLights(std::vector> *outLights); + + /* + Recursively updates the sort keys of this node, preparing this node and its children + for rendering. This method also computes non-transform-related parameters for each + node (opacity, lights, etc.) that are required prior to render, and outputs metadata + about the forthcoming render to VRORenderMetadata. + + Note: this method and getSortKeys() *only* apply to visible nodes. Invisible nodes + are skipped. + */ + void updateSortKeys(uint32_t depth, + VRORenderParameters ¶ms, + std::shared_ptr &metadata, + const VRORenderContext &context, + std::shared_ptr &driver); + + /* + Get the sort keys for all visible nodes in this portal. Stops the search + when we reach the hit of the scene graph or hit another portal. + */ + void getSortKeysForVisibleNodes(std::vector *outKeys); + + /* + Render the given element of this node's geometry, using its latest computed transforms. + */ + void render(int elementIndex, + std::shared_ptr &material, + const VRORenderContext &context, + std::shared_ptr &driver); + + /* + Recursively render this node and all of its children, with full texture + and lighting. + + Note: this method does not intelligently batch or sort. It is is less efficient + than directly calling render(..) above after proper sorting. + */ + void render(const VRORenderContext &context, std::shared_ptr &driver); + + /* + Recursively render this the silhouette of this node and all of its children. + Lighting is fixed at constant, and the given material is used for all elements. + If mode is set to Textured, then textures will be bound. This method is typically + used to render to the stencil or depth buffers only. + + The filter is used to only render the silhouettes of specific objects. Returns + true on each node to render, false to not. Either way we continue down the tree + recursively. + */ + void renderSilhouettes(std::shared_ptr &material, VROSilhouetteMode mode, + std::function filter, + const VRORenderContext &context, std::shared_ptr &driver); + + /* + This function recomputes this node's transform before recomputing its umbrella bounding box + using its parent's last computed transform. + */ + void recomputeUmbrellaBoundingBox(); + +#pragma mark - Geometry + + void setGeometry(std::shared_ptr geometry) { + passert_thread(); + _geometry = geometry; + } + std::shared_ptr getGeometry() const { + return _geometry; + } + +#pragma mark - Camera + + void setCamera(std::shared_ptr camera) { + passert_thread(); + _camera = camera; + } + const std::shared_ptr &getCamera() const { + return _camera; + } + +#pragma mark - Transforms + + VROVector3f getComputedPosition() const; + VROMatrix4f getComputedRotation() const; + VROMatrix4f getComputedTransform() const; + + VROVector3f getPosition() const { + return _position; + } + VROVector3f getScale() const { + return _scale; + } + VROQuaternion getRotation() const { + return _rotation; + } + VROVector3f getRotationEuler() const { + return _euler; + } + + /* + The following are atomic, updated once per frame on the rendering thread. They can + be accessed safely from any thread to get an up-to-date state of the transform. + */ + VROMatrix4f getLastWorldTransform() const; + VROVector3f getLastWorldPosition() const; + VROVector3f getLastLocalPosition() const; + VROVector3f getLastLocalScale() const; + VROQuaternion getLastLocalRotation() const; + VROBoundingBox getLastUmbrellaBoundingBox() const; + + /* + Set the rotation, position, or scale. Animatable. + */ + void setRotation(VROQuaternion rotation); + void setPosition(VROVector3f position); + void setScale(VROVector3f scale); + void setTransformDelegate(std::shared_ptr delegate); + + /* + Notifies attached transform delegate, if any, that a position change had occurred. + */ + void notifyTransformUpdate(bool forced); + + /* + Set the rotation as a vector of Euler angles. Using this method + will update the Euler angles stored internally in a predictable + way. Setting rotation by quaternion updates Euler angles in an + unpredictable way (i.e. the quaternion axis may change). + */ + void setRotationEuler(VROVector3f euler); + + /* + These piecewise setters are used in order to change one axis + only, without altering the remaining axes. Useful when animating + across multiple axes across separate calls. Animatable. + */ + void setPositionX(float x); + void setPositionY(float y); + void setPositionZ(float z); + void setScaleX(float x); + void setScaleY(float y); + void setScaleZ(float z); + void setRotationEulerX(float radians); + void setRotationEulerY(float radians); + void setRotationEulerZ(float radians); + + /* + Pivot points define the center for rotation and scale. For example, + by translating the rotation pivot, you can use rotation to rotate an + object about a faraway point. By translating the scale pivot, you can + scale an object relative to its corner, instead of its center. Not + animatable. + */ + void setRotationPivot(VROMatrix4f pivot); + void setScalePivot(VROMatrix4f pivot); + +#pragma mark - Render Settings + + std::string getName() const { + return _name; + } + void setName(std::string name) { + _name = name; + } + + float getOpacity() const { + return _opacity; + } + void setOpacity(float opacity); + + virtual bool isHidden() const { + return _hidden; + } + virtual void setHidden(bool hidden); + + int getRenderingOrder() const { + return _renderingOrder; + } + void setRenderingOrder(int renderingOrder) { + _renderingOrder = renderingOrder; + } + + bool isHierarchicalRendering() const { + return _hierarchicalRendering; + } + void setHierarchicalRendering(bool hierarchicalRendering) { + _hierarchicalRendering = hierarchicalRendering; + } + + /* + Returns true if this node was found visible during the last call to + computeVisibility(). If a node is not visible, that means none of its + children are visible either (we use the umbrella bounding box for + visibility tests). + */ + bool isVisible() const { + return _visible; + } + + /* + Debug function to count the number of visible nodes (including this + node if visible, then recursively descending from this node's children) + since the last call to computeVisibility(). + */ + int countVisibleNodes() const; + +#pragma mark - Particle Emitters + + void setParticleEmitter(std::shared_ptr emitter); + void removeParticleEmitter(); + std::shared_ptr getParticleEmitter() const; + +#pragma mark - Lights + + void addLight(std::shared_ptr light) { + passert_thread(); + _lights.push_back(light); + } + void removeLight(std::shared_ptr light) { + passert_thread(); + _lights.erase( + std::remove_if(_lights.begin(), _lights.end(), + [light](std::shared_ptr candidate) { + return candidate == light; + }), _lights.end()); + } + void removeAllLights() { + passert_thread(); + _lights.clear(); + } + std::vector> &getLights() { + return _lights; + } + const std::vector> &getComputedLights() const { + return _computedLights; + } + uint32_t getComputedLightsHash() const { + return _computedLightsHash; + } + + void setLightReceivingBitMask(int bitMask, bool recursive = false) { + _lightReceivingBitMask = bitMask; + if (recursive) { + for (std::shared_ptr &child : _subnodes) { + child->setLightReceivingBitMask(bitMask, recursive); + } + } + } + int getLightReceivingBitMask() const { + return _lightReceivingBitMask; + } + + void setShadowCastingBitMask(int bitMask, bool recursive = false) { + _shadowCastingBitMask = bitMask; + if (recursive) { + for (std::shared_ptr &child : _subnodes) { + child->setShadowCastingBitMask(bitMask, recursive); + } + } + } + int getShadowCastingBitMask() const { + return _shadowCastingBitMask; + } + +#pragma mark - Sounds + + void addSound(std::shared_ptr sound) { + passert_thread(); + if (sound->getType() == VROSoundType::Spatial) { + _sounds.push_back(sound); + } + } + void removeSound(std::shared_ptr sound) { + passert_thread(); + _sounds.erase( + std::remove_if(_sounds.begin(), _sounds.end(), + [sound](std::shared_ptr candidate) { + return candidate == sound; + }), _sounds.end()); + } + void removeAllSounds() { + passert_thread(); + _sounds.clear(); + } + +#pragma mark - Scene Graph + + void addChildNode(std::shared_ptr node); + void removeFromParentNode(); + + /* + Return a copy of the subnode list. + */ + std::vector> getChildNodes() const; + + /* + Remove all children from this node. + */ + void removeAllChildren(); + + /* + Return the parent node. Null if this node is root or does not have a parent. + */ + std::shared_ptr getParentNode() const { + return _supernode.lock(); + } + + /* + Get the parent scene of this VRONode. If this node is not attached to the + scene graph, this will return null. + */ + std::shared_ptr getScene() const { + return _scene.lock(); + } + + /* + Set the parent scene of this node. Internal use only. + */ + void setScene(std::shared_ptr scene, bool recursive); + + /* + Returns the type of this node. Faster then dynamic_cast. + */ + VRONodeType getType() const { + return _type; + } + + /* + Get the nearest portal that's an ancestor of this node. Returns null if this is + the root node. + */ + const std::shared_ptr getParentPortal() const; + + /* + Get the nearest child portals of this node. This recurses down the graph in all + directions, stopping whenever we hit a portal or the end of the graph. + */ + void getChildPortals(std::vector> *outPortals) const; + +#pragma mark - Actions and Animations + + /* + Actions enable open-ended and fully customizable manipulation of nodes over successive + frames. + */ + void runAction(std::shared_ptr action); + void removeAction(std::shared_ptr action); + void removeAllActions(); + + /* + Animations enable structured manipulation of nodes over successive frames. They can + be as simple interpolating batches of properties over time, or as complex as full + skeletal animation. + + These methods take a key parameter. Keys identify animations that run together in + a single transaction; e.g., there can be multiple animations with a single key. + removeAnimation will remove *all* animations with the given key. + */ + void addAnimation(std::string key, std::shared_ptr animation); + void removeAnimation(std::string key); + + /* + Get the keys for all animations in this node. If recursive is true, will search + down the hierarchy as well. + */ + std::set getAnimationKeys(bool recursive); + + /* + Retrieve all animations with the given key, as a single, composite executable animation. + If recursive is true, then this will return a new parallel VROAnimationChain that + contains every animation in this node and every animation in any subnode that shares + the same key. + + For example, if the animation 'Take 001' contains a torso animation and an arm animation, + both will be returned in a single animation group. + */ + std::shared_ptr getAnimation(std::string key, bool recursive); + + /* + Remove all animations from this node. + */ + void removeAllAnimations(); + + /* + Triggered when the animation running this animatable node completes. + */ + void onAnimationFinished(); + +#pragma mark - Events + + VROBoundingBox getBoundingBox() const; + VROBoundingBox getUmbrellaBoundingBox() const; + std::vector hitTest(const VROCamera &camera, VROVector3f origin, VROVector3f ray, + bool boundsOnly = false); + + void setSelectable(bool selectable) { + _selectable = selectable; + } + + void setEventDelegate(std::shared_ptr delegate) { + passert_thread(); + _eventDelegateWeak = delegate; + } + + std::shared_ptr getEventDelegate() { + if (_eventDelegateWeak.expired()){ + return nullptr; + } + return _eventDelegateWeak.lock(); + } + + bool isSelectable() const { + return _selectable; + } + + void setIgnoreEventHandling(bool canHandle) { + _ignoreEventHandling = canHandle; + } + + bool getIgnoreEventHandling() const { + return _ignoreEventHandling; + } + + void setTag(std::string tag) { + _tag = tag; + } + + std::string getTag() const { + return _tag; + } + + void setHighAccuracyGaze(bool enabled); + + bool getHighAccuracyGaze() const { + return _highAccuracyGaze; + } + + void setIsBeingDragged(bool isDragging) { + std::shared_ptr physicsBody = getPhysicsBody(); + if (physicsBody != nullptr) { + physicsBody->setKinematicDrag(isDragging); + } + } + + void setDragType(VRODragType dragType) { + _dragType = dragType; + } + + VRODragType getDragType() { + return _dragType; + } + + bool isAnimatingDrag() { + return _isAnimatingDrag; + } + + void setIsAnimatingDrag(bool isAnimatingDrag) { + _isAnimatingDrag = isAnimatingDrag; + } + + std::shared_ptr getDragAnimation() { + return _dragAnimation; + } + + void setDragAnimation(std::shared_ptr dragAnimation) { + _dragAnimation = dragAnimation; + } + +#pragma mark - Constraints + + void addConstraint(std::shared_ptr constraint); + void removeConstraint(std::shared_ptr constraint); + void removeAllConstraints(); + +#pragma mark - Physics + + std::shared_ptr initPhysicsBody(VROPhysicsBody::VROPhysicsBodyType type, + float mass, + std::shared_ptr shape); + std::shared_ptr getPhysicsBody() const; + void clearPhysicsBody(); + +protected: + + VRONodeType _type; + + /* + The node's parent and children. + */ + std::vector> _subnodes; + std::weak_ptr _supernode; + + /* + The VROScene to which this node belongs. + */ + std::weak_ptr _scene; + + /* + The geometry in the node. Null means the node has no geometry. + */ + std::shared_ptr _geometry; + + /* + True if this node was found visible during the last call to computeVisibility(). + */ + bool _visible; + + /* + Last frame that this node was visited during sorting. Used for graph traversal. + */ + int _lastVisitedRenderingFrame; + +private: + + /* + Name for debugging. + */ + std::string _name; + + /* + Unique identifier. + */ + int _uniqueID; + + /* + Lights, sound, particles, and camera. + */ + std::vector> _lights; + std::vector> _sounds; + std::shared_ptr _particleEmitter; + std::shared_ptr _camera; + + /* + Scale and position. + */ + VROVector3f _scale; + VROVector3f _position; + + /* + Rotation is stored as a quaternion, but we also maintain euler angles + for use in animation (since we cannot additively rotate by reading euler + angles from a quaternion and writing them again). + */ + VROQuaternion _rotation; + VROVector3f _euler; + + /* + Pivots define the center of the rotation and scale operations. + Declared optional becuase they are not always used, and we can optimize + them away when not used. + */ + std::experimental::optional _rotationPivot; + std::experimental::optional _rotationPivotInverse; + std::experimental::optional _scalePivot; + std::experimental::optional _scalePivotInverse; + + /* + User-defined rendering order for this node. + */ + int _renderingOrder; + + /* + Parameters computed by descending down the tree. These are updated whenever + any parent or this node itself is updated. For example, computedOpacity is + the opacity of this node multiplied by the opacities of all this node's + ancestors. Similarly, computedTransform is the full cascaded transformation + matrix for the node. + + computedRotation only takes into account rotations (not scale or translation). + computedLights are the lights that influence this node, based on distance from + the light and light attenuation, unrelated to the scene graph (e.g. the lights + in _computedLights may belong to any node in the scene). + */ + VROMatrix4f _computedTransform; + VROMatrix4f _computedInverseTransposeTransform; + VROMatrix4f _computedRotation; + float _computedOpacity; + std::vector> _computedLights; + uint32_t _computedLightsHash; + VROVector3f _computedPosition; + std::weak_ptr _transformDelegate; + + /* + Because _computedTransform is computed multiple times during a single render, storing + the last fully computed transform is necessary to retrieve a "valid" computedTransform. + We also store the last *local* position, scale, and rotation atomically. + */ + std::atomic _lastComputedTransform; + std::atomic _lastComputedPosition; + std::atomic _lastPosition; + std::atomic _lastScale; + std::atomic _lastRotation; + std::atomic _lastUmbrellaBoundingBox; + + /* + The transformed bounding box containing this node's geometry. The + _umbrellaBoundingBox encompasses not only this geometry, but the geometries + of all this node's children. + */ + VROBoundingBox _computedBoundingBox; + VROBoundingBox _umbrellaBoundingBox; + VROFrustumBoxIntersectionMetadata _umbrellaBoxMetadata; + + /* + True if this node is hidden. Hidden nodes are not rendered, and do not + respond to tap events. Hiding a node within an animation results in a + fade-out animation. The _opacityFromHiddenFlag is the opacity as derived + from _hidden: 0.0 if _hidden is true, 1.0 if _hidden is false, or somewhere + in-between during animation. + */ + bool _hidden; + float _opacityFromHiddenFlag; + + /* + The opacity of the node (0.0 is transparent, 1.0 is opaque). When opacity + drops below a threshold value, the node is hidden. This opacity is set by + the user. + */ + float _opacity; + + /* + True if this node is selectable by hit testing. Defaults to true. + */ + bool _selectable; + + /* + True if this node is set to ignore all events fired from VROBaseInputController. + */ + bool _ignoreEventHandling; + + /* + Delegate through which events are notified from the VROEventManager. + */ + std::weak_ptr _eventDelegateWeak; + + /* + True if we want to perform more accurate hit testing against this node's geometry + rather than its bounding box. + */ + bool _highAccuracyGaze; + + /* + Active actions on this node. + */ + std::vector> _actions; + + /* + Animations stored with this node. + */ + std::map>> _animations; + + /* + Constraints on the node, which can modify the node's transformation matrix. + */ + std::vector> _constraints; + + /* + True indicates that this node's descendants (children, grand-children, and so on) + should be rendered by order of their scene graph depth. Useful when rendering + 2D layouts like flexbox views. Defaults to false. + */ + bool _hierarchicalRendering; + + /* + The drag type to use for this VRONode. + */ + VRODragType _dragType; + + /* + Whether or not a drag is still being animated (used only if _dragType == VRODragType::FixedToWorld + */ + bool _isAnimatingDrag; + + /* + The VROTransaction representing the animation from dragging while _dragType == VRODragType::FixedToWorld. + */ + std::shared_ptr _dragAnimation; + +#pragma mark - Private + + /* + Recursively set the visibility of this node and all of its children to the + given value. + */ + void setVisibilityRecursive(bool visible); + + /* + Recursively expand the given bounding box by this node's _computedBoundingBox. + */ + void computeUmbrellaBounds(VROBoundingBox *bounds) const; + + /* + Compute the transform for this node, taking into the account the parent's transform. + Updates all related variables: + + _computedTransform + _computedPosition + _computedBoundingBox + */ + void doComputeTransform(VROMatrix4f parentTransform); + + /* + Action processing: execute all current actions and remove those that are + expired. + */ + void processActions(); + + /* + Get the animations in this node under the given key, and add them to the + given vector. + */ + void getAnimations(std::vector> &animations, + std::string key, bool recursive); + + /* + Get the keys of all animations in this node, and add them to the given set. + */ + void getAnimationKeys(std::set &animations, bool recursive); + + /* + Hit test helper functions. + */ + void hitTest(const VROCamera &camera, VROVector3f origin, VROVector3f ray, + bool boundsOnly, std::vector &results); + bool hitTestGeometry(VROVector3f origin, VROVector3f ray, VROMatrix4f transform); + + /* + The light and shadow bit masks. These are logically ANDed with each light's + influence bit mask. + + If the result is non-zero for the light bit mask, then the light will illuminate + the node. If the result is zero, then this node will be excluded from the light's + illumination, including receipt of that light's shadows. + + If the AND result is non-zero for the shadow casting bit map, then the node + will be cast shadows from the light (e.g. it will be rendered to that light's + shadow map). If the result is zero, it will not cast shadows from said light. + + These both default to 1. + */ + int _lightReceivingBitMask; + int _shadowCastingBitMask; + + /* + Physics rigid body that if defined, drives and sets the transformations of this node. + */ + std::shared_ptr _physicsBody; + + /* + Non-unique tag identifier representing this node. Defaults to kDefaultNodeTag. + */ + std::string _tag = kDefaultNodeTag; +}; + +#endif /* VRONode_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VRONodeCamera.h b/mobile/ios/ViroKit.framework/Headers/VRONodeCamera.h new file mode 100644 index 0000000..5458b06 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VRONodeCamera.h @@ -0,0 +1,94 @@ +// +// VRONodeCamera.h +// ViroRenderer +// +// Created by Raj Advani on 3/24/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VRONodeCamera_h +#define VRONodeCamera_h + +#include "VROAnimatable.h" +#include "VROVector3f.h" +#include "VROQuaternion.h" + +enum class VROCameraRotationType; + +/* + Node cameras are attached to nodes, and derive their base position and rotation + from said parent node. The "active" node camera each frame becomes the + point of view from which the scene is rendered in that frame. To designate + a node camera as active, set the VROView's pointOfView property to that + camera's node. + */ +class VRONodeCamera : public VROAnimatable { + +public: + + VRONodeCamera(); + virtual ~VRONodeCamera(); + + void setPosition(VROVector3f position); + void setBaseRotation(VROQuaternion baseRotation); + void setRotationType(VROCameraRotationType type); + void setOrbitFocalPoint(VROVector3f focalPt); + void setFieldOfViewY(float fovy); + + VROVector3f getPosition() const { + return _position; + } + VROQuaternion getBaseRotation() const { + return _baseRotation; + } + VROCameraRotationType getRotationType() const { + return _rotationType; + } + VROVector3f getOrbitFocalPoint() const { + return _orbitFocalPt; + } + float getFieldOfView() const { + return _fov; + } + +private: + + /* + The position of the camera, relative to the node's coordinate system. + */ + VROVector3f _position; + + /* + The base rotation. This is set by the application. Total rotation is head + rotation plus base rotation plus the rotation of the parent node. + */ + VROQuaternion _baseRotation; + + /* + The camera rotation type (orbit around a focal point, or standard rotation). + */ + VROCameraRotationType _rotationType; + + /* + If in orbit mode, this is the point that the camera focuses on, from its current + position. Specified in the coordinate system of the parent node. + */ + VROVector3f _orbitFocalPt; + + /* + The field of view for this camera, along the major (larger) axis. The minor axis + FOV will be automatically computed from this and the viewport. If this is zero, then + Viro will use the default FOV for the view. This value is ignored on VR and AR + platforms, where the FOV is fixed by the eye settings or the camera. This value + is given in degrees. + + Note that the major axis is the axis with the larger dimension: the X axis in landscape + mode, or the Y axis in portrait mode. By specifying the FOV in terms of the major axis, Viro + can keep the FOV consistent even upon orientation changes when the major/minor axes + swap. + */ + float _fov; + +}; + +#endif /* VRONodeCamera_hpp */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROOBJLoader.h b/mobile/ios/ViroKit.framework/Headers/VROOBJLoader.h new file mode 100644 index 0000000..2c8b947 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROOBJLoader.h @@ -0,0 +1,65 @@ +// +// VROOBJLoader.h +// ViroRenderer +// +// Created by Raj Advani on 12/13/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROOBJLoader_h +#define VROOBJLoader_h + +#include +#include +#include +#include +#include +#include +#include "VROGeometrySource.h" +#include "VROGeometryElement.h" +#include "tiny_obj_loader.h" + +class VRONode; +class VROTexture; +class VROGeometry; +enum class VROResourceType; + +class VROOBJLoader { + +public: + + /* + Load the OBJ file at the given resource. For all dependent resources + (e.g. textures) found, locate them in the parent folder of the resource. + + If async is true, an empty node is immediately returned while the OBJ is + loaded in the background. Afterward, the geometry is injected into the node + on the main (rendering) thread, and the given callback is invoked. + + If async is false, the callback is still executed. + */ + static void loadOBJFromResource(std::string resource, VROResourceType type, + std::shared_ptr destination, + bool async = false, std::function node, bool success)> onFinish = nullptr); + static void loadOBJFromResources(std::string resource, VROResourceType type, + std::shared_ptr destination, + std::map resourceMap, + bool async = false, std::function node, bool success)> onFinish = nullptr); + +private: + + static void injectOBJ(std::shared_ptr geometry, std::shared_ptr node, + std::function node, bool success)> onFinish); + static std::shared_ptr loadOBJ(std::string file, std::string base, VROResourceType type); + static std::shared_ptr loadOBJ(std::string file, + std::map resourceMap); + + static std::shared_ptr processOBJ(tinyobj::attrib_t attrib, + std::vector &shapes, + std::vector &materials, + std::string base, + VROResourceType type, + std::map *resourceMap = nullptr); +}; + +#endif /* VROOBJLoader_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROOpenGL.h b/mobile/ios/ViroKit.framework/Headers/VROOpenGL.h new file mode 100644 index 0000000..40b2e73 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROOpenGL.h @@ -0,0 +1,77 @@ +// +// VROOpenGL.h +// ViroRenderer +// +// Created by Raj Advani on 11/2/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROOpenGL_h +#define VROOpenGL_h + +#include "VRODefines.h" +#include "VROLog.h" + +#if VRO_PLATFORM_ANDROID + +#include +#include +#include +#include +#include +#include +#include + +// Avoiding glBufferSubData seems to increase stability on Adreno devices +#define VRO_AVOID_BUFFER_SUB_DATA 1 + +#elif VRO_PLATFORM_IOS + +#import +#import +#import +#import +#import +#import +#define VRO_AVOID_BUFFER_SUB_DATA 0 + +#endif + +#ifdef CHECK_GL_ERRORS + +static const char * GlErrorString( GLenum error ) +{ + switch ( error ) + { + case GL_NO_ERROR: return "GL_NO_ERROR"; + case GL_INVALID_ENUM: return "GL_INVALID_ENUM"; + case GL_INVALID_VALUE: return "GL_INVALID_VALUE"; + case GL_INVALID_OPERATION: return "GL_INVALID_OPERATION"; + case GL_INVALID_FRAMEBUFFER_OPERATION: return "GL_INVALID_FRAMEBUFFER_OPERATION"; + case GL_OUT_OF_MEMORY: return "GL_OUT_OF_MEMORY"; + default: return "unknown"; + } +} + +static void GLCheckErrors( int line ) +{ + for ( int i = 0; i < 10; i++ ) + { + const GLenum error = glGetError(); + if ( error == GL_NO_ERROR ) + { + break; + } + pinfo( "GL error on line %d: %s", line, GlErrorString( error ) ); + } +} + +#define GL( func ) func; GLCheckErrors( __LINE__ ); + +#else // CHECK_GL_ERRORS + +#define GL( func ) func; + +#endif // CHECK_GL_ERRORS + +#endif /* VROOpenGL_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROParticle.h b/mobile/ios/ViroKit.framework/Headers/VROParticle.h new file mode 100644 index 0000000..3278810 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROParticle.h @@ -0,0 +1,73 @@ +// +// VROParticle.h +// ViroRenderer +// +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROParticle_h +#define VROParticle_h + +#include "VROMatrix4f.h" +#include "VROVector4f.h" +#include "VROVector3f.h" + +/* + Struct containing all properties relating to a single particle, such as + life cycle spawn, transformations, color and physics states. + */ +struct VROParticle{ + // Position at which particle had spawned at, local to the particle emitter. + VROMatrix4f spawnedLocalTransform; + + // Position at which particle had spawned at, in world transform. + VROMatrix4f spawnedWorldTransform; + + // Current position of the particle, local to the particle emitter. + VROMatrix4f currentLocalTransform; + + // Current position of the particle, in world transform + VROMatrix4f currentWorldTransform; + + // True if this particle's scale, rotation and position are continously + // affected by changes in the emitter's transform after it has been spawned. + bool fixedToEmitter; + + // Initial values representing scale, rotation, physics and color properties; + // These are all determined by VROParticleModifiers that have been set on the emitter. + VROVector3f initialRotation; + VROVector3f initialScale; + VROVector3f initialColor; + VROVector3f initialVelocity; + VROVector3f initialAccel; + VROVector3f initialAlpha; + VROVector4f colorCurrent; + + // The amount of time that had passed for this particle, since it had spawned. + double timeSinceSpawnedInMs; + + // The total amount of travelled distance from it's spawned location. + double distanceTraveled; + + // The current speed at which this particle is travelling at. + double velocity; + + // True if the particle has died but is not yet due to be de-allocated. + // This is mainly used for recycling particles quickly and to reduce the + // numerous number of allocations / de-allocations of particle objects. + bool isZombie; + + // Time at which this particle was spawned at in milliseconds. + double spawnTimeMs; + + // Time at which this particle is killed and becomes a zombie, in milliseconds. + double killedTimeMs; + + // Duration of time a particle remains alive, in milliseconds. + double lifePeriodMs; + + // Duration of time a particle remains a zombie before being deallocated, in milliseconds. + double zombiePeriodMs; +}; + +#endif /* VROParticle_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROParticleEmitter.h b/mobile/ios/ViroKit.framework/Headers/VROParticleEmitter.h new file mode 100644 index 0000000..a0b7a1f --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROParticleEmitter.h @@ -0,0 +1,470 @@ +// +// VROParticleEmitter.h +// ViroRenderer +// +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROParticleEmitter_h +#define VROParticleEmitter_h + +#include "VRODriver.h" +#include "VROParticleModifier.h" + +// Assumed mass of a single particle, used for all physics calculations. +static float kAssumedParticleMass = 1; + +class VROSurface; +class VROParticleUBO; +class VROParticle; +class VROTexture; + +/* + Volume describing the area around which particles spawn within / around. + */ +struct VROParticleSpawnVolume{ + enum class Shape{ + Box, + Sphere, + Point + }; + + static VROParticleSpawnVolume::Shape getModifierFactorForString(std::string strType) { + if (VROStringUtil::strcmpinsensitive(strType, "Box")) { + return VROParticleSpawnVolume::Shape::Box; + } else if (VROStringUtil::strcmpinsensitive(strType, "Sphere")) { + return VROParticleSpawnVolume::Shape::Sphere; + } else { + return VROParticleSpawnVolume::Shape::Point; + } + } + + Shape shape; + + // Vec of params to be provided for configuring the specified shape. + std::vector shapeParams; + + // True if particles should be spawned on this shape's surface + // instead of within it. Applicable for Box and Sphere shapes only. + bool spawnOnSurface; +}; + + +/* + VROParticleEmitter handles the behavior of quad particles emitted in the scene in terms of + its life cycle, physical motion, and visual characteristics like color and alpha. + */ +class VROParticleEmitter { +public: + VROParticleEmitter(std::shared_ptr driver, + std::shared_ptr particleGeometry); + + /* + Constructor that creates an uninitialized emitter. To initialize this emitter before + it can be configured / modified, call VROParticleEmitter::initEmitter(); + */ + VROParticleEmitter(); + virtual ~VROParticleEmitter(); + + /* + Called per frame to update particle states, lifetime and behavior. The computedTransform + is the final transform of this emitter's parent node. + */ + virtual void update(const VRORenderContext &context, const VROMatrix4f &computedTransform); + + /* + Allows for setting of the particleSurface if initEmitter has already been called. + */ + virtual void setParticleSurface(std::shared_ptr particleSurface); + std::shared_ptr getParticleSurface() const; + + void setRun(bool emit) { + _requestRun = emit; + } + + void setDuration(double duration) { + _duration = duration; + } + + void setDelay(double delay) { + _emitterDelayDuration = delay; + } + + void setLoop(bool loop) { + _loop = loop; + } + + void setFixedToEmitter(bool isFixed) { + _fixToEmitter = isFixed; + } + + virtual void setMaxParticles(int maxParticles) { + _maxParticles = maxParticles; + } + + void setParticleLifeTime(std::pair lifeTime) { + _particleLifeTime = lifeTime; + } + + void setEmissionRatePerSecond(std::pair rate) { + _particlesEmittedPerSecond = rate; + } + + void setEmissionRatePerDistance(std::pair rate) { + _particlesEmittedPerMeter = rate; + } + + void setBlendMode(VROBlendMode mode); + void setBloomThreshold(float threshold); + + /* + True if we are no longer emitting particles and have completed the emission cycle. + */ + bool finishedEmissionCycle(); + + /* + Reset back to the beginning of the emission cycle for this emitter. + */ + void resetEmissionCycle(bool resetParticles); + + /* + Used for constructing the behavior of how bursts of particles spawn. + */ + struct VROParticleBurst { + // Reference factor against which to compare when deciding how to burst-spawn particles. + VROParticleModifier::VROModifierFactor referenceFactor; + + // Min, Max range of number of particles to spawn. + std::pair numberOfParticles; + + // Starting Reference Value at which to begin the burst. + double referenceValueStart; + + // Cool down period in milliseconds or distance in meters after each burst. + double referenceValueInterval; + + // Number of times to repeat this burst. + int cycles; + }; + + /* + Sets on this emitter a list of VROParticleBurst to emit. + */ + void setParticleBursts(std::vector bursts) { + _bursts = bursts; + _scheduledBurst = bursts; + } + + /* + Overrides the current specified VROParticleSpawnVolume. + */ + void setParticleSpawnVolume(VROParticleSpawnVolume volume) { + _currentVolume = volume; + } + + /* + Parameters for configuring an initial explosive force at a given explosionPoint local + to the emitter with a magnitude of impulseExplosion. + */ + void setInitialExplosion(VROVector3f explosionPoint, float impulseExplosion, float decelleration = -1) { + _explosionCenter = explosionPoint; + _impulseExplosionMagnitude = impulseExplosion; + _impulseDeaccelerationExplosionPeriod = decelleration; + } + + /* + Below are specific particle modifiers that can be set by the bridge, that defines the + behavior and appearance of emitted particles. + */ + void setAlphaModifier(std::shared_ptr mod) { + _alphaModifier = mod; + } + void setColorModifier(std::shared_ptr mod) { + _colorModifier = mod; + } + void setScaleModifier(std::shared_ptr mod) { + _scaleModifier = mod; + } + void setRotationModifier(std::shared_ptr mod) { + _rotationModifier = mod; + } + void setVelocityModifier(std::shared_ptr mod) { + _velocityModifier = mod; + } + void setAccelerationmodifier(std::shared_ptr mod) { + _accelerationModifier = mod; + } + + /* + Initialize the emitter with default configurations and states. + */ + void initEmitter(std::shared_ptr driver, + std::shared_ptr particleGeometry); + void setDefaultValues(); + +protected: + + /* + The last transform computed for this emitter's parent node. Used when resetting + particles. + */ + VROMatrix4f _lastComputedTransform; + + /* + The geometry used to represent particles in this emitter. + */ + std::shared_ptr _particleGeometry; + + /* + List of all particles in the scene for this emitter. This includes active particles (particles + that have just been spawned and are animating in the scene) and also zombie particles + (particles that are just killed and become a zombie temporarily before being de-allocated + and removed from this list to encourage the recycling of particle objects). + */ + std::vector _particles; + + /* + Vector containing all particles that have died so that they can be reused. Particles + in a zombie start after a certain time will be de-allocated. + */ + std::vector _zombieParticles; + + /* + The maximum number of active particles (not including zombie ones) that this emitter + can have at any given moment. + */ + int _maxParticles; + +private: + +#pragma mark - Particle Emission Behaviors + /* + Flag for setting the _run state on a render pass. This is required because emitter states that + are updated as a result of changes to the _run flag are dependent on certain scene->compute + render passes to occur first before we compute this Particle emitter (like transforms). + */ + bool _requestRun; + + /* + True to continue emitting particles from when the emitter had last stopped. + */ + bool _run; + + /* + The length of time in milliseconds this emitter is emitting particles. + */ + double _duration; + + /* + If true, the emission cycle will repeat after the duration. + */ + bool _loop; + + /* + If false, already emitted particles will not be affected by transformation changes made + to this emitter's node, else, they would be "locked" to the emitter. + */ + bool _fixToEmitter; + + /* + Below are specific particle modifiers that can be set by the bridge, that defines the + behavior and appearance of emitted particles. + */ + std::shared_ptr _alphaModifier; + std::shared_ptr _colorModifier; + std::shared_ptr _scaleModifier; + std::shared_ptr _rotationModifier; + std::shared_ptr _velocityModifier; + std::shared_ptr _accelerationModifier; + + /* + Emission of extra particles at specific times or distances during the entire _duration + this emitter is emitting. + */ + std::vector _bursts; + + /* + Copied from _burst at the beginning of every emitter emission cycle to schedule and + maintain the state of all incoming burst events. + */ + std::vector _scheduledBurst; + + /* + The min max lifetime of emitted particles, in milliseconds. + */ + std::pair _particleLifeTime; + +#pragma mark - Emitter Attributes + /* + Length of time in milliseconds this emitter delays before emitting particles. + Note that this will not be include in _duration. + */ + double _emitterDelayDuration = -1; + + /* + Time at which we have started the delay, used for tracking the delay status by + checking against: _emitterDelayStartTime + _emitterDelayTimePassedSoFar > currentTime. + */ + double _emitterDelayStartTime = -1; + + /* + Length of delay time left before emitting particles. This is reset to _emitterDelayDuration + but is manipulated / subtracted to track remaining delay time as the emitter is paused/resumed. + */ + double _emitterDelayTimePassedSoFar = 0; + + /* + Total time that has passed since the beginning of this emitter's emission cycle. + */ + double _emitterTotalPassedTime = 0; + + /* + Time that has passed since this emitter has last started. It is redefined as the emitter + is paused / resumed. + */ + double _emitterPassedTimeSoFar = 0; + + /* + Time at which this emitter has been started at in milliseconds. + */ + double _emitterStartTimeMs = 0; + + /* + Total travelled distance of the emitter since the beginning of this emitter's emission cycle. + */ + double _emitterTotalPassedDistance = 0; + + /* + Distance travelled since this emitter has last started. It is redefined as the emitter + is paused / resumed. + */ + double _emitterPassedDistanceSoFar = 0; + + /* + Location at which this emitter has started at. It is redefined as the emitter + is paused / resumed. + */ + VROVector3f _emitterStartLocation; + + /* + Set for determining how many particles should be emitted per distance travelled of this + emitter, if any. The pair defines a uniform distribution (min, max). + */ + std::pair _particlesEmittedPerMeter; + + /* + Position at which we had last emitted particles that were distance spawned. + */ + VROVector3f _distanceSpawnedLastEmitPosition; + + /* + Position where we first started distance spawning particles from. + */ + VROVector3f _distanceSpawnedInitPosition; + + /* + Rate at which particles are distance spawned, per meter. + */ + double _distanceSpawnedEmissionRate = 0; + + /* + Set for determining how many particles should be emitted per second of _duration of this + emitter, if any. The pair defines a uniform distribution (min, max). + */ + std::pair _particlesEmittedPerSecond; + + /* + Time at which we had last emitted particles that were time spawned. + */ + double _intervalSpawnedLastEmitTime = 0; + + /* + Time when we had first started time-spawning particles from. + */ + double _intervalSpawnedInitTime = 0; + double _particlesSpawnIntervalMs = 100; + double _intervalSpawnedEmissionRate = 0; + + /* + Updates any time / distance state that the emitter needs to determine particle behavior. + */ + void updateEmitter(double currentTime, const VROMatrix4f &computedTransform); + + /* + Processes any delay period left on this particle emitter's current emit cycle. + Returns true if any delay was processed, false otherwise. + */ + bool processDelay(double currentTime); + +#pragma mark - Particle Attributes + + /* + Below are specific update functions that define the behavior and appearance + of the particle. + */ + void updateParticles(double currentTime, const VRORenderContext &context, + const VROMatrix4f &computedTransform, bool isCurrentlyDelayed); + void updateParticlePhysics(double currentTime); + void updateParticleAppearance(double currentTime); + void updateParticlesToBeKilled(double currentTime); + void updateParticleSpawn(double currentTime, VROVector3f currentPos); + void updateZombieParticles(double currentTime); + + /* + Called when we wish to spawn new particles, given the numberOfParticles. To do so, + we firstly attempt to recycle zombie particles and create new ones if we do ever run out. + */ + void spawnParticle(int numberOfParticles, double currentTime); + + /* + Returns the number of particles to spawn at the given currentTime with the set + _particlesEmittedPerSecond on this emitter. + */ + int getSpawnParticlesPerSecond(double currentTime); + + /* + Returns the number of particles to spawn at the given position with the set + _particlesEmittedPerMeter on this emitter. + */ + int getSpawnParticlesPerMeter(VROVector3f currentPos); + + /* + Returns the number of particles to spawn based on _scheduledBurst. + */ + int getSpawnParticleBursts(); + + /* + Resets the particle to a set of known defaults, so that it can be re-used / re-emitted. + */ + void resetParticle(VROParticle &particle, double currentTime); + + /* + Volume defining the location of where particles would spawn. + */ + VROParticleSpawnVolume _currentVolume; + + /* + Location local to this Particle Emitter from which to calculate an explosive force + to determine initial velocity. + */ + VROVector3f _explosionCenter; + + /* + The magnitude of an explosion's impulse. + */ + float _impulseExplosionMagnitude = -1; + + double _impulseDeaccelerationExplosionPeriod = -1; + /* + Grabs a random point from the currently configured _currentVolume. + */ + VROVector3f getPointInSpawnVolume(); + + /* + Extrapolate the initial velocity for this particle if explosion parameters have been set. + */ + VROVector3f getExplosionInitialVel(VROVector3f particlePosition); + VROVector3f getExplosionAccel(VROVector3f particlePosition); +}; + +#endif /* VROParticleEmitter_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROParticleModifier.h b/mobile/ios/ViroKit.framework/Headers/VROParticleModifier.h new file mode 100644 index 0000000..954a358 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROParticleModifier.h @@ -0,0 +1,229 @@ +// +// VROParticleModifier.h +// ViroRenderer +// +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROParticleModifier_h +#define VROParticleModifier_h + +#include +#include +#include +#include "VROMatrix4f.h" +#include "VROVector4f.h" +#include "VROOpenGL.h" +#include "VROVector3f.h" +#include "VROParticle.h" +#include "VROMath.h" +#include "VROStringUtil.h" + +/* + VROParticleModifier contains a list of VROModifierIntervals to interpolate against with + referenceFactor to time, distance or velocity (as defined by a given VROModifierFactor). This + is used by VROParticleEmitter to pre-define a set of particle property behaviors (color, + scale, rotation, etc) that can then be applied to any particle. + */ +class VROParticleModifier { +public: + /* + VROModifierFactor represents the referenceFactor factor this modifier will interpolate against. + */ + enum class VROModifierFactor { + Time, // Interpolate against the timeSinceSpawnedInMs of a particle. + Distance, // Interpolate against the distanceTravelled of a particle. + Velocity // Interpolate against the current velocity of a particle. + }; + + static VROModifierFactor getModifierFactorForString(std::string strType) { + if (VROStringUtil::strcmpinsensitive(strType, "Velocity")) { + return VROModifierFactor::Velocity; + } else if (VROStringUtil::strcmpinsensitive(strType, "Distance")) { + return VROModifierFactor::Distance; + } else { + return VROModifierFactor::Time; + } + } + + /* + Interpolation points between which to animate a given initial value (most likely the + particle's property value) towards. + */ + struct VROModifierInterval { + // Property of the particle to interpolate towards for this given VROModifierWindow. + VROVector3f targetedValue; + + // Start and End factor values. For example, startTime and endTime. + double startFactor; + double endFactor; + + bool operator < (const VROModifierInterval& point) const { + return (endFactor <= point.startFactor); + } + }; + + VROParticleModifier(VROVector3f constant) { + init(constant, constant, VROModifierFactor::Time); + }; + + VROParticleModifier(VROVector3f minRange, VROVector3f maxRange) { + init(minRange, maxRange, VROModifierFactor::Time); + }; + + VROParticleModifier(VROVector3f minRange, VROVector3f maxRange, + VROModifierFactor factor, std::vector values) { + init(minRange, maxRange, factor); + setInterpolatedPoints(values); + }; + + virtual ~VROParticleModifier(){}; + + VROVector3f getInitialValue() { + return random(_initialMinValue, _initialMaxValue); + } + + /* + Apply the behavior of this modifier (set by VROInterpolateValues) on the given initialValue + with referenceFactor to the preset _referenceFactor. + */ + VROVector3f applyModifier(VROParticle &particle, VROVector3f initialValue) { + if (_modifierInterval.size() <= 0) { + return initialValue; + } + + double deltaFactor = getReferenceFactorForParticle(particle); + return getFinalValue(initialValue, deltaFactor); + } + +private: + void init(VROVector3f minRange, VROVector3f maxRange, VROModifierFactor factor) { + _initialMinValue = minRange; + _initialMaxValue = maxRange; + _referenceFactor = factor; + } + + /* + Min and Max ranges from which randomize across and determine the initial value applied + by this modifier. + */ + VROVector3f _initialMinValue; + VROVector3f _initialMaxValue; + + /* + Reference factor this modifier will interpolate against (Time, Distance or Velocity). + */ + VROModifierFactor _referenceFactor; + + /* + List of VROModifiers with values dictating the behavior of this modifier, along which this + VROParticleModifier will interpolate against. + */ + std::vector _modifierInterval; + + /* + Sets a list of VROModifierInterval values that will be used by this VROParticleModifier. + */ + void setInterpolatedPoints(std::vector values) { + if (values.size() == 0 ){ + return; + } + + std::sort(values.begin(), values.end()); + for (int i = 0; i < values.size() - 1; i ++) { + if (values[i].endFactor > values[i + 1].startFactor + || (values[i].startFactor > values[i].endFactor)) { + perror("Attempted to set an invalid set of interpolated points for the Particle Emitter!"); + return; + } + } + + _modifierInterval = values; + } + + /* + Returns the referenceFactor factor value from the provided particle. The type of referenceFactor factor + is determined by this VROParticleModifier _referenceFactor. + */ + double getReferenceFactorForParticle(const VROParticle &particle) { + if (_referenceFactor == VROModifierFactor::Distance) { + return particle.distanceTraveled; + } else if (_referenceFactor == VROModifierFactor::Velocity) { + return particle.velocity; + } + return particle.timeSinceSpawnedInMs; + } + + /* + With the given particle, and based on this emitter's referenceFactor factor, determine the amount of + passed time, distance, or velocity that is required to interpolate the desired value. + */ + VROVector3f getFinalValue(VROVector3f initialValue, double currentFactor) { + VROVector3f start; + VROVector3f end; + for (int i = 0; i < _modifierInterval.size(); i ++) { + + // Determine if this VROModifierInterval contains a startFactor and endFactor interval + // that applies to the current deltaFactor. + if (currentFactor >= _modifierInterval[i].startFactor && currentFactor <= _modifierInterval[i].endFactor) { + // If so, calculate progression ratio + float delta = currentFactor - _modifierInterval[i].startFactor; + float deltaWindow = _modifierInterval[i].endFactor - _modifierInterval[i].startFactor; + float ratio = delta / deltaWindow; + if (i == 0){ + start = initialValue; + } else { + start = _modifierInterval[i-1].targetedValue; + } + end = _modifierInterval[i].targetedValue; + + + return interpolatePoint(start, end, ratio); + } + + // Else, if we can't find a VROModifierInterval that matches the currentFactor, + // check if the currentFactor may be referring to a time/distance period in between + // VROModifierIntervals. If so, attempt to find the last known VROModifierInterval + // that we had applied before and use its ending value. + if (i != 0 && currentFactor >= _modifierInterval[i-1].endFactor + & currentFactor <= _modifierInterval[i].endFactor) { + if (i - 1 == 0) { + start = initialValue; + } else { + start = _modifierInterval[i-2].targetedValue; + } + + end = _modifierInterval[i-1].targetedValue; + return interpolatePoint(start, end, 1); + } + + // Else if this is the last VROModifierInterval, and the currentFactor has progressed + // beyond it, attempt to use the ending value of the last known VROModifierInterval. + if (i == _modifierInterval.size() - 1 && currentFactor > _modifierInterval[i].endFactor) { + if (i != 0) { + start = _modifierInterval[i-1].targetedValue; + } else { + start = _modifierInterval[i].targetedValue; + } + end = _modifierInterval[i].targetedValue; + return interpolatePoint(start, end, 1); + } + } + + // If no last known windows were yet found, we have yet to encounter our first + // VROModifierInterval, thus return initialValue. + return initialValue; + } + + VROVector3f interpolatePoint(VROVector3f &startValue, VROVector3f &endValue, float ratio) { + VROVector3f final; + if (ratio >= 1 ) { + final = endValue; + } else { + final = startValue.interpolate(endValue, ratio); + } + return final; + } +}; + +#endif /* VROParticleModifier_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROParticleUBO.h b/mobile/ios/ViroKit.framework/Headers/VROParticleUBO.h new file mode 100644 index 0000000..27d384e --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROParticleUBO.h @@ -0,0 +1,91 @@ +// +// VROParticleUBO.h +// ViroRenderer +// +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROParticleUBO_h +#define VROParticleUBO_h + +#include "VROInstancedUBO.h" + +static const int kMaxParticlesPerUBO = 180; +static const int kMaxFloatsPerTransform = 16; +static const int kMaxFloatsPerColor = 4; + +/* + Uniform buffer object structure format through which particle transform data are batched + into the Vertex shader. Data is grouped in 4N slots, matching layout specified + in particle_vsh.glsl. + */ +typedef struct { + float particles_transform[kMaxParticlesPerUBO * kMaxFloatsPerTransform]; +} VROParticlesUBOVertexData; + +/* + Uniform buffer object structure format through which particle "appearance" data are + batched into the Fragment shader. Data is grouped in 4N slots, matching layout specified + in particle_fsh.glsl. + */ +typedef struct { + float frag_particles_color[kMaxParticlesPerUBO * kMaxFloatsPerColor]; +} VROParticlesUBOFragmentData; + +class VROParticle; + +/* + VROParticleUBO handles the binding and batching of particle information into the vertex + and fragment shaders for instance rendering. Note that any instance of a given VROParticleUBO + will always bind data to the same uniform buffers (Binding Point and Buffer ID). + */ +class VROParticleUBO : public VROInstancedUBO { +public: + VROParticleUBO(std::shared_ptr driver); + virtual ~VROParticleUBO(); + + void bind(); + std::vector> createInstanceShaderModifier(); + + /* + Returns number of glDraw(s) required to instance draw all the particles represented + by this VROParticleUBO. + */ + int getNumberOfDrawCalls(); + + /* + Binds all VROParticlesUBOVertexData and VROParticlesUBOFragmentData to its corresponding + vertex and fragment uniform buffers so that they can be referred to and processed + by shader modifiers crated with createInstanceShaderModifier(). + */ + int bindDrawData(int currentDrawCallIndex); + + /* + Update the data in this UBO with the latest list of instanced particle data + like transformation matrix / color. + */ + void update(std::vector &particles, VROBoundingBox &box); + + /* + Returns a bounding box that encapsulates all _lastKnownParticles. + */ + VROBoundingBox getInstancedBoundingBox(); + +private: + + /* + Buffer IDs representing the Uniform Buffer objects that were generated for this + UBO. + */ + GLuint _particleVertexUBO; + GLuint _particleFragmentUBO; + + /* + The driver that created this UBO. + */ + std::weak_ptr _driver; + std::vector _lastKnownParticles; + VROBoundingBox _lastKnownBoundingBox; +}; + +#endif /* VROParticleUBO_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROPencil.h b/mobile/ios/ViroKit.framework/Headers/VROPencil.h new file mode 100644 index 0000000..32251f5 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROPencil.h @@ -0,0 +1,52 @@ +// +// VROPencil.h +// ViroRenderer +// +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROPencil_h +#define VROPencil_h + +#include +#include +#include "VROSortKey.h" + +class VRONode; +class VRORenderContext; +class VRODriver; +class VROVector3f; +class VROVector4f; +class VROMaterial; + +/* + Stored in VRORenderContext, VROPencil is used to draw a list of VROPolylines + in a separate render pass, after having rendered the scene, mainly for drawing + debug information. + */ +class VROPencil { +public: + VROPencil(){} + virtual ~VROPencil(); + + /* + Adds a line to be drawn starting and ending at the provided world coordinates. + */ + void draw(VROVector3f from, VROVector3f to); + + /* + Renders the geometry of all lines added with VROPencil.draw(), called in VRORenderer.renderEye(), + after the scene and reticle has been rendered. + */ + void render(const VRORenderContext &context, std::shared_ptr &driver); + + /* + Clears all added lines in preparation for the next render pass. + */ + void clear(); + +private: + std::vector> _paths; +}; + +#endif diff --git a/mobile/ios/ViroKit.framework/Headers/VROPhysicsBody.h b/mobile/ios/ViroKit.framework/Headers/VROPhysicsBody.h new file mode 100644 index 0000000..2548539 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROPhysicsBody.h @@ -0,0 +1,260 @@ +// +// VROPhysicsBody.h +// ViroRenderer +// +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROPhysicsBody_h +#define VROPhysicsBody_h + +#include +#include "VROVector3f.h" +#include "VROPhysicsShape.h" +#include "VROLog.h" +#include "VROStringUtil.h" + +class VRONode; +class btTransform; +class btMotionState; +class btRigidBody; +class btVector3; +class VROPhysicsBodyDelegate; + +//Atomic counter used to grab a unique Id to represent a VROPhysicsBody. +static std::atomic_int sPhysicsBodyIdCounter; + +/* + VROPhysicsBody contains all the physics properties and forces that are associated with and/or + applied to a given node. After construction, it is given to and processed within a simulated + VROPhysicsWorld. + */ +class VROPhysicsBody : public std::enable_shared_from_this { +public: + enum class VROPhysicsBodyType { + /* + Static bodies are stationary, has 0 mass, and will not move. + It can only collide with dynamic bodies. + */ + Static = 0, + + /* + Kinematic bodies can be moved via animations, and has 0 mass. + It can only collide with dynamic bodies (but cannot be influenced by them). + */ + Kinematic = 1, + + /* + Dynamic bodies are designed to be moved only under a physics simulation, + and has positive mass. It collides with all VROPhysicsBody types. + */ + Dynamic = 2 + }; + static const std::string kDynamicTag; + static const std::string kKinematicTag; + static const std::string kStaticTag; + + /* + Returns true if the given string and mass represents a valid representation of + VROPhysicsBodyType. Else, false is returned and the errorMsg is populated + with the reason for failure. + */ + static bool isValidType(std::string strType, float mass, std::string &errorMsg) { + if (!VROStringUtil::strcmpinsensitive(strType, kKinematicTag) + && !VROStringUtil::strcmpinsensitive(strType, kDynamicTag) + && !VROStringUtil::strcmpinsensitive(strType, kStaticTag)) { + errorMsg = "Provided invalid physicsBody of type: " + strType; + return false; + } else if ((VROStringUtil::strcmpinsensitive(strType, kKinematicTag) || VROStringUtil::strcmpinsensitive(strType, kStaticTag)) && mass != 0) { + errorMsg = "Mass must be 0 for kinematic or static bodies."; + return false; + } else if (VROStringUtil::strcmpinsensitive(strType, kDynamicTag) && mass <= 0) { + errorMsg = "Mass must be > 0 for dynamic bodies."; + return false; + } + + return true; + } + + /* + Returns a VROPhysicsBodyType for a given string. + */ + static VROPhysicsBody::VROPhysicsBodyType getBodyTypeForString(std::string strType) { + if (VROStringUtil::strcmpinsensitive(strType, kKinematicTag)) { + return VROPhysicsBody::VROPhysicsBodyType::Kinematic; + } else if (VROStringUtil::strcmpinsensitive(strType, kDynamicTag)) { + return VROPhysicsBody::VROPhysicsBodyType::Dynamic; + } + return VROPhysicsBody::VROPhysicsBodyType::Static; + } + + VROPhysicsBody(std::shared_ptr node, VROPhysicsBody::VROPhysicsBodyType type, + float mass, std::shared_ptr shape); + virtual ~VROPhysicsBody(); + + /* + Unique key identifier that the VROPhysicsWorld uses to track this VROPhysicsBody. + */ + std::string getKey(); + + /* + Returns a non-unique tag identifier stored in VRONode for referring to this VROPhysicsbody. + */ + std::string getTag(); + + /* + Setters and getters for physics properties associated with this VROPhysicsBody. + */ + void setMass(float mass); + void setInertia(VROVector3f inertia); + void setIsSimulated(bool enabled); + bool getIsSimulated(); + void setRestitution(float restitution); + void setUseGravity(bool useGravity); + bool getUseGravity(); + void setFriction(float friction); + void setType(VROPhysicsBodyType type, float mass); + + /* + Sets this physics body in a kinematic drag mode, where we momentarily treat the body as + a draggable kinematic object. + */ + void setKinematicDrag(bool isDragging); + + /* + Sets the given VROPhysicsShape that will be used to process collisions. + */ + void setPhysicsShape(std::shared_ptr shape); + + /* + Schedules an update that re-invalidates the properties of this + physics body on the next compute physics step. + */ + void refreshBody(); + + /* + Functions for applying forces on this VROPhysicsBody. + */ + void applyForce(VROVector3f power, VROVector3f position); + void applyImpulse(VROVector3f impulse, VROVector3f position); + + /* + Functions for applying torque on this VROPhysicsBody. + */ + void applyTorque(VROVector3f torque); + void applyTorqueImpulse(VROVector3f impulse); + void clearForces(); + + /* + Sets a velocity on this VROPhysicsBody to be applied when VROPhysicsWorld calls + applyPresetVelocity on this physics body. + */ + void setVelocity(VROVector3f velocity, bool isConstant); + + /* + Returns the underlying bullet rigid body that represents this VROPhysicsBody. + */ + btRigidBody* getBulletRigidBody(); + + /* + Called to synchronize the world transform of the node associated with this VROPhysicsBody + on to the underlying bullet physics body's transform. + */ + void getWorldTransform(btTransform& centerOfMassWorldTrans ) const; + + /* + Called to synchronize the world transform of the underlying bullet physics body, on to the + node's transform associated with this VROPhysicsBody. + */ + void setWorldTransform(const btTransform& centerOfMassWorldTrans); + + /* + Updates the underlying Bullet physics body with the latest properties of VROPhysicsBody. + */ + void updateBulletRigidBody(); + + /* + Flag to notify the physics world if the VROPhysicsBody has been modified (where it can then + decide to perform updates if needed). + */ + bool needsBulletUpdate(); + + /* + Updates the forces applied on the underlying bullet physics body. This is called and re-applied + in each simulated physics step, as required by bullet. + */ + void updateBulletForces(); + + /* + Applies the set velocity on this VROPhysicsBody at every physics step if isConstant was true, + simulating constant velocity. Else, an instantaneous velocity is applied only once. + */ + void applyPresetVelocity(); + + /* + Delegates attached to this VROPhysicsBody to be notified of collision events. + */ + void setPhysicsDelegate(std::shared_ptr delegate); + std::shared_ptr getPhysicsDelegate(); + + /* + Collision struct encapsulating all collision properties representing + a collided event. + */ + struct VROCollision { + VROCollision(): penetrationDistance(1) { } + VROVector3f collidedPoint; + VROVector3f collidedNormal; + std::string collidedBodyTag; + + /* + Penetration depth given by bullet will be some negative number + if they are colliding. VROCollision defaults penetrationDistance + to a positive number (1) to ensure that it is set / re-evaulated + in a computeCollision pass. + */ + float penetrationDistance; + }; + +private: + std::string _key; + std::weak_ptr _w_node; + bool _needsBulletUpdate; + btRigidBody* _rigidBody; + + // Physics Properties + std::shared_ptr _shape; + VROPhysicsBody::VROPhysicsBodyType _type; + bool _enableSimulation; + float _mass; + VROVector3f _inertia; + bool _useGravity; + std::weak_ptr _w_physicsDelegate; + VROVector3f _constantVelocity; + VROVector3f _instantVelocity; + + /* + * Preserved physics properties when in kinematic drag mode. + */ + float _preservedDraggedMass; + VROPhysicsBodyType _preservedType; + + /* + Simple force struct containing a force vector + and the location that it is applied at. + */ + struct BulletForce { + VROVector3f force; + VROVector3f location; + }; + + std::vector _forces; + std::vector _torques; + + /* + Creates / destroys the underlying bullet object representing this VROPhysicsBody. + */ + void createBulletBody(); + void releaseBulletBody(); +}; +#endif diff --git a/mobile/ios/ViroKit.framework/Headers/VROPhysicsBodyDelegate.h b/mobile/ios/ViroKit.framework/Headers/VROPhysicsBodyDelegate.h new file mode 100644 index 0000000..595a52d --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROPhysicsBodyDelegate.h @@ -0,0 +1,62 @@ +// +// VROPhysicsBodyDelegate.h +// ViroRenderer +// +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROPhysicsBodyDelegate_h +#define VROPhysicsBodyDelegate_h +#include "VROPhysicsBody.h" +#include "VROTime.h" + +/* + VROPhysicsBodyDelegate contains all callbacks delegate events pertaining to + the VROPhysicsBody that it is attached to (like collisions). + */ +class VROPhysicsBodyDelegate { + /* + LastKnownCollidedObjects is used to filter out similar collision results + so that delegates are only notify with collided-enter events. + */ + std::map _lastKnownCollidedObjects; + std::map _currentCollidedObjects; + double _lastSampledTime = 0; + +public: + VROPhysicsBodyDelegate(){} + virtual ~VROPhysicsBodyDelegate() {} + + virtual void onCollided(std::string bodyBKey, VROPhysicsBody::VROCollision collision) = 0; + + /* + Called by VROPhysicsWorld when an object has collided within the computeCollisions() pass. + Bullet however only provides continuous contact collision checks. Instead, we only want to + notify our delegates about collision-entered events with onCollided(). Thus, here we + iterate through all known latestCollidedObjects and compare it with the objects we have + last seen in _lastKnownCollidedObjects, and then only notify the delegates regarding + new collisions. + */ + void onEngineCollisionUpdate(std::string currentObject, const std::map &latestCollidedObjects) { + _currentCollidedObjects.insert(latestCollidedObjects.begin(), latestCollidedObjects.end()); + + // Sample at a rate of every 10 frames + double collidedTime = VROTimeCurrentMillis(); + if (_lastSampledTime + 160 > collidedTime) { + return; + } + + _lastSampledTime = collidedTime; + for (auto &it: _currentCollidedObjects) { + if (_lastKnownCollidedObjects.find(it.first) == _lastKnownCollidedObjects.end()) { + onCollided(it.first, it.second); + } + } + + _lastKnownCollidedObjects = _currentCollidedObjects; + _currentCollidedObjects.clear(); + } +}; + + +#endif /* VROPhysicsBodyDelegate_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROPhysicsBodyDelegateiOS.h b/mobile/ios/ViroKit.framework/Headers/VROPhysicsBodyDelegateiOS.h new file mode 100644 index 0000000..db9a608 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROPhysicsBodyDelegateiOS.h @@ -0,0 +1,42 @@ +// +// VROPhysicsBodyDelegateiOS.h +// ViroRenderer +// +// Copyright © 201Z Viro Media. All rights reserved. +// + +#ifndef VROPhysicsBodyDelegateiOS_h +#define VROPhysicsBodyDelegateiOS_h +#import +#import "VROPhysicsBodyDelegate.h" + +/** + * Protocol to be implemented by objective C controls to be + * set on VROPhysicsBodyDelegateiOS for the notification of + * physics events. + */ +@protocol VROPhysicsBodyDelegateProtocol +@required +- (void)onCollided:(std::string) bodyTagB + collision:(VROPhysicsBody::VROCollision) collision; +@end + +/** + * iOS implementation of VROPhysicsBodyDelegate for the notification + * of delegate events across the bridge. + */ +class VROPhysicsBodyDelegateiOS : public VROPhysicsBodyDelegate { +public: + VROPhysicsBodyDelegateiOS(id delegate) : + _delegate(delegate) {} + virtual ~VROPhysicsBodyDelegateiOS() {} + + virtual void onCollided(std::string bodyBKey, VROPhysicsBody::VROCollision collision) { + [_delegate onCollided:bodyBKey collision:collision]; + } + +private: + __weak id _delegate; + +}; +#endif /* VROEventDelegateiOS_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROPhysicsContactResultCallback.h b/mobile/ios/ViroKit.framework/Headers/VROPhysicsContactResultCallback.h new file mode 100644 index 0000000..7571190 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROPhysicsContactResultCallback.h @@ -0,0 +1,65 @@ +// +// VROPhysicsContactResultCallback.h +// ViroRenderer +// +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROPhysicsMotionState_h +#define VROPhysicsMotionState_h + +#include +#include "VROPhysicsBody.h" + +/* + VROPhysicsContactResultCallback is used by Bullet to return a list of collision hit results that are + detected from a findCollisionsWithShape call. + */ +struct VROPhysicsContactResultCallback : public btCollisionWorld::ContactResultCallback { + std::vector _collisions; + + VROPhysicsContactResultCallback() {} + ~VROPhysicsContactResultCallback() {_collisions.clear();} + + btScalar addSingleResult(btManifoldPoint& bulletPoint, + const btCollisionObjectWrapper* colObj0Wrap, + int partId0, + int index0, + const btCollisionObjectWrapper* colObj1Wrap, + int partId1, + int index1) { + + // Only process points that have collided + if (bulletPoint.getDistance() > 0.f) { + return 1.f; + } + + // Sanity check ensuring Bullet / VROPhysics bodies are properly constructed + const btCollisionObject* obB = colObj1Wrap->m_collisionObject; + if (obB->getUserPointer() == nullptr) { + perror("Incorrectly constructed bullet rigid body for a VROPhysics body!"); + return 1.f; + } + + // Grab bullet's phsyics properties from the collided body + const btVector3& ptB = bulletPoint.getPositionWorldOnB(); + VROVector3f collisionOnBodyB = VROVector3f(ptB.x(), ptB.y(), ptB.z()); + VROPhysicsBody *vroPhysicsBodyB = ((VROPhysicsBody *) obB->getUserPointer()); + std::string bodyKeyB = vroPhysicsBodyB->getKey(); + std::string bodyTagB = vroPhysicsBodyB->getTag(); + VROVector3f collidedNormal = VROVector3f(bulletPoint.m_normalWorldOnB.x(), + bulletPoint.m_normalWorldOnB.y(), + bulletPoint.m_normalWorldOnB.z()); + + // Create and save a vector of all VROCollisions + VROPhysicsBody::VROCollision collision; + collision.collidedBodyTag = bodyKeyB; + collision.collidedPoint = collisionOnBodyB; + collision.collidedNormal = collidedNormal; + _collisions.push_back(collision); + + // Return a 1.f hit fraction to prevent bullet from extending the hit distance. + return 1.f; + } +}; +#endif diff --git a/mobile/ios/ViroKit.framework/Headers/VROPhysicsMotionState.h b/mobile/ios/ViroKit.framework/Headers/VROPhysicsMotionState.h new file mode 100644 index 0000000..2a9fab4 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROPhysicsMotionState.h @@ -0,0 +1,55 @@ +// +// VROPhysicsMotionState.h +// ViroRenderer +// +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROPhysicsMotionState_h +#define VROPhysicsMotionState_h + +#include + +/* + VROPhysicsMotionState, when attached to a Bullet body, notifies or grabs + transformation updates to/from a weakly referenced VROPhysicsBody. + */ +class VROPhysicsMotionState : public btMotionState { +public: + std::weak_ptr _w_physicsBody; + VROPhysicsMotionState(std::shared_ptr body, btTransform transformOffset) { + _w_physicsBody = body; + _physicsTransformOffset = transformOffset; + } + + virtual ~VROPhysicsMotionState(){} + + void getWorldTransform(btTransform& centerOfMassWorldTrans) const { + std::shared_ptr body = _w_physicsBody.lock(); + if (!body) { + return; + } + + body->getWorldTransform(centerOfMassWorldTrans); + } + + void setWorldTransform(const btTransform& centerOfMassWorldTrans) { + std::shared_ptr body = _w_physicsBody.lock(); + if (!body) { + return; + } + + body->setWorldTransform(centerOfMassWorldTrans); + } + + btTransform getPhysicsTransformOffset(){ + return _physicsTransformOffset; + } + +private: + /* + The offset from Viro's geometric transform to Bullet's physicsBody transform (center of mass). + */ + btTransform _physicsTransformOffset; +}; +#endif diff --git a/mobile/ios/ViroKit.framework/Headers/VROPhysicsShape.h b/mobile/ios/ViroKit.framework/Headers/VROPhysicsShape.h new file mode 100644 index 0000000..e949205 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROPhysicsShape.h @@ -0,0 +1,124 @@ +// +// VROPhysicsShape.h +// ViroRenderer +// +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROPhysicsShape_h +#define VROPhysicsShape_h + +#include "VROLog.h" +#include +#include +#include +#include +#include +#include "VROStringUtil.h" + +class VRONode; +class btCollisionShape; +class btCompoundShape; + +/* + VROPhysicsShape describes the type and dimensions of a physics shape that represents a VROPhysicsBody. + */ +class VROPhysicsShape { + +public: + /* + VROShapeType describes the type of shape representing this object. + Required parameters for each shape type are as shown below: + */ + enum VROShapeType { + Auto = 0, // Automatically infer a shape from attached geometry. + AutoCompound = 1, // Automatically infer a compound shape from attached geometry. + Sphere = 2, // _params[0] represents the radius of the sphere + Box = 3 // _params[0],[1],[2] represents the X,Y,Z half span of the Box + }; + static const std::string kSphereTag; + static const std::string kBoxTag; + static const std::string kAutoCompoundTag; + + /* + Returns true of the given string and mass represents a valid representation of + VROPhysicsBodyType. Else, false is returned and the errorMsg is populated + with the reason for failure. + */ + static bool isValidShape(std::string strType, std::vector params, std::string &errorMsg) { + if (!VROStringUtil::strcmpinsensitive(strType, kSphereTag) + && !VROStringUtil::strcmpinsensitive(strType, kBoxTag) + && !VROStringUtil::strcmpinsensitive(strType,kAutoCompoundTag)) { + errorMsg = "Provided invalid shape of type: " + strType; + return false; + } else if (VROStringUtil::strcmpinsensitive(strType, kSphereTag) && params.size() != 1) { + errorMsg = "Invalid params provided for type sphere! Expected 1 parameter for radius."; + return false; + } else if (VROStringUtil::strcmpinsensitive(strType, kBoxTag) && params.size() != 3) { + errorMsg = "Invalid params provided for type box! Expected 3 parameter defining [x,y,z]."; + return false; + } + return true; + } + + static VROPhysicsShape::VROShapeType getTypeForString(std::string strType) { + if (VROStringUtil::strcmpinsensitive(strType, kSphereTag)) { + return VROPhysicsShape::VROShapeType::Sphere; + } else if (VROStringUtil::strcmpinsensitive(strType, kAutoCompoundTag)) { + return VROPhysicsShape::VROShapeType::AutoCompound; + } + return VROPhysicsShape::VROShapeType::Box; + } + + VROPhysicsShape(VROShapeType type, std::vector params = std::vector()); + VROPhysicsShape(std::shared_ptr node, bool hasCompoundShapes = false); + virtual ~VROPhysicsShape(); + + /* + Returns the Bullet representation of a VROPhysicsShape. + */ + btCollisionShape* getBulletShape(); + + /* + Returns true if this VROShape was generated from the geometry of the + node it is attached to. + */ + bool getIsGeneratedFromGeometry(); + + /* + Returns true if this VROShape was generated from a combination of several + geometric shapes (compound shape). + */ + bool getIsCompoundShape(); + +private: + /* + Parameters that describe the dimensions of a shape. + See VROShapeType for what parameters should be defined for which shape type. + */ + VROShapeType _type; + btCollisionShape* _bulletShape; + + /* + Creates an underlying bullet collision shape representing this VROPhysicsShape, + given the target shape type and associated params. + */ + btCollisionShape *generateBasicBulletShape(VROShapeType type, std::vector params); + + /* + Infers from the geometry associated with the given node to create an underlying + bullet collision shape representing this VROPhysicsShape. + */ + btCollisionShape *generateBasicBulletShape(std::shared_ptr node); + + /* + Recursively examines each node within the given root node's subtree and automatically infer + the corresponding bullet collision shape of each node. These shapes are then combined and + returned as a compound bullet shape. + */ + void generateCompoundBulletShape(btCompoundShape &compoundShape, + const std::shared_ptr &rootNode, + const std::shared_ptr &childNode); + +}; +#endif diff --git a/mobile/ios/ViroKit.framework/Headers/VROPhysicsWorld.h b/mobile/ios/ViroKit.framework/Headers/VROPhysicsWorld.h new file mode 100644 index 0000000..308a36c --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROPhysicsWorld.h @@ -0,0 +1,141 @@ +// +// VROPhysicsWorld.h +// ViroRenderer +// +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROPhysicsWorld_h +#define VROPhysicsWorld_h +#include +#include "VROPhysicsBody.h" + +class btBulletDynamicsCommon; +class btDiscreteDynamicsWorld; +class btBroadphaseInterface; +class btDefaultCollisionConfiguration; +class btCollisionDispatcher; +class btSequentialImpulseConstraintSolver; +class VROPhysicsDebugDraw; +class VRODriver; +class VRORenderContext; + +/* + VROPhysicsWorld is a simulated physics environment that contains and processes + all acting forces and collisions on VROPhysicsBodies. It also contains both + the physics properties of the simulated world (like gravity) and collision + configuration parameters. + */ +class VROPhysicsWorld{ +public: + VROPhysicsWorld(); + virtual ~VROPhysicsWorld(); + + /* + Adds and removes a physics rigid body from the physics world. + Also guards against adding or removing the same physics + body from the world twice. + */ + void addPhysicsBody(std::shared_ptr body); + void removePhysicsBody(std::shared_ptr body); + + /* + When called, performs a timeStep of simulation / calculations for this physics world. + */ + void computePhysics(const VRORenderContext &context); + + /* + Iterate through the dynamic world, identify collided object pairs and notify their corresponding + physicsBodyDelegates regarding the collision event. + */ + void computeCollisions(); + + /* + Sets the x,y,z gravity on this physics world. + */ + void setGravity(VROVector3f gravity); + + /* + Projects a ray into the scene from the given start to end location and returns + true if it has collided with any VROPhysics shape. If a collision occurred, + the collided body's physics delegate will be notified as well. + */ + bool findCollisionsWithRay(VROVector3f from, VROVector3f to, bool returnClosest, + std::string rayTag); + + /* + Projects a shape into the scene from the given start to end location and returns + true if it has collided with any VROPhysics shape. If a collision occurred, + the collided body's physics delegate will be notified as well. + + Note: If checking along a path, only the first collided object is notified. Else, + if checking at a point (where start and end VROVector3fs are the same), all collided + objects intersecting the shape are notified. This is currently a Bullet limitation. + */ + bool findCollisionsWithShape(VROVector3f fromPos, VROVector3f toPos, + std::shared_ptr shape, + std::string rayTag); + + /* + If true, renders a set of lines representing the collision mesh of all physicsBodies + within this world. + */ + void setDebugDrawVisible(bool isVisible); + +private: + + /* + Represents the physicsBodies that have been added to and processed by this physics world. + */ + std::map> _activePhysicsBodies; + + /* + Bullet's representation of the physics world. + */ + btDiscreteDynamicsWorld* _dynamicsWorld; + + /* + Bullet Broadphase represents the collision algorithm used for quick, rough computations + of collision pairs early on in the physics pipeline. + */ + btBroadphaseInterface* _broadphase; + + /* + Configuration used for fine tuning collision algorithms. + */ + btDefaultCollisionConfiguration* _collisionConfiguration; + + /* + Dispatcher is used for the notification of collisions. + */ + btCollisionDispatcher* _collisionDispatcher; + + /* + Represents the constraints upon which the objects in this world will be resolved against. + This takes into account things like gravity, collisions, and hinges. + */ + btSequentialImpulseConstraintSolver* _constraintSolver; + + /* + Performs a collision shape test at the given location, returns true if it has collided + with any VROPhysics shape, and notifies delegates along the way. + */ + bool collisionTestAtPoint(VROVector3f pos, std::shared_ptr shape, + std::string rayTag); + + /* + Projects a shape into the scene from the given start to end location, returns + true if it has collided with any VROPhysics shape. Only the closest VROPhysicsShape's + delegate is notified. + */ + bool collisionTestAlongPath(VROVector3f fromPos, VROVector3f toPos, + std::shared_ptr shape, + std::string rayTag); + + /* + Used by Bullet to render all debug elements within the physics world. + */ + VROPhysicsDebugDraw* _debugDraw; + bool _debugDrawVisible; +}; +#endif diff --git a/mobile/ios/ViroKit.framework/Headers/VROPlane.h b/mobile/ios/ViroKit.framework/Headers/VROPlane.h new file mode 100644 index 0000000..defe9f9 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROPlane.h @@ -0,0 +1,59 @@ +// +// VROPlane.h +// ViroRenderer +// +// Created by Raj Advani on 10/15/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VROPLANE_H_ +#define VROPLANE_H_ + +#include "VROVector3f.h" +#include "VROQuaternion.h" + +enum class VROPlaneHalfSpace { + OnPlane, + Negative, + Positive +}; + +class VROPlane { +public: + + /* + The normal of the plane (defines a,b,c in the plane equation). + */ + VROVector3f normal; + + /* + The distance of the plane from the origin in the direction of its normal. + */ + float d; + + VROPlane(); + VROPlane(VROVector3f normal, float d); + VROPlane(VROVector3f normal, VROVector3f point); + virtual ~VROPlane(); + + VROVector3f projectNormalizedVector(VROVector3f vector); + + float distanceToPoint(VROVector3f point) const; + float distanceToPointXY(VROVector3f point) const; + + VROPlaneHalfSpace getHalfSpaceOfPoint(VROVector3f point) const; + + float getA() const { return normal.x; } + float getB() const { return normal.y; } + float getC() const { return normal.z; } + float getD() const { return d; } + + void setA(float a) { normal.x = a; } + void setB(float b) { normal.y = b; } + void setC(float c) { normal.z = c; } + void setD(float d) { this->d = d; } + + void normalize(); +}; + +#endif /* VROPLANE_H_ */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROPlatformUtil.h b/mobile/ios/ViroKit.framework/Headers/VROPlatformUtil.h new file mode 100644 index 0000000..67850e1 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROPlatformUtil.h @@ -0,0 +1,226 @@ +// +// VROPlatformUtil.h +// ViroRenderer +// +// Created by Raj Advani on 11/7/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROPlatformUtil_h +#define VROPlatformUtil_h + +#include "VRODefines.h" +#include +#include +#include +#include + +#if VRO_PLATFORM_ANDROID + +#include +#include +#include +#include + +#endif + +class VROImage; +enum class VROTextureInternalFormat; + +#pragma mark - Platform Identification + +enum class VROPlatformType { + Unknown, + AndroidGVR, + AndroidOVR, + AndroidARCore, + AndroidSceneView, + iOSCardboard, + iOSARKit +}; + +void VROPlatformSetType(VROPlatformType type); +VROPlatformType VROPlatformGetType(); + +#pragma mark - String Loading + +std::string VROPlatformLoadResourceAsString(std::string resource, std::string type); +std::string VROPlatformLoadFileAsString(std::string path); + +#pragma mark - Network and File Utilities + +/* + Copy the given bundled resource (e.g., asset on Android, bundled resource on iOS) + to a location on the filesystem where it can be accessed through a local path. + isTemp is set to true if the file had to be copied to a temporary file. + */ +std::string VROPlatformCopyResourceToFile(std::string asset, bool *isTemp); + +/* + This function is used exclusively by Android (iOS is no-op) because it makes a few assumptions: + 1) key needs to have its extension removed + 2) key needs be lower case + 3) key needs sanitizing and have 'prohibited' character(s) removed + */ +std::string VROPlatformFindValueInResourceMap(std::string key, std::map resourceMap); + +/* + Load the given URL to a file, and return the path to the file. If the file + is temporary and must be deleted after it's processed, temp will be set to true. + If the download fails, success will be set to false. + */ +std::string VROPlatformDownloadURLToFile(std::string url, bool *temp, bool *success); +void VROPlatformDeleteFile(std::string filename); + +/* + Load the file into a binary blob and return it. The returned buffer + *must* be freed by the caller! + */ +void *VROPlatformLoadFile(std::string filename, int *outLength); + +#pragma mark - Image Loading + +// Returns empty shared_ptr on failure +std::shared_ptr VROPlatformLoadImageFromFile(std::string filename, VROTextureInternalFormat format); + +#if VRO_PLATFORM_ANDROID +std::shared_ptr VROPlatformLoadImageFromAsset(std::string asset, VROTextureInternalFormat format); +jobject VROPlatformLoadBitmapFromAsset(std::string resource, VROTextureInternalFormat format); +jobject VROPlatformLoadBitmapFromFile(std::string path, VROTextureInternalFormat format); + +// Note the returned buffer *must* be freed by the caller! +void *VROPlatformConvertBitmap(jobject jbitmap, int *bitmapLength, int *width, int *height); + +#endif + +#pragma mark - Threading + +/* + Run the given function on the rendering thread, asynchronously (this function + returns immediately). + */ +void VROPlatformDispatchAsyncRenderer(std::function fcn); + +/* + Run the given function on a background thread. The thread can be pooled, + or spun up fresh. The caller should make no assumptions. + */ +void VROPlatformDispatchAsyncBackground(std::function fcn); + +/* + Run the given function on the application UI thread, asynchronously. + */ +void VROPlatformDispatchAsyncApplication(std::function fcn); + +/* + Flushes the task queues from calling VROPlatformDispatch* before VROPlatformUtil + was set up. + */ +void VROPlatformFlushTaskQueues(); + +#if VRO_PLATFORM_IOS +#import + +NSURLSessionDataTask *VROPlatformDownloadDataWithURL(NSURL *url, void (^completionBlock)(NSData *data, NSError *error)); + +#endif + +#pragma mark - Android Setup + +#if VRO_PLATFORM_ANDROID + +void VROPlatformSetEnv(JNIEnv *env, jobject appContext, jobject assetManager, jobject platformUtil); + +// This function was added because VROPlatformConvertBitmap can be called before the renderer +// is created and as a result, activity and assetManager hasn't been set yet. We should think +// about how to do this better. +void VROPlatformSetEnv(JNIEnv *env); +void VROPlatformReleaseEnv(); + +JNIEnv *VROPlatformGetJNIEnv(); +jobject VROPlatformGetJavaAppContext(); +jobject VROPlatformGetJavaAssetManager(); +AAssetManager *VROPlatformGetAssetManager(); + +// Copy the given asset into a file with the same name in the cache dir. +// This enables us to load assets through routines that only take file paths, +// for testing purposes only. Not needed in prod because assets are not used +// in prod. +std::string VROPlatformCopyAssetToFile(std::string asset); + +/** + * This function takes a Java Map (java.util.Map) w/ String key and values and returns + * a C++ std::map w/ std::string key and values. + */ +std::map VROPlatformConvertFromJavaMap(jobject javaMap); + +/** + * This function takes a java map of filename -> resource location and copies the resources + * to the Android cache w/ the given filename. It then returns a c++ map of filename -> download + * location. + */ +std::map VROPlatformCopyObjResourcesToFile(jobject resourceMap); + + +#pragma mark - JNI Utilities + +// Get the class loader from the given object +jobject VROPlatformGetClassLoader(JNIEnv *jni, jobject jcontext); + +// Find a class using the class loader associated with the given object, +// typically an activity. +// This is safe to call from any thread, even those not spawned in Java +// (i.e. threads created using pthread_create). +jclass VROPlatformFindClass(JNIEnv *jni, jobject javaObject, const char *className); + +// Calls a java function from native through JNI on the given jObject with the given +// functionName, methodID and desired java function parameters. +// +// Example: VROPlatformCallJavaFunction(jObj, +// "onHover", +// "(Z)V", +// isGazing); +void VROPlatformCallJavaFunction(jobject javaObject, + std::string functionName, + std::string methodID, ...); +jlong VROPlatformCallJavaLongFunction(jobject javaObject, + std::string functionName, + std::string methodID, ...); + +// Helper functions for setting jObject properties through JNI from C++ +void VROPlatformSetFloat(JNIEnv *env, jclass cls, jobject jObj, const char *fieldName, jfloat value); +void VROPlatformSetString(JNIEnv *env, jclass cls, jobject jObj, const char *fieldName, std::string value); +void VROPlatformSetInt(JNIEnv *env, jclass cls, jobject jObj, const char *fieldName, jint value); +void VROPlatformSetBool(JNIEnv *env, jclass cls, jobject jObj, const char *fieldName, jboolean value); +void VROPlatformSetEnumValue(JNIEnv *env, jclass cls, jobject jObj, const char *fieldName, + std::string enumClassPathName, std::string enumValueStr); + +// Safely converts the given string with the provided jni environment. +std::string VROPlatformGetString(jstring string, JNIEnv *env); + +#pragma mark - Android A/V + +// Create a video sink on the Java side. Returns the Surface. +jobject VROPlatformCreateVideoSink(int textureId); +void VROPlatformDestroyVideoSink(int textureId); + +// Get audio properties for this device. +int VROPlatformGetAudioSampleRate(); +int VROPlatformGetAudioBufferSize(); + +extern "C" { + +void Java_com_viro_core_internal_PlatformUtil_runTask(JNIEnv *env, jclass clazz, jint taskId); + +} + +#endif + +#if VRO_PLATFORM_IOS || VRO_PLATFORM_ANDROID + +// Returns enum of type gvr_audio_material_type +int VROPlatformParseGVRAudioMaterial(std::string property); + +#endif + +#endif /* VROPlatformUtil_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROPointCloudEmitter.h b/mobile/ios/ViroKit.framework/Headers/VROPointCloudEmitter.h new file mode 100644 index 0000000..929b521 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROPointCloudEmitter.h @@ -0,0 +1,75 @@ +// +// VROPointCloudEmitter.h +// ViroKit +// +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROPointCloudEmitter_h +#define VROPointCloudEmitter_h + +#include +#include "VROParticleEmitter.h" + +class VRODriver; +class VRONode; +class VROSurface; +class VROARSession; +class VROBillboardConstraint; + +/* + Class that inheirits from VROParticleEmitter that uses the particle system to draw + PointCloud points that we get from the given VROARSession. + + Only things that can really be modified are the surface, scale and # of particles + */ +class VROPointCloudEmitter : public VROParticleEmitter { +public: + VROPointCloudEmitter(std::shared_ptr driver, + std::shared_ptr session); + virtual ~VROPointCloudEmitter() {}; + + void setParticleScale(VROVector3f scale) { + _particleScale = scale; + } + + void clearParticles(); + void update(const VRORenderContext &context, const VROMatrix4f &computedTransform); + + void resetParticleSurface(); + void setParticleSurface(std::shared_ptr particleSurface); + +private: + std::weak_ptr _arSession; + VROVector3f _particleScale; + + /* + This function updates the _particles array with the given pointCloudPoints by reusing particles, + resurrecting zombie particles and/or creating new ones to meet the demand. It also computes + the boundingbox that contains all the points. + */ + VROBoundingBox updateParticles(std::vector pointCloudPoints, + const VRORenderContext &context); + + /* + This function updates the UBO w/ the particles in _particles. + */ + void updateUBO(VROBoundingBox boundingBox); + + /* + Computes the transform for the given particle with the given position, constraint + and also updates the given boundingBox. + */ + void computeParticleTransform(VROParticle *particle, + VROVector4f position, + std::shared_ptr constraint, + VROBoundingBox *boundingBox, + const VRORenderContext &context); + + /* + This function adds all _particles from startIndex and on to _zombieParticles + */ + void zombifyParticles(int startIndex); +}; + +#endif /* VROPointCloudEmitter_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROPolyline.h b/mobile/ios/ViroKit.framework/Headers/VROPolyline.h new file mode 100644 index 0000000..366de83 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROPolyline.h @@ -0,0 +1,75 @@ +// +// VROPolyline.h +// ViroRenderer +// +// Created by Raj Advani on 10/12/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#include +#include +#include "VROGeometry.h" +#include "VROAnimatable.h" + +class VROVector3f; +class VROByteBuffer; +class VROLineSegment; +class VROShaderModifier; + +class VROPolyline : public VROGeometry { + +public: + static std::shared_ptr createPolyline(std::vector> &path, float thickness); + static std::shared_ptr createPolyline(std::vector &path, float thickness); + + VROPolyline(); + virtual ~VROPolyline() {} + + /* + Set the thickness. Animatable. + */ + void setThickness(float thickness); + float getThickness() const { + return _thickness; + } + + /* + Set the paths of this polyline. Each path is a contiguous line. This will reconstruct + all paths. + */ + void setPaths(std::vector> &paths); + + /* + Append the given point the last path in this polyline. This is more efficient + than invoking setPaths. + */ + void appendPoint(VROVector3f point); + + virtual void setMaterials(std::vector> materials); + +private: + + float _thickness; + + VROPolyline(std::vector> sources, + std::vector> elements, + float thickness) : + VROGeometry(sources, elements), + _thickness(thickness) + {} + + bool isEmpty() const; + VROVector3f getLastPoint() const; + + static void buildGeometry(std::vector> &paths, + std::vector> &sources, + std::vector> &elements); + static std::shared_ptr buildElement(size_t numCorners); + static size_t encodeLine(const std::vector &path, VROByteBuffer &outBuffer); + static size_t encodeQuad(VROLineSegment segment, bool beginDegenerate, bool endDegenerate, VROByteBuffer &buffer); + static size_t encodeCircularEndcap(VROVector3f center, bool beginDegenerate, bool endDegenerate, VROByteBuffer &buffer); + + static void writeCorner(VROVector3f position, VROVector3f normal, VROByteBuffer &buffer); + static std::shared_ptr createPolylineShaderModifier(); + +}; diff --git a/mobile/ios/ViroKit.framework/Headers/VROPortal.h b/mobile/ios/ViroKit.framework/Headers/VROPortal.h new file mode 100644 index 0000000..6ce9c30 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROPortal.h @@ -0,0 +1,293 @@ +// +// VROPortal.h +// ViroKit +// +// Created by Raj Advani on 7/31/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROPortal_h +#define VROPortal_h + +#include "VRONode.h" +#include "VROTree.h" +#include "VROLineSegment.h" +#include "VROPortalDelegate.h" + +class VROPortalFrame; + +/* + Portals are nodes that partition subgraphs of the overall scene + graph. They are used to simulate "teleportation" between two + different scenes, and can also be used for more efficient visibility + determination. + */ +class VROPortal : public VRONode { +public: + + VROPortal(); + virtual ~VROPortal(); + + /* + Delete any rendering resources. Invoked prior to destruction, on the + rendering thread. + + Recurses down the tree. + */ + void deleteGL(); + + /* + Render this portal's background. + */ + void renderBackground(const VRORenderContext &context, std::shared_ptr &driver); + + /* + Render this portal's geometry. + */ + void renderPortal(const VRORenderContext &context, std::shared_ptr &driver); + + /* + Render this portal's silhouette. The geometry is rendered using the provided material. This + method is typically used to render into the stencil or depth buffers only. + */ + void renderPortalSilhouette(std::shared_ptr &material, + VROSilhouetteMode mode, std::function filter, + const VRORenderContext &context, std::shared_ptr &driver); + + /* + Render the visible nodes in this portal's graph, in an order determined by the + latest computed sort keys. + */ + void renderContents(const VRORenderContext &context, std::shared_ptr &driver); + + /* + Iterate up and down the scene graph, starting at the active portal. + Fill in the recursion level of each portal (defined as steps to + reach from the active portal), and return a graph of all portals reached. + + This is the recursive helper for VROScene::sortPortalsByDistance(). + + The frame number if used as a 'visited' flag, as this function searches + both up and down the graph and is expected to only be invoked once + per frame as part of the render-cycle. + + The activeFrame node is used to assign an entrance frame geometry to this + portal. See the discussion under _activePortalFrame for more detail. + */ + void traversePortals(int frame, int recursionLevel, + std::shared_ptr activeFrame, + tree> *outPortals); + + /* + Sort the visible nodes in this portal's sub-graph by their sort-keys, and fill + the internal _keys vector with the results. + */ + void sortNodesBySortKeys(); + + /* + Represents how how many levels deep this portal is: for example, the active portal + is 0, a portal within the active portal is 1, a portal within a portal within a portal + is 2, and so on. + + Note this is *always* relative to the active portal. + */ + int getRecursionLevel() const { + return _recursionLevel; + } + + /* + Set the node (with geometry) to render for the entrance to this portal. This + geometry will double as the 'exit' back to this portal from children. + */ + void setPortalEntrance(std::shared_ptr entrance); + const std::shared_ptr getPortalEntrance() { + return _portalEntrance; + } + + /* + Return the portal frame being rendered for this portal; either an exit or an + entrance. + */ + const std::shared_ptr getActivePortalFrame() const { + return _activePortalFrame; + } + + /* + Return portalDelegate if it exists. + */ + std::shared_ptr getPortalDelegate() { + if (_portalDelegate.expired()){ + return nullptr; + } + return _portalDelegate.lock(); + } + + void setPortalDelegate(std::shared_ptr delegate) { + _portalDelegate = delegate; + } + + /* + Return true if the portal frame rendered by this portal is an exit into + a parent portal, as opposed to this portal's own 'entrance' portal. + */ + bool isRenderingExitFrame() const { + return _activePortalFrame != _portalEntrance; + } + + /* + If a portal is passable then it reprsents an entry-point into another navigable world, + meaning it can be set as the active portal. Non-passable portals can be AR elements overlaid + on the real world like picture frames, that are meant to be viewed from outside only. + */ + void setPassable(bool passable) { + _passable = passable; + } + bool isPassable() const { + return _passable; + } + + /* + Return true if the given line segment intersects the portal geometry. + */ + bool intersectsLineSegment(VROLineSegment segment) const; + +#pragma mark - Environment Lighting + + /* + Set the lighting environment map for this portal. + */ + void setLightingEnvironment(std::shared_ptr texture); + + /* + Get the lighting environment map for this portal. + */ + std::shared_ptr getLightingEnvironment() const; + +#pragma mark - Backgrounds + + /* + Note: the scene renders all backgrounds in its tree before rendering + any content. + */ + + /* + Set the background to a cube-map defined by the given cube texture or + color. + */ + void setBackgroundCube(std::shared_ptr textureCube); + void setBackgroundCube(VROVector4f color); + + /* + Set the background to a textured sphere. + */ + void setBackgroundSphere(std::shared_ptr textureSphere); + + /* + Set the background to an arbitrary geometry. All this guarantees is that + the given object will be rendered first. No properties will be set on + this geometry, but typically background geometries are screen-space, and + do not read or write to the depth buffer. + */ + void setBackground(std::shared_ptr geometry); + + /* + Set an arbitrary transform to apply to the background. The transform + may also be set as a quaternion (rotation). + */ + void setBackgroundTransform(VROMatrix4f transform); + void setBackgroundRotation(VROQuaternion rotation); + + std::shared_ptr getBackground() const { + return _background; + } + void removeBackground(); + +private: + + /* + The number of steps to reach this portal from the active portal. + */ + int _recursionLevel; + + /* + The nodes in this portal's scene-graph, ordered for rendering by their + sort keys. + */ + std::vector _keys; + + /* + True if this portal can be entered; e.g, if it can be made into an + active portal. + */ + bool _passable; + + /* + Portals have an entrance node that strictly defines the *geometry* + (the frame, or window) that delineates the entrance into, or exit from, + the portal. + */ + std::shared_ptr _portalEntrance; + + /* + The _activePortalFrame is the frame this portal should render as its + entrance. + + When moving down the portal tree, this is set to the portal's own + entrance: _portalEntrance. However, when moving up the tree, this is + set to the active child portal's entrance. + + For example, if we have the following portal tree: + + A + B E + C D + + If A is the active portal, then B would render its own entrance (as an + entrance from A into B), C would render its own entrance (as an entrance + from B into C) and so on for every portal in the tree. + + However, if D is the active portal, then B will render D's entrance (as + an exit from D into B), B will render A's entrance (as an exit from B into + A), and the remaining portals (C and E) would simply render their own + entrances. + + These portals frames are assigned during traversePortals. + */ + std::shared_ptr _activePortalFrame; + + /* + The background visual to display. All backgrounds in the scene are rendered before + node content. + */ + std::shared_ptr _background; + + /* + The lighting environment for this portal. Determines the effect of image-based + lighting (IBL) for objects using the physically based lighting model. + */ + std::shared_ptr _lightingEnvironment; + + /* + Portal delegate that is invoked when a portal is entered and exited. + */ + std::weak_ptr _portalDelegate; + + /* + Transform to apply to the background geometry. + */ + VROMatrix4f _backgroundTransform; + + /* + Installs required shader modifiers on the background. + */ + void installBackgroundShaderModifier(); + + /* + Deactivates culling on every geometry in the given node, recursively down the + tree. Needed to ensure culling is off on portal frames. + */ + void deactivateCulling(std::shared_ptr node); + +}; + +#endif /* VROPortal_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROPortalDelegate.h b/mobile/ios/ViroKit.framework/Headers/VROPortalDelegate.h new file mode 100644 index 0000000..77798cd --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROPortalDelegate.h @@ -0,0 +1,27 @@ +// +// VROPortalDelegate.hpp +// ViroRenderer +// +// Created by Vik Advani on 9/14/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROPortalDelegate_h +#define VROPortalDelegate_h + +#include +#include +#include "VROVector3f.h" +#include "VROTime.h" + +/* + Delegate that is attached to a node for notifying the bridge regarding transformation updates. + */ +class VROPortalDelegate { +public: + VROPortalDelegate() {} + virtual ~VROPortalDelegate() {} + virtual void onPortalEnter()=0; + virtual void onPortalExit()=0; +}; +#endif diff --git a/mobile/ios/ViroKit.framework/Headers/VROPortalDelegateiOS.h b/mobile/ios/ViroKit.framework/Headers/VROPortalDelegateiOS.h new file mode 100644 index 0000000..5743558 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROPortalDelegateiOS.h @@ -0,0 +1,51 @@ +// +// VROPortalDelegateiOS.h +// ViroKit +// +// Created by Vik Advani on 9/14/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROPortalDelegateiOS_h +#define VROPortalDelegateiOS_h +#import "VROPortalDelegate.h" +#import + +/* + Protocol to be implemented by objective C controls to be + set on VROEventDelegateiOS for the notification of + input events. + */ +@protocol VROPortalDelegateProtocol +@required +- (void)onPortalEnter; +- (void)onPortalExit; +@end + + +/* + iOS implementation of VROEventDelegate for the notification + of delegate events across the bridge. + */ +class VROPortalDelegateiOS : public VROPortalDelegate { +public: + VROPortalDelegateiOS(id delegate) : + _delegate(delegate) {} + virtual ~VROPortalDelegateiOS() {} + + /* + Delegate events triggered by the EventManager. + */ + virtual void onPortalEnter() { + [_delegate onPortalEnter]; + } + virtual void onPortalExit() { + [_delegate onPortalExit]; + } + +private: + __weak id _delegate; + +}; + +#endif /* VROPortalDelegateiOS_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROPortalFrame.h b/mobile/ios/ViroKit.framework/Headers/VROPortalFrame.h new file mode 100644 index 0000000..029b2a8 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROPortalFrame.h @@ -0,0 +1,103 @@ +// +// VROPortalFrame.h +// ViroKit +// +// Created by Raj Advani on 8/5/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROPortalFrame_h +#define VROPortalFrame_h + +#include "VRONode.h" + +class VROShaderModifier; +class VROLineSegment; +enum class VROFace; + +/* + Portal frames are nodes that contain the geometry representing the + entrance (or exit) from the portal. We need these for two reasons: + + 1. They enable us to manipulate the scale and other transformations + of the portal's entrance without changing the transform of the entire + VROPortal. + + 2. VROPortals need their frames dynamically assigned each frame if the + active portal changes, in order to render entrances where necessary + and exits where necessary. + */ +class VROPortalFrame : public VRONode { +public: + + /* + Return the shader modifier that is used to render a portal frame to the + stencil buffer. This modifier discards the non-transparent sections of the + portal frame, so that only the 'window' gets rendered to the stencil + buffer. + */ + static std::shared_ptr getAlphaDiscardModifier(); + + VROPortalFrame(); + virtual ~VROPortalFrame(); + + /* + If this portal frame is two-sided then this returns the stencil face + that we should render to the stencil buffer. The other face (the inactive) + face, will not render to the stencil buffer. + + Example: + + A --- P --- B + + Suppose A and B are two portals separated by portal frame P. Suppose P is + the 'entrance' to B. Our goal is to have the front face of P display B, and + the back face display A. + + Therefore, if we're "in" portal B, we should render the stencil to the back + faces of B, and if we're "in" portal A, we should render the stencil to the + front faces of B. This works because when we don't write to the stencil, we + simply render the world we're in; so in the former case the front of P will + render B, and the latter case the back of P will render A. + */ + VROFace getActiveFace(bool isExit) const; + VROFace getInactiveFace(bool isExit) const; + + /* + Return true if this portal frame is two-sided. See _twoSided below for + discussion. + */ + bool isTwoSided() const { + return _twoSided; + } + void setTwoSided(bool twoSided) { + _twoSided = twoSided; + } + + /* + Returns true if this frame intersects the given line segment. + */ + bool intersectsLineSegment(VROLineSegment segment) const; + +private: + + /* + Normally, both sides of a portal frame are windows into the same scene. So if + you are in an AR world and you're looking through a portal into a VR world, + you can walk around the portal and see the VR world from both sides of the + portal. + + However, it's also useful to sometimes have 2-sided portals: that is, + a portal which on one side shows the VR world and on the other side the AR + world. This is particularly useful when we're about to pass through a portal. + In such cases, we want the portal to show different worlds on each side in + order to prevent flickering. + + Two-sided portals are enabled under the hood by using the front/back stencil + buffer operations. + */ + bool _twoSided; + +}; + +#endif /* VROPortalFrame_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROPortalTraversalListener.h b/mobile/ios/ViroKit.framework/Headers/VROPortalTraversalListener.h new file mode 100644 index 0000000..135de20 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROPortalTraversalListener.h @@ -0,0 +1,54 @@ +// +// VROPortalTraversalListener.h +// ViroKit +// +// Created by Raj Advani on 8/3/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROPortalTraversalListener_h +#define VROPortalTraversalListener_h + +#include "VROFrameListener.h" +#include "VROTree.h" +#include + +class VROScene; +class VROPortal; +class VROVector3f; +class VROLineSegment; + +class VROPortalTraversalListener : public VROFrameListener { +public: + + VROPortalTraversalListener(std::shared_ptr scene); + virtual ~VROPortalTraversalListener(); + + void onFrameWillRender(const VRORenderContext &context); + void onFrameDidRender(const VRORenderContext &context); + +private: + + std::weak_ptr _scene; + + /* + Scan the portal tree's immediate children to see if we've intersected any passable + portal with the given segment. Return the portal found, if any. + + Note this does *not* recurse because only the portals that are immediate children + of the current portal are passable. + */ + std::shared_ptr findPortalTraversal(const VROLineSegment &segment, + const tree> &portalTree); + + /* + Scan the portal tree for passable portals, and if we're a significant distance + away from them, restore them to one-sided mode. We only want portals we are about + to traverse to be in two-sided mode. + */ + void restorePortalFaces(const VROVector3f &cameraPosition, + const tree> &portalTree); + +}; + +#endif /* VROPortalTraversalListener_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROPostProcessEffectFactory.h b/mobile/ios/ViroKit.framework/Headers/VROPostProcessEffectFactory.h new file mode 100644 index 0000000..ae41333 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROPostProcessEffectFactory.h @@ -0,0 +1,135 @@ +// +// VROPostProcessEffectFactory.h +// ViroKit +// +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROPostProcessEffectFactory_h +#define VROPostProcessEffectFactory_h + +#include +#include +#include +#include +#include "VROStringUtil.h" + +class VROShaderProgram; +class VROImagePostProcess; +class VROMaterial; +class VROLight; +class VROShaderModifier; +class VRODriverOpenGL; +class VRODriver; +class VRORenderTarget; + +enum class VROPostProcessEffect{ + GrayScale, + Sepia, + SinCity, + BarallelDistortion, + PincushionDistortion, + Toonify, + Inverted, + ThermalVision, + Pixelated, + CrossHatch, + None +}; + +/* + The PostProcessEffectFactory handles the enabling, disabling and caching of PostProcessEffectPrograms + that are applied as part of VROChoreographer.renderBasePass(). + */ +class VROPostProcessEffectFactory { +public: + VROPostProcessEffectFactory(); + virtual ~VROPostProcessEffectFactory(); + + /* + Enables the given VROPostProcessEffect to be applied. Note effects are applied in the order + upon which they are enabled. + */ + void enableEffect(VROPostProcessEffect effect, std::shared_ptr driver); + + /* + Disables the given VROPostProcessEffect to be applied. + */ + void disableEffect(VROPostProcessEffect effect); + + /* + Clears all effects that had been previously applied. + */ + void clearAllEffects(); + + /* + This method should be invoked by the main render cycle, *after* the scene is + rendered to an HDR target, but before tone-mapping and gamma. It is here + that we should perform all post-processing effects. The *final* output of + post processing should be rendered into the given target. + + Return true if anything was written to the destination. False if there was + no post-processing done. + */ + bool handlePostProcessing(std::shared_ptr source, + std::shared_ptr destination, + std::shared_ptr driver); + + static VROPostProcessEffect getEffectForString(std::string strEffect){ + VROStringUtil::toLowerCase(strEffect); + if (strEffect.compare("grayscale") == 0){ + return VROPostProcessEffect::GrayScale; + } else if (strEffect.compare("sepia") == 0){ + return VROPostProcessEffect::Sepia; + } else if (strEffect.compare("sincity") == 0){ + return VROPostProcessEffect::SinCity; + } else if (strEffect.compare("baralleldistortion") == 0){ + return VROPostProcessEffect::BarallelDistortion; + } else if (strEffect.compare("pincushiondistortion") == 0){ + return VROPostProcessEffect::PincushionDistortion; + } else if (strEffect.compare("toonify") == 0){ + return VROPostProcessEffect::Toonify; + } else if (strEffect.compare("inverted") == 0){ + return VROPostProcessEffect::Inverted; + } else if (strEffect.compare("thermalvision") == 0){ + return VROPostProcessEffect::ThermalVision; + } else if (strEffect.compare("pixelated") == 0){ + return VROPostProcessEffect::Pixelated; + } else if (strEffect.compare("crosshatch") == 0){ + return VROPostProcessEffect::CrossHatch; + } + return VROPostProcessEffect::None; + } +private: + + void renderEffects(std::shared_ptr input, + std::shared_ptr output, + std::shared_ptr driver); + + /* + Shader programs cached by their VROPostProcessEffect types. + */ + std::vector>> _cachedPrograms; + + /* + Below is a list of post-process specific functions that builds, caches and returns post process + effects to run. + + TODO VIRO-1634: Optimize PostProcess Effects to negate cost of re-binding shaders when multiple + effects are applied by having a single postProcess.vsh. + */ + std::shared_ptr createGreyScale(std::shared_ptr driver); + std::shared_ptr createSepia(std::shared_ptr driver); + std::shared_ptr createSinCity(std::shared_ptr driver); + std::shared_ptr createBarallelDistortion(std::shared_ptr driver); + std::shared_ptr createPinCusionDistortion(std::shared_ptr driver); + std::shared_ptr createToonify(std::shared_ptr driver); + std::shared_ptr createInverted(std::shared_ptr driver); + std::shared_ptr createThermalVision(std::shared_ptr driver); + std::shared_ptr createPixel(std::shared_ptr driver); + std::shared_ptr createCrossHatch(std::shared_ptr driver); + std::shared_ptr createEmptyEffect(std::shared_ptr driver); + std::vector getHBCSModification(float hue, float brightness, float contrast, float saturation); +}; + +#endif /* VROPostProcessEffectFactory_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROProjector.h b/mobile/ios/ViroKit.framework/Headers/VROProjector.h new file mode 100644 index 0000000..217b89e --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROProjector.h @@ -0,0 +1,31 @@ +// +// VROProjector.h +// ViroRenderer +// +// Created by Raj Advani on 1/13/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROProjector_h +#define VROProjector_h + +#include "VROVector3f.h" + +class VROProjector { + +public: + + /* + Project the given world coordinates into screen coordinates. + */ + static bool project(const VROVector3f pos, const float *mvp, const int *viewport, VROVector3f *result); + + /* + Unproject the given screen coordinates into world coordinates. The given screen coordinate vector must + contain a Z element in the range [0,1], where 0 is the near clipping plane and 1 the far clipping plane. + */ + static bool unproject(const VROVector3f screen, const float *mvp, const int *viewport, VROVector3f *result); + +}; + +#endif /* VROProjector_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROPropertyAnimation.h b/mobile/ios/ViroKit.framework/Headers/VROPropertyAnimation.h new file mode 100644 index 0000000..f63bc15 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROPropertyAnimation.h @@ -0,0 +1,86 @@ +// +// VROPropertyAnimation.h +// ViroRenderer +// +// Created by Raj Advani on 12/28/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROPropertyAnimation_h +#define VROPropertyAnimation_h + +#include +#include +#include + +/* + Animated property values can be of the following types. + */ +enum class VROValueType { + Float, + Int +}; + +/* + Encapsulates different types of animation values. + */ +class VROAnimationValue { +public: + VROValueType type; + float valueFloat; + int valueInt; +}; + +/* + Determines if animation assigns values, or adds/multiplies. + */ +enum class VROAnimationOperation { + Add, + Multiply, + Assign +}; + +/* + Represents a single animated property of a node (e.g. position, scale, rotation). + */ +class VROPropertyAnimation { + +public: + + static std::shared_ptr parse(const std::string &name, const std::string &value); + + VROPropertyAnimation(std::string propertyName, VROAnimationValue value, VROAnimationOperation op) : + _propertyName(propertyName), + _value(value), + _op(op) {} + virtual ~VROPropertyAnimation() {} + + std::string getPropertyName() const { return _propertyName; } + VROAnimationValue getValue() const { return _value; } + VROAnimationOperation getOp() const { return _op; } + + float processOp(float input) const { + switch (_op) { + case VROAnimationOperation::Assign: + return _value.valueFloat; + case VROAnimationOperation::Add: + return _value.valueFloat + input; + case VROAnimationOperation::Multiply: + return _value.valueFloat * input; + + default: + return _value.valueFloat; + } + } + + std::string toString() const; + +private: + + const std::string _propertyName; + const VROAnimationValue _value; + const VROAnimationOperation _op; + +}; + +#endif /* VROPropertyAnimation_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROQuaternion.h b/mobile/ios/ViroKit.framework/Headers/VROQuaternion.h new file mode 100644 index 0000000..6e9f715 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROQuaternion.h @@ -0,0 +1,180 @@ +// +// VROQuaternion.h +// ViroRenderer +// +// Created by Raj Advani on 10/15/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef __VROQUATERNION_H_INCLUDED__ +#define __VROQUATERNION_H_INCLUDED__ + +#include "VROVector3f.h" +#include "VROMatrix4f.h" + +static float kRoundingErrorQuatFloat = 0.00001; + +//! Quaternion class for representing rotations. +/** It provides cheap combinations and avoids gimbal locks. +Also useful for interpolations. */ +class VROQuaternion { + public: + + //! Default Constructor + VROQuaternion() noexcept : X(0.0f), Y(0.0f), Z(0.0f), W(1.0f) {} + + //! Constructor + VROQuaternion(float x, float y, float z, float w) : X(x), Y(y), Z(z), W(w) { } + + //! Constructor which converts euler angles (radians) to a quaternion + VROQuaternion(float x, float y, float z); + + //! Constructor which converts euler angles (radians) to a quaternion + VROQuaternion(const VROVector3f& vec); + + //! Constructor which converts a matrix to a quaternion + VROQuaternion(const VROMatrix4f& mat); + + //! Equalilty operator + bool operator==(const VROQuaternion &other) const; + + //! inequality operator + bool operator!=(const VROQuaternion &other) const; + + //! Matrix assignment operator + VROQuaternion& operator=(const VROMatrix4f& other); + + //! Add operator + VROQuaternion operator+(const VROQuaternion &other) const; + + //! Subtract operator + VROQuaternion operator-(const VROQuaternion &other) const; + + //! Multiplication operator + //! Be careful, unfortunately the operator order here is opposite of that in CVROMatrix4f::operator* + VROQuaternion operator*(const VROQuaternion &other) const; + + //! Multiplication operator with scalar + VROQuaternion operator*(float s) const; + + //! Multiplication operator with scalar + VROQuaternion &operator*=(float s); + + //! Multiplication operator + VROVector3f operator*(const VROVector3f& v) const; + + //! Multiplication operator + VROQuaternion &operator*=(const VROQuaternion &other); + + //! Calculates the dot product + float dotProduct(const VROQuaternion &other) const; + + // Get the magnitude of the angle represented by this quaternion. + float getAngle() const; + + //! Sets new quaternion + VROQuaternion &set(float x, float y, float z, float w); + + //! Sets new quaternion based on euler angles (radians) + VROQuaternion &set(float x, float y, float z); + + //! Sets new quaternion based on euler angles (radians) + VROQuaternion &set(const VROVector3f& vec); + + //! Sets new quaternion from other quaternion + VROQuaternion &set(const VROQuaternion &quat); + + //! returns if this quaternion equals the other one, taking floating point rounding errors into account + bool equals(const VROQuaternion &other, + const float tolerance = kRoundingErrorQuatFloat ) const; + + //! Normalizes the quaternion + VROQuaternion &normalize(); + + // Get the norm of the quaternion + float getNorm(); + + //! Creates a matrix from this quaternion + VROMatrix4f getMatrix() const; + + //! Creates a matrix from this quaternion + void getMatrix( VROMatrix4f &dest, const VROVector3f &translation=VROVector3f() ) const; + + /*! + Creates a matrix from this quaternion + Rotate about a center point + shortcut for + quaternion q; + q.rotationFromTo ( vin[i].Normal, forward ); + q.getMatrixCenter ( lookat, center, newPos ); + + VROMatrix4f m2; + m2.setInverseTranslation ( center ); + lookat *= m2; + + VROMatrix4f m3; + m2.setTranslation ( newPos ); + lookat *= m3; + + */ + void getMatrixCenter( VROMatrix4f &dest, const VROVector3f ¢er, const VROVector3f &translation ) const; + + //! Creates a matrix from this quaternion + void getMatrix_transposed( VROMatrix4f &dest ) const; + + //! Inverts this quaternion + VROQuaternion &makeInverse(); + + //! Set this quaternion to the linear interpolation between two quaternions + /** \param q1 First quaternion to be interpolated. + \param q2 Second quaternion to be interpolated. + \param time Progress of interpolation. For time=0 the result is + q1, for time=1 the result is q2. Otherwise interpolation + between q1 and q2. + */ + static VROQuaternion lerp(VROQuaternion q1, VROQuaternion q2, float time); + + //! Set this quaternion to the result of the spherical interpolation between two quaternions + /** \param q1 First quaternion to be interpolated. + \param q2 Second quaternion to be interpolated. + \param time Progress of interpolation. For time=0 the result is + q1, for time=1 the result is q2. Otherwise interpolation + between q1 and q2. + \param threshold To avoid inaccuracies at the end (time=1) the + interpolation switches to linear interpolation at some point. + This value defines how much of the remaining interpolation will + be calculated with lerp. Everything from 1-threshold up will be + linear interpolation. + */ + static VROQuaternion slerp(VROQuaternion q1, VROQuaternion q2, + float time, float threshold=.05f); + + //! Create quaternion from rotation angle and rotation axis. + /** Axis must be unit length. + The quaternion representing the rotation is + q = cos(A/2)+sin(A/2)*(x*i+y*j+z*k). + \param angle Rotation Angle in radians. + \param axis Rotation axis. */ + static VROQuaternion fromAngleAxis (float angle, const VROVector3f& axis); + + //! Fills an angle (radians) around an axis (unit vector) + void toAngleAxis (float &angle, VROVector3f& axis) const; + + //! Output this quaternion to an euler angle (radians) + VROVector3f toEuler() const; + + //! Set quaternion to identity + VROQuaternion &makeIdentity(); + + //! Set quaternion to represent a rotation from one vector to another. + static VROQuaternion rotationFromTo(const VROVector3f& from, const VROVector3f& to); + + //! Quaternion elements. + float X; // vectorial (imaginary) part + float Y; + float Z; + float W; // real part +}; + +#endif + diff --git a/mobile/ios/ViroKit.framework/Headers/VRORenderContext.h b/mobile/ios/ViroKit.framework/Headers/VRORenderContext.h new file mode 100644 index 0000000..e208675 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VRORenderContext.h @@ -0,0 +1,274 @@ +// +// VRORenderContext.hpp +// ViroRenderer +// +// Created by Raj Advani on 10/13/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VRORenderContext_h +#define VRORenderContext_h + +#include +#include +#include +#include "VROFrameListener.h" +#include "VROMatrix4f.h" +#include "VROVector3f.h" +#include "VROQuaternion.h" +#include "VROCamera.h" +#include "VROFrameScheduler.h" + +class VROFrameSynchronizer; +class VRORenderTarget; +class VROTexture; +class VROPencil; +class VROInputControllerBase; +enum class VROEyeType; + +/* + Holds data specific to the current frame. Includes things like transformation + matrices. There is nothing driver or device specific contained here. + + Objects should *not* hold onto the VRORenderContext, as it is replaced each + frame with fresh data. + */ +class VRORenderContext { + +public: + + VRORenderContext(std::shared_ptr synchronizer, + std::shared_ptr scheduler) : + _frame(0), + _frameSynchronizer(synchronizer), + _frameScheduler(scheduler), + _pbrEnabled(true) { + + } + + int getFrame() const { + return _frame; + } + void setFrame(int frame) { + _frame = frame; + } + + void setEyeType(VROEyeType eye) { + _eye = eye; + } + VROEyeType getEyeType() const { + return _eye; + } + + void setZNear(float zNear) { + _zNear = zNear; + } + float getZNear() const { + return _zNear; + } + + void setZFar(float zFar) { + _zFar = zFar; + } + float getZFar() const { + return _zFar; + } + + void setProjectionMatrix(VROMatrix4f projectionMatrix) { + _projectionMatrix = projectionMatrix; + } + void setViewMatrix(VROMatrix4f viewMatrix) { + _viewMatrix = viewMatrix; + } + void setEnclosureViewMatrix(VROMatrix4f enclosureViewMatrix) { + _enclosureViewMatrix = enclosureViewMatrix; + } + void setOrthographicMatrix(VROMatrix4f orthographicMatrix) { + _orthographicMatrix = orthographicMatrix; + } + void setCamera(VROCamera camera) { + _camera = camera; + } + void setPreviousCamera(VROCamera camera) { + _previousCamera = camera; + } + + VROMatrix4f getProjectionMatrix() const { + return _projectionMatrix; + } + VROMatrix4f getViewMatrix() const { + return _viewMatrix; + } + VROMatrix4f getEnclosureViewMatrix() const { + return _enclosureViewMatrix; + } + VROMatrix4f getOrthographicMatrix() const { + return _orthographicMatrix; + } + + std::shared_ptr getShadowMap() const { + return _shadowMap; + } + void setShadowMap(std::shared_ptr shadowMap) { + _shadowMap = shadowMap; + } + + std::shared_ptr getIrradianceMap() const { + return _irradianceMap; + } + void setIrradianceMap(std::shared_ptr irradianceMap) { + _irradianceMap = irradianceMap; + } + + std::shared_ptr getPreFilteredMap() const { + return _prefilteredMap; + } + void setPreFilteredMap(std::shared_ptr map) { + _prefilteredMap = map; + } + + std::shared_ptr getBRDFMap() const { + return _brdfMap; + } + void setBRDFMap(std::shared_ptr map) { + _brdfMap = map; + } + + const VROCamera &getCamera() const { + return _camera; + } + const VROCamera &getPreviousCamera() const { + return _previousCamera; + } + + void setRenderTarget(std::shared_ptr target) { + _renderTarget = target; + } + const std::shared_ptr getRenderTarget() const { + return _renderTarget; + } + + std::shared_ptr getFrameSynchronizer() const { + return _frameSynchronizer; + } + std::shared_ptr getFrameScheduler() const { + return _frameScheduler; + } + + void setFPS(double fps) { + _fps = fps; + } + double getFPS() const { + return _fps; + } + + void setPencil(std::shared_ptr pencil){ + _pencil = pencil; + } + std::shared_ptr getPencil() const { + return _pencil; + } + + void setInputController(std::shared_ptr inputController) { + _inputController = inputController; + } + std::shared_ptr getInputController() const { + return _inputController; + } + + void setPBREnabled(bool enabled) { + _pbrEnabled = enabled; + } + bool isPBREnabled() const { + return _pbrEnabled; + } + +private: + + int _frame; + VROEyeType _eye; + double _fps; + bool _pbrEnabled; + + /* + The target to which we are currently rendering. + */ + std::shared_ptr _renderTarget; + + /* + The standard view and projection matrices. The view matrix is specific for + the eye currently being rendered (it includes the stereo translation). + */ + VROMatrix4f _projectionMatrix; + VROMatrix4f _viewMatrix; + + /* + The view matrix for camera enclosure objects (e.g. skyboxes). + */ + VROMatrix4f _enclosureViewMatrix; + + /* + The projection matrix used for orthographically rendered geometries. + */ + VROMatrix4f _orthographicMatrix; + + /* + The camera used for this frame. + */ + VROCamera _camera; + + /* + The camera used during the previous frame. Useful for computing deltas, if + required. + */ + VROCamera _previousCamera; + + /* + The near and far clipping planes. + */ + float _zNear, _zFar; + + /* + Synchronizer used to add or remove frame listeners. + */ + std::shared_ptr _frameSynchronizer; + + /* + Scheduler used for queueing and executing rendering thread tasks. + */ + std::shared_ptr _frameScheduler; + + /* + The texture containing shadow maps for all lights. This is a depth texture array. + */ + std::shared_ptr _shadowMap; + + /* + Diffuse irradiance map used for PBR image-based lighting. + */ + std::shared_ptr _irradianceMap; + + /* + Prefiltered irradiance map used for PBR image-based specular lighting. + */ + std::shared_ptr _prefilteredMap; + + /* + BRDF irradiance map used for PBR image-based specular lighting. + */ + std::shared_ptr _brdfMap; + + /* + VROPencil is used for drawing a list of VROPolylines in a separate render pass, + after having rendered the scene, mainly for representing debug information. + */ + std::shared_ptr _pencil; + + /* + The input controller being used. + */ + std::shared_ptr _inputController; + +}; + +#endif /* VRORenderContext_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VRORenderDelegate.h b/mobile/ios/ViroKit.framework/Headers/VRORenderDelegate.h new file mode 100644 index 0000000..6381dc8 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VRORenderDelegate.h @@ -0,0 +1,28 @@ +// +// VRORenderDelegate.h +// ViroRenderer +// +// Created by Raj Advani on 12/15/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VRORenderDelegate_h +#define VRORenderDelegate_h + +#import +#import +#import + +class VRORenderContext; +class VRODriver; +class VROVector3f; +enum class VROEyeType; + +@protocol VRORenderDelegate + +- (void)setupRendererWithDriver:(std::shared_ptr)driver; +- (void)userDidRequestExitVR; + +@end + +#endif /* VRORenderDelegate_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VRORenderMetadata.h b/mobile/ios/ViroKit.framework/Headers/VRORenderMetadata.h new file mode 100644 index 0000000..73f1aa9 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VRORenderMetadata.h @@ -0,0 +1,41 @@ +// +// VRORenderMetadata.h +// ViroKit +// +// Created by Raj Advani on 9/14/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VRORenderMetadata_h +#define VRORenderMetadata_h + +/* + The VRORenderMetadata collects scene-wide information about the + forthcoming render during the updateSortKeys() phase of the render loop. + + Enables the choreographer to optimize its render passes based on the + content of the scene. + */ +class VRORenderMetadata { +public: + + VRORenderMetadata() : + _requiresBloomPass(false) {} + + void setRequiresBloomPass(bool requiresBloomPass) { + _requiresBloomPass = requiresBloomPass; + } + bool requiresBloomPass() const { + return _requiresBloomPass; + } + +private: + + /* + Set to true to indicate that bloom was used in this render pass, and + we therefore require a Gaussian blur / accumulation (Bloom) pass. + */ + bool _requiresBloomPass; + +}; +#endif /* VRORenderMetadata_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VRORenderParameters.h b/mobile/ios/ViroKit.framework/Headers/VRORenderParameters.h new file mode 100644 index 0000000..c57e37e --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VRORenderParameters.h @@ -0,0 +1,43 @@ +// +// VRORenderParameters.h +// ViroRenderer +// +// Created by Raj Advani on 12/15/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VRORenderParameters_h +#define VRORenderParameters_h + +#include +#include +#include "VROMatrix4f.h" + +class VROLight; + +/* + Contains the per-frame render parameters for the current + render pass. + */ +class VRORenderParameters { + +public: + + std::stack opacities; + std::vector> lights; + std::stack hierarchyDepths; + std::stack distancesFromCamera; + int hierarchyId; + float furthestDistanceFromCamera; + + VRORenderParameters() { + opacities.push(1.0); + hierarchyDepths.push(-1); + hierarchyId = 0; + furthestDistanceFromCamera = 0; + distancesFromCamera.push(0); + } + +}; + +#endif /* VRORenderParameters_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VRORendererConfiguration.h b/mobile/ios/ViroKit.framework/Headers/VRORendererConfiguration.h new file mode 100644 index 0000000..38b30ee --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VRORendererConfiguration.h @@ -0,0 +1,22 @@ +// +// VRORendererConfiguration.h +// ViroKit +// +// Created by Raj Advani on 2/1/18. +// Copyright © 2018 Viro Media. All rights reserved. +// + +#ifndef VRORendererConfiguration_h +#define VRORendererConfiguration_h + +#include + +class VRORendererConfiguration { +public: + bool enableShadows = true; + bool enableBloom = true; + bool enableHDR = true; + bool enablePBR = true; +}; + +#endif /* VRORendererConfiguration_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VRORendererTest.h b/mobile/ios/ViroKit.framework/Headers/VRORendererTest.h new file mode 100644 index 0000000..8a53e61 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VRORendererTest.h @@ -0,0 +1,64 @@ +// +// VRORendererTest.h +// ViroRenderer +// +// Created by Raj Advani on 10/1/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VRORendererTest_h +#define VRORendererTest_h + +#include +#include "VRORendererTestHarness.h" +#include "VRONode.h" +#include "VROFrameSynchronizer.h" +#include "VRODriver.h" +#include "VROGeometry.h" +#include "VROBox.h" +#include "VROVector3f.h" +#include "VROScene.h" +#include "VROSceneController.h" +#include "VROTexture.h" +#include "VROLight.h" +#include "VROARSceneController.h" +#include "VROARScene.h" +#include "VROTorusKnot.h" +#include "VROAction.h" +#include "VROTransaction.h" +#include "VROShaderModifier.h" +#include "VROImage.h" +#include "VROARShadow.h" +#include "VROUniform.h" +#include "VRONodeCamera.h" +#include "VROVideoTexture.h" +#include "VROOBJLoader.h" +#include "VROFBXLoader.h" +#include "VROText.h" +#include "VROTextureUtil.h" + +class VRORenderer; + +class VRORendererTest { +public: + + VRORendererTest(VRORendererTestType type) : _type(type) {} + virtual ~VRORendererTest() {} + + VRORendererTestType getType() const { + return _type; + } + + virtual void build(std::shared_ptr renderer, + std::shared_ptr frameSynchronizer, + std::shared_ptr driver) = 0; + virtual std::shared_ptr getPointOfView() = 0; + virtual std::shared_ptr getSceneController() = 0; + +private: + + VRORendererTestType _type; + +}; + +#endif /* VRORendererTest_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VRORendererTestHarness.h b/mobile/ios/ViroKit.framework/Headers/VRORendererTestHarness.h new file mode 100644 index 0000000..f7f56a3 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VRORendererTestHarness.h @@ -0,0 +1,73 @@ +// +// VRORendererTestHarness.h +// ViroKit +// +// Created by Raj Advani on 10/1/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VRORendererTestHarness_h +#define VRORendererTestHarness_h + +#include +#include + +class VRODriver; +class VRORenderer; +class VROFrameSynchronizer; + +enum class VRORendererTestType { + OBJ, + Torus, + Particle, + Physics, + Box, + Text, + VideoSphere, + NormalMap, + Stereoscopic, + FBX, + ARPlane, + ARDraggableNode, + ARImageTracking, + Portal, + Shadow, + ARShadow, + HDR, + Bloom, + Perf, + Polyline, + PBRDirect, + PBRTextured, + DiffuseIrradiance, + PhotometricLight, + RendererSettings, + NumTests, +}; + +class VRORendererTest; + +class VRORendererTestHarness { +public: + + VRORendererTestHarness(std::shared_ptr renderer, + std::shared_ptr frameSynchronizer, + std::shared_ptr driver); + virtual ~VRORendererTestHarness(); + + std::shared_ptr loadNextTest(); + std::shared_ptr loadTest(VRORendererTestType type); + std::shared_ptr getCurrentTest(); + +private: + + std::shared_ptr _currentTest; + std::shared_ptr createTest(VRORendererTestType type); + + std::shared_ptr _renderer; + std::shared_ptr _frameSynchronizer; + std::shared_ptr _driver; + +}; + +#endif /* VRORendererTestHarness_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROReticle.h b/mobile/ios/ViroKit.framework/Headers/VROReticle.h new file mode 100644 index 0000000..3df1a69 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROReticle.h @@ -0,0 +1,110 @@ +// +// VROReticle.h +// ViroRenderer +// +// Created by Raj Advani on 1/12/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VRORecticle_h +#define VRORecticle_h + +#include +#include +#include "VROSurface.h" +#include "VROTexture.h" +#include "VRONode.h" + +class VRONode; +class VROPolyline; +class VROVector3f; +class VRORenderContext; +class VRODriver; +enum class VROEyeType; + +class VROReticle { + +public: + + VROReticle(std::shared_ptr icon); + virtual ~VROReticle(); + + void trigger(); + void renderEye(VROEyeType eye, const VRORenderContext &renderContext, std::shared_ptr &driver); + + void setPosition(VROVector3f position); + void setRadius(float radius); + + void setEnabled(bool enabled); + + /* + If pointer is fixed, the reticle will be locked at the center of each eye. This is used for + VR devices that lack a pointing controller (e.g. Cardboard). + */ + void setPointerFixed(bool fixed); + bool isHeadlocked(); + + void animateFuse(float fuseRatio); + void stopFuseAnimation(); + +private: + + /* + Set to true by controllers if the reticle is fixed at the center + of each eye. Set to false if the VR platform has a hand-held controller + that can be used to point. + */ + bool _isHeadlocked; + + bool _enabled; + float _size; + float _radius; + float _thickness; + float _endThickness; + float _fuseScale; + + /* + Cached x y points describing a circle with kCircleSegments, used + to draw the reticleLine and fuseLine. + */ + std::vector _cachedCirclePoints; + std::vector createArc(float radius, int numSegments); + + /* + Helper function to render each node in the reticle. + */ + void renderNode(std::shared_ptr node, const VRORenderContext &renderContext, + std::shared_ptr &driver); + + /* + Nodes containing the UI components of the reticle. It can be + a line or an icon (image) reticle. + */ + std::shared_ptr _reticleBaseNode; + std::shared_ptr _reticleIcon; + std::shared_ptr _reticleLine; + + /* + Nodes containing the UI components of the reticle when it is fused. + */ + std::shared_ptr _fuseNode; + std::shared_ptr _fuseLine; + std::shared_ptr _fuseBackgroundNode; + std::shared_ptr _fuseBackgroundLine; + std::shared_ptr _fuseTriggeredNode; + std::shared_ptr _fuseTriggeredLine; + + /* + True when we are currently animating the reticle with a fuse ratio under + animateFuse(). False if we've stopped with stopFuseAnimation(). + */ + bool _isFusing; + + /* + True when we have already ran the fuseTriggered animation for the + current fuse state. + */ + bool _fuseTriggered; + void animateFuseTriggered(); +}; +#endif diff --git a/mobile/ios/ViroKit.framework/Headers/VROScene.h b/mobile/ios/ViroKit.framework/Headers/VROScene.h new file mode 100644 index 0000000..69bd78d --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROScene.h @@ -0,0 +1,294 @@ +// +// VROScene.h +// ViroRenderer +// +// Created by Raj Advani on 10/19/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VROScene_h +#define VROScene_h + +#include +#include +#include +#include "VROInputPresenter.h" +#include "VROAllocationTracker.h" +#include "VROSortKey.h" +#include "VROQuaternion.h" +#include "VROThreadRestricted.h" +#include "VROPhysicsWorld.h" +#include "VROTree.h" + +class VRONode; +class VROPortal; +class VRORenderContext; +class VRODriver; +class VROTexture; +class VROGeometry; +class VROHitTestResult; +class VROVector3f; +class VROVector4f; +class VROAudioPlayer; +class VRORenderMetadata; +class VROInputControllerBase; +enum class VROToneMappingMethod; + +class VROScene : public std::enable_shared_from_this, public VROThreadRestricted { + +public: + + VROScene(); + virtual ~VROScene(); + +#pragma mark - Core Render Cycle + + /* + Compute the transforms, recursively, for all nodes in this scene. + */ + void computeTransforms(const VRORenderContext &context); + + /* + Update the visibility status of all nodes in the scene graph. + */ + void updateVisibility(const VRORenderContext &context); + + /* + Update the particle emitters in the scene graph. + */ + void updateParticles(const VRORenderContext &context); + + /* + Apply transformation constraints (e.g. billboarding) to all nodes in + the scene. + */ + void applyConstraints(const VRORenderContext &context); + + /* + Notifies the root node that it the render properties have settled and + that it should set them now. + */ + void setAtomicRenderProperties(); + + /* + Update the sort keys for all nodes in this scene. + */ + void updateSortKeys(std::shared_ptr &metadata, + const VRORenderContext &context, + std::shared_ptr &driver); + +#pragma mark - Scene Introspection + + /* + Retrieve the root node of the scene. + */ + std::shared_ptr getRootNode(); + + float getDistanceOfFurthestObjectFromCamera() const { + return _distanceOfFurthestObjectFromCamera; + } + + /* + Get all backgrounds in the scene. + */ + std::vector> getBackgrounds() const; + + /* + Get all the lights in the scene, as collected from the last render cycle. + */ + const std::vector> &getLights() const { + return _lights; + } + +#pragma mark - Physics + + bool hasPhysicsWorld() const { + return _physicsWorld != nullptr; + } + + /* + Returns the associated physics world with this scene. If there's none + one is created and returned. + */ + std::shared_ptr getPhysicsWorld() { + if (_physicsWorld == nullptr) { + _physicsWorld = std::make_shared(); + } + return _physicsWorld; + } + + /* + Computes the physics simulation for the current frame, if a VROPhysicsWorld + exists. + */ + void computePhysics(const VRORenderContext &context) { + if (_physicsWorld != nullptr) { + _physicsWorld->computePhysics(context); + } + } + +#pragma mark - Input + + /* + Attach or detach input controllers. + */ + void attachInputController(std::shared_ptr controller); + void detachInputController(std::shared_ptr controller); + std::shared_ptr getControllerPresenter(); + +#pragma mark - Portals + + /* + Set the 'active', or present portal. This is the portal the user is + in, and determines the render-order of the stenciling, which in turn + creates the illusion of being in the specified portal. + */ + void setActivePortal(std::shared_ptr node); + + /* + Get the portal tree. Reconstructed each frame. + */ + const tree> getPortalTree() const; + + /* + Get the active portal, which is the portal the user is currently "inside". + */ + const std::shared_ptr getActivePortal() const { + return _activePortal; + } + +#pragma mark - Post-processing + + /* + Tone mapping settings. Note that linear rendering is controlled by the + driver's getColorRenderingMode() method, while this setting merely controls + whether or not we're using tone-mapping. + + If tone mapping is disabled, all HDR colors are translated directly into the + 8-bit framebuffer, clamped at 1.0. + */ + void setToneMappingEnabled(bool enabled); + void setToneMappingMethod(VROToneMappingMethod method); + void setToneMappingExposure(float exposure); + void setToneMappingWhitePoint(float whitePoint); + void setToneMappingUpdated(bool updated); + + bool isToneMappingEnabled() const { return _toneMappingEnabled; } + VROToneMappingMethod getToneMappingMethod() const { return _toneMappingMethod; } + float getToneMappingExposure() const { return _toneMappingExposure; } + float getToneMappingWhitePoint() const { return _toneMappingWhitePoint; } + bool isToneMappingUpdated() const { return _toneMappingUpdated; } + + /* + Set or get the post-processing effects installed on the scene. Each string + corresponds to a VROPostProcessEffect. + */ + void setPostProcessingEffects(std::vector effects); + std::vector getPostProcessingEffects() const; + + /* + Indicates if the renderer needs to update its installed post-processing effects. + */ + bool isPostProcessingEffectsUpdated() const; + void setPostProcessingEffectsUpdated(bool updated); + +protected: + + /* + The root node of the scene. + */ + std::shared_ptr _rootNode; + + /* + Create a tree of portals in the scene graph, with the active portal at the + root of the tree. Note we use graph traversal because portal stencil rendering + begins at the 'active' node, not necesarily at the root node. + */ + void createPortalTree(const VRORenderContext &context); + + /* + Helper function, sorts portals at each recursion level by distance from camera. + */ + void sortSiblingPortals(tree> &tree, const VRORenderContext &context); + + /* + Returns true if the given node is present in this scene. + */ + bool hasNode(std::shared_ptr node) const; + bool hasNode_helper(const std::shared_ptr &candidate, const std::shared_ptr &node) const; + + /* + Retrieve all background textures in the scene. + */ + void getBackgrounds(std::shared_ptr node, std::vector> &backgrounds) const; + +private: + + /* + UI representation of the underlying controller + */ + std::shared_ptr _controllerPresenter; + + /* + The portals in tree form, with the active portal at the root. + */ + tree> _portals; + + /* + All the lights in the scene, as collected during the last render cycle. + */ + std::vector> _lights; + + /* + The distance from the camera of the furthest away object, since the last + call to updateSortKeys. Distance is from the camera to the bounding + box of the object. + */ + float _distanceOfFurthestObjectFromCamera; + + /* + Manages the physics in the scene. + */ + std::shared_ptr _physicsWorld = nullptr; + + /* + Represents a list of all actively emitting particles in this scene. + */ + std::vector> _activeParticles; + + /* + The active portal; the scene is rendered as though the camera is in this + portal. Defaults to the root node. + */ + std::shared_ptr _activePortal; + + /* + List of post-processing effects to be applied in the renderer. + */ + std::vector _activePostProcessingEffects; + + /* + True if we post-processing effects were updated since the last time the + renderer checked. + */ + bool _postProcessingEffectsUpdated; + + /* + Tone mapping parameters, and flag indicating if any have been updated. + */ + bool _toneMappingEnabled; + VROToneMappingMethod _toneMappingMethod; + float _toneMappingExposure; + float _toneMappingWhitePoint; + bool _toneMappingUpdated; + + /* + A helper method that draws a line from the max to min points of the given node's bounding box. Call + from the render function if you want to see the lines + */ + void drawBoundingBoxCorners(std::shared_ptr node, + const VRORenderContext &context, + std::shared_ptr &driver); +}; + +#endif /* VROScene_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROSceneController.h b/mobile/ios/ViroKit.framework/Headers/VROSceneController.h new file mode 100644 index 0000000..53332ce --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROSceneController.h @@ -0,0 +1,89 @@ +// +// VROSceneController.h +// ViroKit +// +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef ANDROID_VROSCENECONTROLLER_H +#define ANDROID_VROSCENECONTROLLER_H +#include +#include "VROScene.h" +#include "VROLog.h" +#include "VROTransaction.h" +#include "VROMaterial.h" +#include "VROPortal.h" + +class VROScene; +class VROVector3f; +class VRODriver; +class VRORenderContext; +class VROPortalTraversalListener; + +static float kTransitionPushDistance = 0.10; + +/* + SceneController manages transitions between Scenes and the Scene lifecyle. + */ +class VROSceneController : public std::enable_shared_from_this{ + +public: + // Delegate for callbacks across the bridge + class VROSceneControllerDelegate { + public: + virtual void onSceneWillAppear(VRORenderContext * context, std::shared_ptr driver) {}; + virtual void onSceneDidAppear(VRORenderContext * context, std::shared_ptr driver) {}; + virtual void onSceneWillDisappear(VRORenderContext * context, std::shared_ptr driver) {}; + virtual void onSceneDidDisappear(VRORenderContext * context, std::shared_ptr driver) {}; + }; + + void setDelegate(std::shared_ptr delegate){ + auto autoWeakDelegate = delegate; + _sceneDelegateWeak = autoWeakDelegate; + } + + VROSceneController() { + _scene = std::make_shared(); + _scene->getRootNode()->setScene(_scene, true); + } + virtual ~VROSceneController() {} + + virtual std::shared_ptr getScene() { + return _scene; + } + + /* + Scene appeared delegate methods, triggered by VRORenderer. + */ + virtual void onSceneWillAppear(VRORenderContext *context, std::shared_ptr driver); + virtual void onSceneDidAppear(VRORenderContext *context, std::shared_ptr driver); + virtual void onSceneWillDisappear(VRORenderContext *context, std::shared_ptr driver); + virtual void onSceneDidDisappear(VRORenderContext *context, std::shared_ptr driver); + + // For now, we use fade plus push for all animated scene transitions. TODO: VIRO-771 + // captures applying varying kinds of custom animations on scene transitions. + void startIncomingTransition(float duration, VROTimingFunctionType timingFunctionType, + VRORenderContext *context); + void startOutgoingTransition(float duration, VROTimingFunctionType timingFunctionType, + VRORenderContext *context); + + bool hasActiveTransitionAnimation(){ + return _isTransitionAnimationActive; + } + void setActiveTransitionAnimation (bool flag){ + _isTransitionAnimationActive = flag; + } + +protected: + + std::shared_ptr _scene; + std::weak_ptr _sceneDelegateWeak; + +private: + + bool _isTransitionAnimationActive; + std::shared_ptr _portalTraversalListener; + +}; + +#endif //ANDROID_VROSCENECONTROLLER_H diff --git a/mobile/ios/ViroKit.framework/Headers/VROSceneDelegateiOS.h b/mobile/ios/ViroKit.framework/Headers/VROSceneDelegateiOS.h new file mode 100644 index 0000000..58bba9e --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROSceneDelegateiOS.h @@ -0,0 +1,83 @@ +// +// VROSceneDelegateiOS.h +// ViroRenderer +// +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROSceneDelegateiOS_h +#define VROSceneDelegateiOS_h +#import + +/** + * Protocol to be implemented by objective C controls to be + * set on VROSceneControllerDelegateiOS for the notification of + * scene transition events. + */ +@protocol VROSceneDelegateProtocol +- (void)sceneWillAppear:(VRORenderContext *)context driver:(std::shared_ptr)driver; +- (void)sceneDidAppear:(VRORenderContext *)context driver:(std::shared_ptr)driver; +- (void)sceneWillDisappear:(VRORenderContext *)context driver:(std::shared_ptr)driver; +- (void)sceneDidDisappear:(VRORenderContext *)context driver:(std::shared_ptr)driver; +- (void)startIncomingTransition:(VRORenderContext *)context duration:(float)duration; +- (void)startOutgoingTransition:(VRORenderContext *)context duration:(float)duration; +- (void)endIncomingTransition:(VRORenderContext *)context; +- (void)endOutgoingTransition:(VRORenderContext *)context; +- (void)animateIncomingTransition:(VRORenderContext *)context percentComplete:(float)t; +- (void)animateOutgoingTransition:(VRORenderContext *)context percentComplete:(float)t; +@end + +/** + * iOS implementation of VROSceneControllerDelegate for the notification + * of scene delegate events across the bridge. + */ +class VROSceneControllerDelegateiOS : public VROSceneController::VROSceneControllerDelegate { +public: + VROSceneControllerDelegateiOS(id delegate) : + _delegate(delegate) {} + virtual ~VROSceneControllerDelegateiOS() {} + + /* + Scene appeared delegate methods. + */ + virtual void onSceneWillAppear(VRORenderContext *context, std::shared_ptr driver) { + [_delegate sceneWillAppear:context driver:driver]; + } + virtual void onSceneDidAppear(VRORenderContext *context, std::shared_ptr driver) { + [_delegate sceneDidAppear:context driver:driver]; + } + virtual void onSceneWillDisappear(VRORenderContext *context, std::shared_ptr driver) { + [_delegate sceneWillDisappear:context driver:driver]; + } + virtual void onSceneDidDisappear(VRORenderContext *context, std::shared_ptr driver) { + [_delegate sceneDidDisappear:context driver:driver]; + } + + /* + Scene animation delegate methods. + */ + virtual void startIncomingTransition(VRORenderContext *context, float duration){ + [_delegate startIncomingTransition:context duration:duration]; + } + virtual void startOutgoingTransition(VRORenderContext *context, float duration){ + [_delegate startOutgoingTransition:context duration:duration]; + } + virtual void endIncomingTransition(VRORenderContext *context) { + [_delegate endIncomingTransition:context]; + } + virtual void endOutgoingTransition(VRORenderContext *context) { + [_delegate endOutgoingTransition:context]; + } + virtual void animateIncomingTransition(VRORenderContext *context, float t){ + [_delegate animateIncomingTransition:context percentComplete:t]; + } + virtual void animateOutgoingTransition(VRORenderContext *context, float t){ + [_delegate animateOutgoingTransition:context percentComplete:t]; + } + +private: + + __weak id _delegate; + +}; +#endif /* VROSceneDelegateiOS_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROShaderModifier.h b/mobile/ios/ViroKit.framework/Headers/VROShaderModifier.h new file mode 100644 index 0000000..6681b1f --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROShaderModifier.h @@ -0,0 +1,299 @@ +// +// VROShaderModifier.h +// ViroRenderer +// +// Created by Raj Advani on 10/13/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROShaderModifier_h +#define VROShaderModifier_h + +#include +#include +#include +#include +#include +#include +#include "VROOpenGL.h" + +class VROUniform; +class VROGeometry; +class VROMaterial; + +typedef std::function VROUniformBindingBlock; + +/* + The entry point, which signals where in the shader program this modifier will + act. + + ---------------- + + Geometry entry point. The code may declare uniforms and read/write + to the following structures: + + struct VROShaderGeometry { + vec3 position; + vec3 normal; + vec2 texcoord; + vec4 tangent; + vec4 bone_weights; + ivec4 bone_indices; + } _geometry; + + struct VROTransforms { + mat4 model_matrix; + mat4 view_matrix; + mat4 projection_matrix; + } _transforms; + + The Geometry entry point enables modifiers to change vertex parameters + in the vertex shader. This includes geometry parameters like position, + normals, and texcoords, and transform parameters like the model, view, + and projection matrices. + + ---------------- + + Vertex entry point. The code may declare uniforms and read/write + to the following structure: + + struct VROShaderVertex { + vec3 position; + } _vertex; + + The Vertex entry point enables modifiers to change the position of + vertices *after* their transformation into normalized device coordinates. + The input and output (_vertex.position) is in normalized device coordinates. + + ---------------- + Surface entry point. The code may declare uniforms and read/write + to the following structure: + + struct VROSurface { + lowp vec4 diffuse_color; + highp vec2 diffuse_texcoord; + lowp float diffuse_intensity; + + lowp float shininess; + lowp vec3 specular_color; + highp vec2 specular_texcoord; + + highp float roughness; + highp float metalness; + highp float ao; + + lowp float alpha; + lowp vec3 normal; + highp vec3 position; + } _surface; + + The Surface entry point enables modifiers to change surface parameters, in + the fragment shader, prior to the lighting computation. + + ---------------- + + Lighting Model entry point. The code runs once per light. It reads from the + _surface structure and the _light structure below, and sets the results in + the _lightingContribution structure: + + struct VROLightingContribution { + highp vec3 ambient; + highp vec3 diffuse; + highp vec3 specular; + highp float visibility; + } _lightingContribution; + + struct VROLightUniforms { + int type; + highp float attenuation_start_distance; + highp float attenuation_end_distance; + highp float attenuation_falloff_exp; + + highp vec4 position; + highp vec4 direction; + + highp vec3 color; + highp float intensity; + + highp float spot_inner_angle; + highp float spot_outer_angle; + } _light; + + The Lighting Model entry point enables modifiers to define the impact of each + light on a given material. After being invoked on each light, the lighting + contributions from each light are accumulated and combined with material surface + properties to generate the final color. The visibility value (which defaults to + 1.0) is multiplied by the diffuse and specular components; it can be used to + simulate the impact of shadow. + + Note, as an optimization, total ambient light is initialized to the sum + of all ambient lights. Therefore, in general lighting models will not need to + add anything to _lightingContribution.ambient. + + ---------------- + + Fragment entry point. The code may declare uniforms and read/write + to the variable: + + highp vec4 _output_color; + + The Fragment entry point enables modifiers to alter the final color of each + fragment, after the lighting computation. + + ---------------- + + Image entry point. The image entry point is *only* available for 2D post-processing + shaders. The code may declare uniforms for the fragment shader (the vertex + shader is a fixed quad in normalized device coordinates), and must simply + set the frag_color. + + frag_color = ... (vec4) ... + + The Image entry point enables modifiers to quickly create new post-processing + functions for VROImageShaderPrograms. + + ---------------- + */ +enum class VROShaderEntryPoint { + Geometry, + Vertex, + Surface, + LightingModel, + Fragment, + Image, +}; + +enum class VROShaderSection { + Uniforms, + Body +}; + +/* + Modifies the source of a VROShaderProgram, and enables the binding of new uniforms + to said program. A shader modifier can be attached to multiple shaders. Note in such + cases, the uniform binders will be consistent across shaders (they cannot be different + for each shader). + */ +class VROShaderModifier { + +public: + + static std::string getShaderModifierKey(const std::vector> &modifiers); + + /* + Create a new shader modifier that operates at the given entry point. The input + should be valid GLSL code, with each line as a separate string. Uniform declarations + are automatically separated out from the body of the input code. + */ + VROShaderModifier(VROShaderEntryPoint entryPoint, std::vector input); + virtual ~VROShaderModifier(); + + VROShaderEntryPoint getEntryPoint() const { + return _entryPoint; + } + int getShaderModifierId() const { + return _shaderModifierId; + } + + /* + Names can be added to shader modifiers, for debugging only. Will be appended + to the parent shader name. + */ + void setName(std::string name) { + _name = name; + } + std::string getName() const { + return _name; + } + + /* + Add a string of text and what it should be replaced with. This will perform + a find and replace on the modified shader. + */ + void addReplacement(std::string stringMatching, std::string replacementString) { + _replacements[stringMatching] = replacementString; + } + + /* + Set a block that will bind the uniform of the given name. This will be + invoked each time a shader containining this modifier is bound. The block + should set the uniform in the shader via glUniform* methods. + */ + void setUniformBinder(std::string uniform, VROUniformBindingBlock bindingBlock); + + /* + Invoke the uniform binder for the given uniform. + */ + void bindUniform(VROUniform *uniform, GLuint location, + const VROGeometry *geometry, const VROMaterial *material); + + /* + Get the pragma directive that corresponds to this modifier's entry point and + the given section within a shader. This is the point in the shader where the + modifier source will be inserted. + */ + std::string getDirective(VROShaderSection section) const; + + /* + Get the uniforms for which we have an attached binder. + */ + std::vector getUniforms() const; + + /* + Get the replacement map, used to replace matching lines of code in the + modified shader with new lines of code. + */ + const std::map &getReplacements() const { + return _replacements; + } + + /* + Get the uniform declaration code. This gets placed at the top of the file. + */ + std::string getUniformsSource() const { + return _uniforms; + } + + /* + Get the body of the source. This gets placed in the main vertex or fragment + function. + */ + std::string getBodySource() const { + return _body; + } + +private: + + int _shaderModifierId; + std::string _name; + + /* + The new uniforms this shader modifier will add. Single string containing + the uniform declarations, with newlines between them. + */ + std::string _uniforms; + + /* + The code this modifier is adding to the body of the shader. + */ + std::string _body; + + /* + Map of lines this modifier will replace in the shader it modifies. + */ + std::map _replacements; + + VROShaderEntryPoint _entryPoint; + std::map _uniformBinders; + + /* + Return true if the given line is a variable declaration, and false + if not. Variable declarations are lines that declare a uniform, in, + our out variable. + */ + bool isVariableDeclaration(std::string &line); + +}; + +#endif diff --git a/mobile/ios/ViroKit.framework/Headers/VROShaderProgram.h b/mobile/ios/ViroKit.framework/Headers/VROShaderProgram.h new file mode 100644 index 0000000..62e7373 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROShaderProgram.h @@ -0,0 +1,302 @@ +// +// VROShaderProgram.h +// ViroRenderer +// +// Created by Raj Advani on 4/22/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROSHADERPROGRAM_H_ +#define VROSHADERPROGRAM_H_ + +#include +#include +#include +#include +#include +#include +#include "VROLog.h" +#include "VROUniform.h" +#include "VROOpenGL.h" + +enum class VROGeometrySourceSemantic; + +/* + Bit-mask indicating support for each shader attribute. + */ +enum class VROShaderMask { + Tex = 1, + Color = 2, + Norm = 4, + Tangent = 8, + BoneIndex = 16, + BoneWeight = 32 +}; + +class VROShaderModifier; +class VRODriverOpenGL; + +/* + Represents a GLSL shader program. Shader programs are constructed with vertex + code, fragment code, samplers, attributes, uniforms, and shader modifiers. + + Materials can share access to a single shader. In these cases, the materials can + set their own values for the uniforms when it is their turn to render. Note though + that the uniform objects themselves are not owned by these materials; they are + owned by the shader. + */ +class VROShaderProgram { +public: + + /* + Assign a binding point to each type of UBO. + */ + static const int sLightingVertexUBOBindingPoint = 0; + static const int sLightingFragmentUBOBindingPoint = 1; + static const int sBonesUBOBindingPoint = 2; + static const int sParticleVertexUBOBindingPoint = 3; + static const int sParticleFragmentUBOBindingPoint = 4; + + /* + Create a new shader program with the given source. This constructor assumes that the + shader code is bundled with the application. + */ + VROShaderProgram(std::string vertexShader, std::string fragmentShader, + const std::vector &samplers, + const std::vector> &modifiers, + const std::vector attributes, + std::shared_ptr driver); + + uint32_t getShaderId() const { + return _shaderId; + } + + virtual ~VROShaderProgram(); + + /* + Get the VROUniform setter given a name or index. The name accessors are much slower + as they iterate through each uniform. + */ + int getUniformIndex(const std::string &name); + VROUniform *getUniform(const std::string &name); + VROUniform *getUniform(int index); + + /* + Add a new uniform to this shader. Returns a pointer to the uniform. Note this shader + will own the uniform (callers must not delete the pointer). + */ + VROUniform *addUniform(VROShaderProperty type, int arraySize, const std::string &name); + + /* + Hydration, for shaders, involves compiling and linking the shader program so it can be + run by the GPU. + */ + bool hydrate(); + void evict(); + bool isHydrated() const; + + /* + Bind this shader program, or unbind any program. Returns false if the program was + already bound. + */ + bool bind(); + static void unbind(); + + /* + Get the vertex and fragment source code for this shader. + */ + const std::string &getVertexSource() const; + const std::string &getFragmentSource() const; + + int getNumUniforms() const { + return (int) _uniforms.size(); + } + const std::vector &getUniforms() const { + return _uniforms; + } + + const std::vector &getSamplers() const { + return _samplers; + } + + const std::string &getName() const { + return _shaderName; + } + + GLuint getProgram() const { + return _program; + } + + bool hasLightingFragmentBlock() const { + return _lightingFragmentBlockIndex != GL_INVALID_INDEX; + } + GLuint getLightingFragmentBlockIndex() const { + return _lightingFragmentBlockIndex; + } + + bool hasLightingVertexBlock() const { + return _lightingVertexBlockIndex != GL_INVALID_INDEX; + } + GLuint getLightingVertexBlockIndex() const { + return _lightingVertexBlockIndex; + } + + bool hasBonesBlock() const { + return _bonesBlockIndex != GL_INVALID_INDEX; + } + GLuint getBonesBlockIndex() const { + return _bonesBlockIndex; + } + + bool hasParticlesVertexBlock() const { + return _particlesVertexBlockIndex != GL_INVALID_INDEX; + } + GLuint getParticlesVertexBlockIndex() const { + return _particlesVertexBlockIndex; + } + + bool hasParticlesFragmentBlock() const { + return _particlesFragmentBlockIndex != GL_INVALID_INDEX; + } + GLuint getParticlesFragmentBlockIndex() const { + return _particlesFragmentBlockIndex; + } + + const std::vector> &getModifiers() const { + return _modifiers; + } + bool hasModifier(std::shared_ptr modifier) { + return std::find(_modifiers.begin(), _modifiers.end(), modifier) != _modifiers.end(); + } + +protected: + + /* + Bind attributes, standard uniforms, and uniform blocks. Attributes are bound prior + to linking, and uniform blocks are bound after compilation. These can be overriden + by subclasses. The default implementation (here) adds the attributes, uniform blocks, + and uniforms for the standard 3D shader used by lighting models Constant, Lambert, + Blinn, and Phong. + */ + virtual void bindAttributes(); + virtual void bindUniformBlocks(); + virtual void addStandardUniforms(); + +private: + + uint32_t _shaderId; + + /* + VROUniform for each uniform in the shader. The VROUniform holds both the location of the uniform + and the proper glUniform function to invoke to set its value. + */ + std::vector _uniforms; + + /* + The uniform block indices used by this shader to refer to the lighting block and the + bones block, if supported. + */ + GLuint _lightingFragmentBlockIndex; + GLuint _lightingVertexBlockIndex; + GLuint _bonesBlockIndex; + + /* + The uniform block for particles to be used by this shader - one for the fragment and + one for the vertex shader. + */ + GLuint _particlesVertexBlockIndex; + GLuint _particlesFragmentBlockIndex; + + /* + The attributes supported by this shader, as defined by the VROShader enum above. + */ + int _attributes; + + /* + True if the uniforms used by this shader have changed and require a rebind. + This is always true after a shader is compiled. + */ + bool _uniformsNeedRebind; + + /* + The name of the shader. + */ + std::string _shaderName; + + /* + The source code of the shader. + */ + std::string _vertexSource; + std::string _fragmentSource; + + /* + Integer identifying the program. + */ + GLuint _program; + + /* + True if the shader failed to compile or link. + */ + bool _failedToLink; + + /* + List of the names of all samplers used by this shader. + */ + std::vector _samplers; + + /* + The modifiers used on this shader. + */ + std::vector> _modifiers; + + /* + Weak reference to the driver that created this program. The driver's lifecycle + is tied to the parent EGL context, so we only delete GL objects if the driver + is alive, to ensure we're deleting them under the correct context (e.g. to avoid + accidentally deleting objects in a new context that were created in an older + one). + */ + std::weak_ptr _driver; + + /* + Compile and link the shader. Returns true on success. + */ + bool compileAndLink(); + + /* + Compile, link, and validate the shader at the given path. Type indicates fragment or vertex. + */ + bool compileShader(GLuint *shader, GLenum type, const char *source); + bool linkProgram(GLuint prog); + bool validateProgram(GLuint prog); + + /* + Loads the the uniforms used by the modifiers. + */ + void addModifierUniforms(); + + /* + Set the location of each uniform in the uniformMap and each sampler in the samplers + list. Requires an EGL context and requires that this shader is bound. + */ + void findUniformLocations(); + + /* + Inflate the #include directives in the source. Loads the files referred to by the + includes into the shader. + */ + void inflateIncludes(std::string &source) const; + + /* + Inflate the shader modifiers into the shader source. + */ + void inflateVertexShaderModifiers(const std::vector> &modifiers, + std::string &source); + void inflateFragmentShaderModifiers(const std::vector> &modifiers, + std::string &source); + void inflateReplacements(const std::map &replacements, std::string &source) const; + void insertModifier(std::string modifierSource, std::string directive, std::string &source) const; + +}; + +#endif /* VROSHADERPROGRAM_H_ */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROShapeUtils.h b/mobile/ios/ViroKit.framework/Headers/VROShapeUtils.h new file mode 100644 index 0000000..605b2fd --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROShapeUtils.h @@ -0,0 +1,63 @@ +// +// VROShapeUtils.h +// ViroRenderer +// +// Created by Raj Advani on 12/3/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VROShapeUtils_h +#define VROShapeUtils_h + +#include +#include +#include + +class VROData; +class VROVector3f; +class VROGeometrySource; + +typedef struct { + // Position + float x; + float y; + float z; + + // Tex-coords + float u; + float v; + + // Normal + float nx; + float ny; + float nz; + + // Tangent + float tx; + float ty; + float tz; + float tw; +} VROShapeVertexLayout; + +/* + Compute the tangents for the given shape and store them. + */ +void VROShapeUtilComputeTangents(VROShapeVertexLayout *vertexLayout, size_t verticesLength, + int *indices, size_t indicesLength); + +/* + Three-part function for computing tangents across different index arrays, but the same + vertex array. + */ +VROVector3f *VROShapeUtilStartTangents(VROShapeVertexLayout *vertexLayout, size_t verticesLength); +void VROShapeUtilComputeTangentsForIndices(VROShapeVertexLayout *vertexLayout, size_t verticesLength, + int *indices, size_t indicesLength, VROVector3f *tan1); +void VROShapeUtilEndTangents(VROShapeVertexLayout *vertexLayout, size_t verticesLength, VROVector3f *tan1); + +/* + Build the geometry sources for rendering the given vertex data. + */ +std::vector> VROShapeUtilBuildGeometrySources(std::shared_ptr vertexData, + size_t numVertices); + +#endif /* VROShapeUtils_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROSkinner.h b/mobile/ios/ViroKit.framework/Headers/VROSkinner.h new file mode 100644 index 0000000..8b689d9 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROSkinner.h @@ -0,0 +1,163 @@ +// +// VROSkinner.h +// ViroRenderer +// +// Created by Raj Advani on 5/9/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROSkinner_h +#define VROSkinner_h + +#include "VROMatrix4f.h" +#include "VROGeometrySource.h" +#include +#include + +class VROGeometry; +class VROSkeleton; + +/* + VROSkinner is the base class for skeletal animation; it associates an animation + skeleton with the geometry that will be deformed. + + A single VROSkeleton can be used by multiple VROGeometries; each geometry using + the VROSkeleton will have its own VROSkinner that maps the geometry to the + skeleton. + + Brief explanation of coordinate transformations + ------ + + Skeletal animation works by associating a geometry with a skeleton. The geometry + is transformed first so that it aligns with the skeleton, via the _bindTransforms. + Next, we associate each vertex in the geometry with the set of bones that will + 'influence' it, via _boneWeights and _boneIndices. Then we animate the + skeleton, specifically by animating each of the bone's transforms. And finally, we + deform the mesh to follow the movement of the skeleton. + + The steps, in more detail: + + 1. Bind the geometry to the skeleton. + + The position in which our model is encoded in its vertex array is called its + 'original position'. Initially, our model is in its original position, in model + space. For each vertex we animate, we need to transform it from its original + position, model space, to the bind position for the bone that's influencing it, + in bone local space. Note we do this for every bone that influences the vertex. + This is the purpose of the geometryBindTransform and the bindTransform for each bone: + + Model space, original position --> [bindTransform] --> Bone space, bind position + + 2. Animate the skeleton locally + + Once we have a vertex in the bind position, bone local space, it can follow the + animations of the skeleton. To animate, we multiply by the boneTransform. The + boneTransform (retrieved via skeleton->getTransform(i) for bone 'i'), transforms + from the bind position, bone local space to the animated position, bone local + space. + + Bone space, bind position --> [boneTransform] --> Bone space, animated position + + 3. Return to model space + + We have to return to the model space of the geometry with a final transform. These + transforms are concatenated together by VROSkinner::getModelTransform. + + Bone space, animated position --> [inverseBindTransform] --> Model space, animated position + + 4. Deform the mesh + + All the final bone transforms are then written to the vertex shader via the VROBoneUBO. + For each vertex of the geometry, we deform by all connected bone transforms. These + connections are determined by the _boneWeights and _boneIndices. The latter indexes + into the correct bone transform; the former determines how much influence said bone has + on the vertex. + */ +class VROSkinner { + +public: + + /* + The geometryBindTransform passed in here transforms from the geometry's + original encoded position, in model space, to the bind position in world space. + The boneSpaceTransforms move from the bind position in world space, to the bind + position in bone local space, for each bone. We use these two parameters to + construct the _bindTransforms and _inverseBindTransforms fields, then discard + them. + */ + VROSkinner(std::shared_ptr skeleton, + VROMatrix4f geometryBindTransform, + std::vector boneSpaceTransforms, + std::shared_ptr boneIndices, + std::shared_ptr boneWeights); + virtual ~VROSkinner() {} + + /* + Get the concatenated transform that will transform a vertex tied to the + given bone from its original (encoded) position in model space, to its animated + position in model space. + */ + VROMatrix4f getModelTransform(int boneIndex); + + std::shared_ptr getSkeleton() { + return _skeleton; + } + + const std::shared_ptr getBoneIndices() const { + return _boneIndices; + } + const std::shared_ptr getBoneWeights() const { + return _boneWeights; + } + +private: + + /* + The geometry being animated, with coordinates in model space. + */ + std::shared_ptr _geometry; + + /* + The skeleton that drives the animation. The skeleton is *also* in model space. + */ + std::shared_ptr _skeleton; + + /* + These transforms move vertices from from their original position in model space, + to the bind position in the local space of the bone at index 'i'. + + The purpose of these transforms is two-fold: + + 1. To place the geometry into the bind pose, the pose at which the geometry + aligns with the skeleton, and from which its vertices can therefore be animated + alongside the skeleton's bones. + + 2. To transform from model space into the coordinate system of a given bone. + This way we can animate vertices hierarchically: e.g. a finger vertex can + animate around the finger bone, then the elbow, then the shoulder, etc. See + VROBone.h and getModelTransform() for more details. + + Finally, note that the transform at _bindTransforms[i] is for the bone in + _skeleton.bones[i]. + + The inverse bindTransforms go the other direction, from bone local + space back to model space. + */ + std::vector _bindTransforms; + std::vector _inverseBindTransforms; + + /* + Vertex data that maps each vertex to the bones that influence its position + during skeletal animation. The indices map into the _skeleton's _bones array. + */ + std::shared_ptr _boneIndices; + + /* + Vertex data that for each vertex defines the weight each bone (mapped to + via _boneIndices) has in influencing the vertex. + */ + std::shared_ptr _boneWeights; + +}; + +#endif /* VROSkinner_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROSkybox.h b/mobile/ios/ViroKit.framework/Headers/VROSkybox.h new file mode 100644 index 0000000..7ac8bb2 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROSkybox.h @@ -0,0 +1,38 @@ +// +// VROSkybox.h +// ViroRenderer +// +// Created by Raj Advani on 1/11/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROSkybox_h +#define VROSkybox_h + +#include +#include +#include "VROGeometry.h" + +class VROTexture; +class VROVector4f; + +class VROSkybox : public VROGeometry { + +public: + + static std::shared_ptr createSkybox(std::shared_ptr textureCube); + static std::shared_ptr createSkybox(VROVector4f color); + virtual ~VROSkybox(); + +private: + + VROSkybox(std::vector> sources, + std::vector> elements) : + VROGeometry(sources, elements) + {} + + static std::shared_ptr buildSkyboxGeometry(); + +}; + +#endif /* VROSkybox_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROSortKey.h b/mobile/ios/ViroKit.framework/Headers/VROSortKey.h new file mode 100644 index 0000000..456a928 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROSortKey.h @@ -0,0 +1,109 @@ +// +// VROSortKey.hpp +// ViroRenderer +// +// Created by Raj Advani on 6/3/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROSortKey_hpp +#define VROSortKey_hpp + +#include +#include + +/* + Sort keys are used to quickly sort geometry elements into optimal batch rendering order, + to limit state changes on the GPU. They consist of a large byte[] that can be sorted + quickly via memcmp. + */ +class VROSortKey { + +public: + VROSortKey() { + + } + + bool operator< (const VROSortKey& r) const { + /* + The std::tie operation perform the sort for us, in order of increasing important. + We generally sort by rendering order and distance to camera, then by batch switching + concerns (shader, textures, light, material), and finally by tie-breakers (node, + element index). + + For hierarchies, note that the distance from camera for all objects in a hierarchy + is set to the distance from camera of the parent. This way distance from camera becomes + irrelevant within a hierarchy, so that within each hierarchy we can sort by hierarchy + depth only. Note we do not sort by hierarchy ID because it is ok to interleave objects + of different hierarchies within the render order. + */ + return std::tie(renderingOrder, distanceFromCamera, hierarchyDepth, incoming, shader, textures, lights, material, node, elementIndex) < + std::tie(r.renderingOrder, r.distanceFromCamera, r.hierarchyDepth, r.incoming, r.shader, r.textures, r.lights, r.material, r.node, r.elementIndex); + } + + /* + Manual rendering order setting is the highest sorting concern. + */ + uint32_t renderingOrder; + + /* + The depth of the node in its hierarchy. This is normally set + to zero. If any of the node's parents is set to hierarchical + rendering, then this is set to the node's depth in the hierarchy, + with 0 being the depth of the first hierarhical parent, 1 being + the depth after, etc. + + This ensures that when a hierarchial node is rendered, all + of its children will be rendered immediately after by order of + their depth. + */ + uint32_t hierarchyDepth; + + /* + The ID of the hierarchy this node resides in. When comparing two + nodes, we only include graph depth in the sort if the two nodes + are in the same hierarchy. 0 indicates we are not in a hierarchy. + */ + uint32_t hierarchyId; + + /* + Distance fom camera for objects is next (back to front). + This value is set to (zFar - distance from the camera). + + When sorted, this results in back to front rendering of + objects, ensuring correct rendering of translucent objects. + */ + float distanceFromCamera; + + /* + If a material is incoming (i.e. geometry transitioning in to + a new material as a result of an animation), we render it after + its outgoing counterpart. The incoming material renders + second (on top), as its alpha moves from 0 to 1. + */ + bool incoming; + + /* + State-change minimization concerns. + */ + uint32_t shader; + uint32_t textures; + uint32_t lights; + uint32_t material; + + //// 24 bytes to this point. Keep uintptr_t at an 8 byte boundary to avoid waste //// + + /* + Tie-breakers, double as pointers to the node and + index of the geometry element. + */ + uintptr_t node; + uint32_t elementIndex; + +}; + +// Uncomment to see a compiler error indicating the size of each VROSortKey +// template struct SortKeySize; +// SortKeySize sortKeySize; + +#endif /* VROSortKey_hpp */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROSound.h b/mobile/ios/ViroKit.framework/Headers/VROSound.h new file mode 100644 index 0000000..eee1bc5 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROSound.h @@ -0,0 +1,79 @@ +// +// VROSound.h +// ViroRenderer +// +// Created by Raj Advani on 3/23/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROSound_h +#define VROSound_h + +#include +#include +#include +#include "VROSoundDelegateInternal.h" +#include "VROQuaternion.h" +#include "VROModelIOUtil.h" + +enum class VROSoundType { + Normal, + Spatial, + SoundField, +}; + +enum class VROSoundRolloffModel { + Linear, + Logarithmic, + None, +}; + +class VROSound { + +public: + + VROSound() : _volume(1), _muted(false), _loop(false) {}; + virtual ~VROSound() {} + + virtual void play() = 0; + virtual void pause() = 0; + virtual void setVolume(float volume) = 0; + virtual void setMuted(bool muted) = 0; + virtual void setLoop(bool loop) = 0; + virtual void seekToTime(float seconds) = 0; + + virtual void setDelegate(std::shared_ptr delegate) { + _delegate = delegate; + } + + virtual VROSoundType getType() { + return _type; + } + + // Used by SoundField + virtual void setRotation(VROQuaternion rotation) = 0; + + // Used by SpatialSound + virtual void setPosition(VROVector3f position) = 0; + virtual VROVector3f getPosition() = 0; + virtual void setTransformedPosition(VROVector3f transformedPosition) = 0; + + // Used by SpatialSound + virtual void setDistanceRolloffModel(VROSoundRolloffModel model, float minDistance, + float maxDistance) = 0; + +protected: + std::shared_ptr _delegate; + float _volume; + bool _muted; + bool _loop; + VROSoundType _type; + VROQuaternion _rotation; + VROVector3f _position; + VROVector3f _transformedPosition; + VROSoundRolloffModel _rolloffModel; + float _rolloffMinDistance; + float _rolloffMaxDistance; +}; + +#endif /* VROSound_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROSoundData.h b/mobile/ios/ViroKit.framework/Headers/VROSoundData.h new file mode 100644 index 0000000..796cb8a --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROSoundData.h @@ -0,0 +1,32 @@ +// +// VROSoundData.h +// ViroRenderer +// +// Created by Andy Chu on 1/30/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROSoundData_h +#define VROSoundData_h + +#include +#include +#include "VROSoundDataDelegate.h" + +class VROSoundData { + +public: + + virtual ~VROSoundData() {} + + virtual std::string getLocalFilePath() = 0; + + virtual void setDelegate(std::weak_ptr delegate) { + _delegate = delegate; + } + +protected: + std::weak_ptr _delegate; +}; + +#endif /* VROSoundData_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROSoundDataDelegate.h b/mobile/ios/ViroKit.framework/Headers/VROSoundDataDelegate.h new file mode 100644 index 0000000..4de054b --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROSoundDataDelegate.h @@ -0,0 +1,27 @@ +// +// VROSoundDataDelegate.h +// ViroRenderer +// +// Created by Andy Chu on 1/30/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROSoundDataDelegate_h +#define VROSoundDataDelegate_h + +/** + * This is the delegate for the SoundObject + */ +class VROSoundDataDelegate { + +public: + + virtual ~VROSoundDataDelegate() {} + + virtual void dataIsReady() = 0; + virtual void dataError(std::string error) = 0; + +}; + + +#endif /* VROSoundDataDelegate_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROSoundDataGVR.h b/mobile/ios/ViroKit.framework/Headers/VROSoundDataGVR.h new file mode 100644 index 0000000..ee7768e --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROSoundDataGVR.h @@ -0,0 +1,51 @@ +// +// VROSoundDataGVR.h +// ViroRenderer +// +// Created by Andy Chu on 1/30/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROSoundDataGVR_h +#define VROSoundDataGVR_h + +#include +#include "VROSoundData.h" +#include "VROModelIOUtil.h" + +enum class VROSoundDataStatus { + NotLoaded, + Ready, + Error +}; + +class VROSoundDataGVR : public VROSoundData, public std::enable_shared_from_this { +public: + + static std::shared_ptr create(std::string resource, VROResourceType type); + VROSoundDataGVR(std::string resource, VROResourceType type); + virtual ~VROSoundDataGVR(); + + std::string getLocalFilePath(); + void setDelegate(std::weak_ptr delegate); + + void ready(std::string fileName, bool isTemp); + void error(std::string err); + +private: + std::string _resource; + VROResourceType _resourceType; + std::string _localPath; + VROSoundDataStatus _status; + std::string _error; + bool _deleteFileOnDestroy; + + void setup(std::string resource, VROResourceType resourceType); + void notifyDelegateOfStatus(); + void loadSoundFromURL(std::string path, + std::function onFinish, + std::function onError); + void loadSoundFromResource(std::string path, + std::function onFinish); +}; +#endif /* VROSoundDataGVR_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROSoundDelegate.h b/mobile/ios/ViroKit.framework/Headers/VROSoundDelegate.h new file mode 100644 index 0000000..88e1da0 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROSoundDelegate.h @@ -0,0 +1,20 @@ +// +// VROSoundDelegate.h +// ViroRenderer +// +// Created by Andy Chu on 1/27/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROSoundDelegate_h +#define VROSoundDelegate_h + +@protocol VROSoundDelegate + +- (void)soundIsReady; +- (void)soundDidFail:(NSString *)error; +- (void)soundDidFinish; + +@end + +#endif /* VROSoundDelegate_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROSoundDelegateInternal.h b/mobile/ios/ViroKit.framework/Headers/VROSoundDelegateInternal.h new file mode 100644 index 0000000..4f268e5 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROSoundDelegateInternal.h @@ -0,0 +1,29 @@ +// +// VROSoundDelegateInternal.h +// ViroRenderer +// +// Created by Andy Chu on 1/20/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROSoundDelegateInternal_h +#define VROSoundDelegateInternal_h + +class VROSoundDelegateInternal { + +public: + + VROSoundDelegateInternal() {} + virtual ~VROSoundDelegateInternal() {} + + // Sound load (of fail) callbacks + virtual void soundIsReady() = 0; + virtual void soundDidFail(std::string error) = 0; + + // Currently this is only called by the VROAudioPlayers which back the Normal VROSounds. If/when + // GVR supports notifying us that the sounds have finished, we can change this behavior (VIRO-758) + virtual void soundDidFinish() = 0; + +}; + +#endif /* VROSoundDelegateInternal_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROSoundDelegateiOS.h b/mobile/ios/ViroKit.framework/Headers/VROSoundDelegateiOS.h new file mode 100644 index 0000000..158a828 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROSoundDelegateiOS.h @@ -0,0 +1,40 @@ +// +// VROSoundDelegateiOS.h +// ViroRenderer +// +// Created by Andy Chu on 1/27/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROSoundDelegateiOS_h +#define VROSoundDelegateiOS_h + +#include "VROSoundDelegateInternal.h" +#include "VROSoundDelegate.h" + +class VROSoundDelegateiOS : public VROSoundDelegateInternal { + +public: + VROSoundDelegateiOS(id delegate) : + _delegate(delegate) + {} + virtual ~VROSoundDelegateiOS() {} + + void soundIsReady() { + [_delegate soundIsReady]; + } + + void soundDidFail(std::string error) { + [_delegate soundDidFail:[NSString stringWithUTF8String:error.c_str()]]; + } + + void soundDidFinish() { + [_delegate soundDidFinish]; + } +private: + __weak id _delegate; + +}; + + +#endif /* VROSoundDelegateiOS_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROSoundGVR.h b/mobile/ios/ViroKit.framework/Headers/VROSoundGVR.h new file mode 100644 index 0000000..54b9a01 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROSoundGVR.h @@ -0,0 +1,88 @@ +// +// VROSoundGVR.h +// ViroRenderer +// +// Created by Andy Chu on 1/26/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROSoundGVR_h +#define VROSoundGVR_h + +#include +#include +#include +#include "VROSound.h" +#include "VROSoundData.h" +#include "VROSoundDataDelegate.h" +#include "VROModelIOUtil.h" + +namespace gvr { + class AudioApi; +} + +class VROSoundGVR : public VROSound, public VROSoundDataDelegate, public std::enable_shared_from_this { + +public: + + /* + Note: we should use the static factory create methods rather than the constructors, because + they automatically call the init function (vs having to call it manually ourselves) + */ + static std::shared_ptr create(std::string resource, VROResourceType resourceType, + std::shared_ptr gvrAudio, + VROSoundType type); + static std::shared_ptr create(std::shared_ptr data, + std::shared_ptr gvrAudio, + VROSoundType type); + + VROSoundGVR(std::string resource, VROResourceType resourceType, std::shared_ptr gvrAudio, + VROSoundType type); + VROSoundGVR(std::shared_ptr data, std::shared_ptr gvrAudio, + VROSoundType type); + + virtual ~VROSoundGVR(); + + virtual void play(); + virtual void pause(); + virtual void setVolume(float volume); + virtual void setMuted(bool muted); + virtual void setLoop(bool loop); + virtual void seekToTime(float seconds); + virtual void setDelegate(std::shared_ptr delegate); + + // Used by SoundField + virtual void setRotation(VROQuaternion rotation); + + // Used by SpatialSound + virtual void setPosition(VROVector3f position); + virtual VROVector3f getPosition(); + virtual void setTransformedPosition(VROVector3f transformedPosition); + virtual void setDistanceRolloffModel(VROSoundRolloffModel model, float minDistance, float maxDistance); + + #pragma mark VROSoundDataDelegate Implementation + + void dataIsReady(); + void dataError(std::string error); + +private: + + /* + Private methods + */ + void setup(); + void setProperties(); + + /* + Private fields + */ + bool _ready = false; + bool _paused = false; + std::shared_ptr _data; + std::weak_ptr _gvrAudio; + + int32_t _audioId = -1; // (type is gvr::AudioSourceId) + int _gvrRolloffType; // type is gvr_audio_distance_rolloff_type +}; + +#endif /* VROSoundGVR_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROSphere.h b/mobile/ios/ViroKit.framework/Headers/VROSphere.h new file mode 100644 index 0000000..8cf23d0 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROSphere.h @@ -0,0 +1,43 @@ +// +// VROSphere.h +// ViroRenderer +// +// Created by Raj Advani on 1/20/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROSphere_h +#define VROSphere_h + +#include "VROGeometry.h" + +class VROSphere : public VROGeometry { + +public: + + static std::shared_ptr createSphere(float radius, int widthSegments, int heightSegments, + bool facesOutward); + VROSphere(float radius, int widthSegments = 20, int heightSegments = 20, bool facesOutward = true); + virtual ~VROSphere() {} + + void setRadius(float radius); + void setWidthSegments(int widthSegments); + void setHeightSegments(int heightSegments); + void setFacesOutward(bool facesOutward); + +private: + + float _radius; + int _widthSegments, _heightSegments; + bool _facesOutward; + + VROSphere(std::vector> sources, + std::vector> elements) : + VROGeometry(sources, elements) + {} + + void updateSphere(); + +}; + +#endif /* VROSphere_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROStringUtil.h b/mobile/ios/ViroKit.framework/Headers/VROStringUtil.h new file mode 100644 index 0000000..0babe53 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROStringUtil.h @@ -0,0 +1,53 @@ +// +// VROStringUtil.hpp +// ViroRenderer +// +// Created by Raj Advani on 11/7/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROStringUtil_h +#define VROStringUtil_h + +#include +#include +#include + +class VROStringUtil { + +public: + + static std::string toString(int i); + static std::string toString(double n, int precision); + static std::wstring toWString(int i); + static std::wstring toWString(double n, int precision); + + static int toInt(std::string s); + static float toFloat(std::string s); + + static std::vector split(const std::string &s, + const std::string &delimiters, + bool emptiesOk); + static std::vector split(const std::wstring &s, + const std::wstring &delimiters, + bool emptiesOk); + + // Simple string compare, not unicode safe (since there are multiple ways of representing some + // characters and this function does a character-by-character comparison. + static bool strcmpinsensitive(const std::string& a, const std::string& b); + + static void toLowerCase(std::string &str); + static bool startsWith(const std::string &candidate, const std::string &prefix); + static bool endsWith(const std::string& candidate, const std::string& ending); + + // Replace the first instance of the 'from' in 'str' with 'to'. The input is modified. + static bool replace(std::string &str, const std::string &from, const std::string &to); + + // Replace all instances of 'from' in 'str' with 'to'. The input is modified. + static void replaceAll(std::string &str, const std::string &from, const std::string &to); + +private: + +}; + +#endif /* VROStringUtil_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROSurface.h b/mobile/ios/ViroKit.framework/Headers/VROSurface.h new file mode 100644 index 0000000..d993f28 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROSurface.h @@ -0,0 +1,85 @@ +// +// VROSurface.h +// ViroRenderer +// +// Created by Raj Advani on 12/3/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VROSurface_h +#define VROSurface_h + +#include "VROGeometry.h" +#include "VROShapeUtils.h" +#include + +class VROSurface : public VROGeometry { + +public: + + static std::shared_ptr createSurface(float width, float height, + float u0 = 0, float v0 = 0, float u1 = 1, float v1 = 1); + static std::shared_ptr createSurface(float x, float y, float width, float height, + float u0, float v0, float u1, float v1); + virtual ~VROSurface(); + + /* + Set physical dimensions of the surface. + */ + void setX(float x); + void setY(float y); + void setWidth(float width); + void setHeight(float height); + + /* + Set texture coordinates of the surface, and an optional transform. + */ + void setU0(float u0); + void setU1(float u1); + void setV0(float v0); + void setV1(float v1); + void setTexcoordTransform(VROMatrix4f transform); + + /* + Directly set the texture coordinates of all four corners. + */ + void setTextureCoordinates(VROVector3f BL, VROVector3f BR, VROVector3f TL, VROVector3f TR); + + float getU0() const { return _u0; } + float getU1() const { return _u1; } + float getV0() const { return _v0; } + float getV1() const { return _v1; } + + float getX() const { return _x; } + float getY() const { return _y; } + float getWidth() const { return _width; } + float getHeight() const { return _height; } + +protected: + + VROSurface(float x, float y, float width, float height, + float u0, float v0, float u1, float v1); + +private: + + void updateSurface(); + + void buildGeometry(float x, float y, float width, float height, + VROVector3f texBL, VROVector3f texBR, VROVector3f texTL, VROVector3f texTR, + std::vector> &sources, + std::vector> &elements); + void buildSurface(VROShapeVertexLayout *vertexLayout, + float left, float bottom, float right, float top, + VROVector3f texBL, VROVector3f texBR, VROVector3f texTL, VROVector3f texTR); + + float _x, _y, _width, _height; + float _u0, _v0, _u1, _v1; + + /* + Transform by which to multiply all texture coordinates. + */ + VROMatrix4f _texcoordTransform; + +}; + +#endif /* VROSurface_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROText.h b/mobile/ios/ViroKit.framework/Headers/VROText.h new file mode 100644 index 0000000..7ec7362 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROText.h @@ -0,0 +1,251 @@ +// +// VROText.h +// ViroRenderer +// +// Created by Raj Advani on 11/24/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROText_h +#define VROText_h + +#include +#include +#include +#include +#include FT_FREETYPE_H + +#include "VROGeometry.h" +#include "VROShapeUtils.h" +#include "VROVector4f.h" + +class VROMaterial; +class VROTexture; +class VROGlyph; + +enum class VROTextHorizontalAlignment { + Left, + Right, + Center +}; + +enum class VROTextVerticalAlignment { + Top, + Bottom, + Center +}; + +enum class VROLineBreakMode { + WordWrap, + CharWrap, + Justify, + None +}; + +enum class VROTextClipMode { + ClipToBounds, + None +}; + +class VROTextLayout { + float width; + float height; + VROTextHorizontalAlignment horizontalAlignment; + VROTextVerticalAlignment verticalAlignment; +}; + +class VROTextLine { +public: + std::wstring line; + float spacingRatio; + + VROTextLine(std::wstring &line) : line(line), spacingRatio(1) {} + VROTextLine(std::wstring &line, float spacingRatio) : line(line), spacingRatio(spacingRatio) {} + virtual ~VROTextLine() {} +}; + +class VROText : public VROGeometry { + +public: + + /* + Create a text object for displaying the given string with the given typeface, + constrained to the bounds defined by the provided width and height, and aligned + according to the given alignment parameters and linebreak mode. + + The clip mode determines whether the text is clipped to the given bounds. + + The maxLines parameter, if set, caps the number of lines; when zero, there is no + limit to the number of lines generated. + */ + static std::shared_ptr createText(std::wstring text, std::shared_ptr typeface, VROVector4f color, + float width, float height, + VROTextHorizontalAlignment horizontalAlignment, VROTextVerticalAlignment verticalAlignment, + VROLineBreakMode lineBreakMode, VROTextClipMode clipMode, int maxLines = 0); + + /* + Helper method to create a single-line text in a horizontal box of the given width. + The box is centered at the parent node's position, and the text is aligned within the + box according to the given alignment. + */ + static std::shared_ptr createSingleLineText(std::wstring text, std::shared_ptr typeface, VROVector4f color, + float width, VROTextHorizontalAlignment alignment, VROTextClipMode clipMode); + + /* + Helper method to create a centered single-line text. The text will be centered (vertically + and horizontally) about the parent node's position. + */ + static std::shared_ptr createSingleLineText(std::wstring text, std::shared_ptr typeface, VROVector4f color); + + /* + Return the width and height of a text object displaying the given string, with the + given typeface. + */ + static VROVector3f getTextSize(std::wstring text, std::shared_ptr typeface, + float maxWidth, float maxHeight, VROLineBreakMode lineBreakMode, + VROTextClipMode clipMode, int maxLines = 0); + + /* + Standard constructor. Update() must be invoked from the rendering thread if this constructor + is used. + */ + VROText(std::wstring text, std::shared_ptr typeface, VROVector4f color, + float width, float height, + VROTextHorizontalAlignment horizontalAlignment, VROTextVerticalAlignment verticalAlignment, + VROLineBreakMode lineBreakMode, VROTextClipMode clipMode, int maxLines); + virtual ~VROText(); + + /* + Initialize the VROText if any fields have changed. This must be invoked on the rendering + thread because it creates glyphs. + */ + void update(); + + /* + Get the width and height of the text. This is not the width and height of the + bounds used when the text was created, but the width and height of the actual + text. + */ + float getRealizedWidth() const { + return _realizedWidth; + } + float getRealizedHeight() const { + return _realizedHeight; + } + + void setText(std::wstring text); + void setTypeface(std::shared_ptr typeface); + void setColor(VROVector4f color); + void setWidth(float width); + void setHeight(float height); + void setHorizontalAlignment(VROTextHorizontalAlignment horizontalAlignment); + void setVerticalAlignment(VROTextVerticalAlignment verticalAlignment); + void setLineBreakMode(VROLineBreakMode lineBreakMode); + void setClipMode(VROTextClipMode clipMode); + void setMaxLines(int maxLines); + +private: + + std::wstring _text; + std::shared_ptr _typeface; + VROVector4f _color; + float _width, _height; + VROTextHorizontalAlignment _horizontalAlignment; + VROTextVerticalAlignment _verticalAlignment; + VROLineBreakMode _lineBreakMode; + VROTextClipMode _clipMode; + int _maxLines; + + std::atomic _realizedWidth, _realizedHeight; + + VROText(std::vector> sources, + std::vector> elements, + float width, float height) : + VROGeometry(sources, elements), + _width(width), + _height(height) + {} + + static void buildText(std::wstring &text, + std::shared_ptr &typeface, + VROVector4f color, + float width, + float height, + VROTextHorizontalAlignment horizontalAlignment, + VROTextVerticalAlignment verticalAlignment, + VROLineBreakMode lineBreakMode, + VROTextClipMode clipMode, + int maxLines, + std::vector> &sources, + std::vector> &elements, + std::vector> &materials, + float *outRealizedWidth, float *outRealizedHeight); + + /* + Build a standard Viro geometry from the given vertex array and material/indices + pairs. + */ + static void buildGeometry(std::vector &var, + std::map, std::vector>> &materialMap, + std::vector> &sources, + std::vector> &elements, + std::vector> &materials); + + /* + Write the geometry for the given glyph (at the given position) into the + provided vertex array, and write the associated indices into the indices + array as well. + */ + static void buildChar(std::shared_ptr &glyph, + float x, float y, + std::vector &var, + std::vector &indices); + + /* + Simple methods for processing the line-break mode. All of the methods below use a + 'greedy' algorithm, filling as much space in the current line as possible then moving + to the next line. These methods also introduce a newline on hard breaks (i.e. whenever + the '\n' character is encountered). In particular, the wrapByNewlines function *only* + processes hard breaks; the rest process both hard and soft. + + These functions also handle clipping. When char/word wrapping is on, we only have to + clip text vertically (horizontal edges are implicitly taken care of by the wrapping + function). When char/word wrapping is off, we also have to clip text horizontally. + */ + static std::vector wrapByWords(std::wstring &text, float maxWidth, float maxHeight, int maxLines, + std::shared_ptr &typeface, + VROTextClipMode clipMode, + std::map> &glyphMap); + static std::vector wrapByChars(std::wstring &text, float maxWidth, float maxHeight, int maxLines, + std::shared_ptr &typeface, + VROTextClipMode clipMode, + std::map> &glyphMap); + static std::vector wrapByNewlines(std::wstring &text, float maxWidth, float maxHeight, int maxLines, + std::shared_ptr &typeface, + VROTextClipMode clipMode, + std::map> &glyphMap); + + /* + Justification routine. Considerably more complex than the greedy algorithms above. Note that + justification is a word-wrapping technique that reduces the 'raggedness' of the text edges; + it can be used with left, right, and centered horizontal alignment. To achieve traditional + justified text as seen in newspapers, use it with VROTextHorizontalAlignment::Left. + */ + static std::vector justify(std::wstring &text, float maxWidth, float maxHeight, int maxLines, + std::shared_ptr &typeface, + VROTextClipMode clipMode, + std::map> &glyphMap); + + /* + Helpers for wrapping/clipping. + */ + static std::vector divideIntoParagraphs(std::wstring &text); + static float getLengthOfWord(const std::wstring &word, std::map> &glyphMap); + + static bool isAnotherLineAvailable(size_t numLinesNow, float maxHeight, int maxLines, + std::shared_ptr &typeface, VROTextClipMode clipMode); + + +}; + +#endif /* VROText_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROTexture.h b/mobile/ios/ViroKit.framework/Headers/VROTexture.h new file mode 100644 index 0000000..a013e06 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROTexture.h @@ -0,0 +1,312 @@ +// +// VROTexture.h +// ViroRenderer +// +// Created by Raj Advani on 11/17/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VROTexture_h +#define VROTexture_h + +#include +#include +#include "VRODefines.h" + +// Constants for ETC2 ripped from NDKr9 headers +#define GL_COMPRESSED_RGB8_ETC2 0x9274 +#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 + +class VROTextureSubstrate; +class VRODriver; +class VROImage; +class VROData; +class VROFrameScheduler; + +enum class VROTextureType { + None = 1, + Texture2D = 2, + TextureCube = 4, + TextureEGLImage = 8 +}; + +// Texture formats for source data +enum class VROTextureFormat { + ETC2_RGBA8_EAC, + ASTC_4x4_LDR, + RGBA8, + RGB565, + RGB8, + RGB9_E5, +}; + +// Texture formats for storage on the GPU +// (e.g. we can load an RGBA8 texture and store it as RGBA4 to +// preserve GPU memory) +enum class VROTextureInternalFormat { + RGBA8, + RGBA4, + RGB565, + YCBCR, + RGB9_E5, +}; + +enum class VROMipmapMode { + None, // Do not use mipmaps + Pregenerated, // Mipmaps are baked into the texture data + Runtime, // Build mipmaps at texture loading time +}; + +enum class VROStereoMode { + None = 1, // No stereo is applied, image is fully represented in the texture. + LeftRight = 2, // Side by side stereoscopic image, with the left image shown to the left eye. + RightLeft = 3, // Side by side stereoscopic image, with the right image shown to the left eye. + TopBottom = 4, // Over/Under stereoscopic image, with the top image shown to the left eye. + BottomTop = 5 // Over/Under stereoscopic image, with the bottom image shown to the left eye. +}; + +enum class VROWrapMode { + Clamp, + Repeat, + ClampToBorder, + Mirror +}; + +enum class VROFilterMode { + None, + Nearest, + Linear +}; + +class VROTexture : public std::enable_shared_from_this { + +public: + + /* + Create a new VROTexture with no underlying image data. + The image data must be injected via setSubstrate(). This is + the preferred constructor for multi-substrate textures + (e.g. YCbCr). + */ + VROTexture(VROTextureType type, + VROTextureInternalFormat internalFormat, + VROStereoMode stereoMode = VROStereoMode::None); + + /* + Create a new VROTexture with the given underlying substrate. + */ + VROTexture(VROTextureType type, + std::unique_ptr substrate, + VROStereoMode stereoMode = VROStereoMode::None); + + /* + Create a new VROTexture from a VROImage. + */ + VROTexture(VROTextureInternalFormat internalFormat, bool sRGB, + VROMipmapMode mipmapMode, + std::shared_ptr image, + VROStereoMode stereoMode = VROStereoMode::None); + + VROTexture(VROTextureInternalFormat internalFormat, bool sRGB, + std::vector> &images, + VROStereoMode stereoMode = VROStereoMode::None); + + /* + Create a new VROTexture from the given raw data in the given format. + The format parameter defines the input format of the data, and + internal format specifies how to store the texture in GPU memory. + Set sRGB to true if the texture is in sRGB color space (gamma 2.2), and + should be gamma-uncorrected into linear RGB space when sampled, for better + accuracy during shader computations. This should *only* be used if gamma + correction is enabled on the framebuffer or shader (to convert + from linear back to gamma 2.2 space when writing to the framebuffer). + */ + VROTexture(VROTextureType type, + VROTextureFormat format, + VROTextureInternalFormat internalFormat, bool sRGB, + VROMipmapMode mipmapMode, + std::vector> &data, + int width, int height, + std::vector mipSizes, + VROStereoMode stereoMode = VROStereoMode::None); + + virtual ~VROTexture(); + + /* + Delete any rendering resources. Invoked prior to destruction, on the + rendering thread. + */ + virtual void deleteGL() {} + + VROTextureType getType() const { + return _type; + } + uint32_t getTextureId() const { + return _textureId; + } + + /* + Get the texture ready for usage now, in advance of when it's visible. If not invoked, + the texture will be initialized when it is made visible. + */ + void prewarm(std::shared_ptr driver); + + /* + Get the substrates for this texture, loading them if necessary. If a scheduler is provided, + then the substrates will be loaded asynchronously via the scheduler; otherwise, the + substrates will be loaded immediately in a blocking fashion. + */ + int getNumSubstrates() const; + VROTextureSubstrate *getSubstrate(int index, std::shared_ptr &driver, VROFrameScheduler *scheduler); + + /* + Textures may have their substrates set externally if they are created and + managed elsewhere. + */ + void setSubstrate(int index, std::unique_ptr substrate); + + VROTextureInternalFormat getInternalFormat() const { + return _internalFormat; + } + VROStereoMode getStereoMode() const { + return _stereoMode; + } + + /* + True if this texture has an alpha channel. + */ + bool hasAlpha() const; + + /* + Access and set wrap properties. + */ + VROWrapMode getWrapS() const { + return _wrapS; + } + void setWrapS(VROWrapMode wrapMode) { + _wrapS = wrapMode; + } + VROWrapMode getWrapT() const { + return _wrapT; + } + void setWrapT(VROWrapMode wrapMode) { + _wrapT = wrapMode; + } + + /* + Access and set filtering properties. + */ + VROFilterMode getMinificationFilter() const { + return _minificationFilter; + } + void setMinificationFilter(VROFilterMode filter) { + _minificationFilter = filter; + } + VROFilterMode getMagnificationFilter() const { + return _magnificationFilter; + } + void setMagnificationFilter(VROFilterMode filter) { + _magnificationFilter = filter; + } + VROFilterMode getMipFilter() const { + return _mipFilter; + } + void setMipFilter(VROFilterMode filter) { + _mipFilter = filter; + } + + /* + Width and height (available for any 2D texture created through an image). + */ + int getWidth() const { + return _width; + } + int getHeight() const { + return _height; + } + +private: + + uint32_t _textureId; + const VROTextureType _type; + + /* + The image is retained until the texture is hydrated, after which the + substrate is populated. + + Vector of images is used for cube textures. + */ + std::vector> _images; + + /* + If the underlying texture is compressed, its raw data is retined until the + substrate is populated. Cube textures contain six faces, all other + textures will only have one element in this vector. + */ + std::vector> _data; + + /* + The format of the source data (_data). + */ + VROTextureFormat _format; + + /* + The format in which we want to store the data on the GPU. + (defaults to RGBA8, and is ignored if we're using a compressed + source data format: compressed textures are always stored in their + source format). + */ + VROTextureInternalFormat _internalFormat; + int _width, _height; + + /* + The mipmap generation mode for this texture. Determines if mipmaps + are loaded from the source data (pregenerated), generated at runtime, + or not used at all. The _mipSizes vector indicates the compessed size + of each mip-level in the source data, if _mipmapMode = Pregenerated. + */ + VROMipmapMode _mipmapMode; + std::vector _mipSizes; + + /* + Representation of the texture in the underlying hardware. Textures typically + have one substrate, but some textures (e.g. YCbCr) may have multiple planes, + each represented by a separate substrate. + */ + std::vector> _substrates; + + /* + True if the underlying substrate should gamma-uncorrect the texture data + into linear space when sampled. Typically only diffuse texture are stored + in sRGB formats and therefore need gamma-uncorrection. + */ + bool _sRGB; + + /* + Represents the stereo property of the image, if any. + */ + VROStereoMode _stereoMode; + + /* + Wrap and filtering properties. + */ + VROWrapMode _wrapS, _wrapT; + VROFilterMode _minificationFilter, _magnificationFilter, _mipFilter; + + /* + Converts the image(s) into a substrate. May be asynchronously executed. + */ + void hydrate(std::shared_ptr &driver); + + /* + Set the number of substrates to be used by this texture. + */ + void setNumSubstrates(int numSubstrates); + + /* + Get the number of substrates used by the given texture format. + */ + int getNumSubstratesForFormat(VROTextureInternalFormat format) const; +}; + +#endif /* VROTexture_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROTextureUtil.h b/mobile/ios/ViroKit.framework/Headers/VROTextureUtil.h new file mode 100644 index 0000000..3d49800 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROTextureUtil.h @@ -0,0 +1,61 @@ +// +// VROTextureUtil.h +// ViroRenderer +// +// Created by Raj Advani on 3/21/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROTextureUtil_h +#define VROTextureUtil_h + +#include +#include +#include "VROStringUtil.h" +#include "VROTexture.h" + +class VRODriver; +class VROData; +enum class VROTextureFormat; +enum class VROTextureType; + +class VROTextureUtil { + +public: + + /* + Read a texture file with an ASTC header. Read the width and height from the header then + strip it out and return the raw texture data. + */ + static std::shared_ptr readASTCHeader(const uint8_t *data, int length, VROTextureFormat *outFormat, + int *outWidth, int *outHeight); + + /* + Read a texture file with a PKM header. Read the width and height from the header then + strip it out and return the raw texture data, with successive mipmap levels concatenated + contiguously together. + + The size of each mipmap level is returned in the outMipmaps vector. + */ + static std::shared_ptr readKTXHeader(const uint8_t *data, uint32_t length, VROTextureFormat *outFormat, + int *outWidth, int *outHeight, std::vector *outMipSizes); + + /* + Read a texture file with a VHD header. Read the width and height from the header then + strip it out and return the raw texture data, with successive mipmap levels concatenated + contiguously together. + + The size of each mipmap level is returned in the outMipmaps vector. + */ + static std::shared_ptr readVHDHeader(const std::string &data, VROTextureFormat *outFormat, + int *outWidth, int *outHeight, std::vector *outMipSizes); + + /** + Returns the stereo mode that corresponds to the given string. + If none is found VROStereoMode::None will be returned. + */ + static VROStereoMode getStereoModeForString(std::string tag); + +}; + +#endif /* VROTextureUtil_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROThreadRestricted.h b/mobile/ios/ViroKit.framework/Headers/VROThreadRestricted.h new file mode 100644 index 0000000..bf4e878 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROThreadRestricted.h @@ -0,0 +1,76 @@ +// +// VROThreadRestricted.h +// ViroRenderer +// +// Created by Raj Advani on 3/30/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROThreadRestricted_h +#define VROThreadRestricted_h + +#include +#include +#include + +// Utility for printing out an ID for the given pthread +std::string print_thread_id(pthread_t id); + +enum class VROThreadName { + Undefined, + Renderer +}; + +/* + Subclasses of VROThreadRestricted may only be accessed from a single thread, + identified by its VROThreadName. + + The passert_thread() method is provided to assert we're on the thread to which + we're restricted. + */ +class VROThreadRestricted { + +public: + + /* + Associate the current thread with the given VROThreadName. + */ + static void setThread(VROThreadName name); + static void unsetThread(); + static bool isThread(VROThreadName name); + + /* + Restrict this object to the thread with the given name. The name must have been set + to a thread via setThread(VROThreadName, pthread_t). + */ + VROThreadRestricted(VROThreadName name); + virtual ~VROThreadRestricted(); + + /* + Assert we are on the correct thread. If not, abort. + */ + void passert_thread(); + + /* + Temporarily enable or disable thread checking. When false, passert_thread() is a no-op. + */ + void setThreadRestrictionEnabled(bool enabled) { + _enabled = enabled; + } + +private: + + /* + The name of the thread this object is restricted to. + */ + VROThreadName _restricted_thread_name; + + /* + True if thread restriction checking is enabled for this object. + When false, passert_thread is a no-op. + */ + bool _enabled; + +}; + +#endif /* VROThreadRestricted_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROTime.h b/mobile/ios/ViroKit.framework/Headers/VROTime.h new file mode 100644 index 0000000..4309ffe --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROTime.h @@ -0,0 +1,29 @@ +// +// VROTime.h +// ViroRenderer +// +// Created by Raj Advani on 10/21/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VROTIME_H_ +#define VROTIME_H_ + +#include +#include +#include + +/* + Get the current time in seconds or milliseconds. + */ +double VROTimeCurrentSeconds(); +double VROTimeCurrentMillis(); + +/* + Get the current calendar time (seconds since 1970). + */ +uint64_t VROTimeGetCalendarTime(); + +uint64_t VRONanoTime(); + +#endif /* VROTIME_H_ */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROTimingFunction.h b/mobile/ios/ViroKit.framework/Headers/VROTimingFunction.h new file mode 100644 index 0000000..1b962df --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROTimingFunction.h @@ -0,0 +1,36 @@ +// +// VROTimingFunction.h +// ViroRenderer +// +// Created by Raj Advani on 10/22/15. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROTIMINGFUNCTION_H_ +#define VROTIMINGFUNCTION_H_ + +#include + +enum class VROTimingFunctionType { + Linear, + EaseIn, + EaseOut, + EaseInEaseOut, + Bounce, + PowerDecel +}; + +class VROTimingFunction { + +public: + + static std::unique_ptr forType(VROTimingFunctionType type); + + VROTimingFunction() {} + virtual ~VROTimingFunction() {} + + virtual float getT(float t) = 0; + +}; + +#endif /* VROTIMINGFUNCTION_H_ */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROTimingFunctionBounce.h b/mobile/ios/ViroKit.framework/Headers/VROTimingFunctionBounce.h new file mode 100644 index 0000000..c7b4913 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROTimingFunctionBounce.h @@ -0,0 +1,33 @@ +// +// VROTimingFunctionBounce.h +// ViroRenderer +// +// Created by Raj Advani on 10/22/15. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROBOUNCETIMINGFUNCTION_H_ +#define VROBOUNCETIMINGFUNCTION_H_ + +#include "VROTimingFunction.h" + +class VROTimingFunctionBounce : public VROTimingFunction { +public: + + VROTimingFunctionBounce() {} + virtual ~VROTimingFunctionBounce() {} + + float getT(float t) { + if (t < 0.5) { + return (float) (t / 0.45); + } + else if (t < 0.67) { + return (float) ((0.5 / 0.45) - ((t - 0.5) / .85)); + } + else { + return (float) ((0.5 / 0.45) - ((0.67 - 0.5) / .85) + (t - 0.67) / 3.3); + } + } +}; + +#endif /* VROBOUNCETIMINGFUNCTION_H_ */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROTimingFunctionCubicBezier.h b/mobile/ios/ViroKit.framework/Headers/VROTimingFunctionCubicBezier.h new file mode 100644 index 0000000..3f9f19d --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROTimingFunctionCubicBezier.h @@ -0,0 +1,58 @@ +// +// VROTimingFunctionCubicBezier.h +// ViroRenderer +// +// Created by Raj Advani on 10/22/15. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef __VROTunedCubicBezierTimingFunction__ +#define __VROTunedCubicBezierTimingFunction__ + +#include "VROTimingFunction.h" +#include + +static const int kTunedBezierLookupSteps = 3000; + +class VROTimingFunctionCubicBezier : public VROTimingFunction { + +public: + + VROTimingFunctionCubicBezier(float x1, float y1, float x2, float y2) { + for (int i = 0; i < kTunedBezierLookupSteps; i++) { + float t = (float) i / (float) (kTunedBezierLookupSteps - 1); + float t_inv = 1-t; + float tsq = t*t; + float t_invsq = t_inv *t_inv; + float a = 3 * t_invsq * t; + float b = 3 * tsq * t_inv; + float c = tsq * t; + + xLookup[i] = x1 * a + x2 * b + c; + yLookup[i] = y1 * a + y2 * b + c; + } + } + + float getT(float t) { + float *begin = &xLookup[0]; + float *end = &xLookup[kTunedBezierLookupSteps]; + + int index = std::binary_search(begin, end, t); + if (index < 0) { + index = 0 - (index + 1); + } + + index = std::max(std::min(index, kTunedBezierLookupSteps - 1), 0); + return yLookup[index]; + } + + virtual ~VROTimingFunctionCubicBezier() {} + +private: + + float xLookup[kTunedBezierLookupSteps]; + float yLookup[kTunedBezierLookupSteps]; + +}; + +#endif /* defined(VROTunedCubicBezierTimingFunction__) */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROTimingFunctionEaseIn.h b/mobile/ios/ViroKit.framework/Headers/VROTimingFunctionEaseIn.h new file mode 100644 index 0000000..ccdfa45 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROTimingFunctionEaseIn.h @@ -0,0 +1,33 @@ +// +// VROTimingFunctionEaseIn.h +// ViroRenderer +// +// Created by Raj Advani on 1/14/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROTimingFunctionEaseIn_h +#define VROTimingFunctionEaseIn_h + +#include "VROTimingFunction.h" +#include + +class VROTimingFunctionEaseIn : public VROTimingFunction { + +public: + + VROTimingFunctionEaseIn() {} + virtual ~VROTimingFunctionEaseIn() {} + + float getT(float t) { + if (t <= 0.5f){ + return 2.0f * t * t; + } + else { + return t; + } + } + +}; + +#endif /* VROTimingFunctionEaseIn_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROTimingFunctionEaseInEaseOut.h b/mobile/ios/ViroKit.framework/Headers/VROTimingFunctionEaseInEaseOut.h new file mode 100644 index 0000000..da3cf10 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROTimingFunctionEaseInEaseOut.h @@ -0,0 +1,34 @@ +// +// VROTimingFunctionEaseInEaseOut.h +// ViroRenderer +// +// Created by Raj Advani on 10/22/15. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef __VROEaseInEaseOutTimingFunction__ +#define __VROEaseInEaseOutTimingFunction__ + +#include "VROTimingFunction.h" +#include + +class VROTimingFunctionEaseInEaseOut : public VROTimingFunction { + +public: + + VROTimingFunctionEaseInEaseOut() {} + virtual ~VROTimingFunctionEaseInEaseOut() {} + + float getT(float t) { + if (t <= 0.5f){ + return 2.0f * t * t; + } + else { + t -= 0.5f; + return 2.0f * t * (1.0f - t) + 0.5; + } + } + +}; + +#endif /* defined(__VROEaseInEaseOutTimingFunction__) */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROTimingFunctionEaseOut.h b/mobile/ios/ViroKit.framework/Headers/VROTimingFunctionEaseOut.h new file mode 100644 index 0000000..ed9ad93 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROTimingFunctionEaseOut.h @@ -0,0 +1,33 @@ +// +// VROTimingFunctionEaseOut.h +// ViroRenderer +// +// Created by Raj Advani on 10/22/15. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef __VROEaseOutTimingFunction__ +#define __VROEaseOutTimingFunction__ + +#include "VROTimingFunction.h" + +class VROTimingFunctionEaseOut : public VROTimingFunction { + +public: + + VROTimingFunctionEaseOut() {} + virtual ~VROTimingFunctionEaseOut() {} + + float getT(float t) { + if (t <= 0.5f){ + return t; + } + else { + t -= 0.5f; + return 2.0f * t * (1.0f - t) + 0.5; + } + } + +}; + +#endif /* defined(__VROEaseOutTimingFunction__) */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROTimingFunctionLinear.h b/mobile/ios/ViroKit.framework/Headers/VROTimingFunctionLinear.h new file mode 100644 index 0000000..2d120cb --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROTimingFunctionLinear.h @@ -0,0 +1,25 @@ +// +// VROTimingFunctionLinear.h +// ViroRenderer +// +// Created by Raj Advani on 10/22/15. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROLINEARTIMINGFUNCTION_H_ +#define VROLINEARTIMINGFUNCTION_H_ + +#include "VROTimingFunction.h" + +class VROTimingFunctionLinear : public VROTimingFunction { +public: + + VROTimingFunctionLinear() {} + virtual ~VROTimingFunctionLinear() {} + + float getT(float t) { + return t; + } +}; + +#endif /* VROLINEARTIMINGFUNCTION_H_ */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROTimingFunctionPowerDeceleration.h b/mobile/ios/ViroKit.framework/Headers/VROTimingFunctionPowerDeceleration.h new file mode 100644 index 0000000..64294a0 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROTimingFunctionPowerDeceleration.h @@ -0,0 +1,49 @@ +// +// VROTimingFunctionPowerDeceleration.h +// ViroRenderer +// +// Created by Raj Advani on 10/22/15. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef __VROPowerDecelerationTimingFunction__ +#define __VROPowerDecelerationTimingFunction__ + +#include "VROTimingFunction.h" +#include "VROLog.h" + +/* + The graph goes from (0,0) smoothly to (1,1). + The slope of x=1 is 0, meaning it smoothly comes to a stop. + The slope of x=0 is the first derivative of y=x^e for x=1 + (since this function is y=x^e flipped both horizontally and + vertically, such that the (0,0) point is the (1,1) point of + y=x^e), which is y'(1)=e, the exponent itself! + + E.g. + For y=x^2, the slope at x=1 is 2. + For y=x^3, the slope at x=1 is 3. + etc. + + 12: quicker slowdown, stop is more graceful. + Note that this is also the slope of the "entry" point at (0,0). + */ +static const double kPowerFunctionDecelerationExponent = 2.0; + +class VROTimingFunctionPowerDeceleration : public VROTimingFunction { + +public: + + VROTimingFunctionPowerDeceleration() {} + virtual ~VROTimingFunctionPowerDeceleration() {} + + float getT(float t) { + passert (t >= 0 && t <= 1); + return (float) (1 - pow(1 - t, kPowerFunctionDecelerationExponent)); + } + +}; + +#endif /* defined(__VROPowerDecelerationTimingFunction__) */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROTorusKnot.h b/mobile/ios/ViroKit.framework/Headers/VROTorusKnot.h new file mode 100644 index 0000000..d5c488f --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROTorusKnot.h @@ -0,0 +1,34 @@ +// +// VROTorusKnot.hpp +// ViroRenderer +// +// Created by Raj Advani on 1/11/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROTorusKnot_h +#define VROTorusKnot_h + +#include "VROGeometry.h" +#include +#include + +class VROTorusKnot : public VROGeometry { + +public: + + static std::shared_ptr createTorusKnot(float p, float q, float tubeRadius, + int segments, int slices); + virtual ~VROTorusKnot(); + +private: + + VROTorusKnot(std::vector> sources, + std::vector> elements) : + VROGeometry(sources, elements) + {} + +}; + + +#endif /* VROTorusKnot_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROTransaction.h b/mobile/ios/ViroKit.framework/Headers/VROTransaction.h new file mode 100644 index 0000000..b77351e --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROTransaction.h @@ -0,0 +1,173 @@ +// +// VROTransaction.h +// ViroRenderer +// +// Created by Raj Advani on 10/22/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VROTransaction_h +#define VROTransaction_h + +#include +#include +#include +#include +#include "VROAnimation.h" +#include "VROTimingFunction.h" + +class VROTransaction { + +public: + +#pragma mark - Static Animation API + + /* + Retrieve the active (most deeply nested) uncommitted VROTransaction. Returns + nullptr if there is no active VROTransaction. + */ + static std::shared_ptr get(); + + /* + Return true if there exists an uncommitted VROTransaction with duration greater + than zero. If false, then animations are considered disabled. + */ + static bool isActive(); + + /* + Update the T values for all committed animation transactions. + */ + static void update(); + + /* + Begin a new VROTransaction on this thread, and make this the active animation + transaction. + */ + static void begin(); + + /* + Adds the given transaction to the openTransactions stack. Internal use only by the Java API. + Enables creating a new transaction off the rendering thread, before adding it to the animation + stack on the rendering thread. + */ + static void add(std::shared_ptr transaction); + + /* + Pauses a VROTransaction if it hasn't yet been paused. + */ + static void pause(std::shared_ptr transaction); + + /* + Resumes a paused a VROTransaction. The animation will continue to + play from where it had left off. + */ + static void resume(std::shared_ptr transaction); + + /* + Cancels a VROTransaction at the current T value. Cancelled transactions + can no longer be paused or resumed. + + Note: this is currently only used internally and currently isn't hooked + up to animations at all (it won't cancel animations, call callbacks, etc). + + TODO: VIRO-1464 Add ability to cancel (vs terminate) animations + */ + static void cancel(std::shared_ptr transaction); + + /* + Terminates a VROTransaction. Terminated transactions can no longer + be paused or resumed. + */ + static void terminate(std::shared_ptr transaction, bool jumpToEnd); + + /* + Commit the active VROTransaction. + */ + static std::shared_ptr commit(); + + /* + Set the animation duration for the active animation transaction, in seconds. + */ + static void setAnimationDuration(float durationSeconds); + static float getAnimationDuration(); + + /* + Set the time in seconds that we wait before the animation starts (after + the animation is committed). + */ + static void setAnimationDelay(float delaySeconds); + + /* + Set to true to make this transaction automatically loop to the beginning on finish. + In effect - reset _time to beginning of animation onFinish if _loop is set. + */ + static void setAnimationLoop(bool loop); + + /* + Set a callback to invoke when the active transaction completes (after duration + seconds). + */ + static void setFinishCallback(std::function finishCallback); + + /* + Set a timing function, which defines the curve of the animation (ease in, ease out, + etc.) + */ + static void setTimingFunction(VROTimingFunctionType timingFunctionType); + static void setTimingFunction(std::unique_ptr timingFunction); + +#pragma mark - VROTransaction + + VROTransaction(); + ~VROTransaction() {} + + /* + Get the T value (between 0 and 1) representing current progress through this + animation. + */ + double getT() { + return _t; + } + + /* + Return true if this animation has a duration of 0. + */ + bool isDegenerate() { + return _durationSeconds <= 0; + } + + /* + Add a new animation to this transaction. + */ + void addAnimation(std::shared_ptr animation) { + _animations.push_back(animation); + } + + /* + Process another frame of all animations in this transaction. The + t value here is prior to timing function transformation. + */ + void processAnimations(float t); + + /* + Invoked when the transaction is finished. + */ + void onTermination(); + +private: + + double _t; + double _durationSeconds; + double _startTimeSeconds; + double _delayTimeSeconds; + double _processedTimeWhenPaused; + bool _paused; + bool _loop; + std::unique_ptr _timingFunction; + + std::function _finishCallback; + std::vector> _animations; + +}; + +#endif /* VROTransaction_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROTransformConstraint.h b/mobile/ios/ViroKit.framework/Headers/VROTransformConstraint.h new file mode 100644 index 0000000..dbc2d09 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROTransformConstraint.h @@ -0,0 +1,31 @@ +// +// VROTransformConstraint.h +// ViroRenderer +// +// Created by Raj Advani on 3/9/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROTransformConstraint_h +#define VROTransformConstraint_h + +#include "VROConstraint.h" +#include + +class VROTransformConstraint : public VROConstraint { + +public: + + VROTransformConstraint(std::function function) : + _function(function) + {} + + VROMatrix4f getTransform(const VRONode &node, VROMatrix4f transform); + +private: + + std::function _function; + +}; + +#endif /* VROTransformConstraint_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROTransformDelegate.h b/mobile/ios/ViroKit.framework/Headers/VROTransformDelegate.h new file mode 100644 index 0000000..7efd589 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROTransformDelegate.h @@ -0,0 +1,52 @@ +// +// VROTransformDelegate +// ViroRenderer +// +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROTransformDelegate_h +#define VROTransformDelegate_h + +#include +#include +#include "VROVector3f.h" +#include "VROTime.h" + +/* + Delegate that is attached to a node for notifying the bridge regarding transformation updates. + */ +class VROTransformDelegate { +public: + VROTransformDelegate(double distanceFilter) { + _distanceFilter = distanceFilter; + } + virtual ~VROTransformDelegate() {} + virtual void onPositionUpdate(VROVector3f position)=0; + + /* + Called from a native vroNode that this delegate is attached to and in turn notifies the bridge + whenever a animation transaction occurs. Filtering is also performed to reduce the number of + calls across the renderer-to-javascript bridge. + */ + void processPositionUpdate(VROVector3f position, bool force) { + double currentRenderTime = VROTimeCurrentMillis(); + if (_lastSampleTimeMs + 16 >= currentRenderTime && !force) { + return; + } + + if (_lastPositionUpdate.distance(position) < _distanceFilter && !force){ + return; + } + + _lastSampleTimeMs = currentRenderTime; + _lastPositionUpdate = position; + onPositionUpdate(position); + } + +private: + double _lastSampleTimeMs = 0; + double _distanceFilter; + VROVector3f _lastPositionUpdate; +}; +#endif diff --git a/mobile/ios/ViroKit.framework/Headers/VROTransformDelegateiOS.h b/mobile/ios/ViroKit.framework/Headers/VROTransformDelegateiOS.h new file mode 100644 index 0000000..67ab11c --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROTransformDelegateiOS.h @@ -0,0 +1,38 @@ +// +// VROTransformDelegateiOS +// ViroRenderer +// +// Copyright © 2017 Viro Media. All rights eserved. +// + +#ifndef VROTransformDelegateiOS_h +#define VROTransformDelegateiOS_h + +#include +#include + +@protocol VROTransformDelegateProtocol +@required +- (void)onPositionUpdate:(VROVector3f)position; +@end + +/* + Notifies the bridge regarding transformation udpates of this delegate's attached control + */ +class VROTransformDelegateiOS: public VROTransformDelegate { +public: + VROTransformDelegateiOS(id delegate, double distanceFilter): VROTransformDelegate(distanceFilter) { + _delegate = delegate; + } + + virtual ~VROTransformDelegateiOS() {} + void onPositionUpdate(VROVector3f position) { + [_delegate onPositionUpdate:position]; + } + +private: + __weak id _delegate; + +}; + +#endif diff --git a/mobile/ios/ViroKit.framework/Headers/VROTree.h b/mobile/ios/ViroKit.framework/Headers/VROTree.h new file mode 100644 index 0000000..464ae84 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROTree.h @@ -0,0 +1,34 @@ +// +// VROTree.h +// ViroKit +// +// Created by Raj Advani on 8/1/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#ifndef VROTree_h +#define VROTree_h + +#include +#include + +template< typename T > +struct tree { +public: + + T value; + std::vector children; + + tree() {} + tree(T val) : value(val) {} + + void walkTree(std::function action) { + action(value); + for (tree &node : children) { + node.walkTree(action); + } + } + +}; + +#endif /* VROTree_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROTriangle.h b/mobile/ios/ViroKit.framework/Headers/VROTriangle.h new file mode 100644 index 0000000..b669b0e --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROTriangle.h @@ -0,0 +1,85 @@ +// +// VROTriangle.h +// ViroRenderer +// +// Created by Raj Advani on 10/15/15. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROTRIANGLE_H_ +#define VROTRIANGLE_H_ + +#include "VROVector3f.h" +#include + +class VROMatrix4f; + +class VROTriangle { +public: + + /* + Construct a new triangle. + */ + VROTriangle(VROVector3f a, VROVector3f b, VROVector3f c); + virtual ~VROTriangle(); + + /* + Return true if this triangle is degenerate, meaning two of its vertices + are exactly equal. + */ + bool isDegenerate() const; + + /* + Return the vertex with the given index from [0,2]. 0=A, 1=B, 2=C. + */ + VROVector3f vertexWithIndex(int index) const; + + /* + Determine if the triangle intersects the given ray. + */ + bool intersectsRay(VROVector3f ray, VROVector3f origin, VROVector3f *intPt) const; + + /* + Determine if the triangle contains the given point. + */ + bool containsPoint(VROVector3f p) const; + + /* + Retrieve the barycenter of this triangle. + */ + VROVector3f barycenter() const; + + /* + Transform this triangle by the given 4x4 matrix. + */ + VROTriangle transformByMatrix(VROMatrix4f matrix) const; + + std::string toString() const { + std::stringstream ss; + ss << std::fixed << "A: " << _a.x << ", " << _a.y << ", " << _a.z << + ", B: " << _b.x << ", " << _b.y << ", " << _b.z << + ", C: " << _c.x << ", " << _c.y << ", " << _c.z; + + return ss.str(); + } + +private: + + /* + Corners of the triangle (each length 3). + */ + VROVector3f _a; + VROVector3f _b; + VROVector3f _c; + + /* + Used for intersection (and containment) testing. + */ + VROVector3f _segAB; + VROVector3f _segBC; + VROVector3f _segCA; + VROVector3f _normal; + +}; + +#endif /* VROTRIANGLE_H_ */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROTypeface.h b/mobile/ios/ViroKit.framework/Headers/VROTypeface.h new file mode 100644 index 0000000..9adf70d --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROTypeface.h @@ -0,0 +1,102 @@ +// +// VROTypeface.h +// ViroRenderer +// +// Created by Raj Advani on 11/24/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROTypeface_h +#define VROTypeface_h + +#include +#include +#include +#include +#include +#include FT_FREETYPE_H +#include "VROLog.h" +#include "VROAllocationTracker.h" + +class VROGlyph; + +class VROTypeface { + +public: + + VROTypeface(std::string name, int size) : + _name(name), + _size(size) { + + if (FT_Init_FreeType(&_ft)) { + pabort("Could not initialize freetype library"); + } + + ALLOCATION_TRACKER_ADD(Typefaces, 1); + } + + virtual ~VROTypeface() { + FT_Done_Face(_face); + FT_Done_FreeType(_ft); + + ALLOCATION_TRACKER_SUB(Typefaces, 1); + } + + std::string getName() const { + return _name; + } + + void loadFace() { + _face = loadFace(_name, _size, _ft); + } + + /* + Get the glyph for the given character. If forRendering is true, then the + texture in the VROGlyph will be populated; otherwise it is left empty. + Glyphs are cached when they are retrieved for the first time (if + forRendering is true), so that future retrievals are faster. + */ + std::shared_ptr getGlyph(FT_ULong charCode, bool forRendering) { + auto kv = _glyphCache.find(charCode); + if (kv != _glyphCache.end()) { + return kv->second; + } + + std::shared_ptr glyph = loadGlyph(charCode, forRendering); + if (forRendering) { + _glyphCache[charCode] = glyph; + } + return glyph; + } + + /* + Preload the glyphs in the given string, caching them with this typeface. + */ + void preloadGlyphs(std::string chars) { + for (std::string::const_iterator c = chars.begin(); c != chars.end(); ++c) { + getGlyph(*c, true); + } + } + + float getLineHeight() const { + return _face->size->metrics.height >> 6; + } + +protected: + + virtual FT_Face loadFace(std::string name, int size, FT_Library ft) = 0; + virtual std::shared_ptr loadGlyph(FT_ULong charCode, bool forRendering) = 0; + + std::string _name; + int _size; + + FT_Library _ft; + FT_Face _face; + +private: + + std::map> _glyphCache; + +}; + +#endif /* VROTypeface_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROUniform.h b/mobile/ios/ViroKit.framework/Headers/VROUniform.h new file mode 100644 index 0000000..b62ee26 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROUniform.h @@ -0,0 +1,348 @@ +// +// VROUniform.h +// ViroRenderer +// +// Created by Raj Advani on 10/14/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROUNIFORM_H_ +#define VROUNIFORM_H_ + +#include +#include +#include "VROVector3f.h" +#include "VROVector4f.h" +#include "VROMatrix4f.h" +#include "VROLog.h" +#include "VROOpenGL.h" + +class VROShaderModifier; +class VROGeometry; +class VROMaterial; + +/* + The various types of properties that may be set for a shader. + */ +enum class VROShaderProperty { + Bool, + Int, + Float, + Vec2, + Vec3, + Vec4, + BVec2, + BVec3, + BVec4, + IVec2, + IVec3, + IVec4, + Mat2, + Mat3, + Mat4 +}; + +/* + Wraps around a uniform variable, holding its location in the shader and the glUniform + function needed to set its value. + */ +class VROUniform { + +public: + + static VROUniform *newUniformForType(const std::string &name, VROShaderProperty type, int arraySize); + + VROUniform(const std::string &name) : + _name(name), + _location(-1) { + } + + virtual ~VROUniform() {} + + const std::string getName() const { + return _name; + } + + virtual void set(const void *value, const VROGeometry *geometry, const VROMaterial *material) = 0; + + inline void setLocation(int location) { + this->_location = location; + } + + virtual void reset() { + //sublcass to reset any cached value + } + + void setVec3(VROVector3f value) { + if (_location == -1) { + return; + } + glUniform3f(_location, value.x, value.y, value.z); + } + + void setVec4(VROVector4f value) { + if (_location == -1) { + return; + } + glUniform4f(_location, value.x, value.y, value.z, value.w); + } + + void setMat4(VROMatrix4f value) { + if (_location == -1) { + return; + } + + glUniformMatrix4fv(_location, 1, GL_FALSE, value.getArray()); + } + + void setInt(int value) { + if (_location == -1) { + return; + } + glUniform1i(_location, value); + } + + void setFloat(float value) { + if (_location == -1) { + return; + } + glUniform1f(_location, value); + } + +protected: + int _location; + +private: + const std::string _name; + +}; + +class VROUniform1i: public VROUniform { +public: + VROUniform1i(const std::string &name, int arraySize) : + VROUniform(name), _arraySize(arraySize), _curValue(0) { + } + + void set(const void *value, const VROGeometry *geometry, const VROMaterial *material) { + if (_location == -1) { + return; + } + GLint *val = (GLint *) value; + + if (*val != _curValue) { + glUniform1iv(_location, _arraySize, val); + _curValue = *val; + } + } + + void reset() { + _curValue = 0; + } + +private: + const int _arraySize; + int _curValue; + +}; + +class VROUniform2i: public VROUniform { +public: + VROUniform2i(const std::string &name, int arraySize) : + VROUniform(name), _arraySize(arraySize) { + } + + void set(const void *value, const VROGeometry *geometry, const VROMaterial *material) { + //passert (_location != -1); + glUniform2iv(_location, _arraySize, (GLint *) value); + } + +private: + const int _arraySize; + +}; + +class VROUniform3i: public VROUniform { +public: + VROUniform3i(const std::string &name, int arraySize) : + VROUniform(name), _arraySize(arraySize) { + } + + void set(const void *value, const VROGeometry *geometry, const VROMaterial *material) { + passert (_location != -1); + glUniform3iv(_location, _arraySize, (GLint *) value); + } + +private: + const int _arraySize; + +}; + +class VROUniform4i: public VROUniform { +public: + VROUniform4i(const std::string &name, int arraySize) : + VROUniform(name), _arraySize(arraySize) { + } + + void set(const void *value, const VROGeometry *geometry, const VROMaterial *material) { + //passert (_location != -1); + glUniform4iv(_location, _arraySize, (GLint *) value); + } + +private: + const int _arraySize; + +}; + +class VROUniform1f: public VROUniform { +public: + + VROUniform1f(const std::string &name, int arraySize) : + VROUniform(name), _arraySize(arraySize), _curValue(9999) { + } + + void set(const void *value, const VROGeometry *geometry, const VROMaterial *material) { + if (_location == -1) { + return; + } + GLfloat *val = (GLfloat *) value; + + if (_arraySize > 1 || *val != _curValue) { + glUniform1f(_location, *val); + _curValue = *val; + } + } + + void reset() { + _curValue = 9999; + } + +private: + const int _arraySize; + float _curValue; + +}; + +class VROUniform2f: public VROUniform { +public: + VROUniform2f(const std::string &name, int arraySize) : + VROUniform(name), _arraySize(arraySize) { + } + + void set(const void *value, const VROGeometry *geometry, const VROMaterial *material) { + //passert (_location != -1); + glUniform2fv(_location, _arraySize, (GLfloat *) value); + } + +private: + const int _arraySize; + +}; + +class VROUniform3f: public VROUniform { +public: + VROUniform3f(const std::string &name, int arraySize) : + VROUniform(name), _arraySize(arraySize) { + _curValue[0] = 0; + _curValue[1] = 0; + _curValue[2] = 0; + } + + void set(const void *value, const VROGeometry *geometry, const VROMaterial *material) { + if (_location == -1) { + return; + } + + GLfloat *val = (GLfloat *) value; + if (_arraySize > 1 || memcmp(val, _curValue, sizeof(GLfloat) * 3) != 0) { + glUniform3fv(_location, _arraySize, val); + memcpy(_curValue, val, sizeof(GLfloat) * 3); + } + } + + void getCurrentValue(void *result) { + memcpy(result, _curValue, sizeof(float) * 3); + } + + void reset() { + _curValue[0] = 0; + _curValue[1] = 0; + _curValue[2] = 0; + } + +private: + const int _arraySize; + GLfloat _curValue[3]; + +}; + +class VROUniform4f: public VROUniform { +public: + VROUniform4f(const std::string &name, int arraySize) : + VROUniform(name), _arraySize(arraySize) { + } + + void set(const void *value, const VROGeometry *geometry, const VROMaterial *material) { + //passert (_location != -1); + glUniform4fv(_location, _arraySize, (GLfloat *) value); + } + +private: + const int _arraySize; + +}; + +class VROUniformMat2: public VROUniform { +public: + VROUniformMat2(const std::string &name) : + VROUniform(name) { + } + + void set(const void *value, const VROGeometry *geometry, const VROMaterial *material) { + //passert (_location != -1); + glUniformMatrix2fv(_location, 1, GL_FALSE, (GLfloat *) value); + } + +}; + +class VROUniformMat3: public VROUniform { +public: + VROUniformMat3(const std::string &name) : + VROUniform(name) { + } + + void set(const void *value, const VROGeometry *geometry, const VROMaterial *material) { + //passert (_location != -1); + glUniformMatrix3fv(_location, 1, GL_FALSE, (GLfloat *) value); + } + +}; + +class VROUniformMat4: public VROUniform { +public: + VROUniformMat4(const std::string &name) : + VROUniform(name) { + } + + void set(const void *value, const VROGeometry *geometry, const VROMaterial *material) { + //passert (_location != -1); + glUniformMatrix4fv(_location, 1, GL_FALSE, (GLfloat *) value); + } + +}; + +class VROUniformShaderModifier : public VROUniform { +public: + VROUniformShaderModifier(const std::string &name, std::shared_ptr modifier) : + VROUniform(name), + _modifier(modifier) { + } + + void set(const void *value, const VROGeometry *geometry, const VROMaterial *material); + +private: + std::shared_ptr _modifier; + +}; + +#endif + diff --git a/mobile/ios/ViroKit.framework/Headers/VROVector3f.h b/mobile/ios/ViroKit.framework/Headers/VROVector3f.h new file mode 100644 index 0000000..f10f172 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROVector3f.h @@ -0,0 +1,181 @@ +// +// VROVector3h.h +// ViroRenderer +// +// Created by Raj Advani on 10/15/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VROVECTOR3F_H_ +#define VROVECTOR3F_H_ + +#include +#include +#include + +class VROVector3f { +public: + float x; + float y; + float z; + + VROVector3f() noexcept; + VROVector3f(float x, float y); + VROVector3f(float x, float y, float z); + + VROVector3f &operator*=(const float multiplier) { + x *= multiplier; + y *= multiplier; + z *= multiplier; + return *this; + } + + VROVector3f &operator/=(const float divisor) { + x /= divisor; + y /= divisor; + z /= divisor; + return *this; + } + + VROVector3f &operator+=(const VROVector3f &rhs) { + x += rhs.x; + y += rhs.y; + z += rhs.z; + return *this; + } + + VROVector3f &operator-=(const VROVector3f &rhs) { + x -= rhs.x; + y -= rhs.y; + z -= rhs.z; + return *this; + } + + /* + Find the absolute angle between this vector and the given vector. + */ + float angleWithVector(const VROVector3f &line) const; + + /* + Find the angle between this vector and another vector. Both must be + normalized. Return value in the range [0, PI]. + */ + float angleWithNormedVector(const VROVector3f &vector) const; + + /* + Rotate the vector. + */ + VROVector3f rotateZ(float angleRad) const; + VROVector3f rotateAboutAxis(const VROVector3f &axisDir, const VROVector3f &axisPos, float angleRad) const; + + /* + Intersect the line or ray defined by this vector and the given origin with the plane defined by the given point and normal. + Store the intersection in the given point. Note that this is only valid if this vector has already been normalized. + */ + bool lineIntersectPlane(const VROVector3f &point, const VROVector3f &normal, + const VROVector3f &origin, VROVector3f *intPt) const; + bool rayIntersectPlane(const VROVector3f &point, const VROVector3f &normal, + const VROVector3f &origin, VROVector3f *intPt) const; + + /* + Copy operations. + */ + void set(const VROVector3f &value); + void set(float x, float y, float z); + + /* + Basic arithmetic. + */ + VROVector3f add(VROVector3f vB) const; + VROVector3f addScaled(const VROVector3f &scaledB, float scale) const; + VROVector3f subtract(VROVector3f vB) const; + VROVector3f scale(float factor) const; + + /* + Midpoints and distances. + */ + VROVector3f midpoint(const VROVector3f &other) const; + float distance(const VROVector3f &vB) const; + float distanceAccurate(const VROVector3f &vB) const; + float distanceXY(const VROVector3f &vB) const; + float distanceSquared(const VROVector3f &vB) const; + float magnitude() const; + float magnitudeXY() const; + + /* + Basic vector operations. + */ + float dot(const VROVector3f &vB) const; + VROVector3f cross(const VROVector3f &vB) const; + VROVector3f normalize() const; + VROVector3f interpolate(VROVector3f other, float t) const; + + /* + Clearing. + */ + void clear(); + bool isZero() const; + + /* + Hashing. + */ + bool isEqual(const VROVector3f &vector) const; + int hash() const; + + /* + Utilities. + */ + std::string toString() const; + void toArray(float *array) const; + + /* + Operator overloads. + */ + inline bool operator ==(const VROVector3f &other) const { + return other.x == x && other.y == y && other.z == z; + } + + inline bool operator !=(const VROVector3f &other) const { + return !this->operator ==(other); + } +}; + +/* + Operator overloads. + */ +inline VROVector3f operator+(VROVector3f lhs, const VROVector3f& rhs) { + lhs.x += rhs.x; + lhs.y += rhs.y; + lhs.z += rhs.z; + return lhs; // return the result by value +} + +inline VROVector3f operator-(VROVector3f lhs, const VROVector3f& rhs) { + lhs.x -= rhs.x; + lhs.y -= rhs.y; + lhs.z -= rhs.z; + return lhs; // return the result by value +} + +inline VROVector3f operator*(VROVector3f lhs, const float multiplier) { + lhs.x *= multiplier; + lhs.y *= multiplier; + lhs.z *= multiplier; + return lhs; // return the result by value +} + +inline VROVector3f operator*(VROVector3f lhs, VROVector3f rhs) { + lhs.x *= rhs.x; + lhs.y *= rhs.y; + lhs.z *= rhs.z; + return lhs; // return the result by value +} + +inline VROVector3f operator/(VROVector3f lhs, const float divisor) { + lhs.x /= divisor; + lhs.y /= divisor; + lhs.z /= divisor; + return lhs; // return the result by value +} + +#endif /* VROVECTOR3F_H_ */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROVector4f.h b/mobile/ios/ViroKit.framework/Headers/VROVector4f.h new file mode 100644 index 0000000..fc75c76 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROVector4f.h @@ -0,0 +1,125 @@ +// +// VROVector4f.h +// ViroRenderer +// +// Created by Raj Advani on 11/30/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VROVector4f_h +#define VROVector4f_h + +#include +#include +#include + +class VROVector4f { +public: + float x; + float y; + float z; + float w; + + VROVector4f(); + VROVector4f(const float *components, int count); + VROVector4f(float x, float y, float z, float w); + VROVector4f(const VROVector4f &vector); + virtual ~VROVector4f(); + + VROVector4f &operator*=(const float multiplier) { + x *= multiplier; + y *= multiplier; + z *= multiplier; + w *= multiplier; + return *this; + } + + VROVector4f &operator/=(const float divisor) { + x /= divisor; + y /= divisor; + z /= divisor; + w /= divisor; + return *this; + } + + VROVector4f &operator+=(const VROVector4f &rhs) { + x += rhs.x; + y += rhs.y; + z += rhs.z; + w += rhs.w; + return *this; + } + + /* + Copy operations. + */ + void set(const VROVector4f &value); + void set(float x, float y, float z, float w); + + /* + Basic arithmetic. + */ + void add(const VROVector4f &vB, VROVector4f *result) const; + void addScaled(const VROVector4f &scaledB, float scale, VROVector4f *result) const; + void subtract(const VROVector4f &vB, VROVector4f *result) const; + void scale(float factor, VROVector4f *result) const; + + /* + Midpoints and distances. + */ + void midpoint(const VROVector4f &other, VROVector4f *result) const; + float magnitude() const; + + /* + Basic vector operations. + */ + float dot(const VROVector4f &vB) const; + VROVector4f normalize() const; + VROVector4f interpolate(VROVector4f other, float t); + + /* + Clearing. + */ + void clear(); + bool isZero() const; + + /* + Hashing. + */ + bool isEqual(const VROVector4f &vector) const; + int hash() const; + + /* + Utilities. + */ + std::string toString() const; +}; + +/* + Operator overloads. + */ +inline VROVector4f operator+(VROVector4f lhs, const VROVector4f& rhs) { + lhs.x += rhs.x; + lhs.y += rhs.y; + lhs.z += rhs.z; + lhs.w += rhs.w; + return lhs; // return the result by value +} + +inline VROVector4f operator*(VROVector4f lhs, const float multiplier) { + lhs.x *= multiplier; + lhs.y *= multiplier; + lhs.z *= multiplier; + lhs.w *= multiplier; + return lhs; // return the result by value +} + +inline VROVector4f operator/(VROVector4f lhs, const float divisor) { + lhs.x /= divisor; + lhs.y /= divisor; + lhs.z /= divisor; + lhs.w /= divisor; + return lhs; // return the result by value +} + +#endif /* VROVector4f_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROVideoDelegate.h b/mobile/ios/ViroKit.framework/Headers/VROVideoDelegate.h new file mode 100644 index 0000000..dd5b5ad --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROVideoDelegate.h @@ -0,0 +1,24 @@ +// +// VROVideoDelegate.h +// ViroRenderer +// +// Created by Andy Chu on 10/7/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROVideoDelegate_h +#define VROVideoDelegate_h + +#import + +@protocol VROVideoDelegate + +- (void)videoWillBuffer; +- (void)videoDidBuffer; +- (void)videoDidFinish; +- (void)videoDidUpdateTime:(float)currentTimeInSeconds totalTimeInSeconds:(float)seconds; +- (void)videoDidFail:(NSString *)error; + +@end + +#endif /* VROVideoDelegate_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROVideoDelegateInternal.h b/mobile/ios/ViroKit.framework/Headers/VROVideoDelegateInternal.h new file mode 100644 index 0000000..e8d5423 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROVideoDelegateInternal.h @@ -0,0 +1,28 @@ +// +// VROVideoDelegateInternal.h +// ViroRenderer +// +// Created by Raj Advani on 11/10/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROVideoDelegateInternal_h +#define VROVideoDelegateInternal_h + +#include + +class VROVideoDelegateInternal { + +public: + + VROVideoDelegateInternal() {} + virtual ~VROVideoDelegateInternal() {} + + virtual void videoWillBuffer() = 0; + virtual void videoDidBuffer() = 0; + virtual void videoDidFinish() = 0; + virtual void onVideoUpdatedTime(float currentTimeInSeconds, float totalTimeInSeconds) = 0; + virtual void videoDidFail(std::string error) = 0; +}; + +#endif /* VROVideoDelegateInternal_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROVideoDelegateiOS.h b/mobile/ios/ViroKit.framework/Headers/VROVideoDelegateiOS.h new file mode 100644 index 0000000..e22c781 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROVideoDelegateiOS.h @@ -0,0 +1,48 @@ +// +// VROVideoDelegateiOS.h +// ViroRenderer +// +// Created by Raj Advani on 11/10/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROVideoDelegateiOS_h +#define VROVideoDelegateiOS_h + +#include "VROVideoDelegateInternal.h" +#include "VROVideoDelegate.h" + +class VROVideoDelegateiOS : public VROVideoDelegateInternal { + +public: + + VROVideoDelegateiOS(id delegate) : + _delegate(delegate) + {} + virtual ~VROVideoDelegateiOS() {} + + void videoWillBuffer() { + [_delegate videoWillBuffer]; + } + + void videoDidBuffer() { + [_delegate videoDidBuffer]; + } + + void videoDidFinish() { + [_delegate videoDidFinish]; + } + void onVideoUpdatedTime(float currentTimeInSeconds, float totalTimeInSeconds){ + [_delegate videoDidUpdateTime:currentTimeInSeconds totalTimeInSeconds:totalTimeInSeconds]; + } + void videoDidFail(std::string error) { + [_delegate videoDidFail:[NSString stringWithUTF8String:error.c_str()]]; + } + +private: + + __weak id _delegate; + +}; + +#endif /* VROVideoDelegateiOS_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROVideoSurface.h b/mobile/ios/ViroKit.framework/Headers/VROVideoSurface.h new file mode 100644 index 0000000..bb698b5 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROVideoSurface.h @@ -0,0 +1,53 @@ +// +// VROVideoTexture.h +// ViroRenderer +// +// Created by Raj Advani on 1/7/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROVideoSurface_h +#define VROVideoSurface_h + +#include "VROSurface.h" +#include "VROVideoDelegateInternal.h" +#include + +class VRORenderContext; +class VRODriver; +class VROMaterial; +class VROSurface; +class VROVideoTexture; +class VROFrameSynchronizer; + +class VROVideoSurface : public VROSurface { + +public: + + static std::shared_ptr createVideoSurface(float width, float height, + std::string url, + std::shared_ptr frameSynchronizer, + std::shared_ptr texture, + std::shared_ptr driver); + + void pause(); + void play(); + bool isPaused(); + void setMuted(bool muted); + void setVolume(float volume); + void setLoop(bool loop); + void seekToTime(float seconds); + void setDelegate(std::shared_ptr delegate); + + ~VROVideoSurface(); + +private: + + VROVideoSurface(float width, float height, + std::shared_ptr texture); + + std::shared_ptr _texture; + +}; + +#endif /* VROVideoSurface_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROVideoTexture.h b/mobile/ios/ViroKit.framework/Headers/VROVideoTexture.h new file mode 100644 index 0000000..1d41176 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROVideoTexture.h @@ -0,0 +1,125 @@ +// +// VROVideoTexture.h +// ViroRenderer +// +// Created by Raj Advani on 1/8/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROVideoTexture_h +#define VROVideoTexture_h + +#include "VROFrameListener.h" +#include "VROTexture.h" +#include +#include "VROVideoDelegateInternal.h" +#include "VROTime.h" +#include /* floor */ +#include + +class VRORenderContext; +class VROFrameSynchronizer; +class VRODriver; + +class VROVideoTexture : public VROTexture, public VROFrameListener { + +public: + + VROVideoTexture(VROTextureType type, VROStereoMode state = VROStereoMode::None) : + VROTexture(type, VROTextureInternalFormat::RGBA8, state) {} + virtual ~VROVideoTexture() {} + + /* + Delete any rendering resources. Invoked prior to destruction, on the + rendering thread. + */ + virtual void deleteGL() {} + + /* + Use this video texture to display the contents of the given URL. The video + will not run until play() is invoked. + */ + virtual void loadVideo(std::string url, + std::shared_ptr frameSynchronizer, + std::shared_ptr driver) = 0; + + /* + Perform video initialization (which causes a stutter) early. + */ + virtual void prewarm() = 0; + + virtual void onFrameWillRender(const VRORenderContext &context) {} + virtual void onFrameDidRender(const VRORenderContext &context) {} + + virtual void pause() = 0; + virtual void play() = 0; + virtual bool isPaused() = 0; + + virtual void seekToTime(float seconds) = 0; + virtual float getCurrentTimeInSeconds() = 0; + virtual float getVideoDurationInSeconds() = 0; + + virtual void setMuted(bool muted) = 0; + virtual void setVolume(float volume) = 0; + virtual void setLoop(bool loop) = 0; + + virtual void setDelegate(std::shared_ptr delegate) { + _delegate = delegate; + } + +protected: + + std::weak_ptr _delegate; + + /* + Notifies delegates about the video player's current time, per second. + */ + void updateVideoTime(){ + std::shared_ptr delegate = _delegate.lock(); + if (!delegate) { + return; + } + + /* + Reduce the amount of JNI Calls to getCurrentTimeInSeconds() to + a per-second basis - the lowest unit of time currently used by + video players. Thus, _lastVideoTimeGetAttempt is used to filter + the amount of calls made. + */ + double currentRenderTime = floor(VROTimeCurrentSeconds()); + if (_lastVideoTimeGetAttempt == currentRenderTime) { + return; + } + _lastVideoTimeGetAttempt = currentRenderTime; + + /* + Only notify delegates if the last known CurrentVideoTime returned + from the AVPlayer has changed. Also, we're doing it by integer seconds + */ + int currentVideoTimeInSeconds = getCurrentTimeInSeconds(); + if (_lastCurrentVideoTimeInSeconds != currentVideoTimeInSeconds) { + // if a video just starts, then getVideoDurationInSeconds returns NaN, do nothing in this case. + float duration = getVideoDurationInSeconds(); + if (!isnan(duration)) { + delegate->onVideoUpdatedTime(currentVideoTimeInSeconds, duration); + _lastCurrentVideoTimeInSeconds = currentVideoTimeInSeconds; + } + } + } + +private: + + /* + Last time stamp at which we attempted a JNI call getCurrentTimeInSeconds() from the + video player. + */ + double _lastVideoTimeGetAttempt = -1; + + /* + Last known current video time that was retrieved from the player. + */ + int _lastCurrentVideoTimeInSeconds = -1; + +}; + +#endif /* VROVideoTexture_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROVideoTextureCache.h b/mobile/ios/ViroKit.framework/Headers/VROVideoTextureCache.h new file mode 100644 index 0000000..ce41c46 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROVideoTextureCache.h @@ -0,0 +1,43 @@ +// +// VROVideoTextureCache.hpp +// ViroRenderer +// +// Created by Raj Advani on 5/19/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROVideoTextureCache_hpp +#define VROVideoTextureCache_hpp + +#include +#include +#import +#import + +class VROTextureSubstrate; + +class VROVideoTextureCache { + +public: + + virtual ~VROVideoTextureCache() {} + + /* + For converting generic RGB buffers to textures. If sRGB is true, we will treat the buffers + as gamma-corrected, converting them to linear when sampled. sRGB should be set to true if using + we're using gamma-correction. + */ + virtual std::unique_ptr createTextureSubstrate(CMSampleBufferRef sampleBuffer, bool sRGB) = 0; + virtual std::unique_ptr createTextureSubstrate(CVPixelBufferRef pixelBuffer, bool sRGB) = 0; + + /* + Convert a YCbCr pixel buffer into two textures; the first will be the Y texture + and the second the CbCr texture. + */ + virtual std::vector> createYCbCrTextureSubstrates(CVPixelBufferRef pixelBuffer) = 0; + +private: + +}; + +#endif /* VROVideoTextureCache_hpp */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROVideoTextureiOS.h b/mobile/ios/ViroKit.framework/Headers/VROVideoTextureiOS.h new file mode 100644 index 0000000..9681121 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROVideoTextureiOS.h @@ -0,0 +1,116 @@ +// +// VROVideoTextureiOS.h +// ViroRenderer +// +// Created by Raj Advani on 11/10/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#ifndef VROVideoTextureiOS_h +#define VROVideoTextureiOS_h + +#import "VROVideoTexture.h" +#import +#import +#import + +@class VROVideoCaptureDelegate; +@class VROAVPlayerDelegate; +@class VROVideoNotificationListener; +class VRORenderContext; +class VROFrameSynchronizer; +class VRODriver; +class VROMaterial; +class VROVideoTextureCache; + +static const long kInFlightVideoTextures = 3; + +class VROVideoTextureiOS : public VROVideoTexture { + +public: + + VROVideoTextureiOS(VROStereoMode stereoMode = VROStereoMode::None); + virtual ~VROVideoTextureiOS(); + + /* + Delete any rendering resources. Invoked prior to destruction, on the + rendering thread. + */ + virtual void deleteGL(); + + /* + Use this video texture to display the contents of the given URL. The video + will not run until play() is invoked. + */ + void loadVideo(std::string url, + std::shared_ptr frameSynchronizer, + std::shared_ptr driver); + + /* + Perform video initialization (which causes a stutter) early. + */ + void prewarm(); + + void playerWillBuffer(); + void playerDidBuffer(); + + void onFrameWillRender(const VRORenderContext &context); + void onFrameDidRender(const VRORenderContext &context); + + void pause(); + void play(); + bool isPaused(); + + void seekToTime(float seconds); + float getCurrentTimeInSeconds(); + float getVideoDurationInSeconds(); + + void setMuted(bool muted); + void setVolume(float volume); + void setLoop(bool loop); + + void setDelegate(std::shared_ptr delegate); + + /* + Internal: invoked by the delegate. + */ + void displayPixelBuffer(std::unique_ptr substrate); + +private: + + /* + AVPlayer for recorded video playback. + */ + AVPlayer *_player; + bool _paused; + bool _loop; + VROAVPlayerDelegate *_avPlayerDelegate; + VROVideoNotificationListener *_videoNotificationListener; + +}; + +/* + Delegate for receiving video output from URLs. + */ +@interface VROAVPlayerDelegate : NSObject + +- (id)initWithVideoTexture:(VROVideoTextureiOS *)texture player:(AVPlayer *)player + driver:(std::shared_ptr)driver; +- (void)renderFrame; + +@end + +/* + Simple object to register for AVPlayer notifications + */ +@interface VROVideoNotificationListener : NSObject + +- (id)initWithVideoPlayer:(AVPlayer *)player loop:(BOOL)loop + videoDelegate:(std::shared_ptr)videoDelegate; + +- (void)shouldLoop:(BOOL)loop; +- (void)setDelegate:(std::shared_ptr)videoDelegate; + +@end + +#endif /* VROVideoTextureiOS_h */ diff --git a/mobile/ios/ViroKit.framework/Headers/VROView.h b/mobile/ios/ViroKit.framework/Headers/VROView.h new file mode 100644 index 0000000..a9f96f8 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROView.h @@ -0,0 +1,69 @@ +// +// VROView.h +// ViroRenderer +// +// Created by Raj Advani on 12/15/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#import +#import +#import "VRORenderDelegate.h" +#import "VROQuaternion.h" +#import "VROCamera.h" +#import "VROViewRecorder.h" +#import + +class VROSceneController; +class VROScene; +class VROReticle; +class VRONode; +class VROFrameSynchronizer; +enum class VROTimingFunctionType; + +typedef void (^VROViewValidApiKeyBlock)(BOOL); + +@protocol VROView + +@required + +@property (nonatomic, weak) IBOutlet id renderDelegate; +@property (readonly, nonatomic) std::shared_ptr renderer; +@property (readwrite, nonatomic) std::shared_ptr sceneController; + +- (void)setSceneController:(std::shared_ptr)sceneController; +- (void)setSceneController:(std::shared_ptr)sceneController duration:(float)seconds + timingFunction:(VROTimingFunctionType)timingFunctionType; + +- (void)setPointOfView:(std::shared_ptr)node; +- (void)validateApiKey:(NSString *)apiKey withCompletionBlock:(VROViewValidApiKeyBlock)completionBlock; +- (void)setDebugHUDEnabled:(BOOL)enabled; +- (void)recenterTracking; + +- (void)startVideoRecording:(NSString *)fileName + saveToCameraRoll:(BOOL)saveToCamera + errorBlock:(VROViewRecordingErrorBlock)errorBlock; +- (void)stopVideoRecordingWithHandler:(VROViewWriteMediaFinishBlock)completionHandler; +- (void)takeScreenshot:(NSString *)fileName + saveToCameraRoll:(BOOL)saveToCamera + withCompletionHandler:(VROViewWriteMediaFinishBlock)completionHandler; + +- (BOOL)setShadowsEnabled:(BOOL)enabled; +- (BOOL)setHDREnabled:(BOOL)enabled; +- (BOOL)setPBREnabled:(BOOL)enabled; +- (BOOL)setBloomEnabled:(BOOL)enabled; + +- (NSString *)getPlatform; +- (NSString *)getHeadset; +- (NSString *)getController; + +/* + Calling setVrMode allows switching to and from VR mode. + When set to NO, it transitions back to pre-VR (mono) mode. + When set to YES, we set thie view into a full VR mode + */ +- (void)setVrMode:(BOOL)enabled; + +- (std::shared_ptr)frameSynchronizer; + +@end diff --git a/mobile/ios/ViroKit.framework/Headers/VROViewAR.h b/mobile/ios/ViroKit.framework/Headers/VROViewAR.h new file mode 100644 index 0000000..a4e9161 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROViewAR.h @@ -0,0 +1,67 @@ +// +// VROViewAR.h +// ViroRenderer +// +// Created by Raj Advani on 5/31/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#import +#import +#import "VROView.h" +#import "VROARSession.h" +#import "VROARHitTestResult.h" +#include + +// TODO VIRO-1355 Remove after event delegate integration +typedef void (^VROViewARTapHandler)(VROARHitTestResult, std::shared_ptr, std::shared_ptr); + +class VROARSessionDelegate; +class VRORendererConfiguration; + +@interface VROViewAR : GLKView + +@property (readwrite, nonatomic) BOOL suspended; + +- (instancetype)initWithFrame:(CGRect)frame + config:(VRORendererConfiguration)config + context:(EAGLContext *)context + worldAlignment:(VROWorldAlignment)worldAlignment; + +- (void)setARSessionDelegate:(std::shared_ptr)delegate; + +/* + Should be invoked before this object gets deallocated, to clean up GL + resources on the rendering thread before the underlying EAGLContext used + by this view is destroyed. This is required to prevent deadlocks in + CVOpenGLTextureCache, which hangs on dealloc if the EAGLContext it's using + is already gone. + */ +- (void)deleteGL; + +/* + Sets the paused state of the underlying CADisplayLink + */ +- (void)setPaused:(BOOL)paused; + +/* + Performs an AR hit test with the given ray assuming origin is the camera + */ +- (std::vector)performARHitTest:(VROVector3f)ray; + +/* + Performs an AR hit test with the given 2D point on the screen + */ +- (std::vector)performARHitTestWithPoint:(int)x y:(int)y; + +/* + Returns the ARSession + */ +- (std::shared_ptr)getARSession; + ++ (BOOL)isARSupported; + +// TODO VIRO-1355 Remove after event delegate integration +@property (readwrite, nonatomic) VROViewARTapHandler tapHandler; + +@end diff --git a/mobile/ios/ViroKit.framework/Headers/VROViewControllerGVR.h b/mobile/ios/ViroKit.framework/Headers/VROViewControllerGVR.h new file mode 100644 index 0000000..c1279d6 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROViewControllerGVR.h @@ -0,0 +1,23 @@ +// +// VROViewControllerGVR.h +// ViroKit +// +// Created by Raj Advani on 11/30/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#import + +class VRORendererConfiguration; + +@interface VROViewControllerGVR : UIViewController + +/* + Set this to true to force the view into landscape mode + when it appears. + */ +@property (readwrite, nonatomic) BOOL forceLandscape; + +- (id)initWithConfig:(VRORendererConfiguration)config; + +@end diff --git a/mobile/ios/ViroKit.framework/Headers/VROViewGVR.h b/mobile/ios/ViroKit.framework/Headers/VROViewGVR.h new file mode 100644 index 0000000..242ab9a --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROViewGVR.h @@ -0,0 +1,23 @@ +// +// VROViewGVR.h +// ViroRenderer +// +// Created by Raj Advani on 4/28/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#import +#import +#import +#import "VROView.h" + +class VRORendererConfiguration; + +@interface VROViewGVR : GLKView + +@property (readwrite, nonatomic) BOOL paused; +@property (readwrite, nonatomic) IBInspectable BOOL testingMode; + +- (instancetype)initWithFrame:(CGRect)frame config:(VRORendererConfiguration)config; + +@end diff --git a/mobile/ios/ViroKit.framework/Headers/VROViewMetal.h b/mobile/ios/ViroKit.framework/Headers/VROViewMetal.h new file mode 100644 index 0000000..e704704 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROViewMetal.h @@ -0,0 +1,21 @@ +// +// VROViewMetal.h +// ViroRenderer +// +// Created by Raj Advani on 4/22/16. +// Copyright © 2016 Viro Media. All rights reserved. +// + +#include "VRODefines.h" +#if VRO_METAL + +#import +#import +#import +#import "VROView.h" + +@interface VROViewMetal : MTKView + +@end + +#endif \ No newline at end of file diff --git a/mobile/ios/ViroKit.framework/Headers/VROViewRecorder.h b/mobile/ios/ViroKit.framework/Headers/VROViewRecorder.h new file mode 100644 index 0000000..d978dba --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROViewRecorder.h @@ -0,0 +1,53 @@ +// +// VROViewRecorder.h +// ViroKit +// +// Created by Raj Advani on 11/28/17. +// Copyright © 2017 Viro Media. All rights reserved. +// + +#import +#import +#import +#import +#import + +class VRODriver; +class VRORenderer; + +typedef void (^VROViewRecordingErrorBlock)(NSInteger errorCode); +typedef void (^VROViewWriteMediaFinishBlock)(BOOL success, NSURL *filePath, NSInteger errorCode); + +static NSInteger const kVROViewErrorNone = -1; +static NSInteger const kVROViewErrorUnknown = 0; +static NSInteger const kVROViewErrorNoPermissions = 1; +static NSInteger const kVROViewErrorInitialization = 2; +static NSInteger const kVROViewErrorWriteToFile = 3; +static NSInteger const kVROViewErrorAlreadyRunning = 4; +static NSInteger const kVROViewErrorAlreadyStopped = 5; + +static NSString *const kVROViewTempMediaDirectory = @"viro_media"; +static NSString *const kVROViewAudioSuffix = @".m4a"; +static NSString *const kVROViewImageSuffix = @".png"; +static NSString *const kVROViewTempVideoSuffix = @"-temp.mp4"; +static NSString *const kVROViewVideoSuffix = @".mp4"; + +/* + Video recording and screenshot implementation for a GLKView. + */ +@interface VROViewRecorder : NSObject + +- (id)initWithView:(GLKView *)view + renderer:(std::shared_ptr)renderer + driver:(std::shared_ptr)driver; +- (void)deleteGL; + +- (void)startVideoRecording:(NSString *)fileName + saveToCameraRoll:(BOOL)saveToCamera + errorBlock:(VROViewRecordingErrorBlock)errorBlock; +- (void)stopVideoRecordingWithHandler:(VROViewWriteMediaFinishBlock)completionHandler; +- (void)takeScreenshot:(NSString *)fileName + saveToCameraRoll:(BOOL)saveToCamera + withCompletionHandler:(VROViewWriteMediaFinishBlock)completionHandler; + +@end diff --git a/mobile/ios/ViroKit.framework/Headers/VROViewport.h b/mobile/ios/ViroKit.framework/Headers/VROViewport.h new file mode 100644 index 0000000..68771c8 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/VROViewport.h @@ -0,0 +1,102 @@ +// +// VROViewport.h +// ViroRenderer +// +// Created by Raj Advani on 10/23/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#ifndef VROViewport_hpp +#define VROViewport_hpp + +#include "VRODefines.h" +#include "VROMatrix4f.h" +#include "VROMath.h" + +#if VRO_METAL +#include +#endif + +class VROViewport { + +public: + + VROViewport() : + _x(0), _y(0), _width(0), _height(0), _contentScaleFactor(2) + {} + + VROViewport(int x, int y, int width, int height) : + _x(x), _y(y), _width(width), _height(height), _contentScaleFactor(2) + {} + + int getX() const { return _x; } + int getY() const { return _y; } + int getWidth() const { return _width; } + int getHeight() const { return _height; } + + /* + On some platforms, there is a difference between screen pixels and + screen points (e.g. on iOS Retina displays). Viewports are always + specified in pixels: to get points, divide by the contentScaleFactor. + */ + float getContentScaleFactor() const { return _contentScaleFactor; }; + + VROMatrix4f getOrthographicProjection(float near, float far) { + float left = _x; + float right = _x + _width; + float bottom = _y; + float top = _y + _height; + + return VROMathComputeOrthographicProjection(left, right, bottom, top, near, far); + } + + void setViewport(int x, int y, int width, int height) { + _x = x; + _y = y; + _width = width; + _height = height; + } + + void setContentScaleFactor(float factor) { + _contentScaleFactor = factor; + } + +#if VRO_METAL + MTLViewport toMetalViewport() const { + MTLViewport viewport; + viewport.originX = _x; + viewport.originY = _y; + viewport.width = _width; + viewport.height = _height; + viewport.znear = 0.0; + viewport.zfar = 1.0; + + return viewport; + } + + MTLScissorRect toMetalScissor() const { + MTLScissorRect scissor; + scissor.x = _x; + scissor.y = _y; + scissor.width = _width; + scissor.height = _height; + + return scissor; + } +#endif + + void toArray(int *viewport) const { + viewport[0] = _x; + viewport[1] = _y; + viewport[2] = _width; + viewport[3] = _height; + } + +private: + + int _x, _y, _width, _height; + float _contentScaleFactor; + +}; + +#endif /* VROViewport_hpp */ diff --git a/mobile/ios/ViroKit.framework/Headers/ViroKit.h b/mobile/ios/ViroKit.framework/Headers/ViroKit.h new file mode 100644 index 0000000..b5f67d0 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/ViroKit.h @@ -0,0 +1,186 @@ +// +// ViroKit.h +// ViroKit +// +// Created by Raj Advani on 12/9/15. +// Copyright © 2015 Viro Media. All rights reserved. +// + +#import + +//! Project version number for ViroKit. +FOUNDATION_EXPORT double ViroKitVersionNumber; + +//! Project version string for ViroKit. +FOUNDATION_EXPORT const unsigned char ViroKitVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import + +// Model Loader +#import +#import +#import + +// Core Scene Graph +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import + +// Animation +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import + +// UI +#import +#import +#import + +// Video +#import +#import +#import +#import +#import +#import + +// Audio +#import +#import +#import +#import +#import +#import +#import +#import +#import + +// Math +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import + +// Shapes +#import +#import +#import +#import +#import +#import + +// Controller +#import +#import +#import + +// Util +#import +#import +#import +#import +#import +#import +#import + +// Physics +#import +#import +#import +#import +#import + +// AR +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import + +// Test +#import +#import + +// OpenCV +// #import + + diff --git a/mobile/ios/ViroKit.framework/Headers/glm/CMakeLists.txt b/mobile/ios/ViroKit.framework/Headers/glm/CMakeLists.txt new file mode 100755 index 0000000..67f1146 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/glm/CMakeLists.txt @@ -0,0 +1,67 @@ +file(GLOB ROOT_SOURCE *.cpp) +file(GLOB ROOT_INLINE *.inl) +file(GLOB ROOT_HEADER *.hpp) +file(GLOB ROOT_TEXT ../*.txt) +file(GLOB ROOT_MD ../*.md) +file(GLOB ROOT_NAT ../util/glm.natvis) + +file(GLOB_RECURSE CORE_SOURCE ./detail/*.cpp) +file(GLOB_RECURSE CORE_INLINE ./detail/*.inl) +file(GLOB_RECURSE CORE_HEADER ./detail/*.hpp) + +file(GLOB_RECURSE GTC_SOURCE ./gtc/*.cpp) +file(GLOB_RECURSE GTC_INLINE ./gtc/*.inl) +file(GLOB_RECURSE GTC_HEADER ./gtc/*.hpp) + +file(GLOB_RECURSE GTX_SOURCE ./gtx/*.cpp) +file(GLOB_RECURSE GTX_INLINE ./gtx/*.inl) +file(GLOB_RECURSE GTX_HEADER ./gtx/*.hpp) + +file(GLOB_RECURSE SIMD_SOURCE ./simd/*.cpp) +file(GLOB_RECURSE SIMD_INLINE ./simd/*.inl) +file(GLOB_RECURSE SIMD_HEADER ./simd/*.h) + +source_group("Text Files" FILES ${ROOT_TEXT} ${ROOT_MD}) +source_group("Core Files" FILES ${CORE_SOURCE}) +source_group("Core Files" FILES ${CORE_INLINE}) +source_group("Core Files" FILES ${CORE_HEADER}) +source_group("GTC Files" FILES ${GTC_SOURCE}) +source_group("GTC Files" FILES ${GTC_INLINE}) +source_group("GTC Files" FILES ${GTC_HEADER}) +source_group("GTX Files" FILES ${GTX_SOURCE}) +source_group("GTX Files" FILES ${GTX_INLINE}) +source_group("GTX Files" FILES ${GTX_HEADER}) +source_group("SIMD Files" FILES ${SIMD_SOURCE}) +source_group("SIMD Files" FILES ${SIMD_INLINE}) +source_group("SIMD Files" FILES ${SIMD_HEADER}) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..) + +if(GLM_STATIC_LIBRARY_ENABLE OR GLM_DYNAMIC_LIBRARY_ENABLE) + if(GLM_STATIC_LIBRARY_ENABLE) + add_library(glm_static STATIC ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT} + ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER} + ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER} + ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER} + ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER} + ${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER}) + endif(GLM_STATIC_LIBRARY_ENABLE) + + if(GLM_DYNAMIC_LIBRARY_ENABLE) + add_library(glm_shared SHARED ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT} + ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER} + ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER} + ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER} + ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER} + ${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER}) + endif(GLM_DYNAMIC_LIBRARY_ENABLE) + +else(GLM_STATIC_LIBRARY_ENABLE OR GLM_DYNAMIC_LIBRARY_ENABLE) + add_executable(glm_dummy ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT} + ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER} + ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER} + ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER} + ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER} + ${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER}) + +endif(GLM_STATIC_LIBRARY_ENABLE OR GLM_DYNAMIC_LIBRARY_ENABLE) diff --git a/mobile/ios/ViroKit.framework/Headers/glm/common.hpp b/mobile/ios/ViroKit.framework/Headers/glm/common.hpp new file mode 100755 index 0000000..ac8af6e --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/glm/common.hpp @@ -0,0 +1,6 @@ +/// @ref core +/// @file glm/common.hpp + +#pragma once + +#include "detail/func_common.hpp" diff --git a/mobile/ios/ViroKit.framework/Headers/glm/detail/_features.hpp b/mobile/ios/ViroKit.framework/Headers/glm/detail/_features.hpp new file mode 100755 index 0000000..d47eef6 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/glm/detail/_features.hpp @@ -0,0 +1,399 @@ +/// @ref core +/// @file glm/detail/_features.hpp + +#pragma once + +// #define GLM_CXX98_EXCEPTIONS +// #define GLM_CXX98_RTTI + +// #define GLM_CXX11_RVALUE_REFERENCES +// Rvalue references - GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2118.html + +// GLM_CXX11_TRAILING_RETURN +// Rvalue references for *this - GCC not supported +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2439.htm + +// GLM_CXX11_NONSTATIC_MEMBER_INIT +// Initialization of class objects by rvalues - GCC any +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1610.html + +// GLM_CXX11_NONSTATIC_MEMBER_INIT +// Non-static data member initializers - GCC 4.7 +// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2756.htm + +// #define GLM_CXX11_VARIADIC_TEMPLATE +// Variadic templates - GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2242.pdf + +// +// Extending variadic template template parameters - GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf + +// #define GLM_CXX11_GENERALIZED_INITIALIZERS +// Initializer lists - GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm + +// #define GLM_CXX11_STATIC_ASSERT +// Static assertions - GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.html + +// #define GLM_CXX11_AUTO_TYPE +// auto-typed variables - GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1984.pdf + +// #define GLM_CXX11_AUTO_TYPE +// Multi-declarator auto - GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1737.pdf + +// #define GLM_CXX11_AUTO_TYPE +// Removal of auto as a storage-class specifier - GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2546.htm + +// #define GLM_CXX11_AUTO_TYPE +// New function declarator syntax - GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2541.htm + +// #define GLM_CXX11_LAMBDAS +// New wording for C++0x lambdas - GCC 4.5 +// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2927.pdf + +// #define GLM_CXX11_DECLTYPE +// Declared type of an expression - GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf + +// +// Right angle brackets - GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html + +// +// Default template arguments for function templates DR226 GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#226 + +// +// Solving the SFINAE problem for expressions DR339 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2634.html + +// #define GLM_CXX11_ALIAS_TEMPLATE +// Template aliases N2258 GCC 4.7 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf + +// +// Extern templates N1987 Yes +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1987.htm + +// #define GLM_CXX11_NULLPTR +// Null pointer constant N2431 GCC 4.6 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf + +// #define GLM_CXX11_STRONG_ENUMS +// Strongly-typed enums N2347 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf + +// +// Forward declarations for enums N2764 GCC 4.6 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2764.pdf + +// +// Generalized attributes N2761 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf + +// +// Generalized constant expressions N2235 GCC 4.6 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf + +// +// Alignment support N2341 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf + +// #define GLM_CXX11_DELEGATING_CONSTRUCTORS +// Delegating constructors N1986 GCC 4.7 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf + +// +// Inheriting constructors N2540 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2540.htm + +// #define GLM_CXX11_EXPLICIT_CONVERSIONS +// Explicit conversion operators N2437 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf + +// +// New character types N2249 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2249.html + +// +// Unicode string literals N2442 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm + +// +// Raw string literals N2442 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm + +// +// Universal character name literals N2170 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2170.html + +// #define GLM_CXX11_USER_LITERALS +// User-defined literals N2765 GCC 4.7 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2765.pdf + +// +// Standard Layout Types N2342 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2342.htm + +// #define GLM_CXX11_DEFAULTED_FUNCTIONS +// #define GLM_CXX11_DELETED_FUNCTIONS +// Defaulted and deleted functions N2346 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm + +// +// Extended friend declarations N1791 GCC 4.7 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1791.pdf + +// +// Extending sizeof N2253 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2253.html + +// #define GLM_CXX11_INLINE_NAMESPACES +// Inline namespaces N2535 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2535.htm + +// #define GLM_CXX11_UNRESTRICTED_UNIONS +// Unrestricted unions N2544 GCC 4.6 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf + +// #define GLM_CXX11_LOCAL_TYPE_TEMPLATE_ARGS +// Local and unnamed types as template arguments N2657 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm + +// #define GLM_CXX11_RANGE_FOR +// Range-based for N2930 GCC 4.6 +// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2930.html + +// #define GLM_CXX11_OVERRIDE_CONTROL +// Explicit virtual overrides N2928 N3206 N3272 GCC 4.7 +// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm + +// +// Minimal support for garbage collection and reachability-based leak detection N2670 No +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2670.htm + +// #define GLM_CXX11_NOEXCEPT +// Allowing move constructors to throw [noexcept] N3050 GCC 4.6 (core language only) +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3050.html + +// +// Defining move special member functions N3053 GCC 4.6 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3053.html + +// +// Sequence points N2239 Yes +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2239.html + +// +// Atomic operations N2427 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2239.html + +// +// Strong Compare and Exchange N2748 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2427.html + +// +// Bidirectional Fences N2752 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2752.htm + +// +// Memory model N2429 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2429.htm + +// +// Data-dependency ordering: atomics and memory model N2664 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2664.htm + +// +// Propagating exceptions N2179 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html + +// +// Abandoning a process and at_quick_exit N2440 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2440.htm + +// +// Allow atomics use in signal handlers N2547 Yes +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2547.htm + +// +// Thread-local storage N2659 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2659.htm + +// +// Dynamic initialization and destruction with concurrency N2660 GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2660.htm + +// +// __func__ predefined identifier N2340 GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2340.htm + +// +// C99 preprocessor N1653 GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm + +// +// long long N1811 GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1811.pdf + +// +// Extended integral types N1988 Yes +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1988.pdf + +#if(GLM_COMPILER & GLM_COMPILER_GCC) + +# if(GLM_COMPILER >= GLM_COMPILER_GCC43) +# define GLM_CXX11_STATIC_ASSERT +# endif + +#elif(GLM_COMPILER & GLM_COMPILER_CLANG) +# if(__has_feature(cxx_exceptions)) +# define GLM_CXX98_EXCEPTIONS +# endif + +# if(__has_feature(cxx_rtti)) +# define GLM_CXX98_RTTI +# endif + +# if(__has_feature(cxx_access_control_sfinae)) +# define GLM_CXX11_ACCESS_CONTROL_SFINAE +# endif + +# if(__has_feature(cxx_alias_templates)) +# define GLM_CXX11_ALIAS_TEMPLATE +# endif + +# if(__has_feature(cxx_alignas)) +# define GLM_CXX11_ALIGNAS +# endif + +# if(__has_feature(cxx_attributes)) +# define GLM_CXX11_ATTRIBUTES +# endif + +# if(__has_feature(cxx_constexpr)) +# define GLM_CXX11_CONSTEXPR +# endif + +# if(__has_feature(cxx_decltype)) +# define GLM_CXX11_DECLTYPE +# endif + +# if(__has_feature(cxx_default_function_template_args)) +# define GLM_CXX11_DEFAULT_FUNCTION_TEMPLATE_ARGS +# endif + +# if(__has_feature(cxx_defaulted_functions)) +# define GLM_CXX11_DEFAULTED_FUNCTIONS +# endif + +# if(__has_feature(cxx_delegating_constructors)) +# define GLM_CXX11_DELEGATING_CONSTRUCTORS +# endif + +# if(__has_feature(cxx_deleted_functions)) +# define GLM_CXX11_DELETED_FUNCTIONS +# endif + +# if(__has_feature(cxx_explicit_conversions)) +# define GLM_CXX11_EXPLICIT_CONVERSIONS +# endif + +# if(__has_feature(cxx_generalized_initializers)) +# define GLM_CXX11_GENERALIZED_INITIALIZERS +# endif + +# if(__has_feature(cxx_implicit_moves)) +# define GLM_CXX11_IMPLICIT_MOVES +# endif + +# if(__has_feature(cxx_inheriting_constructors)) +# define GLM_CXX11_INHERITING_CONSTRUCTORS +# endif + +# if(__has_feature(cxx_inline_namespaces)) +# define GLM_CXX11_INLINE_NAMESPACES +# endif + +# if(__has_feature(cxx_lambdas)) +# define GLM_CXX11_LAMBDAS +# endif + +# if(__has_feature(cxx_local_type_template_args)) +# define GLM_CXX11_LOCAL_TYPE_TEMPLATE_ARGS +# endif + +# if(__has_feature(cxx_noexcept)) +# define GLM_CXX11_NOEXCEPT +# endif + +# if(__has_feature(cxx_nonstatic_member_init)) +# define GLM_CXX11_NONSTATIC_MEMBER_INIT +# endif + +# if(__has_feature(cxx_nullptr)) +# define GLM_CXX11_NULLPTR +# endif + +# if(__has_feature(cxx_override_control)) +# define GLM_CXX11_OVERRIDE_CONTROL +# endif + +# if(__has_feature(cxx_reference_qualified_functions)) +# define GLM_CXX11_REFERENCE_QUALIFIED_FUNCTIONS +# endif + +# if(__has_feature(cxx_range_for)) +# define GLM_CXX11_RANGE_FOR +# endif + +# if(__has_feature(cxx_raw_string_literals)) +# define GLM_CXX11_RAW_STRING_LITERALS +# endif + +# if(__has_feature(cxx_rvalue_references)) +# define GLM_CXX11_RVALUE_REFERENCES +# endif + +# if(__has_feature(cxx_static_assert)) +# define GLM_CXX11_STATIC_ASSERT +# endif + +# if(__has_feature(cxx_auto_type)) +# define GLM_CXX11_AUTO_TYPE +# endif + +# if(__has_feature(cxx_strong_enums)) +# define GLM_CXX11_STRONG_ENUMS +# endif + +# if(__has_feature(cxx_trailing_return)) +# define GLM_CXX11_TRAILING_RETURN +# endif + +# if(__has_feature(cxx_unicode_literals)) +# define GLM_CXX11_UNICODE_LITERALS +# endif + +# if(__has_feature(cxx_unrestricted_unions)) +# define GLM_CXX11_UNRESTRICTED_UNIONS +# endif + +# if(__has_feature(cxx_user_literals)) +# define GLM_CXX11_USER_LITERALS +# endif + +# if(__has_feature(cxx_variadic_templates)) +# define GLM_CXX11_VARIADIC_TEMPLATES +# endif + +#endif//(GLM_COMPILER & GLM_COMPILER_CLANG) diff --git a/mobile/ios/ViroKit.framework/Headers/glm/detail/_fixes.hpp b/mobile/ios/ViroKit.framework/Headers/glm/detail/_fixes.hpp new file mode 100755 index 0000000..38c210c --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/glm/detail/_fixes.hpp @@ -0,0 +1,30 @@ +/// @ref core +/// @file glm/detail/_fixes.hpp + +#include + +//! Workaround for compatibility with other libraries +#ifdef max +#undef max +#endif + +//! Workaround for compatibility with other libraries +#ifdef min +#undef min +#endif + +//! Workaround for Android +#ifdef isnan +#undef isnan +#endif + +//! Workaround for Android +#ifdef isinf +#undef isinf +#endif + +//! Workaround for Chrone Native Client +#ifdef log2 +#undef log2 +#endif + diff --git a/mobile/ios/ViroKit.framework/Headers/glm/detail/_noise.hpp b/mobile/ios/ViroKit.framework/Headers/glm/detail/_noise.hpp new file mode 100755 index 0000000..3e5913d --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/glm/detail/_noise.hpp @@ -0,0 +1,107 @@ +/// @ref core +/// @file glm/detail/_noise.hpp + +#pragma once + +#include "../vec2.hpp" +#include "../vec3.hpp" +#include "../vec4.hpp" +#include "../common.hpp" + +namespace glm{ +namespace detail +{ + template + GLM_FUNC_QUALIFIER T mod289(T const & x) + { + return x - floor(x * static_cast(1.0) / static_cast(289.0)) * static_cast(289.0); + } + + template + GLM_FUNC_QUALIFIER T permute(T const & x) + { + return mod289(((x * static_cast(34)) + static_cast(1)) * x); + } + + template + GLM_FUNC_QUALIFIER tvec2 permute(tvec2 const & x) + { + return mod289(((x * static_cast(34)) + static_cast(1)) * x); + } + + template + GLM_FUNC_QUALIFIER tvec3 permute(tvec3 const & x) + { + return mod289(((x * static_cast(34)) + static_cast(1)) * x); + } + + template + GLM_FUNC_QUALIFIER tvec4 permute(tvec4 const & x) + { + return mod289(((x * static_cast(34)) + static_cast(1)) * x); + } +/* + template class vecType> + GLM_FUNC_QUALIFIER vecType permute(vecType const & x) + { + return mod289(((x * T(34)) + T(1)) * x); + } +*/ + template + GLM_FUNC_QUALIFIER T taylorInvSqrt(T const & r) + { + return T(1.79284291400159) - T(0.85373472095314) * r; + } + + template + GLM_FUNC_QUALIFIER tvec2 taylorInvSqrt(tvec2 const & r) + { + return T(1.79284291400159) - T(0.85373472095314) * r; + } + + template + GLM_FUNC_QUALIFIER tvec3 taylorInvSqrt(tvec3 const & r) + { + return T(1.79284291400159) - T(0.85373472095314) * r; + } + + template + GLM_FUNC_QUALIFIER tvec4 taylorInvSqrt(tvec4 const & r) + { + return T(1.79284291400159) - T(0.85373472095314) * r; + } +/* + template class vecType> + GLM_FUNC_QUALIFIER vecType taylorInvSqrt(vecType const & r) + { + return T(1.79284291400159) - T(0.85373472095314) * r; + } +*/ + + template + GLM_FUNC_QUALIFIER tvec2 fade(tvec2 const & t) + { + return (t * t * t) * (t * (t * T(6) - T(15)) + T(10)); + } + + template + GLM_FUNC_QUALIFIER tvec3 fade(tvec3 const & t) + { + return (t * t * t) * (t * (t * T(6) - T(15)) + T(10)); + } + + template + GLM_FUNC_QUALIFIER tvec4 fade(tvec4 const & t) + { + return (t * t * t) * (t * (t * T(6) - T(15)) + T(10)); + } +/* + template class vecType> + GLM_FUNC_QUALIFIER vecType fade(vecType const & t) + { + return (t * t * t) * (t * (t * T(6) - T(15)) + T(10)); + } +*/ +}//namespace detail +}//namespace glm + diff --git a/mobile/ios/ViroKit.framework/Headers/glm/detail/_swizzle.hpp b/mobile/ios/ViroKit.framework/Headers/glm/detail/_swizzle.hpp new file mode 100755 index 0000000..670e269 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/glm/detail/_swizzle.hpp @@ -0,0 +1,797 @@ +/// @ref core +/// @file glm/detail/_swizzle.hpp + +#pragma once + +namespace glm{ +namespace detail +{ + // Internal class for implementing swizzle operators + template + struct _swizzle_base0 + { + protected: + GLM_FUNC_QUALIFIER T& elem(size_t i){ return (reinterpret_cast(_buffer))[i]; } + GLM_FUNC_QUALIFIER T const& elem(size_t i) const{ return (reinterpret_cast(_buffer))[i]; } + + // Use an opaque buffer to *ensure* the compiler doesn't call a constructor. + // The size 1 buffer is assumed to aligned to the actual members so that the + // elem() + char _buffer[1]; + }; + + template class vecType, int E0, int E1, int E2, int E3, bool Aligned> + struct _swizzle_base1 : public _swizzle_base0 + { + }; + + template class vecType, int E0, int E1, bool Aligned> + struct _swizzle_base1<2, T, P, vecType, E0,E1,-1,-2, Aligned> : public _swizzle_base0 + { + GLM_FUNC_QUALIFIER vecType operator ()() const { return vecType(this->elem(E0), this->elem(E1)); } + }; + + template class vecType, int E0, int E1, int E2, bool Aligned> + struct _swizzle_base1<3, T, P, vecType, E0,E1,E2,-1, Aligned> : public _swizzle_base0 + { + GLM_FUNC_QUALIFIER vecType operator ()() const { return vecType(this->elem(E0), this->elem(E1), this->elem(E2)); } + }; + + template class vecType, int E0, int E1, int E2, int E3, bool Aligned> + struct _swizzle_base1<4, T, P, vecType, E0,E1,E2,E3, Aligned> : public _swizzle_base0 + { + GLM_FUNC_QUALIFIER vecType operator ()() const { return vecType(this->elem(E0), this->elem(E1), this->elem(E2), this->elem(E3)); } + }; + + // Internal class for implementing swizzle operators + /* + Template parameters: + + ValueType = type of scalar values (e.g. float, double) + VecType = class the swizzle is applies to (e.g. tvec3) + N = number of components in the vector (e.g. 3) + E0...3 = what index the n-th element of this swizzle refers to in the unswizzled vec + + DUPLICATE_ELEMENTS = 1 if there is a repeated element, 0 otherwise (used to specialize swizzles + containing duplicate elements so that they cannot be used as r-values). + */ + template class vecType, int E0, int E1, int E2, int E3, int DUPLICATE_ELEMENTS> + struct _swizzle_base2 : public _swizzle_base1::value> + { + GLM_FUNC_QUALIFIER _swizzle_base2& operator= (const T& t) + { + for (int i = 0; i < N; ++i) + (*this)[i] = t; + return *this; + } + + GLM_FUNC_QUALIFIER _swizzle_base2& operator= (vecType const& that) + { + struct op { + GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e = t; } + }; + _apply_op(that, op()); + return *this; + } + + GLM_FUNC_QUALIFIER void operator -= (vecType const& that) + { + struct op { + GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e -= t; } + }; + _apply_op(that, op()); + } + + GLM_FUNC_QUALIFIER void operator += (vecType const& that) + { + struct op { + GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e += t; } + }; + _apply_op(that, op()); + } + + GLM_FUNC_QUALIFIER void operator *= (vecType const& that) + { + struct op { + GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e *= t; } + }; + _apply_op(that, op()); + } + + GLM_FUNC_QUALIFIER void operator /= (vecType const& that) + { + struct op { + GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e /= t; } + }; + _apply_op(that, op()); + } + + GLM_FUNC_QUALIFIER T& operator[](size_t i) + { + const int offset_dst[4] = { E0, E1, E2, E3 }; + return this->elem(offset_dst[i]); + } + GLM_FUNC_QUALIFIER T operator[](size_t i) const + { + const int offset_dst[4] = { E0, E1, E2, E3 }; + return this->elem(offset_dst[i]); + } + + protected: + template + GLM_FUNC_QUALIFIER void _apply_op(vecType const& that, U op) + { + // Make a copy of the data in this == &that. + // The copier should optimize out the copy in cases where the function is + // properly inlined and the copy is not necessary. + T t[N]; + for (int i = 0; i < N; ++i) + t[i] = that[i]; + for (int i = 0; i < N; ++i) + op( (*this)[i], t[i] ); + } + }; + + // Specialization for swizzles containing duplicate elements. These cannot be modified. + template class vecType, int E0, int E1, int E2, int E3> + struct _swizzle_base2 : public _swizzle_base1::value> + { + struct Stub {}; + + GLM_FUNC_QUALIFIER _swizzle_base2& operator= (Stub const &) { return *this; } + + GLM_FUNC_QUALIFIER T operator[] (size_t i) const + { + const int offset_dst[4] = { E0, E1, E2, E3 }; + return this->elem(offset_dst[i]); + } + }; + + template class vecType, int E0, int E1, int E2, int E3> + struct _swizzle : public _swizzle_base2 + { + typedef _swizzle_base2 base_type; + + using base_type::operator=; + + GLM_FUNC_QUALIFIER operator vecType () const { return (*this)(); } + }; + +// +// To prevent the C++ syntax from getting entirely overwhelming, define some alias macros +// +#define _GLM_SWIZZLE_TEMPLATE1 template class vecType, int E0, int E1, int E2, int E3> +#define _GLM_SWIZZLE_TEMPLATE2 template class vecType, int E0, int E1, int E2, int E3, int F0, int F1, int F2, int F3> +#define _GLM_SWIZZLE_TYPE1 _swizzle +#define _GLM_SWIZZLE_TYPE2 _swizzle + +// +// Wrapper for a binary operator (e.g. u.yy + v.zy) +// +#define _GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(OPERAND) \ + _GLM_SWIZZLE_TEMPLATE2 \ + GLM_FUNC_QUALIFIER vecType operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b) \ + { \ + return a() OPERAND b(); \ + } \ + _GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER vecType operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const vecType& b) \ + { \ + return a() OPERAND b; \ + } \ + _GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER vecType operator OPERAND ( const vecType& a, const _GLM_SWIZZLE_TYPE1& b) \ + { \ + return a OPERAND b(); \ + } + +// +// Wrapper for a operand between a swizzle and a binary (e.g. 1.0f - u.xyz) +// +#define _GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(OPERAND) \ + _GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER vecType operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const T& b) \ + { \ + return a() OPERAND b; \ + } \ + _GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER vecType operator OPERAND ( const T& a, const _GLM_SWIZZLE_TYPE1& b) \ + { \ + return a OPERAND b(); \ + } + +// +// Macro for wrapping a function taking one argument (e.g. abs()) +// +#define _GLM_SWIZZLE_FUNCTION_1_ARGS(RETURN_TYPE,FUNCTION) \ + _GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a) \ + { \ + return FUNCTION(a()); \ + } + +// +// Macro for wrapping a function taking two vector arguments (e.g. dot()). +// +#define _GLM_SWIZZLE_FUNCTION_2_ARGS(RETURN_TYPE,FUNCTION) \ + _GLM_SWIZZLE_TEMPLATE2 \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b) \ + { \ + return FUNCTION(a(), b()); \ + } \ + _GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE1& b) \ + { \ + return FUNCTION(a(), b()); \ + } \ + _GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const typename V& b) \ + { \ + return FUNCTION(a(), b); \ + } \ + _GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const V& a, const _GLM_SWIZZLE_TYPE1& b) \ + { \ + return FUNCTION(a, b()); \ + } + +// +// Macro for wrapping a function take 2 vec arguments followed by a scalar (e.g. mix()). +// +#define _GLM_SWIZZLE_FUNCTION_2_ARGS_SCALAR(RETURN_TYPE,FUNCTION) \ + _GLM_SWIZZLE_TEMPLATE2 \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b, const T& c) \ + { \ + return FUNCTION(a(), b(), c); \ + } \ + _GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE1& b, const T& c) \ + { \ + return FUNCTION(a(), b(), c); \ + } \ + _GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const typename S0::vec_type& b, const T& c)\ + { \ + return FUNCTION(a(), b, c); \ + } \ + _GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const typename V& a, const _GLM_SWIZZLE_TYPE1& b, const T& c) \ + { \ + return FUNCTION(a, b(), c); \ + } + +}//namespace detail +}//namespace glm + +namespace glm +{ + namespace detail + { + _GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(-) + _GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(*) + _GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(+) + _GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(-) + _GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(*) + _GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(/) + } + + // + // Swizzles are distinct types from the unswizzled type. The below macros will + // provide template specializations for the swizzle types for the given functions + // so that the compiler does not have any ambiguity to choosing how to handle + // the function. + // + // The alternative is to use the operator()() when calling the function in order + // to explicitly convert the swizzled type to the unswizzled type. + // + + //_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, abs); + //_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, acos); + //_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, acosh); + //_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, all); + //_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, any); + + //_GLM_SWIZZLE_FUNCTION_2_ARGS(value_type, dot); + //_GLM_SWIZZLE_FUNCTION_2_ARGS(vec_type, cross); + //_GLM_SWIZZLE_FUNCTION_2_ARGS(vec_type, step); + //_GLM_SWIZZLE_FUNCTION_2_ARGS_SCALAR(vec_type, mix); +} + +#define _GLM_SWIZZLE2_2_MEMBERS(T, P, V, E0,E1) \ + struct { detail::_swizzle<2, T, P, V, 0,0,-1,-2> E0 ## E0; }; \ + struct { detail::_swizzle<2, T, P, V, 0,1,-1,-2> E0 ## E1; }; \ + struct { detail::_swizzle<2, T, P, V, 1,0,-1,-2> E1 ## E0; }; \ + struct { detail::_swizzle<2, T, P, V, 1,1,-1,-2> E1 ## E1; }; + +#define _GLM_SWIZZLE2_3_MEMBERS(T, P, V, E0,E1) \ + struct { detail::_swizzle<3,T, P, V, 0,0,0,-1> E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<3,T, P, V, 0,0,1,-1> E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<3,T, P, V, 0,1,0,-1> E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<3,T, P, V, 0,1,1,-1> E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<3,T, P, V, 1,0,0,-1> E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<3,T, P, V, 1,0,1,-1> E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<3,T, P, V, 1,1,0,-1> E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<3,T, P, V, 1,1,1,-1> E1 ## E1 ## E1; }; + +#define _GLM_SWIZZLE2_4_MEMBERS(T, P, V, E0,E1) \ + struct { detail::_swizzle<4,T, P, V, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; + +#define _GLM_SWIZZLE3_2_MEMBERS(T, P, V, E0,E1,E2) \ + struct { detail::_swizzle<2,T, P, V, 0,0,-1,-2> E0 ## E0; }; \ + struct { detail::_swizzle<2,T, P, V, 0,1,-1,-2> E0 ## E1; }; \ + struct { detail::_swizzle<2,T, P, V, 0,2,-1,-2> E0 ## E2; }; \ + struct { detail::_swizzle<2,T, P, V, 1,0,-1,-2> E1 ## E0; }; \ + struct { detail::_swizzle<2,T, P, V, 1,1,-1,-2> E1 ## E1; }; \ + struct { detail::_swizzle<2,T, P, V, 1,2,-1,-2> E1 ## E2; }; \ + struct { detail::_swizzle<2,T, P, V, 2,0,-1,-2> E2 ## E0; }; \ + struct { detail::_swizzle<2,T, P, V, 2,1,-1,-2> E2 ## E1; }; \ + struct { detail::_swizzle<2,T, P, V, 2,2,-1,-2> E2 ## E2; }; + +#define _GLM_SWIZZLE3_3_MEMBERS(T, P, V ,E0,E1,E2) \ + struct { detail::_swizzle<3, T, P, V, 0,0,0,-1> E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 0,0,1,-1> E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 0,0,2,-1> E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 0,1,0,-1> E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 0,1,1,-1> E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 0,1,2,-1> E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 0,2,0,-1> E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 0,2,1,-1> E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 0,2,2,-1> E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 1,0,0,-1> E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 1,0,1,-1> E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 1,0,2,-1> E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 1,1,0,-1> E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 1,1,1,-1> E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 1,1,2,-1> E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 1,2,0,-1> E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 1,2,1,-1> E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 1,2,2,-1> E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 2,0,0,-1> E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 2,0,1,-1> E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 2,0,2,-1> E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 2,1,0,-1> E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 2,1,1,-1> E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 2,1,2,-1> E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 2,2,0,-1> E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 2,2,1,-1> E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 2,2,2,-1> E2 ## E2 ## E2; }; + +#define _GLM_SWIZZLE3_4_MEMBERS(T, P, V, E0,E1,E2) \ + struct { detail::_swizzle<4,T, P, V, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,0,2> E0 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,1,2> E0 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,2,0> E0 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,2,1> E0 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,2,2> E0 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,0,2> E0 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,1,2> E0 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,2,0> E0 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,2,1> E0 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,2,2> E0 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,0,0> E0 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,0,1> E0 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,0,2> E0 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,1,0> E0 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,1,1> E0 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,1,2> E0 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,2,0> E0 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,2,1> E0 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,2,2> E0 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,0,2> E1 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,1,2> E1 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,2,0> E1 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,2,1> E1 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,2,2> E1 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,0,2> E1 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,1,2> E1 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,2,0> E1 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,2,1> E1 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,2,2> E1 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,0,0> E1 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,0,1> E1 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,0,2> E1 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,1,0> E1 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,1,1> E1 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,1,2> E1 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,2,0> E1 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,2,1> E1 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,2,2> E1 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,0,0> E2 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,0,1> E2 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,0,2> E2 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,1,0> E2 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,1,1> E2 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,1,2> E2 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,2,0> E2 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,2,1> E2 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,2,2> E2 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,0,0> E2 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,0,1> E2 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,0,2> E2 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,1,0> E2 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,1,1> E2 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,1,2> E2 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,2,0> E2 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,2,1> E2 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,2,2> E2 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,0,0> E2 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,0,1> E2 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,0,2> E2 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,1,0> E2 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,1,1> E2 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,1,2> E2 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,2,0> E2 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,2,1> E2 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,2,2> E2 ## E2 ## E2 ## E2; }; + +#define _GLM_SWIZZLE4_2_MEMBERS(T, P, V, E0,E1,E2,E3) \ + struct { detail::_swizzle<2,T, P, V, 0,0,-1,-2> E0 ## E0; }; \ + struct { detail::_swizzle<2,T, P, V, 0,1,-1,-2> E0 ## E1; }; \ + struct { detail::_swizzle<2,T, P, V, 0,2,-1,-2> E0 ## E2; }; \ + struct { detail::_swizzle<2,T, P, V, 0,3,-1,-2> E0 ## E3; }; \ + struct { detail::_swizzle<2,T, P, V, 1,0,-1,-2> E1 ## E0; }; \ + struct { detail::_swizzle<2,T, P, V, 1,1,-1,-2> E1 ## E1; }; \ + struct { detail::_swizzle<2,T, P, V, 1,2,-1,-2> E1 ## E2; }; \ + struct { detail::_swizzle<2,T, P, V, 1,3,-1,-2> E1 ## E3; }; \ + struct { detail::_swizzle<2,T, P, V, 2,0,-1,-2> E2 ## E0; }; \ + struct { detail::_swizzle<2,T, P, V, 2,1,-1,-2> E2 ## E1; }; \ + struct { detail::_swizzle<2,T, P, V, 2,2,-1,-2> E2 ## E2; }; \ + struct { detail::_swizzle<2,T, P, V, 2,3,-1,-2> E2 ## E3; }; \ + struct { detail::_swizzle<2,T, P, V, 3,0,-1,-2> E3 ## E0; }; \ + struct { detail::_swizzle<2,T, P, V, 3,1,-1,-2> E3 ## E1; }; \ + struct { detail::_swizzle<2,T, P, V, 3,2,-1,-2> E3 ## E2; }; \ + struct { detail::_swizzle<2,T, P, V, 3,3,-1,-2> E3 ## E3; }; + +#define _GLM_SWIZZLE4_3_MEMBERS(T, P, V, E0,E1,E2,E3) \ + struct { detail::_swizzle<3, T, P, V, 0,0,0,-1> E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 0,0,1,-1> E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 0,0,2,-1> E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 0,0,3,-1> E0 ## E0 ## E3; }; \ + struct { detail::_swizzle<3, T, P, V, 0,1,0,-1> E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 0,1,1,-1> E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 0,1,2,-1> E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 0,1,3,-1> E0 ## E1 ## E3; }; \ + struct { detail::_swizzle<3, T, P, V, 0,2,0,-1> E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 0,2,1,-1> E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 0,2,2,-1> E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 0,2,3,-1> E0 ## E2 ## E3; }; \ + struct { detail::_swizzle<3, T, P, V, 0,3,0,-1> E0 ## E3 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 0,3,1,-1> E0 ## E3 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 0,3,2,-1> E0 ## E3 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 0,3,3,-1> E0 ## E3 ## E3; }; \ + struct { detail::_swizzle<3, T, P, V, 1,0,0,-1> E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 1,0,1,-1> E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 1,0,2,-1> E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 1,0,3,-1> E1 ## E0 ## E3; }; \ + struct { detail::_swizzle<3, T, P, V, 1,1,0,-1> E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 1,1,1,-1> E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 1,1,2,-1> E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 1,1,3,-1> E1 ## E1 ## E3; }; \ + struct { detail::_swizzle<3, T, P, V, 1,2,0,-1> E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 1,2,1,-1> E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 1,2,2,-1> E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 1,2,3,-1> E1 ## E2 ## E3; }; \ + struct { detail::_swizzle<3, T, P, V, 1,3,0,-1> E1 ## E3 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 1,3,1,-1> E1 ## E3 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 1,3,2,-1> E1 ## E3 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 1,3,3,-1> E1 ## E3 ## E3; }; \ + struct { detail::_swizzle<3, T, P, V, 2,0,0,-1> E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 2,0,1,-1> E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 2,0,2,-1> E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 2,0,3,-1> E2 ## E0 ## E3; }; \ + struct { detail::_swizzle<3, T, P, V, 2,1,0,-1> E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 2,1,1,-1> E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 2,1,2,-1> E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 2,1,3,-1> E2 ## E1 ## E3; }; \ + struct { detail::_swizzle<3, T, P, V, 2,2,0,-1> E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 2,2,1,-1> E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 2,2,2,-1> E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 2,2,3,-1> E2 ## E2 ## E3; }; \ + struct { detail::_swizzle<3, T, P, V, 2,3,0,-1> E2 ## E3 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 2,3,1,-1> E2 ## E3 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 2,3,2,-1> E2 ## E3 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 2,3,3,-1> E2 ## E3 ## E3; }; \ + struct { detail::_swizzle<3, T, P, V, 3,0,0,-1> E3 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 3,0,1,-1> E3 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 3,0,2,-1> E3 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 3,0,3,-1> E3 ## E0 ## E3; }; \ + struct { detail::_swizzle<3, T, P, V, 3,1,0,-1> E3 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 3,1,1,-1> E3 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 3,1,2,-1> E3 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 3,1,3,-1> E3 ## E1 ## E3; }; \ + struct { detail::_swizzle<3, T, P, V, 3,2,0,-1> E3 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 3,2,1,-1> E3 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 3,2,2,-1> E3 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 3,2,3,-1> E3 ## E2 ## E3; }; \ + struct { detail::_swizzle<3, T, P, V, 3,3,0,-1> E3 ## E3 ## E0; }; \ + struct { detail::_swizzle<3, T, P, V, 3,3,1,-1> E3 ## E3 ## E1; }; \ + struct { detail::_swizzle<3, T, P, V, 3,3,2,-1> E3 ## E3 ## E2; }; \ + struct { detail::_swizzle<3, T, P, V, 3,3,3,-1> E3 ## E3 ## E3; }; + +#define _GLM_SWIZZLE4_4_MEMBERS(T, P, V, E0,E1,E2,E3) \ + struct { detail::_swizzle<4, T, P, V, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,0,2> E0 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,0,3> E0 ## E0 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,1,2> E0 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,1,3> E0 ## E0 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,2,0> E0 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,2,1> E0 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,2,2> E0 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,2,3> E0 ## E0 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,3,0> E0 ## E0 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,3,1> E0 ## E0 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,3,2> E0 ## E0 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,3,3> E0 ## E0 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,0,2> E0 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,0,3> E0 ## E1 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,1,2> E0 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,1,3> E0 ## E1 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,2,0> E0 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,2,1> E0 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,2,2> E0 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,2,3> E0 ## E1 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,3,0> E0 ## E1 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,3,1> E0 ## E1 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,3,2> E0 ## E1 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,3,3> E0 ## E1 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,0,0> E0 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,0,1> E0 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,0,2> E0 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,0,3> E0 ## E2 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,1,0> E0 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,1,1> E0 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,1,2> E0 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,1,3> E0 ## E2 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,2,0> E0 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,2,1> E0 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,2,2> E0 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,2,3> E0 ## E2 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,3,0> E0 ## E2 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,3,1> E0 ## E2 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,3,2> E0 ## E2 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,3,3> E0 ## E2 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,0,0> E0 ## E3 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,0,1> E0 ## E3 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,0,2> E0 ## E3 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,0,3> E0 ## E3 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,1,0> E0 ## E3 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,1,1> E0 ## E3 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,1,2> E0 ## E3 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,1,3> E0 ## E3 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,2,0> E0 ## E3 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,2,1> E0 ## E3 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,2,2> E0 ## E3 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,2,3> E0 ## E3 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,3,0> E0 ## E3 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,3,1> E0 ## E3 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,3,2> E0 ## E3 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,3,3> E0 ## E3 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,0,2> E1 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,0,3> E1 ## E0 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,1,2> E1 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,1,3> E1 ## E0 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,2,0> E1 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,2,1> E1 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,2,2> E1 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,2,3> E1 ## E0 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,3,0> E1 ## E0 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,3,1> E1 ## E0 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,3,2> E1 ## E0 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,3,3> E1 ## E0 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,0,2> E1 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,0,3> E1 ## E1 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,1,2> E1 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,1,3> E1 ## E1 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,2,0> E1 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,2,1> E1 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,2,2> E1 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,2,3> E1 ## E1 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,3,0> E1 ## E1 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,3,1> E1 ## E1 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,3,2> E1 ## E1 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,3,3> E1 ## E1 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,0,0> E1 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,0,1> E1 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,0,2> E1 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,0,3> E1 ## E2 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,1,0> E1 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,1,1> E1 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,1,2> E1 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,1,3> E1 ## E2 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,2,0> E1 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,2,1> E1 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,2,2> E1 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,2,3> E1 ## E2 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,3,0> E1 ## E2 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,3,1> E1 ## E2 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,3,2> E1 ## E2 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,3,3> E1 ## E2 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,0,0> E1 ## E3 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,0,1> E1 ## E3 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,0,2> E1 ## E3 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,0,3> E1 ## E3 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,1,0> E1 ## E3 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,1,1> E1 ## E3 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,1,2> E1 ## E3 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,1,3> E1 ## E3 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,2,0> E1 ## E3 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,2,1> E1 ## E3 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,2,2> E1 ## E3 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,2,3> E1 ## E3 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,3,0> E1 ## E3 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,3,1> E1 ## E3 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,3,2> E1 ## E3 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,3,3> E1 ## E3 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,0,0> E2 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,0,1> E2 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,0,2> E2 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,0,3> E2 ## E0 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,1,0> E2 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,1,1> E2 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,1,2> E2 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,1,3> E2 ## E0 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,2,0> E2 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,2,1> E2 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,2,2> E2 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,2,3> E2 ## E0 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,3,0> E2 ## E0 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,3,1> E2 ## E0 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,3,2> E2 ## E0 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,3,3> E2 ## E0 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,0,0> E2 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,0,1> E2 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,0,2> E2 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,0,3> E2 ## E1 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,1,0> E2 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,1,1> E2 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,1,2> E2 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,1,3> E2 ## E1 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,2,0> E2 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,2,1> E2 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,2,2> E2 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,2,3> E2 ## E1 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,3,0> E2 ## E1 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,3,1> E2 ## E1 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,3,2> E2 ## E1 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,3,3> E2 ## E1 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,0,0> E2 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,0,1> E2 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,0,2> E2 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,0,3> E2 ## E2 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,1,0> E2 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,1,1> E2 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,1,2> E2 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,1,3> E2 ## E2 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,2,0> E2 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,2,1> E2 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,2,2> E2 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,2,3> E2 ## E2 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,3,0> E2 ## E2 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,3,1> E2 ## E2 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,3,2> E2 ## E2 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,3,3> E2 ## E2 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,0,0> E2 ## E3 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,0,1> E2 ## E3 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,0,2> E2 ## E3 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,0,3> E2 ## E3 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,1,0> E2 ## E3 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,1,1> E2 ## E3 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,1,2> E2 ## E3 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,1,3> E2 ## E3 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,2,0> E2 ## E3 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,2,1> E2 ## E3 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,2,2> E2 ## E3 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,2,3> E2 ## E3 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,3,0> E2 ## E3 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,3,1> E2 ## E3 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,3,2> E2 ## E3 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,3,3> E2 ## E3 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,0,0> E3 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,0,1> E3 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,0,2> E3 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,0,3> E3 ## E0 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,1,0> E3 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,1,1> E3 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,1,2> E3 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,1,3> E3 ## E0 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,2,0> E3 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,2,1> E3 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,2,2> E3 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,2,3> E3 ## E0 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,3,0> E3 ## E0 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,3,1> E3 ## E0 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,3,2> E3 ## E0 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,3,3> E3 ## E0 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,0,0> E3 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,0,1> E3 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,0,2> E3 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,0,3> E3 ## E1 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,1,0> E3 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,1,1> E3 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,1,2> E3 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,1,3> E3 ## E1 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,2,0> E3 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,2,1> E3 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,2,2> E3 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,2,3> E3 ## E1 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,3,0> E3 ## E1 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,3,1> E3 ## E1 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,3,2> E3 ## E1 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,3,3> E3 ## E1 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,0,0> E3 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,0,1> E3 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,0,2> E3 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,0,3> E3 ## E2 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,1,0> E3 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,1,1> E3 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,1,2> E3 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,1,3> E3 ## E2 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,2,0> E3 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,2,1> E3 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,2,2> E3 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,2,3> E3 ## E2 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,3,0> E3 ## E2 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,3,1> E3 ## E2 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,3,2> E3 ## E2 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,3,3> E3 ## E2 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,0,0> E3 ## E3 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,0,1> E3 ## E3 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,0,2> E3 ## E3 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,0,3> E3 ## E3 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,1,0> E3 ## E3 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,1,1> E3 ## E3 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,1,2> E3 ## E3 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,1,3> E3 ## E3 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,2,0> E3 ## E3 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,2,1> E3 ## E3 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,2,2> E3 ## E3 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,2,3> E3 ## E3 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,3,0> E3 ## E3 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,3,1> E3 ## E3 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,3,2> E3 ## E3 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,3,3> E3 ## E3 ## E3 ## E3; }; diff --git a/mobile/ios/ViroKit.framework/Headers/glm/detail/_swizzle_func.hpp b/mobile/ios/ViroKit.framework/Headers/glm/detail/_swizzle_func.hpp new file mode 100755 index 0000000..4c36189 --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/glm/detail/_swizzle_func.hpp @@ -0,0 +1,696 @@ +/// @ref core +/// @file glm/detail/_swizzle_func.hpp + +#pragma once + +#define GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B) \ + SWIZZLED_TYPE A ## B() CONST \ + { \ + return SWIZZLED_TYPE(this->A, this->B); \ + } + +#define GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B, C) \ + SWIZZLED_TYPE A ## B ## C() CONST \ + { \ + return SWIZZLED_TYPE(this->A, this->B, this->C); \ + } + +#define GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B, C, D) \ + SWIZZLED_TYPE A ## B ## C ## D() CONST \ + { \ + return SWIZZLED_TYPE(this->A, this->B, this->C, this->D); \ + } + +#define GLM_SWIZZLE_GEN_VEC2_ENTRY_DEF(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B) \ + template \ + SWIZZLED_TYPE CLASS_TYPE::A ## B() CONST \ + { \ + return SWIZZLED_TYPE(this->A, this->B); \ + } + +#define GLM_SWIZZLE_GEN_VEC3_ENTRY_DEF(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B, C) \ + template \ + SWIZZLED_TYPE CLASS_TYPE::A ## B ## C() CONST \ + { \ + return SWIZZLED_TYPE(this->A, this->B, this->C); \ + } + +#define GLM_SWIZZLE_GEN_VEC4_ENTRY_DEF(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B, C, D) \ + template \ + SWIZZLED_TYPE CLASS_TYPE::A ## B ## C ## D() CONST \ + { \ + return SWIZZLED_TYPE(this->A, this->B, this->C, this->D); \ + } + +#define GLM_MUTABLE + +#define GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, A) + +#define GLM_SWIZZLE_GEN_REF_FROM_VEC2(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE) \ + GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, x, y) \ + GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, r, g) \ + GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, s, t) + +//GLM_SWIZZLE_GEN_REF_FROM_VEC2(valType, detail::vec2, detail::ref2) + +#define GLM_SWIZZLE_GEN_REF2_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, B) + +#define GLM_SWIZZLE_GEN_REF3_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, B, A) + +#define GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, A, B, C) \ + GLM_SWIZZLE_GEN_REF3_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC3_TYPE, A, B, C) \ + GLM_SWIZZLE_GEN_REF2_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, A, B, C) + +#define GLM_SWIZZLE_GEN_REF_FROM_VEC3(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE) \ + GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, x, y, z) \ + GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, r, g, b) \ + GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, s, t, p) + +//GLM_SWIZZLE_GEN_REF_FROM_VEC3(valType, detail::vec3, detail::ref2, detail::ref3) + +#define GLM_SWIZZLE_GEN_REF2_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, D, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, D, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, D, C) + +#define GLM_SWIZZLE_GEN_REF3_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, B, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, D, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, D, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, A, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, D, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, D, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, A, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, B, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, D, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, D, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, C, B) + +#define GLM_SWIZZLE_GEN_REF4_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, C, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, C, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, D, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, D, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, B, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, C, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, C, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, D, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, D, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, A, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, A, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, B, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, B, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, D, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, D, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, A, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, A, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, B, C, A) + +#define GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_REF2_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_REF3_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC3_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_REF4_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC4_TYPE, A, B, C, D) + +#define GLM_SWIZZLE_GEN_REF_FROM_VEC4(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE) \ + GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, x, y, z, w) \ + GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, r, g, b, a) \ + GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, s, t, p, q) + +//GLM_SWIZZLE_GEN_REF_FROM_VEC4(valType, detail::vec4, detail::ref2, detail::ref3, detail::ref4) + +#define GLM_SWIZZLE_GEN_VEC2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B) + +#define GLM_SWIZZLE_GEN_VEC3_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B) + +#define GLM_SWIZZLE_GEN_VEC4_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, B) + +#define GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, A, B) \ + GLM_SWIZZLE_GEN_VEC2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, A, B) \ + GLM_SWIZZLE_GEN_VEC3_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC3_TYPE, A, B) \ + GLM_SWIZZLE_GEN_VEC4_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC4_TYPE, A, B) + +#define GLM_SWIZZLE_GEN_VEC_FROM_VEC2(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, x, y) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, r, g) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, s, t) + +//GLM_SWIZZLE_GEN_VEC_FROM_VEC2(valType, detail::vec2, detail::vec2, detail::vec3, detail::vec4) + +#define GLM_SWIZZLE_GEN_VEC2_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C) + +#define GLM_SWIZZLE_GEN_VEC3_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C) + +#define GLM_SWIZZLE_GEN_VEC4_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, C) + +#define GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, A, B, C) \ + GLM_SWIZZLE_GEN_VEC2_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC3_TYPE, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC4_TYPE, A, B, C) + +#define GLM_SWIZZLE_GEN_VEC_FROM_VEC3(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, x, y, z) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, r, g, b) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, s, t, p) + +//GLM_SWIZZLE_GEN_VEC_FROM_VEC3(valType, detail::vec3, detail::vec2, detail::vec3, detail::vec4) + +#define GLM_SWIZZLE_GEN_VEC2_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D) + +#define GLM_SWIZZLE_GEN_VEC3_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, D) + +#define GLM_SWIZZLE_GEN_VEC4_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, D, D) + +#define GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC2_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC3_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC3_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC4_TYPE, A, B, C, D) + +#define GLM_SWIZZLE_GEN_VEC_FROM_VEC4(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, x, y, z, w) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, r, g, b, a) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, s, t, p, q) + +//GLM_SWIZZLE_GEN_VEC_FROM_VEC4(valType, detail::vec4, detail::vec2, detail::vec3, detail::vec4) diff --git a/mobile/ios/ViroKit.framework/Headers/glm/detail/_vectorize.hpp b/mobile/ios/ViroKit.framework/Headers/glm/detail/_vectorize.hpp new file mode 100755 index 0000000..bba064a --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/glm/detail/_vectorize.hpp @@ -0,0 +1,131 @@ +/// @ref core +/// @file glm/detail/_vectorize.hpp + +#pragma once + +#include "type_vec1.hpp" +#include "type_vec2.hpp" +#include "type_vec3.hpp" +#include "type_vec4.hpp" + +namespace glm{ +namespace detail +{ + template class vecType> + struct functor1{}; + + template + struct functor1 + { + GLM_FUNC_QUALIFIER static tvec1 call(R (*Func) (T x), tvec1 const & v) + { + return tvec1(Func(v.x)); + } + }; + + template + struct functor1 + { + GLM_FUNC_QUALIFIER static tvec2 call(R (*Func) (T x), tvec2 const & v) + { + return tvec2(Func(v.x), Func(v.y)); + } + }; + + template + struct functor1 + { + GLM_FUNC_QUALIFIER static tvec3 call(R (*Func) (T x), tvec3 const & v) + { + return tvec3(Func(v.x), Func(v.y), Func(v.z)); + } + }; + + template + struct functor1 + { + GLM_FUNC_QUALIFIER static tvec4 call(R (*Func) (T x), tvec4 const & v) + { + return tvec4(Func(v.x), Func(v.y), Func(v.z), Func(v.w)); + } + }; + + template class vecType> + struct functor2{}; + + template + struct functor2 + { + GLM_FUNC_QUALIFIER static tvec1 call(T (*Func) (T x, T y), tvec1 const & a, tvec1 const & b) + { + return tvec1(Func(a.x, b.x)); + } + }; + + template + struct functor2 + { + GLM_FUNC_QUALIFIER static tvec2 call(T (*Func) (T x, T y), tvec2 const & a, tvec2 const & b) + { + return tvec2(Func(a.x, b.x), Func(a.y, b.y)); + } + }; + + template + struct functor2 + { + GLM_FUNC_QUALIFIER static tvec3 call(T (*Func) (T x, T y), tvec3 const & a, tvec3 const & b) + { + return tvec3(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z)); + } + }; + + template + struct functor2 + { + GLM_FUNC_QUALIFIER static tvec4 call(T (*Func) (T x, T y), tvec4 const & a, tvec4 const & b) + { + return tvec4(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w)); + } + }; + + template class vecType> + struct functor2_vec_sca{}; + + template + struct functor2_vec_sca + { + GLM_FUNC_QUALIFIER static tvec1 call(T (*Func) (T x, T y), tvec1 const & a, T b) + { + return tvec1(Func(a.x, b)); + } + }; + + template + struct functor2_vec_sca + { + GLM_FUNC_QUALIFIER static tvec2 call(T (*Func) (T x, T y), tvec2 const & a, T b) + { + return tvec2(Func(a.x, b), Func(a.y, b)); + } + }; + + template + struct functor2_vec_sca + { + GLM_FUNC_QUALIFIER static tvec3 call(T (*Func) (T x, T y), tvec3 const & a, T b) + { + return tvec3(Func(a.x, b), Func(a.y, b), Func(a.z, b)); + } + }; + + template + struct functor2_vec_sca + { + GLM_FUNC_QUALIFIER static tvec4 call(T (*Func) (T x, T y), tvec4 const & a, T b) + { + return tvec4(Func(a.x, b), Func(a.y, b), Func(a.z, b), Func(a.w, b)); + } + }; +}//namespace detail +}//namespace glm diff --git a/mobile/ios/ViroKit.framework/Headers/glm/detail/dummy.cpp b/mobile/ios/ViroKit.framework/Headers/glm/detail/dummy.cpp new file mode 100755 index 0000000..cf1730f --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/glm/detail/dummy.cpp @@ -0,0 +1,207 @@ +/// @ref core +/// @file glm/core/dummy.cpp +/// +/// GLM is a header only library. There is nothing to compile. +/// dummy.cpp exist only a wordaround for CMake file. + +/* +#define GLM_MESSAGES +#include +#include +#include + +struct material +{ + glm::vec4 emission; // Ecm + glm::vec4 ambient; // Acm + glm::vec4 diffuse; // Dcm + glm::vec4 specular; // Scm + float shininess; // Srm +}; + +struct light +{ + glm::vec4 ambient; // Acli + glm::vec4 diffuse; // Dcli + glm::vec4 specular; // Scli + glm::vec4 position; // Ppli + glm::vec4 halfVector; // Derived: Hi + glm::vec3 spotDirection; // Sdli + float spotExponent; // Srli + float spotCutoff; // Crli + // (range: [0.0,90.0], 180.0) + float spotCosCutoff; // Derived: cos(Crli) + // (range: [1.0,0.0],-1.0) + float constantAttenuation; // K0 + float linearAttenuation; // K1 + float quadraticAttenuation;// K2 +}; + + +// Sample 1 +#include // glm::vec3 +#include // glm::cross, glm::normalize + +glm::vec3 computeNormal +( + glm::vec3 const & a, + glm::vec3 const & b, + glm::vec3 const & c +) +{ + return glm::normalize(glm::cross(c - a, b - a)); +} + +typedef unsigned int GLuint; +#define GL_FALSE 0 +void glUniformMatrix4fv(GLuint, int, int, float*){} + +// Sample 2 +#include // glm::vec3 +#include // glm::vec4, glm::ivec4 +#include // glm::mat4 +#include // glm::translate, glm::rotate, glm::scale, glm::perspective +#include // glm::value_ptr +void func(GLuint LocationMVP, float Translate, glm::vec2 const & Rotate) +{ + glm::mat4 Projection = glm::perspective(45.0f, 4.0f / 3.0f, 0.1f, 100.f); + glm::mat4 ViewTranslate = glm::translate(glm::mat4(1.0f), glm::vec3(0.0f, 0.0f, -Translate)); + glm::mat4 ViewRotateX = glm::rotate(ViewTranslate, Rotate.y, glm::vec3(-1.0f, 0.0f, 0.0f)); + glm::mat4 View = glm::rotate(ViewRotateX, Rotate.x, glm::vec3(0.0f, 1.0f, 0.0f)); + glm::mat4 Model = glm::scale(glm::mat4(1.0f), glm::vec3(0.5f)); + glm::mat4 MVP = Projection * View * Model; + glUniformMatrix4fv(LocationMVP, 1, GL_FALSE, glm::value_ptr(MVP)); +} + +// Sample 3 +#include // glm::vec2 +#include // glm::packUnorm2x16 +#include // glm::uint +#include // glm::i8vec2, glm::i32vec2 +std::size_t const VertexCount = 4; +// Float quad geometry +std::size_t const PositionSizeF32 = VertexCount * sizeof(glm::vec2); +glm::vec2 const PositionDataF32[VertexCount] = +{ + glm::vec2(-1.0f,-1.0f), + glm::vec2( 1.0f,-1.0f), + glm::vec2( 1.0f, 1.0f), + glm::vec2(-1.0f, 1.0f) + }; +// Half-float quad geometry +std::size_t const PositionSizeF16 = VertexCount * sizeof(glm::uint); +glm::uint const PositionDataF16[VertexCount] = +{ + glm::uint(glm::packUnorm2x16(glm::vec2(-1.0f, -1.0f))), + glm::uint(glm::packUnorm2x16(glm::vec2( 1.0f, -1.0f))), + glm::uint(glm::packUnorm2x16(glm::vec2( 1.0f, 1.0f))), + glm::uint(glm::packUnorm2x16(glm::vec2(-1.0f, 1.0f))) +}; +// 8 bits signed integer quad geometry +std::size_t const PositionSizeI8 = VertexCount * sizeof(glm::i8vec2); +glm::i8vec2 const PositionDataI8[VertexCount] = +{ + glm::i8vec2(-1,-1), + glm::i8vec2( 1,-1), + glm::i8vec2( 1, 1), + glm::i8vec2(-1, 1) +}; +// 32 bits signed integer quad geometry +std::size_t const PositionSizeI32 = VertexCount * sizeof(glm::i32vec2); +glm::i32vec2 const PositionDataI32[VertexCount] = +{ + glm::i32vec2 (-1,-1), + glm::i32vec2 ( 1,-1), + glm::i32vec2 ( 1, 1), + glm::i32vec2 (-1, 1) +}; + +struct intersection +{ + glm::vec4 position; + glm::vec3 normal; +}; +*/ + + +/* +// Sample 4 +#include // glm::vec3 +#include // glm::normalize, glm::dot, glm::reflect +#include // glm::pow +#include // glm::vecRand3 +glm::vec3 lighting +( + intersection const & Intersection, + material const & Material, + light const & Light, + glm::vec3 const & View +) +{ + glm::vec3 Color(0.0f); + glm::vec3 LightVertor(glm::normalize( + Light.position - Intersection.position + + glm::vecRand3(0.0f, Light.inaccuracy)); + + if(!shadow(Intersection.position, Light.position, LightVertor)) + { + float Diffuse = glm::dot(Intersection.normal, LightVector); + if(Diffuse <= 0.0f) + return Color; + if(Material.isDiffuse()) + Color += Light.color() * Material.diffuse * Diffuse; + if(Material.isSpecular()) + { + glm::vec3 Reflect(glm::reflect( + glm::normalize(-LightVector), + glm::normalize(Intersection.normal))); + float Dot = glm::dot(Reflect, View); + float Base = Dot > 0.0f ? Dot : 0.0f; + float Specular = glm::pow(Base, Material.exponent); + Color += Material.specular * Specular; + } + } + return Color; +} +*/ + +/* +template class vecType> +T normalizeDotA(vecType const & x, vecType const & y) +{ + return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y)); +} + +#define GLM_TEMPLATE_GENTYPE typename T, glm::precision P, template class + +template +T normalizeDotB(vecType const & x, vecType const & y) +{ + return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y)); +} + +template +typename vecType::value_type normalizeDotC(vecType const & a, vecType const & b) +{ + return glm::dot(a, b) * glm::inversesqrt(glm::dot(a, a) * glm::dot(b, b)); +} +*/ +int main() +{ +/* + glm::vec1 o(1); + glm::vec2 a(1); + glm::vec3 b(1); + glm::vec4 c(1); + + glm::quat q; + glm::dualquat p; + + glm::mat4 m(1); + + float a0 = normalizeDotA(a, a); + float b0 = normalizeDotB(b, b); + float c0 = normalizeDotC(c, c); +*/ + return 0; +} diff --git a/mobile/ios/ViroKit.framework/Headers/glm/detail/func_common.hpp b/mobile/ios/ViroKit.framework/Headers/glm/detail/func_common.hpp new file mode 100755 index 0000000..65cab6e --- /dev/null +++ b/mobile/ios/ViroKit.framework/Headers/glm/detail/func_common.hpp @@ -0,0 +1,427 @@ +/// @ref core +/// @file glm/detail/func_common.hpp +/// +/// @see GLSL 4.20.8 specification, section 8.3 Common Functions +/// +/// @defgroup core_func_common Common functions +/// @ingroup core +/// +/// These all operate component-wise. The description is per component. + +#pragma once + +#include "setup.hpp" +#include "precision.hpp" +#include "type_int.hpp" +#include "_fixes.hpp" + +namespace glm +{ + /// @addtogroup core_func_common + /// @{ + + /// Returns x if x >= 0; otherwise, it returns -x. + /// + /// @tparam genType floating-point or signed integer; scalar or vector types. + /// + /// @see GLSL abs man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType abs(genType x); + + template class vecType> + GLM_FUNC_DECL vecType abs(vecType const & x); + + /// Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0. + /// + /// @tparam genType Floating-point or signed integer; scalar or vector types. + /// + /// @see GLSL sign man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template class vecType> + GLM_FUNC_DECL vecType sign(vecType const & x); + + /// Returns a value equal to the nearest integer that is less then or equal to x. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL floor man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template class vecType> + GLM_FUNC_DECL vecType floor(vecType const & x); + + /// Returns a value equal to the nearest integer to x + /// whose absolute value is not larger than the absolute value of x. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL trunc man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template class vecType> + GLM_FUNC_DECL vecType trunc(vecType const & x); + + /// Returns a value equal to the nearest integer to x. + /// The fraction 0.5 will round in a direction chosen by the + /// implementation, presumably the direction that is fastest. + /// This includes the possibility that round(x) returns the + /// same value as roundEven(x) for all values of x. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL round man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template class vecType> + GLM_FUNC_DECL vecType round(vecType const & x); + + /// Returns a value equal to the nearest integer to x. + /// A fractional part of 0.5 will round toward the nearest even + /// integer. (Both 3.5 and 4.5 for x will return 4.0.) + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL roundEven man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + /// @see New round to even technique + template class vecType> + GLM_FUNC_DECL vecType roundEven(vecType const & x); + + /// Returns a value equal to the nearest integer + /// that is greater than or equal to x. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL ceil man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template class vecType> + GLM_FUNC_DECL vecType ceil(vecType const & x); + + /// Return x - floor(x). + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL fract man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType fract(genType x); + + template class vecType> + GLM_FUNC_DECL vecType fract(vecType const & x); + + /// Modulus. Returns x - y * floor(x / y) + /// for each component in x using the floating point value y. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL mod man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType mod(genType x, genType y); + + template class vecType> + GLM_FUNC_DECL vecType mod(vecType const & x, T y); + + template class vecType> + GLM_FUNC_DECL vecType mod(vecType const & x, vecType const & y); + + /// Returns the fractional part of x and sets i to the integer + /// part (as a whole number floating point value). Both the + /// return value and the output parameter will have the same + /// sign as x. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL modf man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType modf(genType x, genType & i); + + /// Returns y if y < x; otherwise, it returns x. + /// + /// @tparam genType Floating-point or integer; scalar or vector types. + /// + /// @see GLSL min man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType min(genType x, genType y); + + template class vecType> + GLM_FUNC_DECL vecType min(vecType const & x, T y); + + template class vecType> + GLM_FUNC_DECL vecType min(vecType const & x, vecType const & y); + + /// Returns y if x < y; otherwise, it returns x. + /// + /// @tparam genType Floating-point or integer; scalar or vector types. + /// + /// @see GLSL max man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType max(genType x, genType y); + + template class vecType> + GLM_FUNC_DECL vecType max(vecType const & x, T y); + + template class vecType> + GLM_FUNC_DECL vecType max(vecType const & x, vecType const & y); + + /// Returns min(max(x, minVal), maxVal) for each component in x + /// using the floating-point values minVal and maxVal. + /// + /// @tparam genType Floating-point or integer; scalar or vector types. + /// + /// @see GLSL clamp man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType clamp(genType x, genType minVal, genType maxVal); + + template class vecType> + GLM_FUNC_DECL vecType clamp(vecType const & x, T minVal, T maxVal); + + template class vecType> + GLM_FUNC_DECL vecType clamp(vecType const & x, vecType const & minVal, vecType const & maxVal); + + /// If genTypeU is a floating scalar or vector: + /// Returns x * (1.0 - a) + y * a, i.e., the linear blend of + /// x and y using the floating-point value a. + /// The value for a is not restricted to the range [0, 1]. + /// + /// If genTypeU is a boolean scalar or vector: + /// Selects which vector each returned component comes + /// from. For a component of that is false, the + /// corresponding component of x is returned. For a + /// component of a that is true, the corresponding + /// component of y is returned. Components of x and y that + /// are not selected are allowed to be invalid floating point + /// values and will have no effect on the results. Thus, this + /// provides different functionality than + /// genType mix(genType x, genType y, genType(a)) + /// where a is a Boolean vector. + /// + /// @see GLSL mix man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + /// + /// @param[in] x Value to interpolate. + /// @param[in] y Value to interpolate. + /// @param[in] a Interpolant. + /// + /// @tparam genTypeT Floating point scalar or vector. + /// @tparam genTypeU Floating point or boolean scalar or vector. It can't be a vector if it is the length of genTypeT. + /// + /// @code + /// #include + /// ... + /// float a; + /// bool b; + /// glm::dvec3 e; + /// glm::dvec3 f; + /// glm::vec4 g; + /// glm::vec4 h; + /// ... + /// glm::vec4 r = glm::mix(g, h, a); // Interpolate with a floating-point scalar two vectors. + /// glm::vec4 s = glm::mix(g, h, b); // Teturns g or h; + /// glm::dvec3 t = glm::mix(e, f, a); // Types of the third parameter is not required to match with the first and the second. + /// glm::vec4 u = glm::mix(g, h, r); // Interpolations can be perform per component with a vector for the last parameter. + /// @endcode + template class vecType> + GLM_FUNC_DECL vecType mix(vecType const & x, vecType const & y, vecType const & a); + + template class vecType> + GLM_FUNC_DECL vecType mix(vecType const & x, vecType const & y, U a); + + template + GLM_FUNC_DECL genTypeT mix(genTypeT x, genTypeT y, genTypeU a); + + /// Returns 0.0 if x < edge, otherwise it returns 1.0 for each component of a genType. + /// + /// @see GLSL step man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType step(genType edge, genType x); + + /// Returns 0.0 if x < edge, otherwise it returns 1.0. + /// + /// @see GLSL step man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template