├── .gitignore
├── .idea
├── caches
│ └── build_file_checksums.ser
├── codeStyles
│ └── Project.xml
├── encodings.xml
├── gradle.xml
├── misc.xml
├── runConfigurations.xml
└── vcs.xml
├── README.md
├── a.gif
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── example
│ │ └── ty
│ │ └── openglndk
│ │ └── ExampleInstrumentedTest.kt
│ ├── main
│ ├── AndroidManifest.xml
│ ├── assets
│ │ ├── shape
│ │ │ ├── fragment_shader.glsl
│ │ │ └── vertex_shader.glsl
│ │ ├── simplePBO
│ │ │ ├── fragment_shader.glsl
│ │ │ └── vertex_shader.glsl
│ │ └── texture
│ │ │ ├── fragment_shader.glsl
│ │ │ └── vertex_shader.glsl
│ ├── cpp
│ │ ├── CMakeLists.txt
│ │ ├── glm
│ │ │ ├── CMakeLists.txt
│ │ │ ├── common.hpp
│ │ │ ├── detail
│ │ │ │ ├── _features.hpp
│ │ │ │ ├── _fixes.hpp
│ │ │ │ ├── _noise.hpp
│ │ │ │ ├── _swizzle.hpp
│ │ │ │ ├── _swizzle_func.hpp
│ │ │ │ ├── _vectorize.hpp
│ │ │ │ ├── compute_vector_relational.hpp
│ │ │ │ ├── dummy.cpp
│ │ │ │ ├── func_common.inl
│ │ │ │ ├── func_common_simd.inl
│ │ │ │ ├── func_exponential.inl
│ │ │ │ ├── func_exponential_simd.inl
│ │ │ │ ├── func_geometric.inl
│ │ │ │ ├── func_geometric_simd.inl
│ │ │ │ ├── func_integer.inl
│ │ │ │ ├── func_integer_simd.inl
│ │ │ │ ├── func_matrix.inl
│ │ │ │ ├── func_matrix_simd.inl
│ │ │ │ ├── func_packing.inl
│ │ │ │ ├── func_packing_simd.inl
│ │ │ │ ├── func_trigonometric.inl
│ │ │ │ ├── func_trigonometric_simd.inl
│ │ │ │ ├── func_vector_relational.inl
│ │ │ │ ├── func_vector_relational_simd.inl
│ │ │ │ ├── glm.cpp
│ │ │ │ ├── qualifier.hpp
│ │ │ │ ├── setup.hpp
│ │ │ │ ├── type_float.hpp
│ │ │ │ ├── type_gentype.hpp
│ │ │ │ ├── type_gentype.inl
│ │ │ │ ├── type_half.hpp
│ │ │ │ ├── type_half.inl
│ │ │ │ ├── type_int.hpp
│ │ │ │ ├── type_mat.hpp
│ │ │ │ ├── type_mat.inl
│ │ │ │ ├── type_mat2x2.hpp
│ │ │ │ ├── type_mat2x2.inl
│ │ │ │ ├── type_mat2x3.hpp
│ │ │ │ ├── type_mat2x3.inl
│ │ │ │ ├── type_mat2x4.hpp
│ │ │ │ ├── type_mat2x4.inl
│ │ │ │ ├── type_mat3x2.hpp
│ │ │ │ ├── type_mat3x2.inl
│ │ │ │ ├── type_mat3x3.hpp
│ │ │ │ ├── type_mat3x3.inl
│ │ │ │ ├── type_mat3x4.hpp
│ │ │ │ ├── type_mat3x4.inl
│ │ │ │ ├── type_mat4x2.hpp
│ │ │ │ ├── type_mat4x2.inl
│ │ │ │ ├── type_mat4x3.hpp
│ │ │ │ ├── type_mat4x3.inl
│ │ │ │ ├── type_mat4x4.hpp
│ │ │ │ ├── type_mat4x4.inl
│ │ │ │ ├── type_mat4x4_simd.inl
│ │ │ │ ├── type_vec.hpp
│ │ │ │ ├── type_vec.inl
│ │ │ │ ├── type_vec1.hpp
│ │ │ │ ├── type_vec1.inl
│ │ │ │ ├── type_vec2.hpp
│ │ │ │ ├── type_vec2.inl
│ │ │ │ ├── type_vec3.hpp
│ │ │ │ ├── type_vec3.inl
│ │ │ │ ├── type_vec4.hpp
│ │ │ │ ├── type_vec4.inl
│ │ │ │ └── type_vec4_simd.inl
│ │ │ ├── exponential.hpp
│ │ │ ├── ext.hpp
│ │ │ ├── ext
│ │ │ │ ├── vec1.hpp
│ │ │ │ ├── vec1.inl
│ │ │ │ ├── vector_relational.hpp
│ │ │ │ └── vector_relational.inl
│ │ │ ├── fwd.hpp
│ │ │ ├── geometric.hpp
│ │ │ ├── glm.hpp
│ │ │ ├── gtc
│ │ │ │ ├── bitfield.hpp
│ │ │ │ ├── bitfield.inl
│ │ │ │ ├── color_space.hpp
│ │ │ │ ├── color_space.inl
│ │ │ │ ├── constants.hpp
│ │ │ │ ├── constants.inl
│ │ │ │ ├── epsilon.hpp
│ │ │ │ ├── epsilon.inl
│ │ │ │ ├── integer.hpp
│ │ │ │ ├── integer.inl
│ │ │ │ ├── matrix_access.hpp
│ │ │ │ ├── matrix_access.inl
│ │ │ │ ├── matrix_integer.hpp
│ │ │ │ ├── matrix_inverse.hpp
│ │ │ │ ├── matrix_inverse.inl
│ │ │ │ ├── matrix_transform.hpp
│ │ │ │ ├── matrix_transform.inl
│ │ │ │ ├── noise.hpp
│ │ │ │ ├── noise.inl
│ │ │ │ ├── packing.hpp
│ │ │ │ ├── packing.inl
│ │ │ │ ├── quaternion.hpp
│ │ │ │ ├── quaternion.inl
│ │ │ │ ├── quaternion_simd.inl
│ │ │ │ ├── random.hpp
│ │ │ │ ├── random.inl
│ │ │ │ ├── reciprocal.hpp
│ │ │ │ ├── reciprocal.inl
│ │ │ │ ├── round.hpp
│ │ │ │ ├── round.inl
│ │ │ │ ├── type_aligned.hpp
│ │ │ │ ├── type_precision.hpp
│ │ │ │ ├── type_precision.inl
│ │ │ │ ├── type_ptr.hpp
│ │ │ │ ├── type_ptr.inl
│ │ │ │ ├── ulp.hpp
│ │ │ │ ├── ulp.inl
│ │ │ │ ├── vec1.hpp
│ │ │ │ └── vec1.inl
│ │ │ ├── gtx
│ │ │ │ ├── associated_min_max.hpp
│ │ │ │ ├── associated_min_max.inl
│ │ │ │ ├── bit.hpp
│ │ │ │ ├── bit.inl
│ │ │ │ ├── closest_point.hpp
│ │ │ │ ├── closest_point.inl
│ │ │ │ ├── color_encoding.hpp
│ │ │ │ ├── color_encoding.inl
│ │ │ │ ├── color_space.hpp
│ │ │ │ ├── color_space.inl
│ │ │ │ ├── color_space_YCoCg.hpp
│ │ │ │ ├── color_space_YCoCg.inl
│ │ │ │ ├── common.hpp
│ │ │ │ ├── common.inl
│ │ │ │ ├── compatibility.hpp
│ │ │ │ ├── compatibility.inl
│ │ │ │ ├── component_wise.hpp
│ │ │ │ ├── component_wise.inl
│ │ │ │ ├── dual_quaternion.hpp
│ │ │ │ ├── dual_quaternion.inl
│ │ │ │ ├── easing.hpp
│ │ │ │ ├── easing.inl
│ │ │ │ ├── euler_angles.hpp
│ │ │ │ ├── euler_angles.inl
│ │ │ │ ├── extend.hpp
│ │ │ │ ├── extend.inl
│ │ │ │ ├── extended_min_max.hpp
│ │ │ │ ├── extended_min_max.inl
│ │ │ │ ├── exterior_product.hpp
│ │ │ │ ├── exterior_product.inl
│ │ │ │ ├── fast_exponential.hpp
│ │ │ │ ├── fast_exponential.inl
│ │ │ │ ├── fast_square_root.hpp
│ │ │ │ ├── fast_square_root.inl
│ │ │ │ ├── fast_trigonometry.hpp
│ │ │ │ ├── fast_trigonometry.inl
│ │ │ │ ├── float_notmalize.inl
│ │ │ │ ├── functions.hpp
│ │ │ │ ├── functions.inl
│ │ │ │ ├── gradient_paint.hpp
│ │ │ │ ├── gradient_paint.inl
│ │ │ │ ├── handed_coordinate_space.hpp
│ │ │ │ ├── handed_coordinate_space.inl
│ │ │ │ ├── hash.hpp
│ │ │ │ ├── hash.inl
│ │ │ │ ├── integer.hpp
│ │ │ │ ├── integer.inl
│ │ │ │ ├── intersect.hpp
│ │ │ │ ├── intersect.inl
│ │ │ │ ├── io.hpp
│ │ │ │ ├── io.inl
│ │ │ │ ├── log_base.hpp
│ │ │ │ ├── log_base.inl
│ │ │ │ ├── matrix_cross_product.hpp
│ │ │ │ ├── matrix_cross_product.inl
│ │ │ │ ├── matrix_decompose.hpp
│ │ │ │ ├── matrix_decompose.inl
│ │ │ │ ├── matrix_factorisation.hpp
│ │ │ │ ├── matrix_factorisation.inl
│ │ │ │ ├── matrix_interpolation.hpp
│ │ │ │ ├── matrix_interpolation.inl
│ │ │ │ ├── matrix_major_storage.hpp
│ │ │ │ ├── matrix_major_storage.inl
│ │ │ │ ├── matrix_operation.hpp
│ │ │ │ ├── matrix_operation.inl
│ │ │ │ ├── matrix_query.hpp
│ │ │ │ ├── matrix_query.inl
│ │ │ │ ├── matrix_transform_2d.hpp
│ │ │ │ ├── matrix_transform_2d.inl
│ │ │ │ ├── mixed_product.hpp
│ │ │ │ ├── mixed_product.inl
│ │ │ │ ├── norm.hpp
│ │ │ │ ├── norm.inl
│ │ │ │ ├── normal.hpp
│ │ │ │ ├── normal.inl
│ │ │ │ ├── normalize_dot.hpp
│ │ │ │ ├── normalize_dot.inl
│ │ │ │ ├── number_precision.hpp
│ │ │ │ ├── number_precision.inl
│ │ │ │ ├── optimum_pow.hpp
│ │ │ │ ├── optimum_pow.inl
│ │ │ │ ├── orthonormalize.hpp
│ │ │ │ ├── orthonormalize.inl
│ │ │ │ ├── perpendicular.hpp
│ │ │ │ ├── perpendicular.inl
│ │ │ │ ├── polar_coordinates.hpp
│ │ │ │ ├── polar_coordinates.inl
│ │ │ │ ├── projection.hpp
│ │ │ │ ├── projection.inl
│ │ │ │ ├── quaternion.hpp
│ │ │ │ ├── quaternion.inl
│ │ │ │ ├── range.hpp
│ │ │ │ ├── raw_data.hpp
│ │ │ │ ├── raw_data.inl
│ │ │ │ ├── rotate_normalized_axis.hpp
│ │ │ │ ├── rotate_normalized_axis.inl
│ │ │ │ ├── rotate_vector.hpp
│ │ │ │ ├── rotate_vector.inl
│ │ │ │ ├── scalar_multiplication.hpp
│ │ │ │ ├── scalar_relational.hpp
│ │ │ │ ├── scalar_relational.inl
│ │ │ │ ├── spline.hpp
│ │ │ │ ├── spline.inl
│ │ │ │ ├── std_based_type.hpp
│ │ │ │ ├── std_based_type.inl
│ │ │ │ ├── string_cast.hpp
│ │ │ │ ├── string_cast.inl
│ │ │ │ ├── texture.hpp
│ │ │ │ ├── texture.inl
│ │ │ │ ├── transform.hpp
│ │ │ │ ├── transform.inl
│ │ │ │ ├── transform2.hpp
│ │ │ │ ├── transform2.inl
│ │ │ │ ├── type_aligned.hpp
│ │ │ │ ├── type_aligned.inl
│ │ │ │ ├── type_trait.hpp
│ │ │ │ ├── type_trait.inl
│ │ │ │ ├── vec_swizzle.hpp
│ │ │ │ ├── vector_angle.hpp
│ │ │ │ ├── vector_angle.inl
│ │ │ │ ├── vector_query.hpp
│ │ │ │ ├── vector_query.inl
│ │ │ │ ├── wrap.hpp
│ │ │ │ └── wrap.inl
│ │ │ ├── integer.hpp
│ │ │ ├── mat2x2.hpp
│ │ │ ├── mat2x3.hpp
│ │ │ ├── mat2x4.hpp
│ │ │ ├── mat3x2.hpp
│ │ │ ├── mat3x3.hpp
│ │ │ ├── mat3x4.hpp
│ │ │ ├── mat4x2.hpp
│ │ │ ├── mat4x3.hpp
│ │ │ ├── mat4x4.hpp
│ │ │ ├── matrix.hpp
│ │ │ ├── packing.hpp
│ │ │ ├── simd
│ │ │ │ ├── common.h
│ │ │ │ ├── exponential.h
│ │ │ │ ├── geometric.h
│ │ │ │ ├── integer.h
│ │ │ │ ├── matrix.h
│ │ │ │ ├── packing.h
│ │ │ │ ├── platform.h
│ │ │ │ ├── trigonometric.h
│ │ │ │ └── vector_relational.h
│ │ │ ├── trigonometric.hpp
│ │ │ ├── vec2.hpp
│ │ │ ├── vec3.hpp
│ │ │ ├── vec4.hpp
│ │ │ └── vector_relational.hpp
│ │ ├── jni
│ │ │ ├── AABB.cpp
│ │ │ ├── AABB.h
│ │ │ ├── ClipmapApplication.cpp
│ │ │ ├── ClipmapApplication.h
│ │ │ ├── Frustum.cpp
│ │ │ ├── Frustum.h
│ │ │ ├── GroundMesh.cpp
│ │ │ ├── GroundMesh.h
│ │ │ ├── GroundMeshSetup.cpp
│ │ │ ├── Heightmap.cpp
│ │ │ ├── Heightmap.h
│ │ │ ├── main.cpp
│ │ │ ├── shaders.h
│ │ │ └── vector_math.h
│ │ ├── jni_opengl_controler.cpp
│ │ ├── jni_opengl_controler.h
│ │ ├── libcommon
│ │ │ └── CommonTools.h
│ │ └── librender
│ │ │ ├── CMakeLists.txt
│ │ │ ├── assets_reader.cpp
│ │ │ ├── assets_reader.h
│ │ │ ├── base_render.cpp
│ │ │ ├── base_render.h
│ │ │ ├── cube_texture_render.cpp
│ │ │ ├── cube_texture_render.h
│ │ │ ├── egl_core.cpp
│ │ │ ├── egl_core.h
│ │ │ ├── opengl_render_controller.cpp
│ │ │ ├── opengl_render_controller.h
│ │ │ ├── pbo_render.cpp
│ │ │ ├── pbo_render.h
│ │ │ ├── shape_render.cpp
│ │ │ └── shape_render.h
│ ├── java
│ │ └── com
│ │ │ └── example
│ │ │ └── ty
│ │ │ └── openglndk
│ │ │ ├── CubeTextureActivity.kt
│ │ │ ├── GLSurfaceView.java
│ │ │ ├── MainActivity.kt
│ │ │ ├── NativeOpenglControler.kt
│ │ │ ├── PBOActivity.kt
│ │ │ └── VAOVBOActivity.kt
│ └── res
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable
│ │ └── ic_launcher_background.xml
│ │ ├── layout
│ │ ├── activity_cube_texture.xml
│ │ ├── activity_main.xml
│ │ ├── activity_pbo.xml
│ │ └── activity_vao_vbo.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── bigpic.jpg
│ │ ├── bigpic2.jpeg
│ │ ├── ic_launcher.png
│ │ ├── ic_launcher_round.png
│ │ ├── uupoop10.gif
│ │ ├── uupoop11.gif
│ │ ├── uupoop12.gif
│ │ ├── uupoop13.gif
│ │ ├── uupoop14.gif
│ │ ├── uupoop15.gif
│ │ ├── uupoop16.gif
│ │ ├── uupoop17.gif
│ │ ├── uupoop18.gif
│ │ ├── uupoop19.gif
│ │ ├── uupoop2.gif
│ │ ├── uupoop20.gif
│ │ ├── uupoop3.gif
│ │ ├── uupoop5.gif
│ │ ├── uupoop6.gif
│ │ ├── uupoop7.gif
│ │ ├── uupoop8.gif
│ │ ├── uupoop9.gif
│ │ ├── xiaoren_1.png
│ │ ├── xiaoren_10.png
│ │ ├── xiaoren_11.png
│ │ ├── xiaoren_12.png
│ │ ├── xiaoren_13.png
│ │ ├── xiaoren_14.png
│ │ ├── xiaoren_15.png
│ │ ├── xiaoren_16.png
│ │ ├── xiaoren_17.png
│ │ ├── xiaoren_18.png
│ │ ├── xiaoren_19.png
│ │ ├── xiaoren_2.png
│ │ ├── xiaoren_20.png
│ │ ├── xiaoren_21.png
│ │ ├── xiaoren_22.png
│ │ ├── xiaoren_23.png
│ │ ├── xiaoren_24.png
│ │ ├── xiaoren_25.png
│ │ ├── xiaoren_26.png
│ │ ├── xiaoren_27.png
│ │ ├── xiaoren_28.png
│ │ ├── xiaoren_29.png
│ │ ├── xiaoren_3.png
│ │ ├── xiaoren_30.png
│ │ ├── xiaoren_31.png
│ │ ├── xiaoren_32.png
│ │ ├── xiaoren_33.png
│ │ ├── xiaoren_34.png
│ │ ├── xiaoren_35.png
│ │ ├── xiaoren_36.png
│ │ ├── xiaoren_37.png
│ │ ├── xiaoren_38.png
│ │ ├── xiaoren_4.png
│ │ ├── xiaoren_5.png
│ │ ├── xiaoren_6.png
│ │ ├── xiaoren_7.png
│ │ ├── xiaoren_8.png
│ │ └── xiaoren_9.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ ├── ic_launcher_round.png
│ │ ├── pic1.jpg
│ │ ├── pic2.jpg
│ │ ├── pic3.jpeg
│ │ ├── pic4.jpg
│ │ ├── pic5.jpg
│ │ ├── pic6.jpg
│ │ ├── pic7.jpg
│ │ └── saber.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ └── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── example
│ └── ty
│ └── openglndk
│ └── ExampleUnitTest.kt
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/libraries
5 | /.idea/modules.xml
6 | /.idea/workspace.xml
7 | .DS_Store
8 | /build
9 | /captures
10 | .externalNativeBuild
11 |
--------------------------------------------------------------------------------
/.idea/caches/build_file_checksums.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JabamiLight/AndoridOpenGLCube/310bfdd4f60e3387aae8be514ca171fb25ff5515/.idea/caches/build_file_checksums.ser
--------------------------------------------------------------------------------
/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
17 |
18 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # AndoridOpenGLNDK
2 | 基于Android OpenGL ES 3.0 可随手指任意旋转的立方体
3 |
4 | 
5 |
6 | blog地址 https://blog.csdn.net/a568478312/article/details/80543221
7 |
--------------------------------------------------------------------------------
/a.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JabamiLight/AndoridOpenGLCube/310bfdd4f60e3387aae8be514ca171fb25ff5515/a.gif
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | apply plugin: 'kotlin-android'
4 |
5 | apply plugin: 'kotlin-android-extensions'
6 | android {
7 | compileSdkVersion 27
8 | defaultConfig {
9 | applicationId "com.example.ty.openglndk"
10 | minSdkVersion 23
11 | targetSdkVersion 27
12 | versionCode 1
13 | versionName "1.0"
14 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
15 | externalNativeBuild {
16 | cmake {
17 | cppFlags "-std=c++11 -frtti -fexceptions"
18 | arguments '-DANDROID_ARM_NEON=TRUE'
19 | }
20 | }
21 | ndk {
22 | abiFilters 'armeabi-v7a'
23 | }
24 |
25 | }
26 | buildTypes {
27 | release {
28 | minifyEnabled false
29 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
30 | }
31 | }
32 | externalNativeBuild {
33 | cmake {
34 | path "src/main/cpp/CMakeLists.txt"
35 | }
36 | }
37 |
38 | }
39 | kotlin {
40 |
41 | }
42 | dependencies {
43 | implementation fileTree(dir: 'libs', include: ['*.jar'])
44 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
45 | implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
46 | implementation "org.jetbrains.anko:anko:$anko_version"
47 | implementation 'com.android.support:design:27.1.1'
48 | implementation 'com.android.support:appcompat-v7:27.1.1'
49 | implementation 'com.android.support.constraint:constraint-layout:1.1.0'
50 | testImplementation 'junit:junit:4.12'
51 | androidTestImplementation 'com.android.support.test:runner:1.0.2'
52 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
53 | }
54 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/example/ty/openglndk/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package com.example.ty.openglndk
2 |
3 | import android.support.test.InstrumentationRegistry
4 | import android.support.test.runner.AndroidJUnit4
5 |
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | import org.junit.Assert.*
10 |
11 | /**
12 | * Instrumented test, which will execute on an Android device.
13 | *
14 | * See [testing documentation](http://d.android.com/tools/testing).
15 | */
16 | @RunWith(AndroidJUnit4::class)
17 | class ExampleInstrumentedTest {
18 | @Test
19 | fun useAppContext() {
20 | // Context of the app under test.
21 | val appContext = InstrumentationRegistry.getTargetContext()
22 | assertEquals("com.example.ty.openglndk", appContext.packageName)
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
13 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/app/src/main/assets/shape/fragment_shader.glsl:
--------------------------------------------------------------------------------
1 | #version 300 es
2 | precision highp float;
3 | out vec4 FragColor;
4 | void main(){
5 | FragColor = vec4(1.0f, 0.5f, 0.2f, 1.0f);
6 | }
--------------------------------------------------------------------------------
/app/src/main/assets/shape/vertex_shader.glsl:
--------------------------------------------------------------------------------
1 | #version 300 es
2 | layout (location = 0) in vec3 aPos;
3 | void main(){
4 | gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0);
5 | }
--------------------------------------------------------------------------------
/app/src/main/assets/simplePBO/vertex_shader.glsl:
--------------------------------------------------------------------------------
1 | #version 300 es
2 | layout (location = 0) in vec3 aPos;
3 | layout (location = 1) in vec2 aTexCoord;
4 |
5 | out vec2 TexCoord;
6 |
7 |
8 | void main(){
9 | gl_Position =vec4(aPos, 1.0f);
10 | TexCoord=vec2(aTexCoord.x,aTexCoord.y);
11 | }
--------------------------------------------------------------------------------
/app/src/main/assets/texture/fragment_shader.glsl:
--------------------------------------------------------------------------------
1 | #version 300 es
2 | precision highp float;
3 | out vec4 FragColor;
4 | in vec2 TexCoord;
5 | uniform sampler2D texture1;
6 |
7 | void main(){
8 | FragColor = texture(texture1,TexCoord);
9 | }
--------------------------------------------------------------------------------
/app/src/main/assets/texture/vertex_shader.glsl:
--------------------------------------------------------------------------------
1 | #version 300 es
2 | layout (location = 0) in vec3 aPos;
3 | layout (location = 1) in vec2 aTexCoord;
4 |
5 | out vec2 TexCoord;
6 | uniform mat4 model;
7 | uniform mat4 view;
8 | uniform mat4 projection;
9 |
10 |
11 | void main(){
12 | gl_Position = projection*view*model*vec4(aPos, 1.0f);
13 | TexCoord=vec2(aTexCoord.x,1.0-aTexCoord.y);
14 | }
--------------------------------------------------------------------------------
/app/src/main/cpp/CMakeLists.txt:
--------------------------------------------------------------------------------
1 |
2 | cmake_minimum_required(VERSION 3.4.1)
3 |
4 |
5 | add_subdirectory(./librender)
6 |
7 |
8 | add_library( # Sets the name of the library.
9 | native-lib
10 | SHARED
11 | jni_opengl_controler.cpp )
12 |
13 |
14 |
15 |
16 | target_link_libraries( # Specifies the target library.
17 | native-lib
18 | render_core
19 | )
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/detail/_fixes.hpp:
--------------------------------------------------------------------------------
1 | /// @ref core
2 | /// @file glm/detail/_fixes.hpp
3 |
4 | #include
5 |
6 | //! Workaround for compatibility with other libraries
7 | #ifdef max
8 | #undef max
9 | #endif
10 |
11 | //! Workaround for compatibility with other libraries
12 | #ifdef min
13 | #undef min
14 | #endif
15 |
16 | //! Workaround for Android
17 | #ifdef isnan
18 | #undef isnan
19 | #endif
20 |
21 | //! Workaround for Android
22 | #ifdef isinf
23 | #undef isinf
24 | #endif
25 |
26 | //! Workaround for Chrone Native Client
27 | #ifdef log2
28 | #undef log2
29 | #endif
30 |
31 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/detail/_noise.hpp:
--------------------------------------------------------------------------------
1 | /// @ref core
2 | /// @file glm/detail/_noise.hpp
3 |
4 | #pragma once
5 |
6 | #include "../vec2.hpp"
7 | #include "../vec3.hpp"
8 | #include "../vec4.hpp"
9 | #include "../common.hpp"
10 |
11 | namespace glm{
12 | namespace detail
13 | {
14 | template
15 | GLM_FUNC_QUALIFIER T mod289(T const& x)
16 | {
17 | return x - floor(x * (static_cast(1.0) / static_cast(289.0))) * static_cast(289.0);
18 | }
19 |
20 | template
21 | GLM_FUNC_QUALIFIER T permute(T const& x)
22 | {
23 | return mod289(((x * static_cast(34)) + static_cast(1)) * x);
24 | }
25 |
26 | template
27 | GLM_FUNC_QUALIFIER vec<2, T, Q> permute(vec<2, T, Q> const& x)
28 | {
29 | return mod289(((x * static_cast(34)) + static_cast(1)) * x);
30 | }
31 |
32 | template
33 | GLM_FUNC_QUALIFIER vec<3, T, Q> permute(vec<3, T, Q> const& x)
34 | {
35 | return mod289(((x * static_cast(34)) + static_cast(1)) * x);
36 | }
37 |
38 | template
39 | GLM_FUNC_QUALIFIER vec<4, T, Q> permute(vec<4, T, Q> const& x)
40 | {
41 | return mod289(((x * static_cast(34)) + static_cast(1)) * x);
42 | }
43 |
44 | template
45 | GLM_FUNC_QUALIFIER T taylorInvSqrt(T const& r)
46 | {
47 | return T(1.79284291400159) - T(0.85373472095314) * r;
48 | }
49 |
50 | template
51 | GLM_FUNC_QUALIFIER vec<2, T, Q> taylorInvSqrt(vec<2, T, Q> const& r)
52 | {
53 | return T(1.79284291400159) - T(0.85373472095314) * r;
54 | }
55 |
56 | template
57 | GLM_FUNC_QUALIFIER vec<3, T, Q> taylorInvSqrt(vec<3, T, Q> const& r)
58 | {
59 | return T(1.79284291400159) - T(0.85373472095314) * r;
60 | }
61 |
62 | template
63 | GLM_FUNC_QUALIFIER vec<4, T, Q> taylorInvSqrt(vec<4, T, Q> const& r)
64 | {
65 | return T(1.79284291400159) - T(0.85373472095314) * r;
66 | }
67 |
68 | template
69 | GLM_FUNC_QUALIFIER vec<2, T, Q> fade(vec<2, T, Q> const& t)
70 | {
71 | return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
72 | }
73 |
74 | template
75 | GLM_FUNC_QUALIFIER vec<3, T, Q> fade(vec<3, T, Q> const& t)
76 | {
77 | return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
78 | }
79 |
80 | template
81 | GLM_FUNC_QUALIFIER vec<4, T, Q> fade(vec<4, T, Q> const& t)
82 | {
83 | return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
84 | }
85 | }//namespace detail
86 | }//namespace glm
87 |
88 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/detail/compute_vector_relational.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "setup.hpp"
4 | #include
5 | #include
6 |
7 | namespace glm{
8 | namespace detail
9 | {
10 | template ::is_iec559>
11 | struct compute_equal
12 | {
13 | GLM_FUNC_QUALIFIER static bool call(T a, T b)
14 | {
15 | return a == b;
16 | }
17 | };
18 |
19 | template
20 | struct compute_equal
21 | {
22 | GLM_FUNC_QUALIFIER static bool call(T a, T b)
23 | {
24 | return std::memcmp(&a, &b, sizeof(T)) == 0;
25 | }
26 | };
27 | }//namespace detail
28 | }//namespace glm
29 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/detail/func_exponential_simd.inl:
--------------------------------------------------------------------------------
1 | /// @ref core
2 | /// @file glm/detail/func_exponential_simd.inl
3 |
4 | #include "../simd/exponential.h"
5 |
6 | #if GLM_ARCH & GLM_ARCH_SSE2_BIT
7 |
8 | namespace glm{
9 | namespace detail
10 | {
11 | template
12 | struct compute_sqrt<4, float, Q, true>
13 | {
14 | GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v)
15 | {
16 | vec<4, float, Q> Result;
17 | Result.data = _mm_sqrt_ps(v.data);
18 | return Result;
19 | }
20 | };
21 |
22 | template<>
23 | struct compute_sqrt<4, float, aligned_lowp, true>
24 | {
25 | GLM_FUNC_QUALIFIER static vec<4, float, aligned_lowp> call(vec<4, float, aligned_lowp> const& v)
26 | {
27 | vec<4, float, aligned_lowp> Result;
28 | Result.data = glm_vec4_sqrt_lowp(v.data);
29 | return Result;
30 | }
31 | };
32 | }//namespace detail
33 | }//namespace glm
34 |
35 | #endif//GLM_ARCH & GLM_ARCH_SSE2_BIT
36 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/detail/func_integer_simd.inl:
--------------------------------------------------------------------------------
1 | /// @ref core
2 | /// @file glm/detail/func_integer_simd.inl
3 |
4 | #include "../simd/integer.h"
5 |
6 | #if GLM_ARCH & GLM_ARCH_SSE2_BIT
7 |
8 | namespace glm{
9 | namespace detail
10 | {
11 | template
12 | struct compute_bitfieldReverseStep<4, uint32, Q, true, true>
13 | {
14 | GLM_FUNC_QUALIFIER static vec<4, uint32, Q> call(vec<4, uint32, Q> const& v, uint32 Mask, uint32 Shift)
15 | {
16 | __m128i const set0 = v.data;
17 |
18 | __m128i const set1 = _mm_set1_epi32(static_cast(Mask));
19 | __m128i const and1 = _mm_and_si128(set0, set1);
20 | __m128i const sft1 = _mm_slli_epi32(and1, Shift);
21 |
22 | __m128i const set2 = _mm_andnot_si128(set0, _mm_set1_epi32(-1));
23 | __m128i const and2 = _mm_and_si128(set0, set2);
24 | __m128i const sft2 = _mm_srai_epi32(and2, Shift);
25 |
26 | __m128i const or0 = _mm_or_si128(sft1, sft2);
27 |
28 | return or0;
29 | }
30 | };
31 |
32 | template
33 | struct compute_bitfieldBitCountStep<4, uint32, Q, true, true>
34 | {
35 | GLM_FUNC_QUALIFIER static vec<4, uint32, Q> call(vec<4, uint32, Q> const& v, uint32 Mask, uint32 Shift)
36 | {
37 | __m128i const set0 = v.data;
38 |
39 | __m128i const set1 = _mm_set1_epi32(static_cast(Mask));
40 | __m128i const and0 = _mm_and_si128(set0, set1);
41 | __m128i const sft0 = _mm_slli_epi32(set0, Shift);
42 | __m128i const and1 = _mm_and_si128(sft0, set1);
43 | __m128i const add0 = _mm_add_epi32(and0, and1);
44 |
45 | return add0;
46 | }
47 | };
48 | }//namespace detail
49 |
50 | # if GLM_ARCH & GLM_ARCH_AVX_BIT
51 | template<>
52 | GLM_FUNC_QUALIFIER int bitCount(uint32 x)
53 | {
54 | return _mm_popcnt_u32(x);
55 | }
56 |
57 | # if(GLM_MODEL == GLM_MODEL_64)
58 | template<>
59 | GLM_FUNC_QUALIFIER int bitCount(uint64 x)
60 | {
61 | return static_cast(_mm_popcnt_u64(x));
62 | }
63 | # endif//GLM_MODEL
64 | # endif//GLM_ARCH
65 |
66 | }//namespace glm
67 |
68 | #endif//GLM_ARCH & GLM_ARCH_SSE2_BIT
69 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/detail/func_packing_simd.inl:
--------------------------------------------------------------------------------
1 | /// @ref core
2 | /// @file glm/detail/func_packing_simd.inl
3 |
4 | namespace glm{
5 | namespace detail
6 | {
7 |
8 | }//namespace detail
9 | }//namespace glm
10 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/detail/func_trigonometric_simd.inl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JabamiLight/AndoridOpenGLCube/310bfdd4f60e3387aae8be514ca171fb25ff5515/app/src/main/cpp/glm/detail/func_trigonometric_simd.inl
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/detail/func_vector_relational_simd.inl:
--------------------------------------------------------------------------------
1 | /// @ref core
2 | /// @file glm/detail/func_vector_relational_simd.inl
3 |
4 | namespace glm{
5 | namespace detail
6 | {
7 |
8 | }//namespace detail
9 | }//namespace glm
10 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/detail/type_half.hpp:
--------------------------------------------------------------------------------
1 | /// @ref core
2 | /// @file glm/detail/type_half.hpp
3 |
4 | #pragma once
5 |
6 | #include "setup.hpp"
7 |
8 | namespace glm{
9 | namespace detail
10 | {
11 | typedef short hdata;
12 |
13 | GLM_FUNC_DECL float toFloat32(hdata value);
14 | GLM_FUNC_DECL hdata toFloat16(float const& value);
15 |
16 | }//namespace detail
17 | }//namespace glm
18 |
19 | #include "type_half.inl"
20 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/detail/type_mat.inl:
--------------------------------------------------------------------------------
1 | /// @ref core
2 | /// @file glm/detail/type_mat.inl
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/detail/type_mat4x4_simd.inl:
--------------------------------------------------------------------------------
1 | /// @ref core
2 | /// @file glm/detail/type_mat4x4_sse2.inl
3 |
4 | namespace glm
5 | {
6 |
7 | }//namespace glm
8 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/detail/type_vec.inl:
--------------------------------------------------------------------------------
1 | /// @ref core
2 | /// @file glm/detail/type_vec.inl
3 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/detail/type_vec1.hpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JabamiLight/AndoridOpenGLCube/310bfdd4f60e3387aae8be514ca171fb25ff5515/app/src/main/cpp/glm/detail/type_vec1.hpp
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/ext/vec1.inl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JabamiLight/AndoridOpenGLCube/310bfdd4f60e3387aae8be514ca171fb25ff5515/app/src/main/cpp/glm/ext/vec1.inl
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/ext/vector_relational.inl:
--------------------------------------------------------------------------------
1 | /// @ref ext_vector_relational
2 | /// @file glm/ext/vector_relational.inl
3 |
4 | // Dependency:
5 | #include "../vector_relational.hpp"
6 | #include "../common.hpp"
7 | #include "../detail/type_vec.hpp"
8 |
9 | namespace glm
10 | {
11 | template
12 | GLM_FUNC_QUALIFIER bool equal(genType const& x, genType const& y, genType const& epsilon)
13 | {
14 | return abs(x - y) < epsilon;
15 | }
16 |
17 | template
18 | GLM_FUNC_QUALIFIER vec equal(vec const& x, vec const& y, T const& epsilon)
19 | {
20 | return lessThan(abs(x - y), vec(epsilon));
21 | }
22 |
23 | template
24 | GLM_FUNC_QUALIFIER vec equal(vec const& x, vec const& y, vec const& epsilon)
25 | {
26 | return lessThan(abs(x - y), epsilon);
27 | }
28 |
29 | template
30 | GLM_FUNC_QUALIFIER bool notEqual(genType const& x, genType const& y, genType const& epsilon)
31 | {
32 | return abs(x - y) >= epsilon;
33 | }
34 |
35 | template
36 | GLM_FUNC_QUALIFIER vec notEqual(vec const& x, vec const& y, T const& epsilon)
37 | {
38 | return greaterThanEqual(abs(x - y), vec(epsilon));
39 | }
40 |
41 | template
42 | GLM_FUNC_QUALIFIER vec notEqual(vec const& x, vec const& y, vec const& epsilon)
43 | {
44 | return greaterThanEqual(abs(x - y), epsilon);
45 | }
46 | }//namespace glm
47 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtc/color_space.hpp:
--------------------------------------------------------------------------------
1 | /// @ref gtc_color_space
2 | /// @file glm/gtc/color_space.hpp
3 | ///
4 | /// @see core (dependence)
5 | /// @see gtc_color_space (dependence)
6 | ///
7 | /// @defgroup gtc_color_space GLM_GTC_color_space
8 | /// @ingroup gtc
9 | ///
10 | /// Include to use the features of this extension.
11 | ///
12 | /// Allow to perform bit operations on integer values
13 |
14 | #pragma once
15 |
16 | // Dependencies
17 | #include "../detail/setup.hpp"
18 | #include "../detail/qualifier.hpp"
19 | #include "../exponential.hpp"
20 | #include "../vec3.hpp"
21 | #include "../vec4.hpp"
22 | #include
23 |
24 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
25 | # pragma message("GLM: GLM_GTC_color_space extension included")
26 | #endif
27 |
28 | namespace glm
29 | {
30 | /// @addtogroup gtc_color_space
31 | /// @{
32 |
33 | /// Convert a linear color to sRGB color using a standard gamma correction.
34 | /// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb
35 | template
36 | GLM_FUNC_DECL vec convertLinearToSRGB(vec const& ColorLinear);
37 |
38 | /// Convert a linear color to sRGB color using a custom gamma correction.
39 | /// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb
40 | template
41 | GLM_FUNC_DECL vec convertLinearToSRGB(vec const& ColorLinear, T Gamma);
42 |
43 | /// Convert a sRGB color to linear color using a standard gamma correction.
44 | /// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb
45 | template
46 | GLM_FUNC_DECL vec convertSRGBToLinear(vec const& ColorSRGB);
47 |
48 | /// Convert a sRGB color to linear color using a custom gamma correction.
49 | // IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb
50 | template
51 | GLM_FUNC_DECL vec convertSRGBToLinear(vec const& ColorSRGB, T Gamma);
52 |
53 | /// @}
54 | } //namespace glm
55 |
56 | #include "color_space.inl"
57 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtc/epsilon.hpp:
--------------------------------------------------------------------------------
1 | /// @ref gtc_epsilon
2 | /// @file glm/gtc/epsilon.hpp
3 | ///
4 | /// @see core (dependence)
5 | /// @see gtc_quaternion (dependence)
6 | ///
7 | /// @defgroup gtc_epsilon GLM_GTC_epsilon
8 | /// @ingroup gtc
9 | ///
10 | /// Include to use the features of this extension.
11 | ///
12 | /// Comparison functions for a user defined epsilon values.
13 |
14 | #pragma once
15 |
16 | // Dependencies
17 | #include "../detail/setup.hpp"
18 | #include "../detail/qualifier.hpp"
19 |
20 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
21 | # pragma message("GLM: GLM_GTC_epsilon extension included")
22 | #endif
23 |
24 | namespace glm
25 | {
26 | /// @addtogroup gtc_epsilon
27 | /// @{
28 |
29 | /// Returns the component-wise comparison of |x - y| < epsilon.
30 | /// True if this expression is satisfied.
31 | ///
32 | /// @see gtc_epsilon
33 | template
34 | GLM_FUNC_DECL vec epsilonEqual(vec const& x, vec const& y, T const& epsilon);
35 |
36 | /// Returns the component-wise comparison of |x - y| < epsilon.
37 | /// True if this expression is satisfied.
38 | ///
39 | /// @see gtc_epsilon
40 | template
41 | GLM_FUNC_DECL bool epsilonEqual(genType const& x, genType const& y, genType const& epsilon);
42 |
43 | /// Returns the component-wise comparison of |x - y| < epsilon.
44 | /// True if this expression is not satisfied.
45 | ///
46 | /// @see gtc_epsilon
47 | template
48 | GLM_FUNC_DECL vec epsilonNotEqual(vec const& x, vec const& y, T const& epsilon);
49 |
50 | /// Returns the component-wise comparison of |x - y| >= epsilon.
51 | /// True if this expression is not satisfied.
52 | ///
53 | /// @see gtc_epsilon
54 | template
55 | GLM_FUNC_DECL bool epsilonNotEqual(genType const& x, genType const& y, genType const& epsilon);
56 |
57 | /// @}
58 | }//namespace glm
59 |
60 | #include "epsilon.inl"
61 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtc/integer.hpp:
--------------------------------------------------------------------------------
1 | /// @ref gtc_integer
2 | /// @file glm/gtc/integer.hpp
3 | ///
4 | /// @see core (dependence)
5 | /// @see gtc_integer (dependence)
6 | ///
7 | /// @defgroup gtc_integer GLM_GTC_integer
8 | /// @ingroup gtc
9 | ///
10 | /// Include to use the features of this extension.
11 | ///
12 | /// @brief Allow to perform bit operations on integer values
13 |
14 | #pragma once
15 |
16 | // Dependencies
17 | #include "../detail/setup.hpp"
18 | #include "../detail/qualifier.hpp"
19 | #include "../common.hpp"
20 | #include "../integer.hpp"
21 | #include "../exponential.hpp"
22 | #include
23 |
24 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
25 | # pragma message("GLM: GLM_GTC_integer extension included")
26 | #endif
27 |
28 | namespace glm
29 | {
30 | /// @addtogroup gtc_integer
31 | /// @{
32 |
33 | /// Returns the log2 of x for integer values. Can be reliably using to compute mipmap count from the texture size.
34 | /// @see gtc_integer
35 | template
36 | GLM_FUNC_DECL genIUType log2(genIUType x);
37 |
38 | /// Returns a value equal to the nearest integer to x.
39 | /// The fraction 0.5 will round in a direction chosen by the
40 | /// implementation, presumably the direction that is fastest.
41 | ///
42 | /// @param x The values of the argument must be greater or equal to zero.
43 | /// @tparam T floating point scalar types.
44 | ///
45 | /// @see GLSL round man page
46 | /// @see gtc_integer
47 | template
48 | GLM_FUNC_DECL vec iround(vec const& x);
49 |
50 | /// Returns a value equal to the nearest integer to x.
51 | /// The fraction 0.5 will round in a direction chosen by the
52 | /// implementation, presumably the direction that is fastest.
53 | ///
54 | /// @param x The values of the argument must be greater or equal to zero.
55 | /// @tparam T floating point scalar types.
56 | ///
57 | /// @see GLSL round man page
58 | /// @see gtc_integer
59 | template
60 | GLM_FUNC_DECL vec uround(vec const& x);
61 |
62 | /// @}
63 | } //namespace glm
64 |
65 | #include "integer.inl"
66 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtc/integer.inl:
--------------------------------------------------------------------------------
1 | /// @ref gtc_integer
2 | /// @file glm/gtc/integer.inl
3 |
4 | namespace glm{
5 | namespace detail
6 | {
7 | template
8 | struct compute_log2
9 | {
10 | GLM_FUNC_QUALIFIER static vec call(vec const& v)
11 | {
12 | //Equivalent to return findMSB(vec); but save one function call in ASM with VC
13 | //return findMSB(vec);
14 | return vec(detail::compute_findMSB_vec::call(v));
15 | }
16 | };
17 |
18 | # if GLM_HAS_BITSCAN_WINDOWS
19 | template
20 | struct compute_log2<4, int, Q, false, Aligned>
21 | {
22 | GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& v)
23 | {
24 | vec<4, int, Q> Result;
25 | _BitScanReverse(reinterpret_cast(&Result.x), v.x);
26 | _BitScanReverse(reinterpret_cast(&Result.y), v.y);
27 | _BitScanReverse(reinterpret_cast(&Result.z), v.z);
28 | _BitScanReverse(reinterpret_cast(&Result.w), v.w);
29 | return Result;
30 | }
31 | };
32 | # endif//GLM_HAS_BITSCAN_WINDOWS
33 | }//namespace detail
34 | template
35 | GLM_FUNC_QUALIFIER int iround(genType x)
36 | {
37 | GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'iround' only accept floating-point inputs");
38 | assert(static_cast(0.0) <= x);
39 |
40 | return static_cast(x + static_cast(0.5));
41 | }
42 |
43 | template
44 | GLM_FUNC_QUALIFIER vec iround(vec const& x)
45 | {
46 | GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'iround' only accept floating-point inputs");
47 | assert(all(lessThanEqual(vec(0), x)));
48 |
49 | return vec(x + static_cast(0.5));
50 | }
51 |
52 | template
53 | GLM_FUNC_QUALIFIER uint uround(genType x)
54 | {
55 | GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'uround' only accept floating-point inputs");
56 | assert(static_cast(0.0) <= x);
57 |
58 | return static_cast(x + static_cast(0.5));
59 | }
60 |
61 | template
62 | GLM_FUNC_QUALIFIER vec uround(vec const& x)
63 | {
64 | GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'uround' only accept floating-point inputs");
65 | assert(all(lessThanEqual(vec(0), x)));
66 |
67 | return vec(x + static_cast(0.5));
68 | }
69 | }//namespace glm
70 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtc/matrix_access.hpp:
--------------------------------------------------------------------------------
1 | /// @ref gtc_matrix_access
2 | /// @file glm/gtc/matrix_access.hpp
3 | ///
4 | /// @see core (dependence)
5 | ///
6 | /// @defgroup gtc_matrix_access GLM_GTC_matrix_access
7 | /// @ingroup gtc
8 | ///
9 | /// Include to use the features of this extension.
10 | ///
11 | /// Defines functions to access rows or columns of a matrix easily.
12 |
13 | #pragma once
14 |
15 | // Dependency:
16 | #include "../detail/setup.hpp"
17 |
18 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
19 | # pragma message("GLM: GLM_GTC_matrix_access extension included")
20 | #endif
21 |
22 | namespace glm
23 | {
24 | /// @addtogroup gtc_matrix_access
25 | /// @{
26 |
27 | /// Get a specific row of a matrix.
28 | /// @see gtc_matrix_access
29 | template
30 | GLM_FUNC_DECL typename genType::row_type row(
31 | genType const& m,
32 | length_t index);
33 |
34 | /// Set a specific row to a matrix.
35 | /// @see gtc_matrix_access
36 | template
37 | GLM_FUNC_DECL genType row(
38 | genType const& m,
39 | length_t index,
40 | typename genType::row_type const& x);
41 |
42 | /// Get a specific column of a matrix.
43 | /// @see gtc_matrix_access
44 | template
45 | GLM_FUNC_DECL typename genType::col_type column(
46 | genType const& m,
47 | length_t index);
48 |
49 | /// Set a specific column to a matrix.
50 | /// @see gtc_matrix_access
51 | template
52 | GLM_FUNC_DECL genType column(
53 | genType const& m,
54 | length_t index,
55 | typename genType::col_type const& x);
56 |
57 | /// @}
58 | }//namespace glm
59 |
60 | #include "matrix_access.inl"
61 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtc/matrix_access.inl:
--------------------------------------------------------------------------------
1 | /// @ref gtc_matrix_access
2 | /// @file glm/gtc/matrix_access.inl
3 |
4 | namespace glm
5 | {
6 | template
7 | GLM_FUNC_QUALIFIER genType row
8 | (
9 | genType const& m,
10 | length_t index,
11 | typename genType::row_type const& x
12 | )
13 | {
14 | assert(index >= 0 && index < m[0].length());
15 |
16 | genType Result = m;
17 | for(length_t i = 0; i < m.length(); ++i)
18 | Result[i][index] = x[i];
19 | return Result;
20 | }
21 |
22 | template
23 | GLM_FUNC_QUALIFIER typename genType::row_type row
24 | (
25 | genType const& m,
26 | length_t index
27 | )
28 | {
29 | assert(index >= 0 && index < m[0].length());
30 |
31 | typename genType::row_type Result(0);
32 | for(length_t i = 0; i < m.length(); ++i)
33 | Result[i] = m[i][index];
34 | return Result;
35 | }
36 |
37 | template
38 | GLM_FUNC_QUALIFIER genType column
39 | (
40 | genType const& m,
41 | length_t index,
42 | typename genType::col_type const& x
43 | )
44 | {
45 | assert(index >= 0 && index < m.length());
46 |
47 | genType Result = m;
48 | Result[index] = x;
49 | return Result;
50 | }
51 |
52 | template
53 | GLM_FUNC_QUALIFIER typename genType::col_type column
54 | (
55 | genType const& m,
56 | length_t index
57 | )
58 | {
59 | assert(index >= 0 && index < m.length());
60 |
61 | return m[index];
62 | }
63 | }//namespace glm
64 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtc/matrix_inverse.hpp:
--------------------------------------------------------------------------------
1 | /// @ref gtc_matrix_inverse
2 | /// @file glm/gtc/matrix_inverse.hpp
3 | ///
4 | /// @see core (dependence)
5 | ///
6 | /// @defgroup gtc_matrix_inverse GLM_GTC_matrix_inverse
7 | /// @ingroup gtc
8 | ///
9 | /// Include to use the features of this extension.
10 | ///
11 | /// Defines additional matrix inverting functions.
12 |
13 | #pragma once
14 |
15 | // Dependencies
16 | #include "../detail/setup.hpp"
17 | #include "../matrix.hpp"
18 | #include "../mat2x2.hpp"
19 | #include "../mat3x3.hpp"
20 | #include "../mat4x4.hpp"
21 |
22 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
23 | # pragma message("GLM: GLM_GTC_matrix_inverse extension included")
24 | #endif
25 |
26 | namespace glm
27 | {
28 | /// @addtogroup gtc_matrix_inverse
29 | /// @{
30 |
31 | /// Fast matrix inverse for affine matrix.
32 | ///
33 | /// @param m Input matrix to invert.
34 | /// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-qualifier floating point value is highly innacurate.
35 | /// @see gtc_matrix_inverse
36 | template
37 | GLM_FUNC_DECL genType affineInverse(genType const& m);
38 |
39 | /// Compute the inverse transpose of a matrix.
40 | ///
41 | /// @param m Input matrix to invert transpose.
42 | /// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-qualifier floating point value is highly innacurate.
43 | /// @see gtc_matrix_inverse
44 | template
45 | GLM_FUNC_DECL genType inverseTranspose(genType const& m);
46 |
47 | /// @}
48 | }//namespace glm
49 |
50 | #include "matrix_inverse.inl"
51 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtc/noise.hpp:
--------------------------------------------------------------------------------
1 | /// @ref gtc_noise
2 | /// @file glm/gtc/noise.hpp
3 | ///
4 | /// @see core (dependence)
5 | ///
6 | /// @defgroup gtc_noise GLM_GTC_noise
7 | /// @ingroup gtc
8 | ///
9 | /// Include to use the features of this extension.
10 | ///
11 | /// Defines 2D, 3D and 4D procedural noise functions
12 | /// Based on the work of Stefan Gustavson and Ashima Arts on "webgl-noise":
13 | /// https://github.com/ashima/webgl-noise
14 | /// Following Stefan Gustavson's paper "Simplex noise demystified":
15 | /// http://www.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
16 |
17 | #pragma once
18 |
19 | // Dependencies
20 | #include "../detail/setup.hpp"
21 | #include "../detail/qualifier.hpp"
22 | #include "../detail/_noise.hpp"
23 | #include "../geometric.hpp"
24 | #include "../common.hpp"
25 | #include "../vector_relational.hpp"
26 | #include "../vec2.hpp"
27 | #include "../vec3.hpp"
28 | #include "../vec4.hpp"
29 |
30 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
31 | # pragma message("GLM: GLM_GTC_noise extension included")
32 | #endif
33 |
34 | namespace glm
35 | {
36 | /// @addtogroup gtc_noise
37 | /// @{
38 |
39 | /// Classic perlin noise.
40 | /// @see gtc_noise
41 | template
42 | GLM_FUNC_DECL T perlin(
43 | vec const& p);
44 |
45 | /// Periodic perlin noise.
46 | /// @see gtc_noise
47 | template
48 | GLM_FUNC_DECL T perlin(
49 | vec const& p,
50 | vec const& rep);
51 |
52 | /// Simplex noise.
53 | /// @see gtc_noise
54 | template
55 | GLM_FUNC_DECL T simplex(
56 | vec const& p);
57 |
58 | /// @}
59 | }//namespace glm
60 |
61 | #include "noise.inl"
62 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtc/type_precision.inl:
--------------------------------------------------------------------------------
1 | /// @ref gtc_swizzle
2 | /// @file glm/gtc/swizzle.inl
3 |
4 | namespace glm
5 | {
6 |
7 | }
8 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtc/ulp.hpp:
--------------------------------------------------------------------------------
1 | /// @ref gtc_ulp
2 | /// @file glm/gtc/ulp.hpp
3 | ///
4 | /// @see core (dependence)
5 | ///
6 | /// @defgroup gtc_ulp GLM_GTC_ulp
7 | /// @ingroup gtc
8 | ///
9 | /// Include to use the features of this extension.
10 | ///
11 | /// Allow the measurement of the accuracy of a function against a reference
12 | /// implementation. This extension works on floating-point data and provide results
13 | /// in ULP.
14 |
15 | #pragma once
16 |
17 | // Dependencies
18 | #include "../detail/setup.hpp"
19 | #include "../detail/qualifier.hpp"
20 | #include "../detail/type_int.hpp"
21 | #include "../detail/compute_vector_relational.hpp"
22 |
23 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
24 | # pragma message("GLM: GLM_GTC_ulp extension included")
25 | #endif
26 |
27 | namespace glm
28 | {
29 | /// @addtogroup gtc_ulp
30 | /// @{
31 |
32 | /// Return the next ULP value(s) after the input value(s).
33 | /// @see gtc_ulp
34 | template
35 | GLM_FUNC_DECL genType next_float(genType const& x);
36 |
37 | /// Return the previous ULP value(s) before the input value(s).
38 | /// @see gtc_ulp
39 | template
40 | GLM_FUNC_DECL genType prev_float(genType const& x);
41 |
42 | /// Return the value(s) ULP distance after the input value(s).
43 | /// @see gtc_ulp
44 | template
45 | GLM_FUNC_DECL genType next_float(genType const& x, uint const& Distance);
46 |
47 | /// Return the value(s) ULP distance before the input value(s).
48 | /// @see gtc_ulp
49 | template
50 | GLM_FUNC_DECL genType prev_float(genType const& x, uint const& Distance);
51 |
52 | /// Return the distance in the number of ULP between 2 scalars.
53 | /// @see gtc_ulp
54 | template
55 | GLM_FUNC_DECL uint float_distance(T const& x, T const& y);
56 |
57 | /// Return the distance in the number of ULP between 2 vectors.
58 | /// @see gtc_ulp
59 | template
60 | GLM_FUNC_DECL vec<2, uint, Q> float_distance(vec<2, T, Q> const& x, vec<2, T, Q> const& y);
61 |
62 | /// @}
63 | }// namespace glm
64 |
65 | #include "ulp.inl"
66 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtc/vec1.hpp:
--------------------------------------------------------------------------------
1 | /// @ref gtc_vec1
2 | /// @file glm/gtc/vec1.hpp
3 | ///
4 | /// @see core (dependence)
5 | ///
6 | /// @defgroup gtc_vec1 GLM_GTC_vec1
7 | /// @ingroup gtc
8 | ///
9 | /// Include to use the features of this extension.
10 | ///
11 | /// Add vec1, ivec1, uvec1 and bvec1 types.
12 |
13 | #pragma once
14 |
15 | // Dependency:
16 | #include "../ext/vec1.hpp"
17 |
18 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
19 | # pragma message("GLM: GLM_GTC_vec1 extension included")
20 | #endif
21 |
22 | #include "vec1.inl"
23 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtc/vec1.inl:
--------------------------------------------------------------------------------
1 | /// @ref gtc_vec1
2 | /// @file glm/gtc/vec1.inl
3 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtx/closest_point.hpp:
--------------------------------------------------------------------------------
1 | /// @ref gtx_closest_point
2 | /// @file glm/gtx/closest_point.hpp
3 | ///
4 | /// @see core (dependence)
5 | ///
6 | /// @defgroup gtx_closest_point GLM_GTX_closest_point
7 | /// @ingroup gtx
8 | ///
9 | /// Include to use the features of this extension.
10 | ///
11 | /// Find the point on a straight line which is the closet of a point.
12 |
13 | #pragma once
14 |
15 | // Dependency:
16 | #include "../glm.hpp"
17 |
18 | #ifndef GLM_ENABLE_EXPERIMENTAL
19 | # error "GLM: GLM_GTX_closest_point is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it."
20 | #endif
21 |
22 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
23 | # pragma message("GLM: GLM_GTX_closest_point extension included")
24 | #endif
25 |
26 | namespace glm
27 | {
28 | /// @addtogroup gtx_closest_point
29 | /// @{
30 |
31 | /// Find the point on a straight line which is the closet of a point.
32 | /// @see gtx_closest_point
33 | template
34 | GLM_FUNC_DECL vec<3, T, Q> closestPointOnLine(
35 | vec<3, T, Q> const& point,
36 | vec<3, T, Q> const& a,
37 | vec<3, T, Q> const& b);
38 |
39 | /// 2d lines work as well
40 | template
41 | GLM_FUNC_DECL vec<2, T, Q> closestPointOnLine(
42 | vec<2, T, Q> const& point,
43 | vec<2, T, Q> const& a,
44 | vec<2, T, Q> const& b);
45 |
46 | /// @}
47 | }// namespace glm
48 |
49 | #include "closest_point.inl"
50 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtx/closest_point.inl:
--------------------------------------------------------------------------------
1 | /// @ref gtx_closest_point
2 | /// @file glm/gtx/closest_point.inl
3 |
4 | namespace glm
5 | {
6 | template
7 | GLM_FUNC_QUALIFIER vec<3, T, Q> closestPointOnLine
8 | (
9 | vec<3, T, Q> const& point,
10 | vec<3, T, Q> const& a,
11 | vec<3, T, Q> const& b
12 | )
13 | {
14 | T LineLength = distance(a, b);
15 | vec<3, T, Q> Vector = point - a;
16 | vec<3, T, Q> LineDirection = (b - a) / LineLength;
17 |
18 | // Project Vector to LineDirection to get the distance of point from a
19 | T Distance = dot(Vector, LineDirection);
20 |
21 | if(Distance <= T(0)) return a;
22 | if(Distance >= LineLength) return b;
23 | return a + LineDirection * Distance;
24 | }
25 |
26 | template
27 | GLM_FUNC_QUALIFIER vec<2, T, Q> closestPointOnLine
28 | (
29 | vec<2, T, Q> const& point,
30 | vec<2, T, Q> const& a,
31 | vec<2, T, Q> const& b
32 | )
33 | {
34 | T LineLength = distance(a, b);
35 | vec<2, T, Q> Vector = point - a;
36 | vec<2, T, Q> LineDirection = (b - a) / LineLength;
37 |
38 | // Project Vector to LineDirection to get the distance of point from a
39 | T Distance = dot(Vector, LineDirection);
40 |
41 | if(Distance <= T(0)) return a;
42 | if(Distance >= LineLength) return b;
43 | return a + LineDirection * Distance;
44 | }
45 |
46 | }//namespace glm
47 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtx/color_encoding.hpp:
--------------------------------------------------------------------------------
1 | /// @ref gtx_color_encoding
2 | /// @file glm/gtx/color_encoding.hpp
3 | ///
4 | /// @see core (dependence)
5 | /// @see gtx_color_encoding (dependence)
6 | ///
7 | /// @defgroup gtx_color_encoding GLM_GTX_color_encoding
8 | /// @ingroup gtx
9 | ///
10 | /// Include to use the features of this extension.
11 | ///
12 | /// @brief Allow to perform bit operations on integer values
13 |
14 | #pragma once
15 |
16 | // Dependencies
17 | #include "../detail/setup.hpp"
18 | #include "../detail/qualifier.hpp"
19 | #include "../vec3.hpp"
20 | #include
21 |
22 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
23 | # pragma message("GLM: GLM_GTC_color_encoding extension included")
24 | #endif
25 |
26 | namespace glm
27 | {
28 | /// @addtogroup gtx_color_encoding
29 | /// @{
30 |
31 | /// Convert a linear sRGB color to D65 YUV.
32 | template
33 | GLM_FUNC_DECL vec<3, T, Q> convertLinearSRGBToD65XYZ(vec<3, T, Q> const& ColorLinearSRGB);
34 |
35 | /// Convert a linear sRGB color to D50 YUV.
36 | template
37 | GLM_FUNC_DECL vec<3, T, Q> convertLinearSRGBToD50XYZ(vec<3, T, Q> const& ColorLinearSRGB);
38 |
39 | /// Convert a D65 YUV color to linear sRGB.
40 | template
41 | GLM_FUNC_DECL vec<3, T, Q> convertD65XYZToLinearSRGB(vec<3, T, Q> const& ColorD65XYZ);
42 |
43 | /// Convert a D65 YUV color to D50 YUV.
44 | template
45 | GLM_FUNC_DECL vec<3, T, Q> convertD65XYZToD50XYZ(vec<3, T, Q> const& ColorD65XYZ);
46 |
47 | /// @}
48 | } //namespace glm
49 |
50 | #include "color_encoding.inl"
51 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtx/color_encoding.inl:
--------------------------------------------------------------------------------
1 | /// @ref gtx_color_encoding
2 | /// @file glm/gtx/color_encoding.inl
3 |
4 | namespace glm
5 | {
6 | template
7 | GLM_FUNC_QUALIFIER vec<3, T, Q> convertLinearSRGBToD65XYZ(vec<3, T, Q> const& ColorLinearSRGB)
8 | {
9 | vec<3, T, Q> const M(0.490f, 0.17697f, 0.2f);
10 | vec<3, T, Q> const N(0.31f, 0.8124f, 0.01063f);
11 | vec<3, T, Q> const O(0.490f, 0.01f, 0.99f);
12 |
13 | return (M * ColorLinearSRGB + N * ColorLinearSRGB + O * ColorLinearSRGB) * static_cast(5.650675255693055f);
14 | }
15 |
16 | template
17 | GLM_FUNC_QUALIFIER vec<3, T, Q> convertLinearSRGBToD50XYZ(vec<3, T, Q> const& ColorLinearSRGB)
18 | {
19 | vec<3, T, Q> const M(0.436030342570117f, 0.222438466210245f, 0.013897440074263f);
20 | vec<3, T, Q> const N(0.385101860087134f, 0.716942745571917f, 0.097076381494207f);
21 | vec<3, T, Q> const O(0.143067806654203f, 0.060618777416563f, 0.713926257896652f);
22 |
23 | return M * ColorLinearSRGB + N * ColorLinearSRGB + O * ColorLinearSRGB;
24 | }
25 |
26 | template
27 | GLM_FUNC_QUALIFIER vec<3, T, Q> convertD65XYZToLinearSRGB(vec<3, T, Q> const& ColorD65XYZ)
28 | {
29 | vec<3, T, Q> const M(0.41847f, -0.091169f, 0.0009209f);
30 | vec<3, T, Q> const N(-0.15866f, 0.25243f, 0.015708f);
31 | vec<3, T, Q> const O(0.0009209f, -0.0025498f, 0.1786f);
32 |
33 | return M * ColorD65XYZ + N * ColorD65XYZ + O * ColorD65XYZ;
34 | }
35 |
36 | template
37 | GLM_FUNC_QUALIFIER vec<3, T, Q> convertD65XYZToD50XYZ(vec<3, T, Q> const& ColorD65XYZ)
38 | {
39 | vec<3, T, Q> const M(+1.047844353856414f, +0.029549007606644f, -0.009250984365223f);
40 | vec<3, T, Q> const N(+0.022898981050086f, +0.990508028941971f, +0.015072338237051f);
41 | vec<3, T, Q> const O(-0.050206647741605f, -0.017074711360960f, +0.751717835079977f);
42 |
43 | return M * ColorD65XYZ + N * ColorD65XYZ + O * ColorD65XYZ;
44 | }
45 |
46 | }//namespace glm
47 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtx/color_space.hpp:
--------------------------------------------------------------------------------
1 | /// @ref gtx_color_space
2 | /// @file glm/gtx/color_space.hpp
3 | ///
4 | /// @see core (dependence)
5 | ///
6 | /// @defgroup gtx_color_space GLM_GTX_color_space
7 | /// @ingroup gtx
8 | ///
9 | /// Include to use the features of this extension.
10 | ///
11 | /// Related to RGB to HSV conversions and operations.
12 |
13 | #pragma once
14 |
15 | // Dependency:
16 | #include "../glm.hpp"
17 |
18 | #ifndef GLM_ENABLE_EXPERIMENTAL
19 | # error "GLM: GLM_GTX_color_space is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it."
20 | #endif
21 |
22 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
23 | # pragma message("GLM: GLM_GTX_color_space extension included")
24 | #endif
25 |
26 | namespace glm
27 | {
28 | /// @addtogroup gtx_color_space
29 | /// @{
30 |
31 | /// Converts a color from HSV color space to its color in RGB color space.
32 | /// @see gtx_color_space
33 | template
34 | GLM_FUNC_DECL vec<3, T, Q> rgbColor(
35 | vec<3, T, Q> const& hsvValue);
36 |
37 | /// Converts a color from RGB color space to its color in HSV color space.
38 | /// @see gtx_color_space
39 | template
40 | GLM_FUNC_DECL vec<3, T, Q> hsvColor(
41 | vec<3, T, Q> const& rgbValue);
42 |
43 | /// Build a saturation matrix.
44 | /// @see gtx_color_space
45 | template
46 | GLM_FUNC_DECL mat<4, 4, T, defaultp> saturation(
47 | T const s);
48 |
49 | /// Modify the saturation of a color.
50 | /// @see gtx_color_space
51 | template
52 | GLM_FUNC_DECL vec<3, T, Q> saturation(
53 | T const s,
54 | vec<3, T, Q> const& color);
55 |
56 | /// Modify the saturation of a color.
57 | /// @see gtx_color_space
58 | template
59 | GLM_FUNC_DECL vec<4, T, Q> saturation(
60 | T const s,
61 | vec<4, T, Q> const& color);
62 |
63 | /// Compute color luminosity associating ratios (0.33, 0.59, 0.11) to RGB canals.
64 | /// @see gtx_color_space
65 | template
66 | GLM_FUNC_DECL T luminosity(
67 | vec<3, T, Q> const& color);
68 |
69 | /// @}
70 | }//namespace glm
71 |
72 | #include "color_space.inl"
73 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtx/color_space_YCoCg.hpp:
--------------------------------------------------------------------------------
1 | /// @ref gtx_color_space_YCoCg
2 | /// @file glm/gtx/color_space_YCoCg.hpp
3 | ///
4 | /// @see core (dependence)
5 | ///
6 | /// @defgroup gtx_color_space_YCoCg GLM_GTX_color_space_YCoCg
7 | /// @ingroup gtx
8 | ///
9 | /// Include to use the features of this extension.
10 | ///
11 | /// RGB to YCoCg conversions and operations
12 |
13 | #pragma once
14 |
15 | // Dependency:
16 | #include "../glm.hpp"
17 |
18 | #ifndef GLM_ENABLE_EXPERIMENTAL
19 | # error "GLM: GLM_GTX_color_space_YCoCg is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it."
20 | #endif
21 |
22 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
23 | # pragma message("GLM: GLM_GTX_color_space_YCoCg extension included")
24 | #endif
25 |
26 | namespace glm
27 | {
28 | /// @addtogroup gtx_color_space_YCoCg
29 | /// @{
30 |
31 | /// Convert a color from RGB color space to YCoCg color space.
32 | /// @see gtx_color_space_YCoCg
33 | template
34 | GLM_FUNC_DECL vec<3, T, Q> rgb2YCoCg(
35 | vec<3, T, Q> const& rgbColor);
36 |
37 | /// Convert a color from YCoCg color space to RGB color space.
38 | /// @see gtx_color_space_YCoCg
39 | template
40 | GLM_FUNC_DECL vec<3, T, Q> YCoCg2rgb(
41 | vec<3, T, Q> const& YCoCgColor);
42 |
43 | /// Convert a color from RGB color space to YCoCgR color space.
44 | /// @see "YCoCg-R: A Color Space with RGB Reversibility and Low Dynamic Range"
45 | /// @see gtx_color_space_YCoCg
46 | template
47 | GLM_FUNC_DECL vec<3, T, Q> rgb2YCoCgR(
48 | vec<3, T, Q> const& rgbColor);
49 |
50 | /// Convert a color from YCoCgR color space to RGB color space.
51 | /// @see "YCoCg-R: A Color Space with RGB Reversibility and Low Dynamic Range"
52 | /// @see gtx_color_space_YCoCg
53 | template
54 | GLM_FUNC_DECL vec<3, T, Q> YCoCgR2rgb(
55 | vec<3, T, Q> const& YCoCgColor);
56 |
57 | /// @}
58 | }//namespace glm
59 |
60 | #include "color_space_YCoCg.inl"
61 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtx/compatibility.inl:
--------------------------------------------------------------------------------
1 | /// @ref gtx_compatibility
2 | /// @file glm/gtx/compatibility.inl
3 |
4 | #include
5 |
6 | namespace glm
7 | {
8 | // isfinite
9 | template
10 | GLM_FUNC_QUALIFIER bool isfinite(
11 | genType const& x)
12 | {
13 | # if GLM_HAS_CXX11_STL
14 | return std::isfinite(x) != 0;
15 | # elif GLM_COMPILER & GLM_COMPILER_VC
16 | return _finite(x);
17 | # elif GLM_COMPILER & GLM_COMPILER_GCC && GLM_PLATFORM & GLM_PLATFORM_ANDROID
18 | return _isfinite(x) != 0;
19 | # else
20 | if (std::numeric_limits::is_integer || std::denorm_absent == std::numeric_limits::has_denorm)
21 | return std::numeric_limits::min() <= x && std::numeric_limits::max() >= x;
22 | else
23 | return -std::numeric_limits::max() <= x && std::numeric_limits::max() >= x;
24 | # endif
25 | }
26 |
27 | template
28 | GLM_FUNC_QUALIFIER vec<1, bool, Q> isfinite(
29 | vec<1, T, Q> const& x)
30 | {
31 | return vec<1, bool, Q>(
32 | isfinite(x.x));
33 | }
34 |
35 | template
36 | GLM_FUNC_QUALIFIER vec<2, bool, Q> isfinite(
37 | vec<2, T, Q> const& x)
38 | {
39 | return vec<2, bool, Q>(
40 | isfinite(x.x),
41 | isfinite(x.y));
42 | }
43 |
44 | template
45 | GLM_FUNC_QUALIFIER vec<3, bool, Q> isfinite(
46 | vec<3, T, Q> const& x)
47 | {
48 | return vec<3, bool, Q>(
49 | isfinite(x.x),
50 | isfinite(x.y),
51 | isfinite(x.z));
52 | }
53 |
54 | template
55 | GLM_FUNC_QUALIFIER vec<4, bool, Q> isfinite(
56 | vec<4, T, Q> const& x)
57 | {
58 | return vec<4, bool, Q>(
59 | isfinite(x.x),
60 | isfinite(x.y),
61 | isfinite(x.z),
62 | isfinite(x.w));
63 | }
64 |
65 | }//namespace glm
66 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtx/extend.hpp:
--------------------------------------------------------------------------------
1 | /// @ref gtx_extend
2 | /// @file glm/gtx/extend.hpp
3 | ///
4 | /// @see core (dependence)
5 | ///
6 | /// @defgroup gtx_extend GLM_GTX_extend
7 | /// @ingroup gtx
8 | ///
9 | /// Include to use the features of this extension.
10 | ///
11 | /// Extend a position from a source to a position at a defined length.
12 |
13 | #pragma once
14 |
15 | // Dependency:
16 | #include "../glm.hpp"
17 |
18 | #ifndef GLM_ENABLE_EXPERIMENTAL
19 | # error "GLM: GLM_GTX_extend is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it."
20 | #endif
21 |
22 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
23 | # pragma message("GLM: GLM_GTX_extend extension included")
24 | #endif
25 |
26 | namespace glm
27 | {
28 | /// @addtogroup gtx_extend
29 | /// @{
30 |
31 | /// Extends of Length the Origin position using the (Source - Origin) direction.
32 | /// @see gtx_extend
33 | template
34 | GLM_FUNC_DECL genType extend(
35 | genType const& Origin,
36 | genType const& Source,
37 | typename genType::value_type const Length);
38 |
39 | /// @}
40 | }//namespace glm
41 |
42 | #include "extend.inl"
43 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtx/extend.inl:
--------------------------------------------------------------------------------
1 | /// @ref gtx_extend
2 | /// @file glm/gtx/extend.inl
3 |
4 | namespace glm
5 | {
6 | template
7 | GLM_FUNC_QUALIFIER genType extend
8 | (
9 | genType const& Origin,
10 | genType const& Source,
11 | genType const& Distance
12 | )
13 | {
14 | return Origin + (Source - Origin) * Distance;
15 | }
16 |
17 | template
18 | GLM_FUNC_QUALIFIER vec<2, T, Q> extend
19 | (
20 | vec<2, T, Q> const& Origin,
21 | vec<2, T, Q> const& Source,
22 | T const& Distance
23 | )
24 | {
25 | return Origin + (Source - Origin) * Distance;
26 | }
27 |
28 | template
29 | GLM_FUNC_QUALIFIER vec<3, T, Q> extend
30 | (
31 | vec<3, T, Q> const& Origin,
32 | vec<3, T, Q> const& Source,
33 | T const& Distance
34 | )
35 | {
36 | return Origin + (Source - Origin) * Distance;
37 | }
38 |
39 | template
40 | GLM_FUNC_QUALIFIER vec<4, T, Q> extend
41 | (
42 | vec<4, T, Q> const& Origin,
43 | vec<4, T, Q> const& Source,
44 | T const& Distance
45 | )
46 | {
47 | return Origin + (Source - Origin) * Distance;
48 | }
49 | }//namespace glm
50 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtx/exterior_product.hpp:
--------------------------------------------------------------------------------
1 | /// @ref gtx_exterior_product
2 | /// @file glm/gtx/exterior_product.hpp
3 | ///
4 | /// @see core (dependence)
5 | /// @see gtx_exterior_product (dependence)
6 | ///
7 | /// @defgroup gtx_exterior_product GLM_GTX_exterior_product
8 | /// @ingroup gtx
9 | ///
10 | /// Include to use the features of this extension.
11 | ///
12 | /// @brief Allow to perform bit operations on integer values
13 |
14 | #pragma once
15 |
16 | // Dependencies
17 | #include "../detail/setup.hpp"
18 | #include "../detail/qualifier.hpp"
19 |
20 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
21 | # pragma message("GLM: GLM_GTX_exterior_product extension included")
22 | #endif
23 |
24 | namespace glm
25 | {
26 | /// @addtogroup gtx_exterior_product
27 | /// @{
28 |
29 | /// Returns the cross product of x and y.
30 | ///
31 | /// @tparam T Floating-point scalar types
32 | /// @tparam Q Value from qualifier enum
33 | ///
34 | /// @see Exterior product
35 | template
36 | GLM_FUNC_DECL T cross(vec<2, T, Q> const& v, vec<2, T, Q> const& u);
37 |
38 | /// @}
39 | } //namespace glm
40 |
41 | #include "exterior_product.inl"
42 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtx/exterior_product.inl:
--------------------------------------------------------------------------------
1 | /// @ref core
2 | /// @file glm/detail/func_geometric.inl
3 |
4 | #include
5 |
6 | namespace glm {
7 | namespace detail
8 | {
9 | template
10 | struct compute_cross_vec2
11 | {
12 | GLM_FUNC_QUALIFIER static T call(vec<2, T, Q> const& v, vec<2, T, Q> const& u)
13 | {
14 | GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'cross' accepts only floating-point inputs");
15 |
16 | return v.x * u.y - u.x * v.y;
17 | }
18 | };
19 | }//namespace detail
20 |
21 | template
22 | GLM_FUNC_QUALIFIER T cross(vec<2, T, Q> const& x, vec<2, T, Q> const& y)
23 | {
24 | return detail::compute_cross_vec2::value>::call(x, y);
25 | }
26 | }//namespace glm
27 |
28 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtx/float_notmalize.inl:
--------------------------------------------------------------------------------
1 | /// @ref gtx_float_normalize
2 | /// @file glm/gtx/float_normalize.inl
3 |
4 | #include
5 |
6 | namespace glm
7 | {
8 | template
9 | GLM_FUNC_QUALIFIER vec floatNormalize(vec const& v)
10 | {
11 | return vec(v) / static_cast(std::numeric_limits::max());
12 | }
13 |
14 | }//namespace glm
15 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtx/functions.hpp:
--------------------------------------------------------------------------------
1 | /// @ref gtx_functions
2 | /// @file glm/gtx/functions.hpp
3 | ///
4 | /// @see core (dependence)
5 | /// @see gtc_quaternion (dependence)
6 | ///
7 | /// @defgroup gtx_functions GLM_GTX_functions
8 | /// @ingroup gtx
9 | ///
10 | /// Include to use the features of this extension.
11 | ///
12 | /// List of useful common functions.
13 |
14 | #pragma once
15 |
16 | // Dependencies
17 | #include "../detail/setup.hpp"
18 | #include "../detail/qualifier.hpp"
19 | #include "../detail/type_vec2.hpp"
20 |
21 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
22 | # pragma message("GLM: GLM_GTX_functions extension included")
23 | #endif
24 |
25 | namespace glm
26 | {
27 | /// @addtogroup gtx_functions
28 | /// @{
29 |
30 | /// 1D gauss function
31 | ///
32 | /// @see gtc_epsilon
33 | template
34 | GLM_FUNC_DECL T gauss(
35 | T x,
36 | T ExpectedValue,
37 | T StandardDeviation);
38 |
39 | /// 2D gauss function
40 | ///
41 | /// @see gtc_epsilon
42 | template
43 | GLM_FUNC_DECL T gauss(
44 | vec<2, T, Q> const& Coord,
45 | vec<2, T, Q> const& ExpectedValue,
46 | vec<2, T, Q> const& StandardDeviation);
47 |
48 | /// @}
49 | }//namespace glm
50 |
51 | #include "functions.inl"
52 |
53 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtx/functions.inl:
--------------------------------------------------------------------------------
1 | /// @ref gtx_functions
2 | /// @file glm/gtx/functions.inl
3 |
4 | #include "../exponential.hpp"
5 |
6 | namespace glm
7 | {
8 | template
9 | GLM_FUNC_QUALIFIER T gauss
10 | (
11 | T x,
12 | T ExpectedValue,
13 | T StandardDeviation
14 | )
15 | {
16 | return exp(-((x - ExpectedValue) * (x - ExpectedValue)) / (static_cast(2) * StandardDeviation * StandardDeviation)) / (StandardDeviation * sqrt(static_cast(6.28318530717958647692528676655900576)));
17 | }
18 |
19 | template
20 | GLM_FUNC_QUALIFIER T gauss
21 | (
22 | vec<2, T, Q> const& Coord,
23 | vec<2, T, Q> const& ExpectedValue,
24 | vec<2, T, Q> const& StandardDeviation
25 | )
26 | {
27 | vec<2, T, Q> const Squared = ((Coord - ExpectedValue) * (Coord - ExpectedValue)) / (static_cast(2) * StandardDeviation * StandardDeviation);
28 | return exp(-(Squared.x + Squared.y));
29 | }
30 | }//namespace glm
31 |
32 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtx/gradient_paint.hpp:
--------------------------------------------------------------------------------
1 | /// @ref gtx_gradient_paint
2 | /// @file glm/gtx/gradient_paint.hpp
3 | ///
4 | /// @see core (dependence)
5 | /// @see gtx_optimum_pow (dependence)
6 | ///
7 | /// @defgroup gtx_gradient_paint GLM_GTX_gradient_paint
8 | /// @ingroup gtx
9 | ///
10 | /// Include to use the features of this extension.
11 | ///
12 | /// Functions that return the color of procedural gradient for specific coordinates.
13 |
14 | #pragma once
15 |
16 | // Dependency:
17 | #include "../glm.hpp"
18 | #include "../gtx/optimum_pow.hpp"
19 |
20 | #ifndef GLM_ENABLE_EXPERIMENTAL
21 | # error "GLM: GLM_GTX_gradient_paint is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it."
22 | #endif
23 |
24 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
25 | # pragma message("GLM: GLM_GTX_gradient_paint extension included")
26 | #endif
27 |
28 | namespace glm
29 | {
30 | /// @addtogroup gtx_gradient_paint
31 | /// @{
32 |
33 | /// Return a color from a radial gradient.
34 | /// @see - gtx_gradient_paint
35 | template
36 | GLM_FUNC_DECL T radialGradient(
37 | vec<2, T, Q> const& Center,
38 | T const& Radius,
39 | vec<2, T, Q> const& Focal,
40 | vec<2, T, Q> const& Position);
41 |
42 | /// Return a color from a linear gradient.
43 | /// @see - gtx_gradient_paint
44 | template
45 | GLM_FUNC_DECL T linearGradient(
46 | vec<2, T, Q> const& Point0,
47 | vec<2, T, Q> const& Point1,
48 | vec<2, T, Q> const& Position);
49 |
50 | /// @}
51 | }// namespace glm
52 |
53 | #include "gradient_paint.inl"
54 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtx/gradient_paint.inl:
--------------------------------------------------------------------------------
1 | /// @ref gtx_gradient_paint
2 | /// @file glm/gtx/gradient_paint.inl
3 |
4 | namespace glm
5 | {
6 | template
7 | GLM_FUNC_QUALIFIER T radialGradient
8 | (
9 | vec<2, T, Q> const& Center,
10 | T const& Radius,
11 | vec<2, T, Q> const& Focal,
12 | vec<2, T, Q> const& Position
13 | )
14 | {
15 | vec<2, T, Q> F = Focal - Center;
16 | vec<2, T, Q> D = Position - Focal;
17 | T Radius2 = pow2(Radius);
18 | T Fx2 = pow2(F.x);
19 | T Fy2 = pow2(F.y);
20 |
21 | T Numerator = (D.x * F.x + D.y * F.y) + sqrt(Radius2 * (pow2(D.x) + pow2(D.y)) - pow2(D.x * F.y - D.y * F.x));
22 | T Denominator = Radius2 - (Fx2 + Fy2);
23 | return Numerator / Denominator;
24 | }
25 |
26 | template
27 | GLM_FUNC_QUALIFIER T linearGradient
28 | (
29 | vec<2, T, Q> const& Point0,
30 | vec<2, T, Q> const& Point1,
31 | vec<2, T, Q> const& Position
32 | )
33 | {
34 | vec<2, T, Q> Dist = Point1 - Point0;
35 | return (Dist.x * (Position.x - Point0.x) + Dist.y * (Position.y - Point0.y)) / glm::dot(Dist, Dist);
36 | }
37 | }//namespace glm
38 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtx/handed_coordinate_space.hpp:
--------------------------------------------------------------------------------
1 | /// @ref gtx_handed_coordinate_space
2 | /// @file glm/gtx/handed_coordinate_space.hpp
3 | ///
4 | /// @see core (dependence)
5 | ///
6 | /// @defgroup gtx_handed_coordinate_space GLM_GTX_handed_coordinate_space
7 | /// @ingroup gtx
8 | ///
9 | /// Include to use the features of this extension.
10 | ///
11 | /// To know if a set of three basis vectors defines a right or left-handed coordinate system.
12 |
13 | #pragma once
14 |
15 | // Dependency:
16 | #include "../glm.hpp"
17 |
18 | #ifndef GLM_ENABLE_EXPERIMENTAL
19 | # error "GLM: GLM_GTX_handed_coordinate_space is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it."
20 | #endif
21 |
22 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
23 | # pragma message("GLM: GLM_GTX_handed_coordinate_space extension included")
24 | #endif
25 |
26 | namespace glm
27 | {
28 | /// @addtogroup gtx_handed_coordinate_space
29 | /// @{
30 |
31 | //! Return if a trihedron right handed or not.
32 | //! From GLM_GTX_handed_coordinate_space extension.
33 | template
34 | GLM_FUNC_DECL bool rightHanded(
35 | vec<3, T, Q> const& tangent,
36 | vec<3, T, Q> const& binormal,
37 | vec<3, T, Q> const& normal);
38 |
39 | //! Return if a trihedron left handed or not.
40 | //! From GLM_GTX_handed_coordinate_space extension.
41 | template
42 | GLM_FUNC_DECL bool leftHanded(
43 | vec<3, T, Q> const& tangent,
44 | vec<3, T, Q> const& binormal,
45 | vec<3, T, Q> const& normal);
46 |
47 | /// @}
48 | }// namespace glm
49 |
50 | #include "handed_coordinate_space.inl"
51 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtx/handed_coordinate_space.inl:
--------------------------------------------------------------------------------
1 | /// @ref gtx_handed_coordinate_space
2 | /// @file glm/gtx/handed_coordinate_space.inl
3 |
4 | namespace glm
5 | {
6 | template
7 | GLM_FUNC_QUALIFIER bool rightHanded
8 | (
9 | vec<3, T, Q> const& tangent,
10 | vec<3, T, Q> const& binormal,
11 | vec<3, T, Q> const& normal
12 | )
13 | {
14 | return dot(cross(normal, tangent), binormal) > T(0);
15 | }
16 |
17 | template
18 | GLM_FUNC_QUALIFIER bool leftHanded
19 | (
20 | vec<3, T, Q> const& tangent,
21 | vec<3, T, Q> const& binormal,
22 | vec<3, T, Q> const& normal
23 | )
24 | {
25 | return dot(cross(normal, tangent), binormal) < T(0);
26 | }
27 | }//namespace glm
28 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtx/integer.hpp:
--------------------------------------------------------------------------------
1 | /// @ref gtx_integer
2 | /// @file glm/gtx/integer.hpp
3 | ///
4 | /// @see core (dependence)
5 | ///
6 | /// @defgroup gtx_integer GLM_GTX_integer
7 | /// @ingroup gtx
8 | ///
9 | /// Include to use the features of this extension.
10 | ///
11 | /// Add support for integer for core functions
12 |
13 | #pragma once
14 |
15 | // Dependency:
16 | #include "../glm.hpp"
17 | #include "../gtc/integer.hpp"
18 |
19 | #ifndef GLM_ENABLE_EXPERIMENTAL
20 | # error "GLM: GLM_GTX_integer is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it."
21 | #endif
22 |
23 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
24 | # pragma message("GLM: GLM_GTX_integer extension included")
25 | #endif
26 |
27 | namespace glm
28 | {
29 | /// @addtogroup gtx_integer
30 | /// @{
31 |
32 | //! Returns x raised to the y power.
33 | //! From GLM_GTX_integer extension.
34 | GLM_FUNC_DECL int pow(int x, uint y);
35 |
36 | //! Returns the positive square root of x.
37 | //! From GLM_GTX_integer extension.
38 | GLM_FUNC_DECL int sqrt(int x);
39 |
40 | //! Returns the floor log2 of x.
41 | //! From GLM_GTX_integer extension.
42 | GLM_FUNC_DECL unsigned int floor_log2(unsigned int x);
43 |
44 | //! Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y.
45 | //! From GLM_GTX_integer extension.
46 | GLM_FUNC_DECL int mod(int x, int y);
47 |
48 | //! Return the factorial value of a number (!12 max, integer only)
49 | //! From GLM_GTX_integer extension.
50 | template
51 | GLM_FUNC_DECL genType factorial(genType const& x);
52 |
53 | //! 32bit signed integer.
54 | //! From GLM_GTX_integer extension.
55 | typedef signed int sint;
56 |
57 | //! Returns x raised to the y power.
58 | //! From GLM_GTX_integer extension.
59 | GLM_FUNC_DECL uint pow(uint x, uint y);
60 |
61 | //! Returns the positive square root of x.
62 | //! From GLM_GTX_integer extension.
63 | GLM_FUNC_DECL uint sqrt(uint x);
64 |
65 | //! Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y.
66 | //! From GLM_GTX_integer extension.
67 | GLM_FUNC_DECL uint mod(uint x, uint y);
68 |
69 | //! Returns the number of leading zeros.
70 | //! From GLM_GTX_integer extension.
71 | GLM_FUNC_DECL uint nlz(uint x);
72 |
73 | /// @}
74 | }//namespace glm
75 |
76 | #include "integer.inl"
77 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtx/log_base.hpp:
--------------------------------------------------------------------------------
1 | /// @ref gtx_log_base
2 | /// @file glm/gtx/log_base.hpp
3 | ///
4 | /// @see core (dependence)
5 | ///
6 | /// @defgroup gtx_log_base GLM_GTX_log_base
7 | /// @ingroup gtx
8 | ///
9 | /// Include to use the features of this extension.
10 | ///
11 | /// Logarithm for any base. base can be a vector or a scalar.
12 |
13 | #pragma once
14 |
15 | // Dependency:
16 | #include "../glm.hpp"
17 |
18 | #ifndef GLM_ENABLE_EXPERIMENTAL
19 | # error "GLM: GLM_GTX_log_base is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it."
20 | #endif
21 |
22 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
23 | # pragma message("GLM: GLM_GTX_log_base extension included")
24 | #endif
25 |
26 | namespace glm
27 | {
28 | /// @addtogroup gtx_log_base
29 | /// @{
30 |
31 | /// Logarithm for any base.
32 | /// From GLM_GTX_log_base.
33 | template
34 | GLM_FUNC_DECL genType log(
35 | genType const& x,
36 | genType const& base);
37 |
38 | /// Logarithm for any base.
39 | /// From GLM_GTX_log_base.
40 | template
41 | GLM_FUNC_DECL vec sign(
42 | vec const& x,
43 | vec const& base);
44 |
45 | /// @}
46 | }//namespace glm
47 |
48 | #include "log_base.inl"
49 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtx/log_base.inl:
--------------------------------------------------------------------------------
1 | /// @ref gtx_log_base
2 | /// @file glm/gtx/log_base.inl
3 |
4 | namespace glm
5 | {
6 | template
7 | GLM_FUNC_QUALIFIER genType log(genType const& x, genType const& base)
8 | {
9 | assert(!detail::compute_equal::call(x, static_cast(0)));
10 | return glm::log(x) / glm::log(base);
11 | }
12 |
13 | template
14 | GLM_FUNC_QUALIFIER vec log(vec const& x, vec const& base)
15 | {
16 | return glm::log(x) / glm::log(base);
17 | }
18 | }//namespace glm
19 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtx/matrix_cross_product.hpp:
--------------------------------------------------------------------------------
1 | /// @ref gtx_matrix_cross_product
2 | /// @file glm/gtx/matrix_cross_product.hpp
3 | ///
4 | /// @see core (dependence)
5 | /// @see gtx_extented_min_max (dependence)
6 | ///
7 | /// @defgroup gtx_matrix_cross_product GLM_GTX_matrix_cross_product
8 | /// @ingroup gtx
9 | ///
10 | /// Include to use the features of this extension.
11 | ///
12 | /// Build cross product matrices
13 |
14 | #pragma once
15 |
16 | // Dependency:
17 | #include "../glm.hpp"
18 |
19 | #ifndef GLM_ENABLE_EXPERIMENTAL
20 | # error "GLM: GLM_GTX_matrix_cross_product is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it."
21 | #endif
22 |
23 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
24 | # pragma message("GLM: GLM_GTX_matrix_cross_product extension included")
25 | #endif
26 |
27 | namespace glm
28 | {
29 | /// @addtogroup gtx_matrix_cross_product
30 | /// @{
31 |
32 | //! Build a cross product matrix.
33 | //! From GLM_GTX_matrix_cross_product extension.
34 | template
35 | GLM_FUNC_DECL mat<3, 3, T, Q> matrixCross3(
36 | vec<3, T, Q> const& x);
37 |
38 | //! Build a cross product matrix.
39 | //! From GLM_GTX_matrix_cross_product extension.
40 | template
41 | GLM_FUNC_DECL mat<4, 4, T, Q> matrixCross4(
42 | vec<3, T, Q> const& x);
43 |
44 | /// @}
45 | }//namespace glm
46 |
47 | #include "matrix_cross_product.inl"
48 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtx/matrix_cross_product.inl:
--------------------------------------------------------------------------------
1 | /// @ref gtx_matrix_cross_product
2 | /// @file glm/gtx/matrix_cross_product.inl
3 |
4 | namespace glm
5 | {
6 | template
7 | GLM_FUNC_QUALIFIER mat<3, 3, T, Q> matrixCross3
8 | (
9 | vec<3, T, Q> const& x
10 | )
11 | {
12 | mat<3, 3, T, Q> Result(T(0));
13 | Result[0][1] = x.z;
14 | Result[1][0] = -x.z;
15 | Result[0][2] = -x.y;
16 | Result[2][0] = x.y;
17 | Result[1][2] = x.x;
18 | Result[2][1] = -x.x;
19 | return Result;
20 | }
21 |
22 | template
23 | GLM_FUNC_QUALIFIER mat<4, 4, T, Q> matrixCross4
24 | (
25 | vec<3, T, Q> const& x
26 | )
27 | {
28 | mat<4, 4, T, Q> Result(T(0));
29 | Result[0][1] = x.z;
30 | Result[1][0] = -x.z;
31 | Result[0][2] = -x.y;
32 | Result[2][0] = x.y;
33 | Result[1][2] = x.x;
34 | Result[2][1] = -x.x;
35 | return Result;
36 | }
37 |
38 | }//namespace glm
39 |
--------------------------------------------------------------------------------
/app/src/main/cpp/glm/gtx/matrix_decompose.hpp:
--------------------------------------------------------------------------------
1 | /// @ref gtx_matrix_decompose
2 | /// @file glm/gtx/matrix_decompose.hpp
3 | ///
4 | /// @see core (dependence)
5 | ///
6 | /// @defgroup gtx_matrix_decompose GLM_GTX_matrix_decompose
7 | /// @ingroup gtx
8 | ///
9 | /// Include to use the features of this extension.
10 | ///
11 | /// Decomposes a model matrix to translations, rotation and scale components
12 |
13 | #pragma once
14 |
15 | // Dependencies
16 | #include "../mat4x4.hpp"
17 | #include "../vec3.hpp"
18 | #include "../vec4.hpp"
19 | #include "../geometric.hpp"
20 | #include "../gtc/quaternion.hpp"
21 | #include "../gtc/matrix_transform.hpp"
22 |
23 | #ifndef GLM_ENABLE_EXPERIMENTAL
24 | # error "GLM: GLM_GTX_matrix_decompose is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it."
25 | #endif
26 |
27 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
28 | # pragma message("GLM: GLM_GTX_matrix_decompose extension included")
29 | #endif
30 |
31 | namespace glm
32 | {
33 | /// @addtogroup gtx_matrix_decompose
34 | /// @{
35 |
36 | /// Decomposes a model matrix to translations, rotation and scale components
37 | /// @see gtx_matrix_decompose
38 | template
39 | GLM_FUNC_DECL bool decompose(
40 | mat<4, 4, T, Q> const& modelMatrix,
41 | vec<3, T, Q> & scale, tquat