├── .gitattributes ├── .github └── workflows │ └── sync2gitee.yml ├── .gitignore ├── .gitmodules ├── .pa_devtool └── data.json ├── .vscode └── settings.json ├── CppClient ├── .cmake │ ├── copyFile.cmake │ └── proto.cmake ├── .github │ └── workflows │ │ └── main.yml ├── .gitignore ├── .gitmodules ├── .vscode │ ├── c_cpp_properties temp.json │ ├── c_cpp_properties.json │ └── settings.json ├── CMakeLists.txt ├── CMakeSettings.json ├── ConfigVscode.md ├── README.md ├── VF_CppClient.code-workspace ├── VoxelFrameClient │ ├── CMakeLists.txt │ ├── VoxelFrameClient.cpp │ └── VoxelFrameClient.h ├── __pycache__ │ └── _config.cpython-39.pyc ├── _config.py ├── _preBuild.py ├── conanfile.txt ├── resource │ ├── Shader │ │ ├── camera.fs │ │ ├── camera.vs │ │ ├── shader.fs │ │ └── shader.vs │ ├── font │ │ ├── Cousine-Regular.ttf │ │ ├── DroidSans.ttf │ │ ├── Karla-Regular.ttf │ │ ├── Lato-Light.ttf │ │ ├── Lato-Regular.ttf │ │ ├── ProggyClean.ttf │ │ ├── ProggyTiny.ttf │ │ └── Roboto-Medium.ttf │ └── images │ │ ├── 1.png │ │ ├── 2.png │ │ ├── 3.png │ │ ├── 4.png │ │ ├── 5.png │ │ ├── 6.png │ │ ├── default.png │ │ ├── grass_bottom.png │ │ ├── grass_side.png │ │ └── grass_top.png ├── scripts │ └── build_multi_thread.cmd ├── src │ ├── Datadef │ │ └── data.h │ ├── app.cpp │ ├── app.h │ ├── base │ │ ├── base.calc.h │ │ ├── base.type.h │ │ └── vf_base.h │ ├── event_sys │ │ ├── VF_Event.h │ │ ├── VF_EventListener.h │ │ └── VF_EventPublisher.h │ ├── game │ │ ├── MainPlayerWorldOperator.cpp │ │ ├── MainPlayerWorldOperator.h │ │ ├── bak │ │ │ ├── Chunk.cpp.bak │ │ │ ├── Chunk.h.bak │ │ │ ├── ChunkMap.cpp.bak │ │ │ └── ChunkMap.h.bak │ │ ├── block │ │ │ ├── BlockSelector.cpp │ │ │ ├── BlockSelector.h │ │ │ ├── block.cpp │ │ │ ├── block.h │ │ │ ├── blocks_mesh │ │ │ │ ├── BlockMesh_Common.cpp │ │ │ │ ├── BlockMesh_Common.h │ │ │ │ └── _BlockMesh_Base.h │ │ │ ├── blocks_registry.cpp │ │ │ ├── blocks_registry.h │ │ │ └── blocks_uv_setter │ │ │ │ ├── BlockUVSetter_UP_Side_Bottom.h │ │ │ │ ├── _BlockUVSetter_Base.cpp │ │ │ │ └── _BlockUVSetter_Base.h │ │ ├── chunk │ │ │ ├── chunk.cpp │ │ │ ├── chunk.h │ │ │ ├── chunk.temp.h │ │ │ ├── chunk_key.h │ │ │ ├── chunk_key.temp.h │ │ │ ├── chunk_manager.cpp │ │ │ ├── chunk_manager.h │ │ │ └── chunk_manager.temp.h │ │ ├── ecs │ │ │ ├── CapsuleCollider.h │ │ │ ├── Tags.h │ │ │ ├── VectorAbout.h │ │ │ └── sys │ │ │ │ ├── Physic.cpp │ │ │ │ └── Physic.h │ │ ├── enum.h │ │ ├── game.cpp │ │ ├── game.h │ │ ├── interfaces │ │ │ ├── IUpdaterAfterPhysic.h │ │ │ └── IUpdaterBeforePhysic.h │ │ ├── main_player.cpp │ │ ├── main_player.h │ │ └── physics │ │ │ ├── collision_shape.h │ │ │ ├── raycast.cpp │ │ │ ├── raycast.h │ │ │ └── rigid.h │ ├── graph │ │ ├── Camera.cpp.bak │ │ ├── Camera.h │ │ ├── Camera.h.bak │ │ ├── CameraStateChangeEvent.h │ │ ├── Mesh.cpp │ │ ├── Mesh.h │ │ ├── _Graph.cpp │ │ ├── _Graph.h │ │ ├── gui │ │ │ ├── GuiNothingClickEvent.h │ │ │ ├── GuiSys.h.bak │ │ │ ├── _gui.cpp │ │ │ └── _gui.h │ │ ├── interface │ │ │ ├── Drawer.h.bak │ │ │ └── MeshBuilder.h.bak │ │ ├── shader_m.h │ │ └── texture.h │ ├── impl │ │ └── Protos │ │ │ └── chunkMsg.proto │ ├── interface │ │ └── IRegister.h │ ├── main.cpp │ ├── net │ │ ├── RecStatRecoder.cpp │ │ ├── RecStatRecorder.h │ │ ├── _net.cpp │ │ └── _net.h │ ├── physic_engine │ │ ├── physic_engine.cpp │ │ └── physic_engine.h │ └── system_related │ │ ├── Cursor.cpp │ │ ├── Cursor.h │ │ ├── Cursor_WinAPI.h │ │ ├── GameWindow.cpp │ │ ├── GameWindow.h │ │ ├── MouseMoveEvent.h │ │ ├── _Input.cpp │ │ ├── _Input.h │ │ ├── _Input_Map.h │ │ ├── _media_api.h │ │ ├── _sys_api.h │ │ ├── imgui_impl_sdl.cpp │ │ └── imgui_impl_sys.h ├── task_conan.cmd ├── third │ ├── CMakeLists.txt │ ├── glad │ │ ├── include │ │ │ ├── KHR │ │ │ │ └── khrplatform.h │ │ │ └── glad │ │ │ │ └── glad.h │ │ └── src │ │ │ └── glad.c │ ├── glm │ │ └── include │ │ │ └── glm │ │ │ ├── CMakeLists.txt │ │ │ ├── common.hpp │ │ │ ├── detail │ │ │ ├── _features.hpp │ │ │ ├── _fixes.hpp │ │ │ ├── _noise.hpp │ │ │ ├── _swizzle.hpp │ │ │ ├── _swizzle_func.hpp │ │ │ ├── _vectorize.hpp │ │ │ ├── compute_common.hpp │ │ │ ├── compute_vector_relational.hpp │ │ │ ├── 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_half.hpp │ │ │ ├── type_half.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_quat.hpp │ │ │ ├── type_quat.inl │ │ │ ├── type_quat_simd.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 │ │ │ ├── matrix_clip_space.hpp │ │ │ ├── matrix_clip_space.inl │ │ │ ├── matrix_common.hpp │ │ │ ├── matrix_common.inl │ │ │ ├── matrix_double2x2.hpp │ │ │ ├── matrix_double2x2_precision.hpp │ │ │ ├── matrix_double2x3.hpp │ │ │ ├── matrix_double2x3_precision.hpp │ │ │ ├── matrix_double2x4.hpp │ │ │ ├── matrix_double2x4_precision.hpp │ │ │ ├── matrix_double3x2.hpp │ │ │ ├── matrix_double3x2_precision.hpp │ │ │ ├── matrix_double3x3.hpp │ │ │ ├── matrix_double3x3_precision.hpp │ │ │ ├── matrix_double3x4.hpp │ │ │ ├── matrix_double3x4_precision.hpp │ │ │ ├── matrix_double4x2.hpp │ │ │ ├── matrix_double4x2_precision.hpp │ │ │ ├── matrix_double4x3.hpp │ │ │ ├── matrix_double4x3_precision.hpp │ │ │ ├── matrix_double4x4.hpp │ │ │ ├── matrix_double4x4_precision.hpp │ │ │ ├── matrix_float2x2.hpp │ │ │ ├── matrix_float2x2_precision.hpp │ │ │ ├── matrix_float2x3.hpp │ │ │ ├── matrix_float2x3_precision.hpp │ │ │ ├── matrix_float2x4.hpp │ │ │ ├── matrix_float2x4_precision.hpp │ │ │ ├── matrix_float3x2.hpp │ │ │ ├── matrix_float3x2_precision.hpp │ │ │ ├── matrix_float3x3.hpp │ │ │ ├── matrix_float3x3_precision.hpp │ │ │ ├── matrix_float3x4.hpp │ │ │ ├── matrix_float3x4_precision.hpp │ │ │ ├── matrix_float4x2.hpp │ │ │ ├── matrix_float4x2_precision.hpp │ │ │ ├── matrix_float4x3.hpp │ │ │ ├── matrix_float4x3_precision.hpp │ │ │ ├── matrix_float4x4.hpp │ │ │ ├── matrix_float4x4_precision.hpp │ │ │ ├── matrix_projection.hpp │ │ │ ├── matrix_projection.inl │ │ │ ├── matrix_relational.hpp │ │ │ ├── matrix_relational.inl │ │ │ ├── matrix_transform.hpp │ │ │ ├── matrix_transform.inl │ │ │ ├── quaternion_common.hpp │ │ │ ├── quaternion_common.inl │ │ │ ├── quaternion_common_simd.inl │ │ │ ├── quaternion_double.hpp │ │ │ ├── quaternion_double_precision.hpp │ │ │ ├── quaternion_exponential.hpp │ │ │ ├── quaternion_exponential.inl │ │ │ ├── quaternion_float.hpp │ │ │ ├── quaternion_float_precision.hpp │ │ │ ├── quaternion_geometric.hpp │ │ │ ├── quaternion_geometric.inl │ │ │ ├── quaternion_relational.hpp │ │ │ ├── quaternion_relational.inl │ │ │ ├── quaternion_transform.hpp │ │ │ ├── quaternion_transform.inl │ │ │ ├── quaternion_trigonometric.hpp │ │ │ ├── quaternion_trigonometric.inl │ │ │ ├── scalar_common.hpp │ │ │ ├── scalar_common.inl │ │ │ ├── scalar_constants.hpp │ │ │ ├── scalar_constants.inl │ │ │ ├── scalar_int_sized.hpp │ │ │ ├── scalar_integer.hpp │ │ │ ├── scalar_integer.inl │ │ │ ├── scalar_relational.hpp │ │ │ ├── scalar_relational.inl │ │ │ ├── scalar_uint_sized.hpp │ │ │ ├── scalar_ulp.hpp │ │ │ ├── scalar_ulp.inl │ │ │ ├── vector_bool1.hpp │ │ │ ├── vector_bool1_precision.hpp │ │ │ ├── vector_bool2.hpp │ │ │ ├── vector_bool2_precision.hpp │ │ │ ├── vector_bool3.hpp │ │ │ ├── vector_bool3_precision.hpp │ │ │ ├── vector_bool4.hpp │ │ │ ├── vector_bool4_precision.hpp │ │ │ ├── vector_common.hpp │ │ │ ├── vector_common.inl │ │ │ ├── vector_double1.hpp │ │ │ ├── vector_double1_precision.hpp │ │ │ ├── vector_double2.hpp │ │ │ ├── vector_double2_precision.hpp │ │ │ ├── vector_double3.hpp │ │ │ ├── vector_double3_precision.hpp │ │ │ ├── vector_double4.hpp │ │ │ ├── vector_double4_precision.hpp │ │ │ ├── vector_float1.hpp │ │ │ ├── vector_float1_precision.hpp │ │ │ ├── vector_float2.hpp │ │ │ ├── vector_float2_precision.hpp │ │ │ ├── vector_float3.hpp │ │ │ ├── vector_float3_precision.hpp │ │ │ ├── vector_float4.hpp │ │ │ ├── vector_float4_precision.hpp │ │ │ ├── vector_int1.hpp │ │ │ ├── vector_int1_precision.hpp │ │ │ ├── vector_int2.hpp │ │ │ ├── vector_int2_precision.hpp │ │ │ ├── vector_int3.hpp │ │ │ ├── vector_int3_precision.hpp │ │ │ ├── vector_int4.hpp │ │ │ ├── vector_int4_precision.hpp │ │ │ ├── vector_integer.hpp │ │ │ ├── vector_integer.inl │ │ │ ├── vector_relational.hpp │ │ │ ├── vector_relational.inl │ │ │ ├── vector_uint1.hpp │ │ │ ├── vector_uint1_precision.hpp │ │ │ ├── vector_uint2.hpp │ │ │ ├── vector_uint2_precision.hpp │ │ │ ├── vector_uint3.hpp │ │ │ ├── vector_uint3_precision.hpp │ │ │ ├── vector_uint4.hpp │ │ │ ├── vector_uint4_precision.hpp │ │ │ ├── vector_ulp.hpp │ │ │ └── vector_ulp.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 │ │ │ ├── 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 │ │ │ ├── neon.h │ │ │ ├── packing.h │ │ │ ├── platform.h │ │ │ ├── trigonometric.h │ │ │ └── vector_relational.h │ │ │ ├── trigonometric.hpp │ │ │ ├── vec2.hpp │ │ │ ├── vec3.hpp │ │ │ ├── vec4.hpp │ │ │ └── vector_relational.hpp │ ├── stb_image │ │ └── include │ │ │ └── stb_image.h │ └── third.cmake └── xmake │ ├── .vscode │ └── compile_commands.json │ ├── README.md │ ├── pac.lua │ └── xmake.lua ├── README.md ├── RustClient └── VoxelFrame │ ├── Cargo.lock │ ├── Cargo.toml │ └── src │ └── main.rs ├── VoxelFrameServerRust ├── Cargo.lock ├── Cargo.toml ├── README.md └── src │ ├── main.rs │ └── net.rs └── markdown ├── client_start.md ├── record.md └── 方块顶点顺序.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.github/workflows/sync2gitee.yml: -------------------------------------------------------------------------------- 1 | # 通过 Github action, 在仓库的每一次 commit 后自动同步到 Gitee 上 2 | name: sync2gitee 3 | on: push 4 | jobs: 5 | repo-sync: 6 | env: 7 | dst_key: ${{ secrets.GITEE_PRIVATE_KEY }} 8 | dst_token: ${{ secrets.GITEE_TOKEN }} 9 | gitee_user: ${{ secrets.GITEE_USER }} 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v2 13 | with: 14 | persist-credentials: false 15 | 16 | - name: sync github -> gitee 17 | uses: Yikun/hub-mirror-action@master 18 | if: env.dst_key && env.dst_token && env.gitee_user 19 | with: 20 | # 必选,需要同步的 Github 用户(源) 21 | src: 'github/${{ github.repository_owner }}' 22 | # 必选,需要同步到的 Gitee 用户(目的) 23 | dst: 'gitee/${{ secrets.GITEE_USER }}' 24 | # 必选,Gitee公钥对应的私钥,https://gitee.com/profile/sshkeys 25 | dst_key: ${{ secrets.GITEE_PRIVATE_KEY }} 26 | # 必选,Gitee对应的用于创建仓库的token,https://gitee.com/profile/personal_access_tokens 27 | dst_token: ${{ secrets.GITEE_TOKEN }} 28 | # 如果是组织,指定组织即可,默认为用户 user 29 | # account_type: org 30 | # 直接取当前项目的仓库名 31 | static_list: ${{ github.event.repository.name }} 32 | # 还有黑、白名单,静态名单机制,可以用于更新某些指定库 33 | # static_list: 'repo_name,repo_name2' 34 | # black_list: 'repo_name,repo_name2' 35 | # white_list: 'repo_name,repo_name2' -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "abandoned-part"] 2 | path = abandoned-part 3 | url = https://github.com/VoxelFrame/VoxelFrame-Abandoned.git 4 | [submodule "VoxelFrame_GoServer"] 5 | path = VoxelFrame_GoServer 6 | url = https://github.com/VoxelFrame/VoxelFrame_GoServer.git 7 | [submodule "CppClient/third/protobuff"] 8 | path = CppClient/third/protobuff 9 | url = https://github.com/VoxelFrame/protobuff.git 10 | [submodule "CppClient/third/vf_imgui"] 11 | path = CppClient/third/vf_imgui 12 | url = https://github.com/VoxelFrame/vf_imgui.git 13 | [submodule "CppClient/third/parallel-hashmap"] 14 | path = CppClient/third/parallel-hashmap 15 | url = https://github.com/VoxelFrame/parallel-hashmap.git 16 | [submodule "CppClient/third/glfw"] 17 | path = CppClient/third/glfw 18 | url = https://github.com/VoxelFrame/glfw.git 19 | [submodule "CppClient/third/brynet"] 20 | path = CppClient/third/brynet 21 | url = https://github.com/VoxelFrame/brynet.git 22 | [submodule "CppClient/third/paecs"] 23 | path = CppClient/third/paecs 24 | url = https://github.com/ActivePeter/paecs.git 25 | [submodule "CppClient/third/ThreadPool"] 26 | path = CppClient/third/ThreadPool 27 | url = https://github.com/VoxelFrame/ThreadPool.git 28 | [submodule "CppClient/third/reactphysics3d"] 29 | path = CppClient/third/reactphysics3d 30 | url = https://github.com/VoxelFrame/reactphysics3d.git 31 | [submodule "VoxelFrame_UE4"] 32 | path = VoxelFrame_UE4 33 | url = https://github.com/ActivePeter/VoxelFrame_UE4.git 34 | [submodule "CppClient/third/SDL"] 35 | path = CppClient/third/SDL 36 | url = https://github.com/libsdl-org/SDL 37 | -------------------------------------------------------------------------------- /.pa_devtool/data.json: -------------------------------------------------------------------------------- 1 | {"script_list":[]} -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "idf.espIdfPathWin": "C:/Users/sjjmw/Desktop/esp-idf-2/", 3 | "idf.pythonBinPathWin": "C:/Users/sjjmw/.espressif2/python_env/idf4.2_py3.8_env/Scripts/python.exe", 4 | "idf.customExtraPaths": "C:\\Users\\sjjmw\\.espressif2\\tools\\xtensa-esp32-elf\\esp-2020r3-8.4.0\\xtensa-esp32-elf\\bin;C:\\Users\\sjjmw\\.espressif2\\tools\\xtensa-esp32s2-elf\\esp-2020r3-8.4.0\\xtensa-esp32s2-elf\\bin;C:\\Users\\sjjmw\\.espressif2\\tools\\esp32ulp-elf\\2.28.51-esp-20191205\\esp32ulp-elf-binutils\\bin;C:\\Users\\sjjmw\\.espressif2\\tools\\esp32s2ulp-elf\\2.28.51-esp-20191205\\esp32s2ulp-elf-binutils\\bin;C:\\Users\\sjjmw\\.espressif2\\tools\\cmake\\3.16.4\\bin;C:\\Users\\sjjmw\\.espressif2\\tools\\openocd-esp32\\v0.10.0-esp32-20200709\\openocd-esp32\\bin;C:\\Users\\sjjmw\\.espressif2\\tools\\ninja\\1.10.0;C:\\Users\\sjjmw\\.espressif2\\tools\\idf-exe\\1.0.1;C:\\Users\\sjjmw\\.espressif2\\tools\\ccache\\3.7;C:\\Users\\sjjmw\\.espressif2\\tools\\dfu-util\\0.9\\dfu-util-0.9-win64", 5 | "idf.customExtraVars": "{\"OPENOCD_SCRIPTS\":\"C:\\\\Users\\\\sjjmw\\\\.espressif2\\\\tools\\\\openocd-esp32\\\\v0.10.0-esp32-20200709/openocd-esp32/share/openocd/scripts\",\"IDF_CCACHE_ENABLE\":\"1\"}" 6 | } -------------------------------------------------------------------------------- /CppClient/.cmake/copyFile.cmake: -------------------------------------------------------------------------------- 1 | # 复制资源文件到生成目录 2 | # EXECUTE_PROCESS( 3 | # COMMAND rm -rf E:/pa_files/project/cs_big_prjs/VoxelFrame/CppClient/build/Debug/resource/* 4 | # ) 5 | if(MSVC) 6 | file(REMOVE_RECURSE ${VoxelFrame_BINARY_DIR}/bin/resource) 7 | # file(REMOVE_RECURSE ${VoxelFrame_BINARY_DIR}/Release/resource) 8 | 9 | file(COPY ${PROJECT_SOURCE_DIR}/resource DESTINATION ${VoxelFrame_BINARY_DIR}/bin) 10 | # file(COPY ${PROJECT_SOURCE_DIR}/resource DESTINATION ${VoxelFrame_BINARY_DIR}/Release) 11 | else() 12 | file(REMOVE_RECURSE ${VoxelFrame_BINARY_DIR}/resource) 13 | file(MAKE_DIRECTORY ${VoxelFrame_BINARY_DIR}/resource) 14 | file(COPY ${PROJECT_SOURCE_DIR}/resource DESTINATION ${VoxelFrame_BINARY_DIR}) 15 | endif() -------------------------------------------------------------------------------- /CppClient/.cmake/proto.cmake: -------------------------------------------------------------------------------- 1 | set (PROTOBUF_PROTOC_EXECUTABLE ${PROTO_DIR}/protoc-3.15.5-win64/bin/protoc.exe) 2 | set (PROTO_FILES_DIR ${PROJECT_SOURCE_DIR}/src/impl/Protos) 3 | file(GLOB protobuf_files 4 | ${PROTO_FILES_DIR}/*.proto 5 | ) 6 | # SET(${PROTO_FILES_DIR} ${CMAKE_CURRENT_BINARY_DIR}) 7 | LIST(APPEND PROTO_FLAGS -I${PROTO_FILES_DIR}) 8 | 9 | # 移除原来生成的proto源文件 10 | # EXECUTE_PROCESS( 11 | # COMMAND rm -f ${PROTO_FILES_DIR}/src/* 12 | # ) 13 | file(REMOVE_RECURSE ${PROTO_FILES_DIR}/src) 14 | file(MAKE_DIRECTORY ${PROTO_FILES_DIR}/src) 15 | # 遍历并生成proto源文件 16 | FOREACH(FIL ${protobuf_files}) 17 | 18 | GET_FILENAME_COMPONENT(FIL_WE ${FIL} NAME_WE) 19 | 20 | set(PROTO_SRCS "${PROTO_FILES_DIR}/src/${FIL_WE}.pb.cc") 21 | set(PROTO_HDRS "${PROTO_FILES_DIR}/src/${FIL_WE}.pb.h") 22 | 23 | 24 | EXECUTE_PROCESS( 25 | COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} -I${PROTO_FILES_DIR} --cpp_out=${PROTO_FILES_DIR}/src ${FIL} 26 | ) 27 | 28 | ENDFOREACH() -------------------------------------------------------------------------------- /CppClient/.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | .vs/ 3 | .vscode/c_cpp_properties.json -------------------------------------------------------------------------------- /CppClient/.gitmodules: -------------------------------------------------------------------------------- 1 | 2 | [submodule "third/glfw"] 3 | path = third/glfw 4 | url = https://github.com/VoxelFrame/glfw.git 5 | [submodule "third/vf_imgui"] 6 | path = third/vf_imgui 7 | url = https://github.com/VoxelFrame/vf_imgui.git 8 | [submodule "third/brynet"] 9 | path = third/brynet 10 | url = https://github.com/VoxelFrame/brynet.git 11 | [submodule "third/protobuff"] 12 | path = third/protobuff 13 | url = https://github.com/VoxelFrame/protobuff.git 14 | [submodule "third/sparsepp"] 15 | path = third/sparsepp 16 | url = https://github.com/VoxelFrame/sparsepp.git 17 | [submodule "third/parallel-hashmap"] 18 | path = third/parallel-hashmap 19 | url = https://github.com/VoxelFrame/parallel-hashmap.git 20 | [submodule "third/paecs"] 21 | path = third/paecs 22 | url = https://github.com/ActivePeter/paecs.git 23 | -------------------------------------------------------------------------------- /CppClient/.vscode/c_cpp_properties temp.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Win32", 5 | "includePath": [ 6 | "${workspaceFolder}/src", 7 | "${workspaceFolder}/third/glad/include", 8 | "${workspaceFolder}/third/glfw/include", 9 | "${workspaceFolder}/third/glm/include", 10 | "${workspaceFolder}/third/brynet/include", 11 | "${workspaceFolder}/third/protobuff/src", 12 | "${workspaceFolder}/third/vf_imgui/imgui", 13 | "${workspaceFolder}/third/stb_image/include", 14 | // "${workspaceFolder}/third/sparsepp", 15 | "${workspaceFolder}/third/parallel-hashmap", 16 | "${workspaceFolder}/third/paecs/src", 17 | "E:/pa_files/thd_libs/opencv450/build/include" 18 | ], 19 | "defines": [ 20 | "_DEBUG", 21 | "UNICODE", 22 | "_UNICODE" 23 | ], 24 | "windowsSdkVersion": "10.0.18362.0", 25 | "compilerPath": "E:/VS2019/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe", 26 | "cStandard": "c11", 27 | "cppStandard": "c++11", 28 | "intelliSenseMode": "msvc-x64", 29 | // "configurationProvider": "ms-vscode.cmake-tools" 30 | } 31 | ], 32 | "version": 4 33 | } -------------------------------------------------------------------------------- /CppClient/.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Win32", 5 | "includePath": [ 6 | "${workspaceFolder}/src", 7 | "${workspaceFolder}/third/glad/include", 8 | "${workspaceFolder}/third/glfw/include", 9 | "${workspaceFolder}/third/glm/include", 10 | "${workspaceFolder}/third/brynet/include", 11 | "${workspaceFolder}/third/protobuff/src", 12 | "${workspaceFolder}/third/vf_imgui/imgui", 13 | "${workspaceFolder}/third/stb_image/include", 14 | // "${workspaceFolder}/third/sparsepp", 15 | "${workspaceFolder}/third/parallel-hashmap", 16 | "${workspaceFolder}/third/paecs/src", 17 | "C:/.conan/e241d5/1/include", 18 | "${workspaceFolder}/third/ThreadPool", 19 | "${workspaceFolder}/third/reactphysics3d/include", 20 | "${workspaceFolder}/third/SDL/include" 21 | ], 22 | "defines": [ 23 | "_DEBUG", 24 | "UNICODE", 25 | "_UNICODE" 26 | ], 27 | "windowsSdkVersion": "10.0.18362.0", 28 | "compilerPath": "E:/VS2019/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe", 29 | "cStandard": "c11", 30 | "cppStandard": "c++11", 31 | "intelliSenseMode": "msvc-x64", 32 | // "configurationProvider": "ms-vscode.cmake-tools" 33 | } 34 | ], 35 | "version": 4 36 | } -------------------------------------------------------------------------------- /CppClient/CMakeSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "x64-Debug", 5 | "generator": "Ninja", 6 | "configurationType": "Debug", 7 | "inheritEnvironments": [ "msvc_x64_x64" ], 8 | "buildRoot": "${projectDir}\\out\\build\\${name}", 9 | "installRoot": "${projectDir}\\out\\install\\${name}", 10 | "cmakeCommandArgs": "", 11 | "buildCommandArgs": "", 12 | "ctestCommandArgs": "" 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /CppClient/ConfigVscode.md: -------------------------------------------------------------------------------- 1 | settings.json 2 | 加入 3 | "cmake.generator": "MinGW Makefiles", 4 | 5 | 需要环境中安装有mingw -------------------------------------------------------------------------------- /CppClient/README.md: -------------------------------------------------------------------------------- 1 | ## 必要的操作 2 | 3 | 1,有像glfw等一些依赖的子模块,需要执行 4 | 5 | ``` 6 | git submodule update --init 7 | ``` 8 | 9 | 2. resource 文件夹中内容变化的话,需要执行cmake config,会自动拷贝到生成目录 10 | 3. 有目录源码文件变化,也需要执行cmake config 11 | 12 | ## 开始 13 | 14 | [start.md](../markdown/start.md) -------------------------------------------------------------------------------- /CppClient/VoxelFrameClient/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # CMakeList.txt: VoxelFrameClient 的 CMake 项目,在此处包括源代码并定义 2 | # 项目特定的逻辑。 3 | # 4 | cmake_minimum_required (VERSION 3.8) 5 | 6 | project ("VoxelFrameClient") 7 | 8 | # 将源代码添加到此项目的可执行文件。 9 | add_executable (VoxelFrameClient "VoxelFrameClient.cpp" "VoxelFrameClient.h") 10 | 11 | # TODO: 如有需要,请添加测试并安装目标。 12 | -------------------------------------------------------------------------------- /CppClient/VoxelFrameClient/VoxelFrameClient.cpp: -------------------------------------------------------------------------------- 1 | // VoxelFrameClient.cpp: 定义应用程序的入口点。 2 | // 3 | 4 | #include "VoxelFrameClient.h" 5 | 6 | using namespace std; 7 | 8 | int main() 9 | { 10 | cout << "Hello CMake." << endl; 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /CppClient/VoxelFrameClient/VoxelFrameClient.h: -------------------------------------------------------------------------------- 1 | // VoxelFrameClient.h: 标准系统包含文件的包含文件 2 | // 或项目特定的包含文件。 3 | 4 | #pragma once 5 | 6 | #include 7 | 8 | // TODO: 在此处引用程序需要的其他标头。 9 | -------------------------------------------------------------------------------- /CppClient/__pycache__/_config.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ActivePeter/VoxelFrame/4399b8238b2af027ec2942a5846f43f790243878/CppClient/__pycache__/_config.cpython-39.pyc -------------------------------------------------------------------------------- /CppClient/_config.py: -------------------------------------------------------------------------------- 1 | cmakePath="C:/Program Files/CMake/bin/cmake.exe" 2 | generator="Ninja" 3 | makePath="C:/Program Files/ninja-win/ninja.exe" -------------------------------------------------------------------------------- /CppClient/_preBuild.py: -------------------------------------------------------------------------------- 1 | import _config as conf 2 | import os 3 | 4 | if conf.cmakePath=="": 5 | preMakeCmd='cmake' 6 | else: 7 | preMakeCmd="\""+conf.cmakePath+"\"" 8 | 9 | if conf.generator=="": 10 | generatorCmd='' 11 | else: 12 | generatorCmd='-G '+conf.generator 13 | 14 | if conf.makePath=="": 15 | makePathCmd='' 16 | else: 17 | makePathCmd='-DCMAKE_MAKE_PROGRAM='+"\""+conf.makePath+"\"" 18 | 19 | os.chdir('third') 20 | # os.system('cd ') 21 | print("command is:"+preMakeCmd+' '+generatorCmd+' '+makePathCmd) 22 | os.system(preMakeCmd+' '+generatorCmd+' '+makePathCmd); -------------------------------------------------------------------------------- /CppClient/conanfile.txt: -------------------------------------------------------------------------------- 1 | [requires] 2 | opencv/4.5.0 3 | glfw/3.3.4 4 | 5 | [generators] 6 | cmake -------------------------------------------------------------------------------- /CppClient/resource/Shader/camera.fs: -------------------------------------------------------------------------------- 1 | // #version 330 core 2 | // out vec4 FragColor; 3 | // void main() 4 | // { 5 | // FragColor = vec4(1.0f, 0.5f, 0.2f, 1.0f); 6 | // } 7 | 8 | #version 330 core 9 | out vec4 FragColor; 10 | 11 | // in vec2 TexCoord; 12 | in vec4 vertexColor; // 从顶点着色器传来的输入变量(名称相同、类型相同) 13 | in vec2 TexCoord; 14 | // texture binded 15 | uniform sampler2D texture1; 16 | // uniform sampler2D texture2; 17 | 18 | void main() 19 | { 20 | FragColor = texture(texture1, TexCoord); 21 | // linearly interpolate between both textures (80% container, 20% awesomeface) 22 | // FragColor = mix(texture(texture1, TexCoord), texture(texture2, TexCoord), 0.2); 23 | // FragColor = vertexColor; 24 | // FragColor = vec4(1.0f, 0.5f, 0.2f, 1.0f); 25 | } 26 | 27 | // #version 330 core 28 | // layout (location = 0) in vec3 aPos; // 位置变量的属性位置值为0 29 | 30 | // out vec4 vertexColor; // 为片段着色器指定一个颜色输出 31 | 32 | // void main() 33 | // { 34 | // gl_Position = vec4(aPos, 1.0); // 注意我们如何把一个vec3作为vec4的构造器的参数 35 | // vertexColor = vec4(0.5, 0.0, 0.0, 1.0); // 把输出变量设置为暗红色 36 | // } -------------------------------------------------------------------------------- /CppClient/resource/Shader/camera.vs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec3 aPos; 3 | //材质uv坐标 4 | layout (location = 1) in vec2 aTexCoord; 5 | 6 | out vec2 TexCoord; 7 | out vec4 vertexColor; 8 | 9 | // uniform mat4 model; 10 | uniform mat4 view; 11 | uniform mat4 projection; 12 | 13 | void main() 14 | { 15 | gl_Position = projection * view * vec4(aPos, 1.0f); 16 | // gl_Position = vec4(aPos, 1.0f); 17 | 18 | // TexCoord = vec2(aTexCoord.x, aTexCoord.y); 19 | vertexColor = vec4(0.5, 0.0, 0.0, 1.0); 20 | TexCoord =aTexCoord; 21 | } 22 | 23 | // #version 330 core 24 | // layout (location = 0) in vec3 aPos; 25 | // void main() 26 | // { 27 | // gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0); 28 | // } -------------------------------------------------------------------------------- /CppClient/resource/Shader/shader.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | out vec4 FragColor; 3 | in vec2 texCoord; 4 | uniform sampler2D mainTex; 5 | void main() 6 | { 7 | FragColor = texture(mainTex,texCoord); 8 | 9 | }; -------------------------------------------------------------------------------- /CppClient/resource/Shader/shader.vs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec3 aPos; 3 | layout (location = 1) in vec2 aTexCoord; 4 | out vec2 texCoord; 5 | //uniform mat4 rotate; 6 | uniform mat4 camera; 7 | uniform mat4 projection; 8 | uniform vec3 offset; 9 | void main() 10 | { 11 | gl_Position = projection*camera*vec4(aPos+offset, 1.0); 12 | texCoord=aTexCoord; 13 | } -------------------------------------------------------------------------------- /CppClient/resource/font/Cousine-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ActivePeter/VoxelFrame/4399b8238b2af027ec2942a5846f43f790243878/CppClient/resource/font/Cousine-Regular.ttf -------------------------------------------------------------------------------- /CppClient/resource/font/DroidSans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ActivePeter/VoxelFrame/4399b8238b2af027ec2942a5846f43f790243878/CppClient/resource/font/DroidSans.ttf -------------------------------------------------------------------------------- /CppClient/resource/font/Karla-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ActivePeter/VoxelFrame/4399b8238b2af027ec2942a5846f43f790243878/CppClient/resource/font/Karla-Regular.ttf -------------------------------------------------------------------------------- /CppClient/resource/font/Lato-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ActivePeter/VoxelFrame/4399b8238b2af027ec2942a5846f43f790243878/CppClient/resource/font/Lato-Light.ttf -------------------------------------------------------------------------------- /CppClient/resource/font/Lato-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ActivePeter/VoxelFrame/4399b8238b2af027ec2942a5846f43f790243878/CppClient/resource/font/Lato-Regular.ttf -------------------------------------------------------------------------------- /CppClient/resource/font/ProggyClean.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ActivePeter/VoxelFrame/4399b8238b2af027ec2942a5846f43f790243878/CppClient/resource/font/ProggyClean.ttf -------------------------------------------------------------------------------- /CppClient/resource/font/ProggyTiny.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ActivePeter/VoxelFrame/4399b8238b2af027ec2942a5846f43f790243878/CppClient/resource/font/ProggyTiny.ttf -------------------------------------------------------------------------------- /CppClient/resource/font/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ActivePeter/VoxelFrame/4399b8238b2af027ec2942a5846f43f790243878/CppClient/resource/font/Roboto-Medium.ttf -------------------------------------------------------------------------------- /CppClient/resource/images/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ActivePeter/VoxelFrame/4399b8238b2af027ec2942a5846f43f790243878/CppClient/resource/images/1.png -------------------------------------------------------------------------------- /CppClient/resource/images/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ActivePeter/VoxelFrame/4399b8238b2af027ec2942a5846f43f790243878/CppClient/resource/images/2.png -------------------------------------------------------------------------------- /CppClient/resource/images/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ActivePeter/VoxelFrame/4399b8238b2af027ec2942a5846f43f790243878/CppClient/resource/images/3.png -------------------------------------------------------------------------------- /CppClient/resource/images/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ActivePeter/VoxelFrame/4399b8238b2af027ec2942a5846f43f790243878/CppClient/resource/images/4.png -------------------------------------------------------------------------------- /CppClient/resource/images/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ActivePeter/VoxelFrame/4399b8238b2af027ec2942a5846f43f790243878/CppClient/resource/images/5.png -------------------------------------------------------------------------------- /CppClient/resource/images/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ActivePeter/VoxelFrame/4399b8238b2af027ec2942a5846f43f790243878/CppClient/resource/images/6.png -------------------------------------------------------------------------------- /CppClient/resource/images/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ActivePeter/VoxelFrame/4399b8238b2af027ec2942a5846f43f790243878/CppClient/resource/images/default.png -------------------------------------------------------------------------------- /CppClient/resource/images/grass_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ActivePeter/VoxelFrame/4399b8238b2af027ec2942a5846f43f790243878/CppClient/resource/images/grass_bottom.png -------------------------------------------------------------------------------- /CppClient/resource/images/grass_side.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ActivePeter/VoxelFrame/4399b8238b2af027ec2942a5846f43f790243878/CppClient/resource/images/grass_side.png -------------------------------------------------------------------------------- /CppClient/resource/images/grass_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ActivePeter/VoxelFrame/4399b8238b2af027ec2942a5846f43f790243878/CppClient/resource/images/grass_top.png -------------------------------------------------------------------------------- /CppClient/scripts/build_multi_thread.cmd: -------------------------------------------------------------------------------- 1 | @REM "C:\Program Files\CMake\bin\cmake.exe" --build e:/pa_files/project/game/VoxelFrame/VoxelFrame_CppClient/build --config Debug --target all -- -j 6 2 | 3 | echo -------------------------------------------------------------------------------- /CppClient/src/Datadef/data.h: -------------------------------------------------------------------------------- 1 | #include 2 | #define CHUNK_LNEGTH 32 3 | //区块大小 4 | const int chunkSize = CHUNK_LNEGTH * CHUNK_LNEGTH * CHUNK_LNEGTH; 5 | 6 | //单个块 7 | typedef struct 8 | { 9 | int id1; 10 | int id2; 11 | } BlockKey; 12 | 13 | //Key 区块在世界map中的键 14 | typedef struct 15 | { 16 | int x; 17 | int y; 18 | int z; 19 | } Key; 20 | 21 | //ChunkModel 区块的数据模型 22 | typedef struct 23 | { 24 | BlockKey blockDataArr[chunkSize]; 25 | } ChunkModel; 26 | //WorldModel 地图的数据模型 27 | typedef struct 28 | { 29 | std::map map; 30 | } WorldModel; -------------------------------------------------------------------------------- /CppClient/src/app.cpp: -------------------------------------------------------------------------------- 1 | #include "App.h" 2 | 3 | void App::run() 4 | { 5 | ecsPtr = paecs::createScene(); 6 | gamePtr = std::make_shared(); 7 | graphPtr = std::make_shared(); 8 | inputPtr = std::make_shared(); 9 | auto &graph = *graphPtr; 10 | if (!graph.init()) 11 | { 12 | return; //启动失败 13 | } 14 | inputPtr->init(); 15 | 16 | // ecs.createEntity() 17 | // .addEmptyComponent() 18 | // .addEmptyComponent(); 19 | // ecs.addSysByFunc(helloworld_sys); 20 | // _g_net.start(); 21 | // NetSys::start(); 22 | // WindowInfoModel &windowInfoModel = WindowInfoModel::getInstance(); 23 | gamePtr->start(); 24 | while (graph.running()) 25 | { 26 | calcTimePerLoop(); 27 | inputPtr->processInput(); 28 | // DrawSys::doDraw(); 29 | graph.doDraw(); 30 | gamePtr->loop(); 31 | // //清屏 32 | // glClearColor(0.2f, 0.3f, 0.3f, 1.0f); 33 | // glClear(GL_COLOR_BUFFER_BIT); 34 | 35 | // ecs.loop(); 36 | } 37 | 38 | // //循环渲染,在退出前一直不断地绘制图像 39 | // while (!glfwWindowShouldClose(_g_Graph.window)) 40 | // { 41 | // // DrawSys::doDraw(); 42 | // _g_Graph.doDraw(); 43 | // // //清屏 44 | // // glClearColor(0.2f, 0.3f, 0.3f, 1.0f); 45 | // // glClear(GL_COLOR_BUFFER_BIT); 46 | // } 47 | 48 | // // 退出前清理 49 | graph.end(); 50 | } 51 | 52 | App &App::getInstance() 53 | { 54 | //位于堆区,自创建时就存在 55 | static App instance; 56 | return instance; 57 | } 58 | 59 | // void helloworld_sys(B &a) 60 | // { 61 | // std::cout << "helloworld" << std::endl; 62 | // } 63 | -------------------------------------------------------------------------------- /CppClient/src/app.h: -------------------------------------------------------------------------------- 1 | class App; 2 | 3 | #ifndef __APP_H__ 4 | #define __APP_H__ 5 | 6 | #include "system_related/_media_api.h" 7 | #include "system_related/_sys_api.h" 8 | 9 | #include "base/vf_base.h" 10 | #include "paecs/paecs.h" 11 | #include "game/game.h" 12 | #include "graph/_Graph.h" 13 | // #include "net/_net.h" 14 | #include "system_related/_Input.h" 15 | // #include "system/io/_IO.h" 16 | // #include "s" 17 | 18 | //////////////////////////////////////// 19 | // struct A 20 | // { 21 | // int id; 22 | // }; 23 | // struct B 24 | // { 25 | // int id; 26 | // char testChar; 27 | // }; 28 | 29 | // void helloworld_sys(B &a); 30 | 31 | //the global one 32 | //全局唯一单例 存储,访问 所有动静态资源 33 | class App 34 | { 35 | private: 36 | /* data */ 37 | public: 38 | // Scene scene; 39 | std::shared_ptr ecsPtr; 40 | std::shared_ptr gamePtr; 41 | std::shared_ptr graphPtr; 42 | std::shared_ptr inputPtr; 43 | 44 | // timing 45 | float deltaTime = 0.0f; // time between current frame and last frame 46 | float lastFrame = 0.0f; 47 | 48 | // app() 49 | // { 50 | 51 | // } 52 | inline void calcTimePerLoop() 53 | { 54 | float currentFrame = (float)_sys_api_getTick() / 1000; 55 | deltaTime = currentFrame - lastFrame; 56 | lastFrame = currentFrame; 57 | } 58 | void run(); 59 | static App& getInstance(); 60 | }; 61 | 62 | // extern app _g_app; 63 | #endif // __APP_H__ -------------------------------------------------------------------------------- /CppClient/src/base/base.calc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "math.h" 3 | #include "glm/glm.hpp" 4 | namespace VoxelFrame 5 | { 6 | namespace _Calc 7 | { 8 | inline float vec3Len(float x, float y, float z) 9 | { 10 | return sqrtf(x * x + y * y + z * z); 11 | } 12 | inline float vec3Len(const glm::vec3 &vec) 13 | { 14 | return sqrtf(vec.x * vec.x + vec.y * vec.y + vec.z * vec.z); 15 | } 16 | // inline 17 | } 18 | } -------------------------------------------------------------------------------- /CppClient/src/base/base.type.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "glm/glm.hpp" 3 | namespace VoxelFrame 4 | { 5 | namespace Type 6 | { 7 | using Vec3F = glm::vec3; 8 | using Vec3I = glm::ivec3; 9 | 10 | template 11 | using Vec3 = glm::vec<3, T, glm::defaultp>; 12 | } 13 | } -------------------------------------------------------------------------------- /CppClient/src/base/vf_base.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "iostream" 3 | #include "memory" 4 | #include "vector" 5 | #include "deque" 6 | #include "list" 7 | //#include 8 | namespace VoxelFrame 9 | { 10 | } 11 | namespace VF = VoxelFrame; 12 | #include "base.calc.h" 13 | #include "base.type.h" -------------------------------------------------------------------------------- /CppClient/src/event_sys/VF_Event.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define VF_EventNamespaceBegin \ 4 | namespace VoxelFrame{ \ 5 | namespace _Event{ \ 6 | 7 | #define VF_EventNamespaceEnd \ 8 | }} \ 9 | 10 | #include "VF_EventListener.h" 11 | #include "VF_EventPublisher.h" -------------------------------------------------------------------------------- /CppClient/src/event_sys/VF_EventListener.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "base/vf_base.h" 3 | //#include "VF_EventPublisher.h" 4 | //#include "VF_EventListner.h" 5 | #include "VF_Event.h" 6 | // #define ListenerClassHead2(x) 7 | #define ListenerClass(x) x##_EventListener //class ListenerClassHead2(x) 8 | #define ListenerClassBody(x) \ 9 | public: \ 10 | x##_EventPublisher *listeningPublisher = NULL 11 | 12 | #define ListenerCallback(x) x##_ListenerCallback 13 | // namespace VoxelFrame 14 | // { 15 | // // class EventPublisher; 16 | // class EventListener 17 | // { 18 | // private: 19 | // // EventPublisher *listeningPublisher = 0; 20 | // /* data */ 21 | // public: 22 | // }; 23 | 24 | // } 25 | -------------------------------------------------------------------------------- /CppClient/src/event_sys/VF_EventPublisher.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "base/vf_base.h" 3 | //#include "VF_EventListener.h" 4 | #include "VF_EventPublisher.h" 5 | // #define PublisherClassHead2(x) 6 | #define PublisherClass(x) x##_EventPublisher //class PublisherClassHead2(x) 7 | #define PublisherClassBody(x) \ 8 | public: \ 9 | std::vector listeners; \ 10 | template \ 11 | void addListener(T *listener) \ 12 | { \ 13 | ListenerClass(x) *Ilistener = (ListenerClass(x) *)listener; \ 14 | if (!Ilistener->listeningPublisher) \ 15 | { \ 16 | listeners.push_back(Ilistener); \ 17 | Ilistener->listeningPublisher = this; \ 18 | } \ 19 | } 20 | 21 | // namespace VoxelFrame \ 22 | // { \ 23 | // // class EventPublisher; \ 24 | // class EventPublisher \ 25 | // { \ 26 | // }; 27 | 28 | // } 29 | -------------------------------------------------------------------------------- /CppClient/src/game/MainPlayerWorldOperator.cpp: -------------------------------------------------------------------------------- 1 | #include "MainPlayerWorldOperator.h" 2 | #include 3 | #include "physics/raycast.h" 4 | 5 | namespace VoxelFrame 6 | { 7 | namespace _Game 8 | { 9 | void MainPlayerWorldOperator::CameraStateChange_ListenerCallback(Camera& cam, 10 | const VF::_Event::CameraStateChangeType& stateChangeType) 11 | { 12 | if (stateChangeType == VF::_Event::CameraStateChangeType::Rotate) { 13 | //std::cout << "cam rotated" << std::endl; 14 | 15 | std::shared_ptr<_Chunk::Chunk> return_chunkPtr; 16 | int return_blockIndexInChunk; 17 | Type::Vec3I return_blockPosition; 18 | bool succ = _Physics::raycast2ChunkAndReturnBlock(cam.getPosition(), cam.getFront(), 10, return_chunkPtr, return_blockIndexInChunk, return_blockPosition); 19 | this->blockSelector.active = succ; 20 | this->blockSelector.position = return_blockPosition; 21 | } 22 | } 23 | 24 | void MainPlayerWorldOperator::init(MainPlayer* mainPlayer1) 25 | { 26 | mainPlayer = mainPlayer1; 27 | mainPlayer->cameraPtr->cameraStateChange_EventPublisher.addListener(this); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /CppClient/src/game/MainPlayerWorldOperator.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #include "base/vf_base.h" 5 | #include "graph/Camera.h" 6 | // #include "graph/CameraStateChangeEvent.h" 7 | 8 | //#include "graph/" 9 | 10 | #include "block/BlockSelector.h" 11 | 12 | namespace VoxelFrame 13 | { 14 | namespace _Game 15 | { 16 | class MainPlayer; 17 | 18 | /** 19 | * 用来完成玩家和世界的交互(放方块,拆方块,打动物,操作工具 20 | */ 21 | class MainPlayerWorldOperator : public VF::_Event::CameraStateChange_EventListener 22 | { 23 | 24 | //; 25 | 26 | MainPlayer* mainPlayer{}; 27 | 28 | public: 29 | _Block::Selector blockSelector; 30 | ////////////////////////////////////////// 31 | /** 32 | * CameraStateChange_EventListener 33 | */ 34 | void CameraStateChange_ListenerCallback(Camera& cam, 35 | const VF::_Event::CameraStateChangeType& stateChangeType) override; 36 | 37 | ////////////////////////////////////////// 38 | void init(MainPlayer* mainPlayer1); 39 | 40 | /*MainPlayerWorldOperator(MainPlayer *mainPlayer):mainPlayer(mainPlayer) 41 | { 42 | 43 | }*/ 44 | }; 45 | } 46 | } 47 | 48 | #include "main_player.h" -------------------------------------------------------------------------------- /CppClient/src/game/bak/Chunk.cpp.bak: -------------------------------------------------------------------------------- 1 | #include "Chunk.h" 2 | 3 | // chunk在map中的key ////////////////////////////////// 4 | KeyStruct::KeyStruct(int x, int y, int z) 5 | { 6 | this->x = x; 7 | this->y = y; 8 | this->z = z; 9 | } 10 | 11 | void Chunk::buildMesh() 12 | { 13 | this->mesh.clearIndices() 14 | //先遍历添加顶点 15 | ; 16 | this->mesh.clearVertices(); 17 | // this->mesh 18 | for (int x = 0; x < ChunkSize + 1; x++) 19 | { 20 | for (int y = 0; y < ChunkSize + 1; y++) 21 | { 22 | for (int z = 0; z < ChunkSize + 1; z++) 23 | { 24 | } 25 | } 26 | } 27 | } 28 | 29 | // Chunk(区块) ///////////////////// 30 | void Chunk::fillTest() 31 | { 32 | for (int x = 0; x < ChunkSize; x++) 33 | { 34 | for (int y = 0; y < ChunkSize; y++) 35 | { 36 | for (int z = 0; z < ChunkSize; z++) 37 | { 38 | if (y < 32) //小于32的y填充方块 39 | { 40 | //左移12相当于乘64*64 41 | this->blockData[x << 12 + y << 6 + z] = 1; 42 | } 43 | } 44 | } 45 | } 46 | } 47 | 48 | Chunk::Chunk(int x, int y, int z) 49 | { 50 | this->chunkId.x = x; 51 | this->chunkId.y = y; 52 | this->chunkId.z = z; 53 | this->fillTest(); 54 | } 55 | 56 | Chunk::~Chunk() 57 | { 58 | } 59 | -------------------------------------------------------------------------------- /CppClient/src/game/bak/Chunk.h.bak: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define ChunkSize 64 4 | #include "graph/Mesh.h" 5 | #include "graph/interface/MeshBuilder.h" 6 | 7 | struct KeyStruct 8 | { 9 | int x; 10 | int y; 11 | int z; 12 | /* data */ 13 | KeyStruct(); 14 | KeyStruct(int x, int y, int z); 15 | }; 16 | 17 | class Chunk : MeshBuilder 18 | { 19 | private: 20 | int blockData[ChunkSize * ChunkSize * ChunkSize]; //protobuf需要直接解析到的目标位置 21 | KeyStruct chunkId; //构造函数中进行初始化 22 | Mesh mesh; 23 | /* data */ 24 | public: 25 | void buildMesh(); 26 | void fillTest(); 27 | Chunk(int x, int y, int z); 28 | ~Chunk(); 29 | }; 30 | -------------------------------------------------------------------------------- /CppClient/src/game/bak/ChunkMap.cpp.bak: -------------------------------------------------------------------------------- 1 | #include "ChunkMap.h" 2 | //chunkmap下是一个chunk的键值对 3 | //用于存储chunks,并在操作时可以快速地获取 4 | // #include "sparsepp/spp.h" 5 | 6 | #include "Chunk.h" 7 | 8 | using phmap::flat_hash_map; 9 | 10 | ChunkMap::ChunkMap() 11 | { 12 | // this->chunkPhMap[KeyStruct(0, 0, 0)] = new Chunk(0, 0, 0); 13 | } 14 | 15 | ChunkMap::~ChunkMap() 16 | { 17 | } 18 | -------------------------------------------------------------------------------- /CppClient/src/game/bak/ChunkMap.h.bak: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "parallel_hashmap/phmap.h" 3 | #include "Chunk.h" 4 | 5 | class ChunkMap 6 | { 7 | private: 8 | // phmap::flat_hash_map chunkPhMap; 9 | /* data */ 10 | public: 11 | ChunkMap(/* args */); 12 | ~ChunkMap(); 13 | }; 14 | -------------------------------------------------------------------------------- /CppClient/src/game/block/BlockSelector.cpp: -------------------------------------------------------------------------------- 1 | #include "BlockSelector.h" -------------------------------------------------------------------------------- /CppClient/src/game/block/BlockSelector.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "graph/Mesh.h" 3 | namespace VoxelFrame 4 | { 5 | namespace _Game 6 | { 7 | // class Manager; 8 | ///////////////////// 9 | namespace _Block 10 | { 11 | class Selector :public _Graph::Mesh 12 | { 13 | public: 14 | Type::Vec3I position; 15 | bool active = false; 16 | private: 17 | void bindTexture() override {}; 18 | }; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /CppClient/src/game/block/blocks_mesh/_BlockMesh_Base.h: -------------------------------------------------------------------------------- 1 | class BlockMesh_Base; 2 | #ifndef ___BLOCKMESH_BASE_H__ 3 | #define ___BLOCKMESH_BASE_H__ 4 | 5 | // #pragma once 6 | #include "physic_engine/physic_engine.h" 7 | #include "../block.h" 8 | namespace VoxelFrame 9 | { 10 | namespace _Game 11 | { 12 | namespace _Block 13 | { 14 | class BlockMesh_Base 15 | { 16 | public: 17 | /** 18 | * 获取r3d collider shape 19 | */ 20 | virtual rp3d::BoxShape *getBlockColliderShape() = 0; 21 | 22 | /** 23 | * 获取方块所有的网格三角形(以vertex序列和index序列表示) 24 | */ 25 | virtual void getBlockValidTriangles(std::vector &vertexPoses, _Graph::Indices &indices) = 0; 26 | 27 | /** 28 | * 获取某一面的顶点信息到序列里 29 | * (相对方块自身的坐标 30 | */ 31 | virtual void pushOneFaceVerticesAndIndices_selfPos( 32 | _Block::FaceDirection dir, 33 | std::vector &vertexPoses, 34 | std::vector &indices, unsigned int vertexIndexOffset) = 0; 35 | 36 | /************************************** 37 | * 方块基础信息1,判断某个方向是否有标准类型面 38 | * 以便后续有特殊类型方块可以继承和覆盖 39 | * ***************************************/ 40 | virtual bool hasStandardFace(_Block::FaceDirection dir) = 0; 41 | }; 42 | } 43 | } 44 | } 45 | #endif // ___BLOCKMESH_BASE_H__ -------------------------------------------------------------------------------- /CppClient/src/game/block/blocks_registry.cpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | // #include "game/blocks_base_type/up_side_bottom__block.h" 3 | //#include "game/block.h" 4 | #include "app.h" 5 | #include "blocks_mesh/BlockMesh_Common.h" 6 | #include "blocks_uv_setter/BlockUVSetter_UP_Side_Bottom.h" 7 | #include "block.h" 8 | namespace VoxelFrame 9 | { 10 | namespace _Game 11 | { 12 | namespace _Block 13 | { 14 | void registerBlockAll(Manager &bm) 15 | { 16 | //air 17 | bm.addEmptyBlock(Info::newEmptyBlock()); 18 | //grass 19 | bm.addBlock( 20 | Info( 21 | std::make_shared( 22 | "grass_top", 23 | "grass_side", 24 | "grass_bottom"), 25 | std::make_shared())); 26 | App::getInstance().graphPtr->_textureManagerPtr->registBlockFacesEnd(); 27 | } 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /CppClient/src/game/block/blocks_registry.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | // #include "game/blocks_base_type/up_side_bottom__block.h" 3 | #include "block.h" 4 | namespace VoxelFrame 5 | { 6 | namespace _Game 7 | { 8 | // class Manager; 9 | ///////////////////// 10 | namespace _Block 11 | { 12 | void registerBlockAll(Manager &bm); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /CppClient/src/game/block/blocks_uv_setter/_BlockUVSetter_Base.cpp: -------------------------------------------------------------------------------- 1 | #include "_BlockUVSetter_Base.h" 2 | namespace VoxelFrame 3 | { 4 | namespace _Game 5 | { 6 | namespace _Block 7 | { 8 | //对应基础类型方块的网格设置uv 9 | void BlockUVSetter_Base::setFaceUVsByTextureIndex(_Graph::Mesh &mesh, int textureIndex) 10 | { 11 | float uvs[8]; 12 | auto size = mesh.vertices.size(); 13 | auto &tm = *App::getInstance().graphPtr->_textureManagerPtr; 14 | tm.getBlockFaceUVsByTextureIndex(uvs, textureIndex); 15 | mesh.vertices[size - 4].setUV(uvs[0], uvs[1]); 16 | mesh.vertices[size - 3].setUV(uvs[2], uvs[3]); 17 | mesh.vertices[size - 2].setUV(uvs[4], uvs[5]); 18 | mesh.vertices[size - 1].setUV(uvs[6], uvs[7]); 19 | } 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /CppClient/src/game/block/blocks_uv_setter/_BlockUVSetter_Base.h: -------------------------------------------------------------------------------- 1 | namespace VoxelFrame 2 | { 3 | namespace _Game 4 | { 5 | class BlockUVSetter_Base; 6 | } 7 | } 8 | #pragma once 9 | // #include "../enum.h" 10 | #include "../block.h" 11 | #include "graph/Mesh.h" 12 | #include "app.h" 13 | 14 | ///////////////////////////////////////// 15 | namespace VoxelFrame 16 | { 17 | namespace _Game 18 | { 19 | namespace _Block 20 | { 21 | class BlockUVSetter_Base 22 | { 23 | public: 24 | void setFaceUVsByTextureIndex(_Graph::Mesh &mesh, int textureIndex); 25 | virtual void setVertexUVOnDir(_Block::FaceDirection dir, _Graph::Mesh &mesh) = 0; 26 | }; 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /CppClient/src/game/chunk/chunk.temp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // void Key::getKeyOfPoint(Key &_return, int32_t px, int32_t py, int32_t pz) 4 | 5 | // void Key::getKeyOfPoint(Key &_return, float px, float py, float pz) 6 | // { 7 | // if (px >= 0) 8 | // { 9 | // _return.x = (int)px / VF_ChunkWidth; 10 | // } 11 | // else 12 | // { 13 | // _return.x = ((int)px / VF_ChunkWidth) - 1; 14 | // } 15 | // if (py >= 0) 16 | // { 17 | // _return.y = (int)py / VF_ChunkWidth; 18 | // } 19 | // else 20 | // { 21 | // _return.y = ((int)py / VF_ChunkWidth) - 1; 22 | // } 23 | // if (pz >= 0) 24 | // { 25 | // _return.z = (int)pz / VF_ChunkWidth; 26 | // } 27 | // else 28 | // { 29 | // _return.z = ((int)pz / VF_ChunkWidth) - 1; 30 | // } 31 | // } 32 | -------------------------------------------------------------------------------- /CppClient/src/game/chunk/chunk_key.temp.h: -------------------------------------------------------------------------------- 1 | #include "chunk_key.h" 2 | 3 | /** 4 | * 获取某一点对应的chunk的key 5 | */ 6 | template 7 | void Key::getKeyOfPoint(Key &_return, PosVType px, PosVType py, PosVType pz) 8 | { 9 | if (px >= 0) 10 | { 11 | _return.x = (int)px / VF_ChunkWidth; 12 | } 13 | else 14 | { 15 | _return.x = ((int)px / VF_ChunkWidth) - 1; 16 | } 17 | if (py >= 0) 18 | { 19 | _return.y = (int)py / VF_ChunkWidth; 20 | } 21 | else 22 | { 23 | _return.y = ((int)py / VF_ChunkWidth) - 1; 24 | } 25 | if (pz >= 0) 26 | { 27 | _return.z = (int)pz / VF_ChunkWidth; 28 | } 29 | else 30 | { 31 | _return.z = ((int)pz / VF_ChunkWidth) - 1; 32 | } 33 | } 34 | 35 | template 36 | // std::tuple 37 | Type::Vec3 38 | Key::getChunkPosFromWorldPos(PosVType x, PosVType y, PosVType z) 39 | { 40 | x -= VF_ChunkWidth * this->x; 41 | y -= VF_ChunkWidth * this->y; 42 | z -= VF_ChunkWidth * this->z; 43 | 44 | return Type::Vec3(x, y, z); // std::tuple(x, y, z); 45 | } 46 | -------------------------------------------------------------------------------- /CppClient/src/game/chunk/chunk_manager.temp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | -------------------------------------------------------------------------------- /CppClient/src/game/ecs/CapsuleCollider.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | /** 4 | * 胶囊碰撞器 5 | */ 6 | namespace _EcsComp 7 | { 8 | struct CapsuleCollider 9 | { 10 | rp3d::RigidBody *body; 11 | // //胶囊端半径 12 | // float radius; 13 | // //胶囊高度 14 | // float height; 15 | CapsuleCollider(rp3d::RigidBody *body) : body(body) {} 16 | }; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /CppClient/src/game/ecs/Tags.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | namespace _EcsComp 3 | { 4 | struct PlayerTag 5 | { 6 | /* data */ 7 | }; 8 | struct ChunkRelatedTag 9 | { 10 | }; 11 | } -------------------------------------------------------------------------------- /CppClient/src/game/ecs/VectorAbout.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | namespace _EcsComp 3 | { 4 | struct Position3D 5 | { 6 | float x; 7 | float y; 8 | float z; 9 | /* data */ 10 | }; 11 | struct Velocity3D 12 | { 13 | float x; 14 | float y; 15 | float z; 16 | /* data */ 17 | }; 18 | 19 | } -------------------------------------------------------------------------------- /CppClient/src/game/ecs/sys/Physic.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../CapsuleCollider.h" 3 | #include "../VectorAbout.h" 4 | // #include "../ChunkRelated.h" 5 | #include "../Tags.h" 6 | #include "base/vf_base.h" 7 | namespace VoxelFrame 8 | { 9 | namespace _Game 10 | { 11 | namespace _EcsSys 12 | { 13 | void updateChunkColliderForChunkRelated( 14 | _EcsComp::CapsuleCollider &collider, 15 | // _EcsComp::Position3D &pos, 16 | _EcsComp::ChunkRelatedTag &chunks); 17 | /** 18 | * get check collider for entities in 19 | */ 20 | // void gravity( 21 | // _EcsComp::CapsuleCollider &collider, 22 | // _EcsComp::Position3D &pos, 23 | // _EcsComp::ChunkRelated &chunks); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /CppClient/src/game/enum.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /CppClient/src/game/interfaces/IUpdaterAfterPhysic.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /** 4 | * only used for singleton 5 | * ecs should be the first choice 6 | * */ 7 | class IUpdaterAfterPhysic 8 | { 9 | private: 10 | /* data */ 11 | public: 12 | virtual void updateAfterPhysic() {} 13 | }; 14 | -------------------------------------------------------------------------------- /CppClient/src/game/interfaces/IUpdaterBeforePhysic.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /** 4 | * only used for singleton 5 | * ecs should be the first choice 6 | * */ 7 | class IUpdaterBeforePhysic 8 | { 9 | private: 10 | /* data */ 11 | public: 12 | virtual void updateBeforePhysic() {} 13 | }; 14 | -------------------------------------------------------------------------------- /CppClient/src/game/physics/collision_shape.h: -------------------------------------------------------------------------------- 1 | #include "physic_engine/physic_engine.h" 2 | 3 | class Capsule 4 | { 5 | private: 6 | /* data */ 7 | virtual rp3d::CapsuleShape *Capsule_normal() = 0; 8 | 9 | public: 10 | // Capsule(/* args */); 11 | // ~Capsule(); 12 | }; 13 | -------------------------------------------------------------------------------- /CppClient/src/game/physics/raycast.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "base/vf_base.h" 4 | #include "game/chunk/chunk.h" 5 | #include "app.h" 6 | // #include "math.h" 7 | // #include "tool/calc.h" 8 | #include "numeric" 9 | // #include "main_player.h" 10 | namespace VoxelFrame 11 | { 12 | namespace _Game 13 | { 14 | namespace _Physics 15 | { 16 | //推导过程 见 {$workspace}/markdown/record.md 7.14 17 | bool raycast2Triangle( 18 | const Type::Vec3F& startPoint, 19 | const Type::Vec3F& direction, const Type::Vec3F& triP1, const Type::Vec3F& triP2, const Type::Vec3F& triP3, 20 | Type::Vec3F& return_cross); 21 | 22 | /** 23 | * 与三角形碰撞并返回离射线最近的碰撞点,若无碰撞返回false 24 | */ 25 | bool raycast2TrianglesNearest( 26 | const Type::Vec3F& startPoint, const Type::Vec3F& direction, 27 | std::vector& vertexPoses, _Graph::Indices& indices, Type::Vec3F& return_colidPoint); 28 | /** 29 | * 射线检测是否碰到方块, 30 | * 若碰到方块,返回方块所在区块的指针以及方块的序号, 31 | * 若没碰到,指针为空 32 | */ 33 | bool raycast2ChunkAndReturnBlock( 34 | const Type::Vec3F& startPoint, 35 | const Type::Vec3F& direction, 36 | float maxRange, 37 | std::shared_ptr<_Chunk::Chunk>& return_chunkPtr, 38 | int& return_blockIndexInChunk, Type::Vec3I& return_blockPosition); 39 | 40 | // #include "raycast.declare.h" 41 | } 42 | } 43 | 44 | } // namespace VoxelFrame 45 | -------------------------------------------------------------------------------- /CppClient/src/game/physics/rigid.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "physic_engine/physic_engine.h" 3 | class Rigid 4 | { 5 | private: 6 | rp3d::RigidBody *rigidBody; 7 | /* data */ 8 | public: 9 | Rigid(/* args */) 10 | { 11 | //创建物理刚体 12 | rigidBody = physic_engine::physicWorld().createRigidBody(physic_engine::Transform_normal()); 13 | } 14 | ~Rigid() 15 | { 16 | physic_engine::physicWorld().destroyRigidBody(rigidBody); 17 | } 18 | rp3d::RigidBody &getRigid() 19 | { 20 | return *rigidBody; 21 | } 22 | }; -------------------------------------------------------------------------------- /CppClient/src/graph/Camera.h.bak: -------------------------------------------------------------------------------- 1 | // #ifndef __CAMER_H__ 2 | // #define __CAMER_H__ 3 | // #include "glad/glad.h" 4 | // #include 5 | // namespace DrawSys 6 | // { 7 | // class Camera 8 | // { 9 | // private: 10 | // glm::vec3 camerPos; 11 | // glm::vec3 cameraTarget; 12 | // glm::vec3 cameraUp; 13 | // glm::vec3 cameraFront; 14 | 15 | // public: 16 | // float pitch; 17 | // float yaw; 18 | // Camera(); 19 | // static Camera &GetInstance(); 20 | // glm::vec3 GetCameraPos(); 21 | // glm::vec3 GetCameraTarget(); 22 | // void SetCameraPos(glm::vec3 pos); 23 | // void LookAt(int shaderprogram, glm::vec3 target); 24 | // void SetViewRange(int shaderprogram, float angle, float height, float width); 25 | // void ChangeView(int shaderprogram, float xoffset, float yoffset); 26 | // }; 27 | // } 28 | // #endif // __CAMER_H__ -------------------------------------------------------------------------------- /CppClient/src/graph/CameraStateChangeEvent.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | //#include "event_sys/VF_EventListener.h" 3 | //#include "event_sys/VF_EventPublisher.h" 4 | #include "event_sys/VF_Event.h" 5 | // #include "" 6 | //namespace VoxelFrame 7 | //{ 8 | 9 | VF_EventNamespaceBegin enum class CameraStateChangeType { Rotate 10 | }; 11 | class CameraStateChange_EventPublisher; 12 | 13 | class CameraStateChange_EventListener; 14 | 15 | class CameraStateChange_EventListener 16 | { 17 | ListenerClassBody(CameraStateChange); 18 | 19 | public: 20 | virtual void CameraStateChange_ListenerCallback(Camera &cam, const CameraStateChangeType &stateChangeType) = 0; 21 | }; 22 | 23 | class CameraStateChange_EventPublisher 24 | { 25 | PublisherClassBody(CameraStateChange); 26 | 27 | void pub2All(Camera &cam, const CameraStateChangeType &stateChangeType) 28 | { 29 | for (auto &i : listeners) 30 | { 31 | i->CameraStateChange_ListenerCallback(cam, stateChangeType); 32 | } 33 | } 34 | }; 35 | 36 | VF_EventNamespaceEnd -------------------------------------------------------------------------------- /CppClient/src/graph/gui/GuiNothingClickEvent.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | //#include "event_sys/VF_EventListener.h" 3 | //#include "event_sys/VF_EventPublisher.h" 4 | #include "event_sys/VF_Event.h" 5 | // #include "" 6 | //namespace VoxelFrame 7 | //{ 8 | VF_EventNamespaceBegin 9 | class GuiNothingClick_EventPublisher; 10 | 11 | class GuiNothingClick_EventListener; 12 | 13 | class GuiNothingClick_EventListener { 14 | ListenerClassBody(GuiNothingClick); 15 | 16 | public: 17 | virtual void GuiNothingClick_ListenerCallback() = 0; 18 | }; 19 | 20 | class GuiNothingClick_EventPublisher { 21 | PublisherClassBody(GuiNothingClick); 22 | 23 | void pub2All() { 24 | for (auto &i : listeners) { 25 | i->GuiNothingClick_ListenerCallback(); 26 | } 27 | } 28 | }; 29 | 30 | VF_EventNamespaceEnd -------------------------------------------------------------------------------- /CppClient/src/graph/gui/GuiSys.h.bak: -------------------------------------------------------------------------------- 1 | #ifndef __GUISYS_H__ 2 | #define __GUISYS_H__ 3 | 4 | #include "imgui.h" 5 | #include "impl/imgui_impl_glfw.h" 6 | #include "impl/imgui_impl_opengl3.h" 7 | 8 | namespace DrawSys 9 | { 10 | namespace GuiSys 11 | { 12 | void init(); 13 | void drawGui(); 14 | void renderGui(); 15 | extern bool isRender; 16 | } // namespace GuiSys 17 | } // namespace DrawSys 18 | 19 | #endif // __GUISYS_H__ -------------------------------------------------------------------------------- /CppClient/src/graph/gui/_gui.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | class Gui; 4 | /////////////////////////////////////// 5 | 6 | #ifndef ___GUI_H__ 7 | #define ___GUI_H__ 8 | #include "imgui.h" 9 | // #include "impl/imgui_impl_glfw.h" 10 | // #include "impl/imgui_impl_opengl3.h" 11 | #include "GuiNothingClickEvent.h" 12 | // VF:: 13 | class Gui 14 | { 15 | private: 16 | ImFont *font_default; // = io.Fonts->AddFontDefault(); 17 | ImFont *font_cousine; // = io.Fonts -> AddFontFromFileTTF("resource/font/Cousine-Regular.ttf", 15.0f); 18 | ImFont *font_karla; // = io.Fonts -> AddFontFromFileTTF("resource/font/Karla-Regular.ttf", 18.0f); 19 | ImFont *font_latol; // = io void init() 20 | ImVec4 clear_color; // = ImVec4(0.45f, 0.55f, 0.60f, 1.00f); 21 | 22 | /* data */ 23 | public: 24 | VoxelFrame::_Event::GuiNothingClick_EventPublisher guiNothingClick_EventPublisher; 25 | 26 | ImGuiContext *imguiContext; 27 | void init(); 28 | void drawGui(); 29 | void renderGui(); 30 | }; 31 | 32 | extern Gui _Gui; 33 | #endif // ___GUI_H__ -------------------------------------------------------------------------------- /CppClient/src/graph/interface/Drawer.h.bak: -------------------------------------------------------------------------------- 1 | #pragma once 2 | class Drawer 3 | { 4 | virtual void draw(); 5 | }; -------------------------------------------------------------------------------- /CppClient/src/graph/interface/MeshBuilder.h.bak: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class MeshBuilder 4 | { 5 | private: 6 | /* data */ 7 | public: 8 | virtual void buildMesh(); 9 | }; 10 | -------------------------------------------------------------------------------- /CppClient/src/impl/Protos/chunkMsg.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | package VFproto; 3 | 4 | message ChunkMsg{ 5 | repeated int32 blockArr =1; 6 | } -------------------------------------------------------------------------------- /CppClient/src/interface/IRegister.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class IRegister 4 | { 5 | private: 6 | virtual void IRegister_regist() {} 7 | 8 | public: 9 | }; 10 | -------------------------------------------------------------------------------- /CppClient/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "app.h" 3 | // #include "Systems/DrawSys/DrawSys.h" 4 | // #include "Systems/NetSys/NetSys.h" 5 | // #include "Models/WindowInfoModel.h" 6 | // #pragma comment(lib, "glfw3.lib") 7 | // #pragma comment(lib, "ws2_32.lib") 8 | // #pragma comment(lib, "libprotobuf.lib") 9 | // #pragma comment(lib,"lib文件名或路径") 10 | // #include "stb_image.h" 11 | 12 | int main(int argc, char *argv[]) 13 | { 14 | auto &app1 = App::getInstance(); 15 | app1.run(); 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /CppClient/src/net/RecStatRecoder.cpp: -------------------------------------------------------------------------------- 1 | #include "RecStatRecorder.h" 2 | 3 | RecStatRecorder::RecStatRecorder(/* args */) 4 | { 5 | } 6 | 7 | RecStatRecorder::~RecStatRecorder() 8 | { 9 | } 10 | 11 | void RecStatRecorder::bodyNotCompleteRec(uint32_t bodyLen1, uint16_t msgId1) 12 | { 13 | this->bodyLen = bodyLen1; 14 | this->msgId = msgId1; 15 | this->curState = RecStats_ReceivedHead; 16 | } 17 | 18 | void RecStatRecorder::bodyCompleteRec() 19 | { 20 | this->curState = RecStats_NoHead; 21 | } 22 | RecStatRecorder *RecStatRecorder::getInstance() 23 | { 24 | static RecStatRecorder rsr; 25 | return &rsr; 26 | } 27 | RecStatRecorder::RecStats RecStatRecorder::getCurState() 28 | { 29 | return this->curState; 30 | } 31 | uint16_t RecStatRecorder::getMsgId() 32 | { 33 | return this->msgId; 34 | } 35 | 36 | uint32_t RecStatRecorder::getBodyLen() 37 | { 38 | return this->bodyLen; 39 | } -------------------------------------------------------------------------------- /CppClient/src/net/RecStatRecorder.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdint.h" 4 | 5 | class RecStatRecorder 6 | { 7 | public: 8 | enum RecStats 9 | { 10 | RecStats_ReceivedHead, 11 | RecStats_NoHead 12 | }; 13 | void bodyNotCompleteRec(uint32_t, uint16_t); 14 | void bodyCompleteRec(); 15 | static RecStatRecorder *getInstance(); 16 | RecStats getCurState(); 17 | uint16_t getMsgId(); 18 | uint32_t getBodyLen(); 19 | 20 | private: 21 | RecStats curState = RecStats_NoHead; 22 | /* data */ 23 | uint32_t bodyLen; 24 | uint16_t msgId; 25 | RecStatRecorder(/* args */); 26 | ~RecStatRecorder(); 27 | 28 | // public: 29 | }; 30 | -------------------------------------------------------------------------------- /CppClient/src/net/_net.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class _net 4 | { 5 | private: 6 | /* data */ 7 | public: 8 | void start(); 9 | }; 10 | 11 | extern _net _g_net; 12 | -------------------------------------------------------------------------------- /CppClient/src/physic_engine/physic_engine.cpp: -------------------------------------------------------------------------------- 1 | #include "physic_engine.h" 2 | namespace physic_engine 3 | { 4 | reactphysics3d::PhysicsCommon &physicCommon() 5 | { 6 | static reactphysics3d::PhysicsCommon physicCommon; 7 | return physicCommon; 8 | } 9 | reactphysics3d::PhysicsWorld &physicWorld() 10 | { 11 | static reactphysics3d::PhysicsWorld *ptr; 12 | if (!ptr) 13 | { 14 | ptr = physicCommon().createPhysicsWorld(); 15 | } 16 | return *ptr; 17 | } 18 | reactphysics3d::CapsuleShape &getCapsule(float r, float h) 19 | { 20 | static reactphysics3d::CapsuleShape *ptr; 21 | if (!ptr) 22 | { 23 | ptr = physicCommon().createCapsuleShape(r, h); 24 | } 25 | ptr->setRadius(r); 26 | ptr->setHeight(h); 27 | return *ptr; 28 | } 29 | 30 | rp3d::Transform Transform_normal() 31 | { 32 | { 33 | return rp3d::Transform( 34 | rp3d::Vector3(0, 0, 0), 35 | rp3d::Quaternion::identity()); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /CppClient/src/physic_engine/physic_engine.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace physic_engine 5 | { 6 | rp3d::PhysicsCommon &physicCommon(); 7 | rp3d::PhysicsWorld &physicWorld(); 8 | rp3d::CapsuleShape &getCapsule(float r, float h); 9 | rp3d::Transform Transform_normal(); 10 | 11 | } -------------------------------------------------------------------------------- /CppClient/src/system_related/Cursor.cpp: -------------------------------------------------------------------------------- 1 | #include "Cursor.h" 2 | #if _WIN32 || _WIN64 3 | #include "Cursor_WinAPI.h" 4 | #endif 5 | 6 | #include "base/vf_base.h" 7 | // HWND handle; 8 | void Cursor::setLocked(bool locked) 9 | { 10 | if (locked != this->locked) 11 | { 12 | this->locked = locked; 13 | if (locked) 14 | { 15 | 16 | lockCursor(); 17 | // ShowCursor(FALSE); 18 | } 19 | else 20 | { 21 | releaseCursor(); 22 | // ReleaseCapture(); 23 | 24 | // ShowCursor(TRUE); 25 | } 26 | } 27 | } 28 | 29 | // void Cursor::resetCursorPosIfLocked() 30 | // { 31 | // if(locked){ 32 | // SDL_SetCursorPos 33 | // } 34 | // } 35 | 36 | void Cursor::resetCursorPosIfLocked() 37 | { 38 | if (locked) 39 | { 40 | resetCursorCenter(gameWindow->windowW / 2, 41 | gameWindow->windowH / 2); 42 | } 43 | } 44 | 45 | void Cursor::init(GameWindow *gameWindow) 46 | { 47 | this->gameWindow = gameWindow; 48 | // handle = GetActiveWindow(); 49 | 50 | // setCursorState(true); 51 | } 52 | -------------------------------------------------------------------------------- /CppClient/src/system_related/Cursor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | //a part of gamewindow 3 | 4 | struct GameWindow; 5 | // 6 | class Cursor 7 | { 8 | private: 9 | bool locked; 10 | 11 | public: 12 | GameWindow *gameWindow; 13 | double cursorX; 14 | double cursorY; 15 | /** 16 | * locked getter & setter 17 | */ 18 | void setLocked(bool locked); 19 | inline bool getLocked() 20 | { 21 | return locked; 22 | } 23 | 24 | void resetCursorPosIfLocked(); 25 | // Cursor(); 26 | void init(GameWindow *gameWindow); 27 | }; 28 | #include "GameWindow.h" -------------------------------------------------------------------------------- /CppClient/src/system_related/Cursor_WinAPI.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "_media_api.h" 3 | #include "Windows.h" 4 | inline void lockCursor() 5 | { 6 | SDL_ShowCursor(false); 7 | auto handle = GetActiveWindow(); 8 | RECT wr; 9 | GetWindowRect(handle, &wr); 10 | wr.top += 100; 11 | wr.bottom -= 100; 12 | wr.left += 100; 13 | wr.right -= 100; 14 | ClipCursor(&wr); 15 | } 16 | inline void releaseCursor() 17 | { 18 | SDL_ShowCursor(true); 19 | ClipCursor(NULL); 20 | } 21 | inline void resetCursorCenter(int x, int y) 22 | { 23 | auto handle = GetActiveWindow(); 24 | // LPPOINT p; 25 | POINT point; 26 | point.x = x; 27 | point.y = y; 28 | ClientToScreen(handle, &point); 29 | 30 | // RECT r; 31 | // GetClientRect(handle, &r); 32 | // printf("win rect %d %d\r\n", r.top, r.left); 33 | // printf("win rect %d %d\r\n", point.x, point.y); 34 | // x = point.x; 35 | // y = point.y; 36 | SetCursorPos(point.x, point.y); 37 | } -------------------------------------------------------------------------------- /CppClient/src/system_related/GameWindow.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "system_related/_media_api.h" 3 | 4 | #include "Cursor.h" 5 | 6 | struct GameWindow 7 | { 8 | int windowH = 800; 9 | int windowW = 1000; 10 | int windowX = 0; 11 | int windowY = 0; 12 | // bool cursorLocked = false; 13 | // GLFWwindow *window; 14 | SDL_Window *window; 15 | SDL_GLContext GLContext; 16 | const char *WindowName = "VoxelFrame"; 17 | bool createWindow(); 18 | void pos2Screen(int &x, int &y); 19 | Cursor cursor; 20 | // GameWindow(); 21 | // void init(); 22 | }; 23 | -------------------------------------------------------------------------------- /CppClient/src/system_related/MouseMoveEvent.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "event_sys/VF_EventListener.h" 4 | #include "event_sys/VF_EventPublisher.h" 5 | // #include "" 6 | //namespace VoxelFrame 7 | //{ 8 | VF_EventNamespaceBegin 9 | class PublisherClass(MouseMove); 10 | 11 | class ListenerClass(MouseMove); 12 | 13 | class ListenerClass(MouseMove) { 14 | ListenerClassBody(MouseMove); 15 | 16 | public: 17 | virtual void ListenerCallback(MouseMove)(int x, int y, int dx, int dy) = 0; 18 | }; 19 | 20 | class PublisherClass(MouseMove) { 21 | PublisherClassBody(MouseMove); 22 | 23 | /// 24 | void pub2All(int x, int y, int dx, int dy) { 25 | for (auto &i : listeners) { 26 | i->ListenerCallback(MouseMove)(x, y, dx, dy); 27 | } 28 | // 29 | }; 30 | }; 31 | VF_EventNamespaceEnd -------------------------------------------------------------------------------- /CppClient/src/system_related/_Input.h: -------------------------------------------------------------------------------- 1 | // #include "glad/glad.h" 2 | // #include "GLFW/glfw3.h" 3 | #include "base/vf_base.h" 4 | #include "_Input_Map.h" 5 | #include "MouseMoveEvent.h" 6 | // #include "Input_sys.h" 7 | /** 8 | * 9 | * handle input 10 | * 11 | */ 12 | class Input; 13 | 14 | #pragma once 15 | enum class Input_KeyState { 16 | KeyDown = 1, 17 | KeyUp = 0, 18 | }; 19 | 20 | class Input { 21 | public: 22 | // using ProcessInputFunc = void (*)(Input &Input); 23 | using MouseMoveFunc = void (*)(double xpos, double ypos, double dx, double dy); 24 | 25 | private: 26 | /* data */ 27 | // vector<> 28 | public: 29 | VF::_Event::MouseMove_EventPublisher mouseMovePublisher; 30 | std::vector mouseMoveCallbacks; 31 | std::vector processInputCallbacks; 32 | std::deque mouseBtnCallbacks; 33 | 34 | // inline int getKey(); 35 | void processInput(); 36 | 37 | void init(); 38 | 39 | Input_KeyState getKey(int M_KeyCode); 40 | 41 | //锁定光标 42 | bool cursorLocked = true; 43 | float cursorX = 0; 44 | float cursorY = 0; 45 | 46 | /** 47 | * 注册鼠标移动回调。 48 | * 注意没有重复性检查,所以要确保每个函数只注册一次 49 | */ 50 | void registerMouseMove(MouseMoveFunc f) { 51 | mouseMoveCallbacks.push_back(f); 52 | } 53 | 54 | void registerProcessInput(void (*f)(Input &Input)) { 55 | processInputCallbacks.push_back(f); 56 | } 57 | 58 | void registerMouseClick(void (*hhh)(int btn, int action)) { 59 | mouseBtnCallbacks.emplace_back(hhh); 60 | } 61 | }; 62 | -------------------------------------------------------------------------------- /CppClient/src/system_related/_Input_Map.h: -------------------------------------------------------------------------------- 1 | 2 | #define Input_Key(key) SDL_SCANCODE_##key 3 | -------------------------------------------------------------------------------- /CppClient/src/system_related/_media_api.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include -------------------------------------------------------------------------------- /CppClient/src/system_related/_sys_api.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "SDL.h" 3 | #include "base/vf_base.h" 4 | // #define _sys_api_getTick SDL_GetTicks 5 | 6 | //获取程序运行时间 7 | inline uint64_t _sys_api_getTick() 8 | { 9 | return (uint64_t)SDL_GetTicks(); 10 | } -------------------------------------------------------------------------------- /CppClient/src/system_related/imgui_impl_sys.h: -------------------------------------------------------------------------------- 1 | // ImGui SDL2 binding with OpenGL 2 | // https://github.com/ocornut/imgui 3 | 4 | struct SDL_Window; 5 | typedef union SDL_Event SDL_Event; 6 | 7 | IMGUI_API bool ImGui_ImplSdl_Init(SDL_Window *window); 8 | IMGUI_API void ImGui_ImplSdl_Shutdown(); 9 | IMGUI_API void ImGui_ImplSdl_NewFrame(SDL_Window *window); 10 | IMGUI_API bool ImGui_ImplSdl_ProcessEvent(SDL_Event* event); 11 | 12 | // Use if you want to reset your rendering device without losing ImGui state. 13 | IMGUI_API void ImGui_ImplSdl_InvalidateDeviceObjects(); 14 | IMGUI_API bool ImGui_ImplSdl_CreateDeviceObjects(); -------------------------------------------------------------------------------- /CppClient/task_conan.cmd: -------------------------------------------------------------------------------- 1 | cd build 2 | conan install .. -------------------------------------------------------------------------------- /CppClient/third/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # cmake最低版本号要求 2 | cmake_minimum_required (VERSION 3.0) 3 | # cmake_minimum_required(VERSION 3.20) 4 | 5 | set(PROJECT_NAME ThirdParty) 6 | 7 | project (${PROJECT_NAME}) 8 | 9 | set (CMAKE_CXX_STAND 11) 10 | 11 | # include(../CMAKE_COMPILER.cmake) 12 | 13 | ######################################### 14 | #sdl 15 | add_subdirectory(SDL) 16 | ######################################### 17 | #imgui 18 | set (IMGUI_DIR vf_imgui) 19 | add_subdirectory(${IMGUI_DIR}) 20 | # include_directories (${IMGUI_DIR}/imgui) 21 | # set (thirdLinks ${thirdLinks} imgui) 22 | ######################################### 23 | # glad 24 | include_directories (glad/include) 25 | add_library (glad glad/src/glad.c) 26 | # set (thirdLinks ${thirdLinks} glad) 27 | ######################################### 28 | #reactphysics3d 29 | # SET (reactphysics3d_DIR ${3RD_DIR}/reactphysics3d) 30 | add_subdirectory(reactphysics3d) 31 | # include_directories(${reactphysics3d_DIR}/include) 32 | # set (thirdLinks ${thirdLinks} reactphysics3d) 33 | ######################################### 34 | # paecs 35 | # set (PAECS_DIR ${3RD_DIR}/paecs) 36 | add_subdirectory(paecs) 37 | # include_directories (${PAECS_DIR}/src) 38 | # set (thirdLinks ${thirdLinks} paecs) -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/detail/_fixes.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | //! Workaround for compatibility with other libraries 4 | #ifdef max 5 | #undef max 6 | #endif 7 | 8 | //! Workaround for compatibility with other libraries 9 | #ifdef min 10 | #undef min 11 | #endif 12 | 13 | //! Workaround for Android 14 | #ifdef isnan 15 | #undef isnan 16 | #endif 17 | 18 | //! Workaround for Android 19 | #ifdef isinf 20 | #undef isinf 21 | #endif 22 | 23 | //! Workaround for Chrone Native Client 24 | #ifdef log2 25 | #undef log2 26 | #endif 27 | 28 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/detail/compute_common.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "setup.hpp" 4 | #include 5 | 6 | namespace glm{ 7 | namespace detail 8 | { 9 | template 10 | struct compute_abs 11 | {}; 12 | 13 | template 14 | struct compute_abs 15 | { 16 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genFIType call(genFIType x) 17 | { 18 | GLM_STATIC_ASSERT( 19 | std::numeric_limits::is_iec559 || std::numeric_limits::is_signed, 20 | "'abs' only accept floating-point and integer scalar or vector inputs"); 21 | 22 | return x >= genFIType(0) ? x : -x; 23 | // TODO, perf comp with: *(((int *) &x) + 1) &= 0x7fffffff; 24 | } 25 | }; 26 | 27 | #if GLM_COMPILER & GLM_COMPILER_CUDA 28 | template<> 29 | struct compute_abs 30 | { 31 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR static float call(float x) 32 | { 33 | return fabsf(x); 34 | } 35 | }; 36 | #endif 37 | 38 | template 39 | struct compute_abs 40 | { 41 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genFIType call(genFIType x) 42 | { 43 | GLM_STATIC_ASSERT( 44 | (!std::numeric_limits::is_signed && std::numeric_limits::is_integer), 45 | "'abs' only accept floating-point and integer scalar or vector inputs"); 46 | return x; 47 | } 48 | }; 49 | }//namespace detail 50 | }//namespace glm 51 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/detail/compute_vector_relational.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //#include "compute_common.hpp" 4 | #include "setup.hpp" 5 | #include 6 | 7 | namespace glm{ 8 | namespace detail 9 | { 10 | template 11 | struct compute_equal 12 | { 13 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR 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 GLM_CONSTEXPR static bool call(T a, T b) 23 | { 24 | return detail::compute_abs::is_signed>::call(b - a) <= static_cast(0); 25 | //return std::memcmp(&a, &b, sizeof(T)) == 0; 26 | } 27 | }; 28 | */ 29 | }//namespace detail 30 | }//namespace glm 31 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/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 | # if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE 23 | template<> 24 | struct compute_sqrt<4, float, aligned_lowp, true> 25 | { 26 | GLM_FUNC_QUALIFIER static vec<4, float, aligned_lowp> call(vec<4, float, aligned_lowp> const& v) 27 | { 28 | vec<4, float, aligned_lowp> Result; 29 | Result.data = glm_vec4_sqrt_lowp(v.data); 30 | return Result; 31 | } 32 | }; 33 | # endif 34 | }//namespace detail 35 | }//namespace glm 36 | 37 | #endif//GLM_ARCH & GLM_ARCH_SSE2_BIT 38 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/detail/func_packing_simd.inl: -------------------------------------------------------------------------------- 1 | namespace glm{ 2 | namespace detail 3 | { 4 | 5 | }//namespace detail 6 | }//namespace glm 7 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/detail/func_trigonometric_simd.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ActivePeter/VoxelFrame/4399b8238b2af027ec2942a5846f43f790243878/CppClient/third/glm/include/glm/detail/func_trigonometric_simd.inl -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/detail/func_vector_relational_simd.inl: -------------------------------------------------------------------------------- 1 | namespace glm{ 2 | namespace detail 3 | { 4 | 5 | }//namespace detail 6 | }//namespace glm 7 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/detail/type_half.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "setup.hpp" 4 | 5 | namespace glm{ 6 | namespace detail 7 | { 8 | typedef short hdata; 9 | 10 | GLM_FUNC_DECL float toFloat32(hdata value); 11 | GLM_FUNC_DECL hdata toFloat16(float const& value); 12 | 13 | }//namespace detail 14 | }//namespace glm 15 | 16 | #include "type_half.inl" 17 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/detail/type_mat4x4_simd.inl: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | 3 | namespace glm 4 | { 5 | 6 | }//namespace glm 7 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/matrix_common.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_matrix_common 2 | /// @file glm/ext/matrix_common.hpp 3 | /// 4 | /// @defgroup ext_matrix_common GLM_EXT_matrix_common 5 | /// @ingroup ext 6 | /// 7 | /// Defines functions for common matrix operations. 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// @see ext_matrix_common 12 | 13 | #pragma once 14 | 15 | #include "../detail/qualifier.hpp" 16 | #include "../detail/_fixes.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_EXT_matrix_transform extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup ext_matrix_common 25 | /// @{ 26 | 27 | template 28 | GLM_FUNC_DECL mat mix(mat const& x, mat const& y, mat const& a); 29 | 30 | template 31 | GLM_FUNC_DECL mat mix(mat const& x, mat const& y, U a); 32 | 33 | /// @} 34 | }//namespace glm 35 | 36 | #include "matrix_common.inl" 37 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/matrix_common.inl: -------------------------------------------------------------------------------- 1 | #include "../matrix.hpp" 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER mat mix(mat const& x, mat const& y, U a) 7 | { 8 | return mat(x) * (static_cast(1) - a) + mat(y) * a; 9 | } 10 | 11 | template 12 | GLM_FUNC_QUALIFIER mat mix(mat const& x, mat const& y, mat const& a) 13 | { 14 | return matrixCompMult(mat(x), static_cast(1) - a) + matrixCompMult(mat(y), a); 15 | } 16 | }//namespace glm 17 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/matrix_double2x2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_double2x2.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat2x2.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_matrix 10 | /// @{ 11 | 12 | /// 2 columns of 2 components matrix of double-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<2, 2, double, defaultp> dmat2x2; 16 | 17 | /// 2 columns of 2 components matrix of double-precision floating-point numbers. 18 | /// 19 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 20 | typedef mat<2, 2, double, defaultp> dmat2; 21 | 22 | /// @} 23 | }//namespace glm 24 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/matrix_double2x3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_double2x3.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat2x3.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_matrix 10 | /// @{ 11 | 12 | /// 2 columns of 3 components matrix of double-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<2, 3, double, defaultp> dmat2x3; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/matrix_double2x4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_double2x4.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat2x4.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_matrix 10 | /// @{ 11 | 12 | /// 2 columns of 4 components matrix of double-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<2, 4, double, defaultp> dmat2x4; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/matrix_double3x2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_double3x2.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat3x2.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_matrix 10 | /// @{ 11 | 12 | /// 3 columns of 2 components matrix of double-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<3, 2, double, defaultp> dmat3x2; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/matrix_double3x3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_double3x3.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat3x3.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_matrix 10 | /// @{ 11 | 12 | /// 3 columns of 3 components matrix of double-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<3, 3, double, defaultp> dmat3x3; 16 | 17 | /// 3 columns of 3 components matrix of double-precision floating-point numbers. 18 | /// 19 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 20 | typedef mat<3, 3, double, defaultp> dmat3; 21 | 22 | /// @} 23 | }//namespace glm 24 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/matrix_double3x4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_double3x4.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat3x4.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_matrix 10 | /// @{ 11 | 12 | /// 3 columns of 4 components matrix of double-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<3, 4, double, defaultp> dmat3x4; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/matrix_double4x2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_double4x2.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat4x2.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_matrix 10 | /// @{ 11 | 12 | /// 4 columns of 2 components matrix of double-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<4, 2, double, defaultp> dmat4x2; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/matrix_double4x3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_double4x3.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat4x3.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_matrix 10 | /// @{ 11 | 12 | /// 4 columns of 3 components matrix of double-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<4, 3, double, defaultp> dmat4x3; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/matrix_double4x4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_double4x4.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat4x4.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_matrix 10 | /// @{ 11 | 12 | /// 4 columns of 4 components matrix of double-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<4, 4, double, defaultp> dmat4x4; 16 | 17 | /// 4 columns of 4 components matrix of double-precision floating-point numbers. 18 | /// 19 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 20 | typedef mat<4, 4, double, defaultp> dmat4; 21 | 22 | /// @} 23 | }//namespace glm 24 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/matrix_float2x2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_float2x2.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat2x2.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_matrix 10 | /// @{ 11 | 12 | /// 2 columns of 2 components matrix of single-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<2, 2, float, defaultp> mat2x2; 16 | 17 | /// 2 columns of 2 components matrix of single-precision floating-point numbers. 18 | /// 19 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 20 | typedef mat<2, 2, float, defaultp> mat2; 21 | 22 | /// @} 23 | }//namespace glm 24 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/matrix_float2x3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_float2x3.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat2x3.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_matrix 10 | /// @{ 11 | 12 | /// 2 columns of 3 components matrix of single-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<2, 3, float, defaultp> mat2x3; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/matrix_float2x4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_float2x4.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat2x4.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_matrix 10 | /// @{ 11 | 12 | /// 2 columns of 4 components matrix of single-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<2, 4, float, defaultp> mat2x4; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/matrix_float3x2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_float3x2.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat3x2.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core 10 | /// @{ 11 | 12 | /// 3 columns of 2 components matrix of single-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<3, 2, float, defaultp> mat3x2; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/matrix_float3x3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_float3x3.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat3x3.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_matrix 10 | /// @{ 11 | 12 | /// 3 columns of 3 components matrix of single-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<3, 3, float, defaultp> mat3x3; 16 | 17 | /// 3 columns of 3 components matrix of single-precision floating-point numbers. 18 | /// 19 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 20 | typedef mat<3, 3, float, defaultp> mat3; 21 | 22 | /// @} 23 | }//namespace glm 24 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/matrix_float3x4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_float3x4.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat3x4.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_matrix 10 | /// @{ 11 | 12 | /// 3 columns of 4 components matrix of single-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<3, 4, float, defaultp> mat3x4; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/matrix_float4x2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_float4x2.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat4x2.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_matrix 10 | /// @{ 11 | 12 | /// 4 columns of 2 components matrix of single-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<4, 2, float, defaultp> mat4x2; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/matrix_float4x3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_float4x3.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat4x3.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_matrix 10 | /// @{ 11 | 12 | /// 4 columns of 3 components matrix of single-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<4, 3, float, defaultp> mat4x3; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/matrix_float4x4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_float4x4.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat4x4.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @ingroup core_matrix 10 | /// @{ 11 | 12 | /// 4 columns of 4 components matrix of single-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<4, 4, float, defaultp> mat4x4; 16 | 17 | /// 4 columns of 4 components matrix of single-precision floating-point numbers. 18 | /// 19 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 20 | typedef mat<4, 4, float, defaultp> mat4; 21 | 22 | /// @} 23 | }//namespace glm 24 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/quaternion_common_simd.inl: -------------------------------------------------------------------------------- 1 | #if GLM_ARCH & GLM_ARCH_SSE2_BIT 2 | 3 | namespace glm{ 4 | namespace detail 5 | { 6 | template 7 | struct compute_dot, float, true> 8 | { 9 | static GLM_FUNC_QUALIFIER float call(qua const& x, qua const& y) 10 | { 11 | return _mm_cvtss_f32(glm_vec1_dot(x.data, y.data)); 12 | } 13 | }; 14 | }//namespace detail 15 | }//namespace glm 16 | 17 | #endif//GLM_ARCH & GLM_ARCH_SSE2_BIT 18 | 19 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/quaternion_double.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_quaternion_double 2 | /// @file glm/ext/quaternion_double.hpp 3 | /// 4 | /// @defgroup ext_quaternion_double GLM_EXT_quaternion_double 5 | /// @ingroup ext 6 | /// 7 | /// Exposes double-precision floating point quaternion type. 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// @see ext_quaternion_float 12 | /// @see ext_quaternion_double_precision 13 | /// @see ext_quaternion_common 14 | /// @see ext_quaternion_exponential 15 | /// @see ext_quaternion_geometric 16 | /// @see ext_quaternion_relational 17 | /// @see ext_quaternion_transform 18 | /// @see ext_quaternion_trigonometric 19 | 20 | #pragma once 21 | 22 | // Dependency: 23 | #include "../detail/type_quat.hpp" 24 | 25 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 26 | # pragma message("GLM: GLM_EXT_quaternion_double extension included") 27 | #endif 28 | 29 | namespace glm 30 | { 31 | /// @addtogroup ext_quaternion_double 32 | /// @{ 33 | 34 | /// Quaternion of double-precision floating-point numbers. 35 | typedef qua dquat; 36 | 37 | /// @} 38 | } //namespace glm 39 | 40 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/quaternion_double_precision.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_quaternion_double_precision 2 | /// @file glm/ext/quaternion_double_precision.hpp 3 | /// 4 | /// @defgroup ext_quaternion_double_precision GLM_EXT_quaternion_double_precision 5 | /// @ingroup ext 6 | /// 7 | /// Exposes double-precision floating point quaternion type with various precision in term of ULPs. 8 | /// 9 | /// Include to use the features of this extension. 10 | 11 | #pragma once 12 | 13 | // Dependency: 14 | #include "../detail/type_quat.hpp" 15 | 16 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 17 | # pragma message("GLM: GLM_EXT_quaternion_double_precision extension included") 18 | #endif 19 | 20 | namespace glm 21 | { 22 | /// @addtogroup ext_quaternion_double_precision 23 | /// @{ 24 | 25 | /// Quaternion of double-precision floating-point numbers using high precision arithmetic in term of ULPs. 26 | /// 27 | /// @see ext_quaternion_double_precision 28 | typedef qua lowp_dquat; 29 | 30 | /// Quaternion of medium double-qualifier floating-point numbers using high precision arithmetic in term of ULPs. 31 | /// 32 | /// @see ext_quaternion_double_precision 33 | typedef qua mediump_dquat; 34 | 35 | /// Quaternion of high double-qualifier floating-point numbers using high precision arithmetic in term of ULPs. 36 | /// 37 | /// @see ext_quaternion_double_precision 38 | typedef qua highp_dquat; 39 | 40 | /// @} 41 | } //namespace glm 42 | 43 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/quaternion_float.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_quaternion_float 2 | /// @file glm/ext/quaternion_float.hpp 3 | /// 4 | /// @defgroup ext_quaternion_float GLM_EXT_quaternion_float 5 | /// @ingroup ext 6 | /// 7 | /// Exposes single-precision floating point quaternion type. 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// @see ext_quaternion_double 12 | /// @see ext_quaternion_float_precision 13 | /// @see ext_quaternion_common 14 | /// @see ext_quaternion_exponential 15 | /// @see ext_quaternion_geometric 16 | /// @see ext_quaternion_relational 17 | /// @see ext_quaternion_transform 18 | /// @see ext_quaternion_trigonometric 19 | 20 | #pragma once 21 | 22 | // Dependency: 23 | #include "../detail/type_quat.hpp" 24 | 25 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 26 | # pragma message("GLM: GLM_EXT_quaternion_float extension included") 27 | #endif 28 | 29 | namespace glm 30 | { 31 | /// @addtogroup ext_quaternion_float 32 | /// @{ 33 | 34 | /// Quaternion of single-precision floating-point numbers. 35 | typedef qua quat; 36 | 37 | /// @} 38 | } //namespace glm 39 | 40 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/quaternion_float_precision.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_quaternion_float_precision 2 | /// @file glm/ext/quaternion_float_precision.hpp 3 | /// 4 | /// @defgroup ext_quaternion_float_precision GLM_EXT_quaternion_float_precision 5 | /// @ingroup ext 6 | /// 7 | /// Exposes single-precision floating point quaternion type with various precision in term of ULPs. 8 | /// 9 | /// Include to use the features of this extension. 10 | 11 | #pragma once 12 | 13 | // Dependency: 14 | #include "../detail/type_quat.hpp" 15 | 16 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 17 | # pragma message("GLM: GLM_EXT_quaternion_float_precision extension included") 18 | #endif 19 | 20 | namespace glm 21 | { 22 | /// @addtogroup ext_quaternion_float_precision 23 | /// @{ 24 | 25 | /// Quaternion of single-precision floating-point numbers using high precision arithmetic in term of ULPs. 26 | typedef qua lowp_quat; 27 | 28 | /// Quaternion of single-precision floating-point numbers using high precision arithmetic in term of ULPs. 29 | typedef qua mediump_quat; 30 | 31 | /// Quaternion of single-precision floating-point numbers using high precision arithmetic in term of ULPs. 32 | typedef qua highp_quat; 33 | 34 | /// @} 35 | } //namespace glm 36 | 37 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/quaternion_geometric.inl: -------------------------------------------------------------------------------- 1 | namespace glm 2 | { 3 | template 4 | GLM_FUNC_QUALIFIER T dot(qua const& x, qua const& y) 5 | { 6 | GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'dot' accepts only floating-point inputs"); 7 | return detail::compute_dot, T, detail::is_aligned::value>::call(x, y); 8 | } 9 | 10 | template 11 | GLM_FUNC_QUALIFIER T length(qua const& q) 12 | { 13 | return glm::sqrt(dot(q, q)); 14 | } 15 | 16 | template 17 | GLM_FUNC_QUALIFIER qua normalize(qua const& q) 18 | { 19 | T len = length(q); 20 | if(len <= static_cast(0)) // Problem 21 | return qua(static_cast(1), static_cast(0), static_cast(0), static_cast(0)); 22 | T oneOverLen = static_cast(1) / len; 23 | return qua(q.w * oneOverLen, q.x * oneOverLen, q.y * oneOverLen, q.z * oneOverLen); 24 | } 25 | 26 | template 27 | GLM_FUNC_QUALIFIER qua cross(qua const& q1, qua const& q2) 28 | { 29 | return qua( 30 | q1.w * q2.w - q1.x * q2.x - q1.y * q2.y - q1.z * q2.z, 31 | q1.w * q2.x + q1.x * q2.w + q1.y * q2.z - q1.z * q2.y, 32 | q1.w * q2.y + q1.y * q2.w + q1.z * q2.x - q1.x * q2.z, 33 | q1.w * q2.z + q1.z * q2.w + q1.x * q2.y - q1.y * q2.x); 34 | } 35 | }//namespace glm 36 | 37 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/quaternion_relational.inl: -------------------------------------------------------------------------------- 1 | namespace glm 2 | { 3 | template 4 | GLM_FUNC_QUALIFIER vec<4, bool, Q> equal(qua const& x, qua const& y) 5 | { 6 | vec<4, bool, Q> Result; 7 | for(length_t i = 0; i < x.length(); ++i) 8 | Result[i] = x[i] == y[i]; 9 | return Result; 10 | } 11 | 12 | template 13 | GLM_FUNC_QUALIFIER vec<4, bool, Q> equal(qua const& x, qua const& y, T epsilon) 14 | { 15 | vec<4, T, Q> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w); 16 | return lessThan(abs(v), vec<4, T, Q>(epsilon)); 17 | } 18 | 19 | template 20 | GLM_FUNC_QUALIFIER vec<4, bool, Q> notEqual(qua const& x, qua const& y) 21 | { 22 | vec<4, bool, Q> Result; 23 | for(length_t i = 0; i < x.length(); ++i) 24 | Result[i] = x[i] != y[i]; 25 | return Result; 26 | } 27 | 28 | template 29 | GLM_FUNC_QUALIFIER vec<4, bool, Q> notEqual(qua const& x, qua const& y, T epsilon) 30 | { 31 | vec<4, T, Q> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w); 32 | return greaterThanEqual(abs(v), vec<4, T, Q>(epsilon)); 33 | } 34 | }//namespace glm 35 | 36 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/quaternion_transform.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_quaternion_transform 2 | /// @file glm/ext/quaternion_transform.hpp 3 | /// 4 | /// @defgroup ext_quaternion_transform GLM_EXT_quaternion_transform 5 | /// @ingroup ext 6 | /// 7 | /// Provides transformation functions for quaternion types 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// @see ext_quaternion_float 12 | /// @see ext_quaternion_double 13 | /// @see ext_quaternion_exponential 14 | /// @see ext_quaternion_geometric 15 | /// @see ext_quaternion_relational 16 | /// @see ext_quaternion_trigonometric 17 | 18 | #pragma once 19 | 20 | // Dependency: 21 | #include "../common.hpp" 22 | #include "../trigonometric.hpp" 23 | #include "../geometric.hpp" 24 | 25 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 26 | # pragma message("GLM: GLM_EXT_quaternion_transform extension included") 27 | #endif 28 | 29 | namespace glm 30 | { 31 | /// @addtogroup ext_quaternion_transform 32 | /// @{ 33 | 34 | /// Rotates a quaternion from a vector of 3 components axis and an angle. 35 | /// 36 | /// @param q Source orientation 37 | /// @param angle Angle expressed in radians. 38 | /// @param axis Axis of the rotation 39 | /// 40 | /// @tparam T Floating-point scalar types 41 | /// @tparam Q Value from qualifier enum 42 | template 43 | GLM_FUNC_DECL qua rotate(qua const& q, T const& angle, vec<3, T, Q> const& axis); 44 | /// @} 45 | } //namespace glm 46 | 47 | #include "quaternion_transform.inl" 48 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/quaternion_transform.inl: -------------------------------------------------------------------------------- 1 | namespace glm 2 | { 3 | template 4 | GLM_FUNC_QUALIFIER qua rotate(qua const& q, T const& angle, vec<3, T, Q> const& v) 5 | { 6 | vec<3, T, Q> Tmp = v; 7 | 8 | // Axis of rotation must be normalised 9 | T len = glm::length(Tmp); 10 | if(abs(len - static_cast(1)) > static_cast(0.001)) 11 | { 12 | T oneOverLen = static_cast(1) / len; 13 | Tmp.x *= oneOverLen; 14 | Tmp.y *= oneOverLen; 15 | Tmp.z *= oneOverLen; 16 | } 17 | 18 | T const AngleRad(angle); 19 | T const Sin = sin(AngleRad * static_cast(0.5)); 20 | 21 | return q * qua(cos(AngleRad * static_cast(0.5)), Tmp.x * Sin, Tmp.y * Sin, Tmp.z * Sin); 22 | } 23 | }//namespace glm 24 | 25 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/quaternion_trigonometric.inl: -------------------------------------------------------------------------------- 1 | #include "scalar_constants.hpp" 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER T angle(qua const& x) 7 | { 8 | if (abs(x.w) > cos_one_over_two()) 9 | { 10 | return asin(sqrt(x.x * x.x + x.y * x.y + x.z * x.z)) * static_cast(2); 11 | } 12 | 13 | return acos(x.w) * static_cast(2); 14 | } 15 | 16 | template 17 | GLM_FUNC_QUALIFIER vec<3, T, Q> axis(qua const& x) 18 | { 19 | T const tmp1 = static_cast(1) - x.w * x.w; 20 | if(tmp1 <= static_cast(0)) 21 | return vec<3, T, Q>(0, 0, 1); 22 | T const tmp2 = static_cast(1) / sqrt(tmp1); 23 | return vec<3, T, Q>(x.x * tmp2, x.y * tmp2, x.z * tmp2); 24 | } 25 | 26 | template 27 | GLM_FUNC_QUALIFIER qua angleAxis(T const& angle, vec<3, T, Q> const& v) 28 | { 29 | T const a(angle); 30 | T const s = glm::sin(a * static_cast(0.5)); 31 | 32 | return qua(glm::cos(a * static_cast(0.5)), v * s); 33 | } 34 | }//namespace glm 35 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/scalar_constants.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_scalar_constants 2 | /// @file glm/ext/scalar_constants.hpp 3 | /// 4 | /// @defgroup ext_scalar_constants GLM_EXT_scalar_constants 5 | /// @ingroup ext 6 | /// 7 | /// Provides a list of constants and precomputed useful values. 8 | /// 9 | /// Include to use the features of this extension. 10 | 11 | #pragma once 12 | 13 | // Dependencies 14 | #include "../detail/setup.hpp" 15 | 16 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 17 | # pragma message("GLM: GLM_EXT_scalar_constants extension included") 18 | #endif 19 | 20 | namespace glm 21 | { 22 | /// @addtogroup ext_scalar_constants 23 | /// @{ 24 | 25 | /// Return the epsilon constant for floating point types. 26 | template 27 | GLM_FUNC_DECL GLM_CONSTEXPR genType epsilon(); 28 | 29 | /// Return the pi constant for floating point types. 30 | template 31 | GLM_FUNC_DECL GLM_CONSTEXPR genType pi(); 32 | 33 | /// Return the value of cos(1 / 2) for floating point types. 34 | template 35 | GLM_FUNC_DECL GLM_CONSTEXPR genType cos_one_over_two(); 36 | 37 | /// @} 38 | } //namespace glm 39 | 40 | #include "scalar_constants.inl" 41 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/scalar_constants.inl: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType epsilon() 7 | { 8 | GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'epsilon' only accepts floating-point inputs"); 9 | return std::numeric_limits::epsilon(); 10 | } 11 | 12 | template 13 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType pi() 14 | { 15 | GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'pi' only accepts floating-point inputs"); 16 | return static_cast(3.14159265358979323846264338327950288); 17 | } 18 | 19 | template 20 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType cos_one_over_two() 21 | { 22 | return genType(0.877582561890372716130286068203503191); 23 | } 24 | } //namespace glm 25 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/scalar_int_sized.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_scalar_int_sized 2 | /// @file glm/ext/scalar_int_sized.hpp 3 | /// 4 | /// @defgroup ext_scalar_int_sized GLM_EXT_scalar_int_sized 5 | /// @ingroup ext 6 | /// 7 | /// Exposes sized signed integer scalar types. 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// @see ext_scalar_uint_sized 12 | 13 | #pragma once 14 | 15 | #include "../detail/setup.hpp" 16 | 17 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 18 | # pragma message("GLM: GLM_EXT_scalar_int_sized extension included") 19 | #endif 20 | 21 | namespace glm{ 22 | namespace detail 23 | { 24 | # if GLM_HAS_EXTENDED_INTEGER_TYPE 25 | typedef std::int8_t int8; 26 | typedef std::int16_t int16; 27 | typedef std::int32_t int32; 28 | # else 29 | typedef signed char int8; 30 | typedef signed short int16; 31 | typedef signed int int32; 32 | #endif// 33 | 34 | template<> 35 | struct is_int 36 | { 37 | enum test {value = ~0}; 38 | }; 39 | 40 | template<> 41 | struct is_int 42 | { 43 | enum test {value = ~0}; 44 | }; 45 | 46 | template<> 47 | struct is_int 48 | { 49 | enum test {value = ~0}; 50 | }; 51 | }//namespace detail 52 | 53 | 54 | /// @addtogroup ext_scalar_int_sized 55 | /// @{ 56 | 57 | /// 8 bit signed integer type. 58 | typedef detail::int8 int8; 59 | 60 | /// 16 bit signed integer type. 61 | typedef detail::int16 int16; 62 | 63 | /// 32 bit signed integer type. 64 | typedef detail::int32 int32; 65 | 66 | /// 64 bit signed integer type. 67 | typedef detail::int64 int64; 68 | 69 | /// @} 70 | }//namespace glm 71 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/scalar_relational.inl: -------------------------------------------------------------------------------- 1 | #include "../common.hpp" 2 | #include "../ext/scalar_int_sized.hpp" 3 | #include "../ext/scalar_uint_sized.hpp" 4 | #include "../detail/type_float.hpp" 5 | 6 | namespace glm 7 | { 8 | template 9 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool equal(genType const& x, genType const& y, genType const& epsilon) 10 | { 11 | return abs(x - y) <= epsilon; 12 | } 13 | 14 | template 15 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool notEqual(genType const& x, genType const& y, genType const& epsilon) 16 | { 17 | return abs(x - y) > epsilon; 18 | } 19 | 20 | template 21 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool equal(genType const& x, genType const& y, int MaxULPs) 22 | { 23 | detail::float_t const a(x); 24 | detail::float_t const b(y); 25 | 26 | // Different signs means they do not match. 27 | if(a.negative() != b.negative()) 28 | return false; 29 | 30 | // Find the difference in ULPs. 31 | typename detail::float_t::int_type const DiffULPs = abs(a.i - b.i); 32 | return DiffULPs <= MaxULPs; 33 | } 34 | 35 | template 36 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool notEqual(genType const& x, genType const& y, int ULPs) 37 | { 38 | return !equal(x, y, ULPs); 39 | } 40 | }//namespace glm 41 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_bool1.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_vector_bool1 2 | /// @file glm/ext/vector_bool1.hpp 3 | /// 4 | /// @defgroup ext_vector_bool1 GLM_EXT_vector_bool1 5 | /// @ingroup ext 6 | /// 7 | /// Exposes bvec1 vector type. 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// @see ext_vector_bool1_precision extension. 12 | 13 | #pragma once 14 | 15 | #include "../detail/type_vec1.hpp" 16 | 17 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 18 | # pragma message("GLM: GLM_EXT_vector_bool1 extension included") 19 | #endif 20 | 21 | namespace glm 22 | { 23 | /// @addtogroup ext_vector_bool1 24 | /// @{ 25 | 26 | /// 1 components vector of boolean. 27 | typedef vec<1, bool, defaultp> bvec1; 28 | 29 | /// @} 30 | }//namespace glm 31 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_bool1_precision.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_vector_bool1_precision 2 | /// @file glm/ext/vector_bool1_precision.hpp 3 | /// 4 | /// @defgroup ext_vector_bool1_precision GLM_EXT_vector_bool1_precision 5 | /// @ingroup ext 6 | /// 7 | /// Exposes highp_bvec1, mediump_bvec1 and lowp_bvec1 types. 8 | /// 9 | /// Include to use the features of this extension. 10 | 11 | #pragma once 12 | 13 | #include "../detail/type_vec1.hpp" 14 | 15 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 16 | # pragma message("GLM: GLM_EXT_vector_bool1_precision extension included") 17 | #endif 18 | 19 | namespace glm 20 | { 21 | /// @addtogroup ext_vector_bool1_precision 22 | /// @{ 23 | 24 | /// 1 component vector of bool values. 25 | typedef vec<1, bool, highp> highp_bvec1; 26 | 27 | /// 1 component vector of bool values. 28 | typedef vec<1, bool, mediump> mediump_bvec1; 29 | 30 | /// 1 component vector of bool values. 31 | typedef vec<1, bool, lowp> lowp_bvec1; 32 | 33 | /// @} 34 | }//namespace glm 35 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_bool2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_bool2.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec2.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 2 components vector of boolean. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<2, bool, defaultp> bvec2; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_bool2_precision.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_bool2_precision.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec2.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector_precision 10 | /// @{ 11 | 12 | /// 2 components vector of high qualifier bool numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 16 | typedef vec<2, bool, highp> highp_bvec2; 17 | 18 | /// 2 components vector of medium qualifier bool numbers. 19 | /// 20 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 21 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 22 | typedef vec<2, bool, mediump> mediump_bvec2; 23 | 24 | /// 2 components vector of low qualifier bool numbers. 25 | /// 26 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 27 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 28 | typedef vec<2, bool, lowp> lowp_bvec2; 29 | 30 | /// @} 31 | }//namespace glm 32 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_bool3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_bool3.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec3.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 3 components vector of boolean. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<3, bool, defaultp> bvec3; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_bool3_precision.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_bool3_precision.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec3.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector_precision 10 | /// @{ 11 | 12 | /// 3 components vector of high qualifier bool numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 16 | typedef vec<3, bool, highp> highp_bvec3; 17 | 18 | /// 3 components vector of medium qualifier bool numbers. 19 | /// 20 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 21 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 22 | typedef vec<3, bool, mediump> mediump_bvec3; 23 | 24 | /// 3 components vector of low qualifier bool numbers. 25 | /// 26 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 27 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 28 | typedef vec<3, bool, lowp> lowp_bvec3; 29 | 30 | /// @} 31 | }//namespace glm 32 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_bool4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_bool4.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec4.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 4 components vector of boolean. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<4, bool, defaultp> bvec4; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_bool4_precision.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_bool4_precision.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec4.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector_precision 10 | /// @{ 11 | 12 | /// 4 components vector of high qualifier bool numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 16 | typedef vec<4, bool, highp> highp_bvec4; 17 | 18 | /// 4 components vector of medium qualifier bool numbers. 19 | /// 20 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 21 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 22 | typedef vec<4, bool, mediump> mediump_bvec4; 23 | 24 | /// 4 components vector of low qualifier bool numbers. 25 | /// 26 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 27 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 28 | typedef vec<4, bool, lowp> lowp_bvec4; 29 | 30 | /// @} 31 | }//namespace glm 32 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_double1.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_vector_double1 2 | /// @file glm/ext/vector_double1.hpp 3 | /// 4 | /// @defgroup ext_vector_double1 GLM_EXT_vector_double1 5 | /// @ingroup ext 6 | /// 7 | /// Exposes double-precision floating point vector type with one component. 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// @see ext_vector_double1_precision extension. 12 | /// @see ext_vector_float1 extension. 13 | 14 | #pragma once 15 | 16 | #include "../detail/type_vec1.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_EXT_vector_double1 extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup ext_vector_double1 25 | /// @{ 26 | 27 | /// 1 components vector of double-precision floating-point numbers. 28 | typedef vec<1, double, defaultp> dvec1; 29 | 30 | /// @} 31 | }//namespace glm 32 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_double1_precision.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_vector_double1_precision 2 | /// @file glm/ext/vector_double1_precision.hpp 3 | /// 4 | /// @defgroup ext_vector_double1_precision GLM_EXT_vector_double1_precision 5 | /// @ingroup ext 6 | /// 7 | /// Exposes highp_dvec1, mediump_dvec1 and lowp_dvec1 types. 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// @see ext_vector_double1 12 | 13 | #pragma once 14 | 15 | #include "../detail/type_vec1.hpp" 16 | 17 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 18 | # pragma message("GLM: GLM_EXT_vector_double1_precision extension included") 19 | #endif 20 | 21 | namespace glm 22 | { 23 | /// @addtogroup ext_vector_double1_precision 24 | /// @{ 25 | 26 | /// 1 component vector of double-precision floating-point numbers using high precision arithmetic in term of ULPs. 27 | typedef vec<1, double, highp> highp_dvec1; 28 | 29 | /// 1 component vector of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. 30 | typedef vec<1, double, mediump> mediump_dvec1; 31 | 32 | /// 1 component vector of double-precision floating-point numbers using low precision arithmetic in term of ULPs. 33 | typedef vec<1, double, lowp> lowp_dvec1; 34 | 35 | /// @} 36 | }//namespace glm 37 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_double2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_double2.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec2.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 2 components vector of double-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<2, double, defaultp> dvec2; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_double2_precision.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_double2_precision.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec2.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector_precision 10 | /// @{ 11 | 12 | /// 2 components vector of high double-qualifier floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 16 | typedef vec<2, double, highp> highp_dvec2; 17 | 18 | /// 2 components vector of medium double-qualifier floating-point numbers. 19 | /// 20 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 21 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 22 | typedef vec<2, double, mediump> mediump_dvec2; 23 | 24 | /// 2 components vector of low double-qualifier floating-point numbers. 25 | /// 26 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 27 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 28 | typedef vec<2, double, lowp> lowp_dvec2; 29 | 30 | /// @} 31 | }//namespace glm 32 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_double3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_double3.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec3.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 3 components vector of double-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<3, double, defaultp> dvec3; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_double4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_double4.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec4.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 4 components vector of double-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<4, double, defaultp> dvec4; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_float1.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_vector_float1 2 | /// @file glm/ext/vector_float1.hpp 3 | /// 4 | /// @defgroup ext_vector_float1 GLM_EXT_vector_float1 5 | /// @ingroup ext 6 | /// 7 | /// Exposes single-precision floating point vector type with one component. 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// @see ext_vector_float1_precision extension. 12 | /// @see ext_vector_double1 extension. 13 | 14 | #pragma once 15 | 16 | #include "../detail/type_vec1.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_EXT_vector_float1 extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup ext_vector_float1 25 | /// @{ 26 | 27 | /// 1 components vector of single-precision floating-point numbers. 28 | typedef vec<1, float, defaultp> vec1; 29 | 30 | /// @} 31 | }//namespace glm 32 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_float1_precision.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_vector_float1_precision 2 | /// @file glm/ext/vector_float1_precision.hpp 3 | /// 4 | /// @defgroup ext_vector_float1_precision GLM_EXT_vector_float1_precision 5 | /// @ingroup ext 6 | /// 7 | /// Exposes highp_vec1, mediump_vec1 and lowp_vec1 types. 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// @see ext_vector_float1 extension. 12 | 13 | #pragma once 14 | 15 | #include "../detail/type_vec1.hpp" 16 | 17 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 18 | # pragma message("GLM: GLM_EXT_vector_float1_precision extension included") 19 | #endif 20 | 21 | namespace glm 22 | { 23 | /// @addtogroup ext_vector_float1_precision 24 | /// @{ 25 | 26 | /// 1 component vector of single-precision floating-point numbers using high precision arithmetic in term of ULPs. 27 | typedef vec<1, float, highp> highp_vec1; 28 | 29 | /// 1 component vector of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. 30 | typedef vec<1, float, mediump> mediump_vec1; 31 | 32 | /// 1 component vector of single-precision floating-point numbers using low precision arithmetic in term of ULPs. 33 | typedef vec<1, float, lowp> lowp_vec1; 34 | 35 | /// @} 36 | }//namespace glm 37 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_float2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_float2.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec2.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 2 components vector of single-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<2, float, defaultp> vec2; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_float2_precision.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_float2_precision.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec2.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector_precision 10 | /// @{ 11 | 12 | /// 2 components vector of high single-qualifier floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 16 | typedef vec<2, float, highp> highp_vec2; 17 | 18 | /// 2 components vector of medium single-qualifier floating-point numbers. 19 | /// 20 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 21 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 22 | typedef vec<2, float, mediump> mediump_vec2; 23 | 24 | /// 2 components vector of low single-qualifier floating-point numbers. 25 | /// 26 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 27 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 28 | typedef vec<2, float, lowp> lowp_vec2; 29 | 30 | /// @} 31 | }//namespace glm 32 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_float3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_float3.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec3.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 3 components vector of single-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<3, float, defaultp> vec3; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_float3_precision.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_float3_precision.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec3.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector_precision 10 | /// @{ 11 | 12 | /// 3 components vector of high single-qualifier floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 16 | typedef vec<3, float, highp> highp_vec3; 17 | 18 | /// 3 components vector of medium single-qualifier floating-point numbers. 19 | /// 20 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 21 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 22 | typedef vec<3, float, mediump> mediump_vec3; 23 | 24 | /// 3 components vector of low single-qualifier floating-point numbers. 25 | /// 26 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 27 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 28 | typedef vec<3, float, lowp> lowp_vec3; 29 | 30 | /// @} 31 | }//namespace glm 32 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_float4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_float4.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec4.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 4 components vector of single-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<4, float, defaultp> vec4; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_float4_precision.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_float4_precision.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec4.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector_precision 10 | /// @{ 11 | 12 | /// 4 components vector of high single-qualifier floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 16 | typedef vec<4, float, highp> highp_vec4; 17 | 18 | /// 4 components vector of medium single-qualifier floating-point numbers. 19 | /// 20 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 21 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 22 | typedef vec<4, float, mediump> mediump_vec4; 23 | 24 | /// 4 components vector of low single-qualifier floating-point numbers. 25 | /// 26 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 27 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 28 | typedef vec<4, float, lowp> lowp_vec4; 29 | 30 | /// @} 31 | }//namespace glm 32 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_int1.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_vector_int1 2 | /// @file glm/ext/vector_int1.hpp 3 | /// 4 | /// @defgroup ext_vector_int1 GLM_EXT_vector_int1 5 | /// @ingroup ext 6 | /// 7 | /// Exposes ivec1 vector type. 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// @see ext_vector_uint1 extension. 12 | /// @see ext_vector_int1_precision extension. 13 | 14 | #pragma once 15 | 16 | #include "../detail/type_vec1.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_EXT_vector_int1 extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup ext_vector_int1 25 | /// @{ 26 | 27 | /// 1 component vector of signed integer numbers. 28 | typedef vec<1, int, defaultp> ivec1; 29 | 30 | /// @} 31 | }//namespace glm 32 | 33 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_int1_precision.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_vector_int1_precision 2 | /// @file glm/ext/vector_int1_precision.hpp 3 | /// 4 | /// @defgroup ext_vector_int1_precision GLM_EXT_vector_int1_precision 5 | /// @ingroup ext 6 | /// 7 | /// Exposes highp_ivec1, mediump_ivec1 and lowp_ivec1 types. 8 | /// 9 | /// Include to use the features of this extension. 10 | 11 | #pragma once 12 | 13 | #include "../detail/type_vec1.hpp" 14 | 15 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 16 | # pragma message("GLM: GLM_EXT_vector_int1_precision extension included") 17 | #endif 18 | 19 | namespace glm 20 | { 21 | /// @addtogroup ext_vector_int1_precision 22 | /// @{ 23 | 24 | /// 1 component vector of signed integer values. 25 | typedef vec<1, int, highp> highp_ivec1; 26 | 27 | /// 1 component vector of signed integer values. 28 | typedef vec<1, int, mediump> mediump_ivec1; 29 | 30 | /// 1 component vector of signed integer values. 31 | typedef vec<1, int, lowp> lowp_ivec1; 32 | 33 | /// @} 34 | }//namespace glm 35 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_int2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_int2.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec2.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 2 components vector of signed integer numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<2, int, defaultp> ivec2; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_int2_precision.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_int2_precision.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec2.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector_precision 10 | /// @{ 11 | 12 | /// 2 components vector of high qualifier signed integer numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 16 | typedef vec<2, int, highp> highp_ivec2; 17 | 18 | /// 2 components vector of medium qualifier signed integer numbers. 19 | /// 20 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 21 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 22 | typedef vec<2, int, mediump> mediump_ivec2; 23 | 24 | /// 2 components vector of low qualifier signed integer numbers. 25 | /// 26 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 27 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 28 | typedef vec<2, int, lowp> lowp_ivec2; 29 | 30 | /// @} 31 | }//namespace glm 32 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_int3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_int3.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec3.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 3 components vector of signed integer numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<3, int, defaultp> ivec3; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_int3_precision.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_int3_precision.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec3.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector_precision 10 | /// @{ 11 | 12 | /// 3 components vector of high qualifier signed integer numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 16 | typedef vec<3, int, highp> highp_ivec3; 17 | 18 | /// 3 components vector of medium qualifier signed integer numbers. 19 | /// 20 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 21 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 22 | typedef vec<3, int, mediump> mediump_ivec3; 23 | 24 | /// 3 components vector of low qualifier signed integer numbers. 25 | /// 26 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 27 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 28 | typedef vec<3, int, lowp> lowp_ivec3; 29 | 30 | /// @} 31 | }//namespace glm 32 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_int4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_int4.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec4.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 4 components vector of signed integer numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<4, int, defaultp> ivec4; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_int4_precision.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_int4_precision.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec4.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector_precision 10 | /// @{ 11 | 12 | /// 4 components vector of high qualifier signed integer numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 16 | typedef vec<4, int, highp> highp_ivec4; 17 | 18 | /// 4 components vector of medium qualifier signed integer numbers. 19 | /// 20 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 21 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 22 | typedef vec<4, int, mediump> mediump_ivec4; 23 | 24 | /// 4 components vector of low qualifier signed integer numbers. 25 | /// 26 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 27 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 28 | typedef vec<4, int, lowp> lowp_ivec4; 29 | 30 | /// @} 31 | }//namespace glm 32 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_uint1.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_vector_uint1 2 | /// @file glm/ext/vector_uint1.hpp 3 | /// 4 | /// @defgroup ext_vector_uint1 GLM_EXT_vector_uint1 5 | /// @ingroup ext 6 | /// 7 | /// Exposes uvec1 vector type. 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// @see ext_vector_int1 extension. 12 | /// @see ext_vector_uint1_precision extension. 13 | 14 | #pragma once 15 | 16 | #include "../detail/type_vec1.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_EXT_vector_uint1 extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup ext_vector_uint1 25 | /// @{ 26 | 27 | /// 1 component vector of unsigned integer numbers. 28 | typedef vec<1, unsigned int, defaultp> uvec1; 29 | 30 | /// @} 31 | }//namespace glm 32 | 33 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_uint1_precision.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_vector_uint1_precision 2 | /// @file glm/ext/vector_uint1_precision.hpp 3 | /// 4 | /// @defgroup ext_vector_uint1_precision GLM_EXT_vector_uint1_precision 5 | /// @ingroup ext 6 | /// 7 | /// Exposes highp_uvec1, mediump_uvec1 and lowp_uvec1 types. 8 | /// 9 | /// Include to use the features of this extension. 10 | 11 | #pragma once 12 | 13 | #include "../detail/type_vec1.hpp" 14 | 15 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 16 | # pragma message("GLM: GLM_EXT_vector_uint1_precision extension included") 17 | #endif 18 | 19 | namespace glm 20 | { 21 | /// @addtogroup ext_vector_uint1_precision 22 | /// @{ 23 | 24 | /// 1 component vector of unsigned integer values. 25 | /// 26 | /// @see ext_vector_uint1_precision 27 | typedef vec<1, unsigned int, highp> highp_uvec1; 28 | 29 | /// 1 component vector of unsigned integer values. 30 | /// 31 | /// @see ext_vector_uint1_precision 32 | typedef vec<1, unsigned int, mediump> mediump_uvec1; 33 | 34 | /// 1 component vector of unsigned integer values. 35 | /// 36 | /// @see ext_vector_uint1_precision 37 | typedef vec<1, unsigned int, lowp> lowp_uvec1; 38 | 39 | /// @} 40 | }//namespace glm 41 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_uint2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_uint2.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec2.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 2 components vector of unsigned integer numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<2, unsigned int, defaultp> uvec2; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_uint2_precision.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_uint2_precision.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec2.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector_precision 10 | /// @{ 11 | 12 | /// 2 components vector of high qualifier unsigned integer numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 16 | typedef vec<2, unsigned int, highp> highp_uvec2; 17 | 18 | /// 2 components vector of medium qualifier unsigned integer numbers. 19 | /// 20 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 21 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 22 | typedef vec<2, unsigned int, mediump> mediump_uvec2; 23 | 24 | /// 2 components vector of low qualifier unsigned integer numbers. 25 | /// 26 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 27 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 28 | typedef vec<2, unsigned int, lowp> lowp_uvec2; 29 | 30 | /// @} 31 | }//namespace glm 32 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_uint3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_uint3.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec3.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 3 components vector of unsigned integer numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<3, unsigned int, defaultp> uvec3; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_uint3_precision.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_uint3_precision.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec3.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector_precision 10 | /// @{ 11 | 12 | /// 3 components vector of high qualifier unsigned integer numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 16 | typedef vec<3, unsigned int, highp> highp_uvec3; 17 | 18 | /// 3 components vector of medium qualifier unsigned integer numbers. 19 | /// 20 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 21 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 22 | typedef vec<3, unsigned int, mediump> mediump_uvec3; 23 | 24 | /// 3 components vector of low qualifier unsigned integer numbers. 25 | /// 26 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 27 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 28 | typedef vec<3, unsigned int, lowp> lowp_uvec3; 29 | 30 | /// @} 31 | }//namespace glm 32 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_uint4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_uint4.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec4.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 4 components vector of unsigned integer numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<4, unsigned int, defaultp> uvec4; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/ext/vector_uint4_precision.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_uint4_precision.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec4.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector_precision 10 | /// @{ 11 | 12 | /// 4 components vector of high qualifier unsigned integer numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 16 | typedef vec<4, unsigned int, highp> highp_uvec4; 17 | 18 | /// 4 components vector of medium qualifier unsigned integer numbers. 19 | /// 20 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 21 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 22 | typedef vec<4, unsigned int, mediump> mediump_uvec4; 23 | 24 | /// 4 components vector of low qualifier unsigned integer numbers. 25 | /// 26 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 27 | /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier 28 | typedef vec<4, unsigned int, lowp> lowp_uvec4; 29 | 30 | /// @} 31 | }//namespace glm 32 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/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_ENABLE && !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 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtc/matrix_access.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtc_matrix_access 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER genType row 7 | ( 8 | genType const& m, 9 | length_t index, 10 | typename genType::row_type const& x 11 | ) 12 | { 13 | assert(index >= 0 && index < m[0].length()); 14 | 15 | genType Result = m; 16 | for(length_t i = 0; i < m.length(); ++i) 17 | Result[i][index] = x[i]; 18 | return Result; 19 | } 20 | 21 | template 22 | GLM_FUNC_QUALIFIER typename genType::row_type row 23 | ( 24 | genType const& m, 25 | length_t index 26 | ) 27 | { 28 | assert(index >= 0 && index < m[0].length()); 29 | 30 | typename genType::row_type Result(0); 31 | for(length_t i = 0; i < m.length(); ++i) 32 | Result[i] = m[i][index]; 33 | return Result; 34 | } 35 | 36 | template 37 | GLM_FUNC_QUALIFIER genType column 38 | ( 39 | genType const& m, 40 | length_t index, 41 | typename genType::col_type const& x 42 | ) 43 | { 44 | assert(index >= 0 && index < m.length()); 45 | 46 | genType Result = m; 47 | Result[index] = x; 48 | return Result; 49 | } 50 | 51 | template 52 | GLM_FUNC_QUALIFIER typename genType::col_type column 53 | ( 54 | genType const& m, 55 | length_t index 56 | ) 57 | { 58 | assert(index >= 0 && index < m.length()); 59 | 60 | return m[index]; 61 | } 62 | }//namespace glm 63 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtc/matrix_transform.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtc_matrix_transform 2 | /// @file glm/gtc/matrix_transform.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtx_transform 6 | /// @see gtx_transform2 7 | /// 8 | /// @defgroup gtc_matrix_transform GLM_GTC_matrix_transform 9 | /// @ingroup gtc 10 | /// 11 | /// Include to use the features of this extension. 12 | /// 13 | /// Defines functions that generate common transformation matrices. 14 | /// 15 | /// The matrices generated by this extension use standard OpenGL fixed-function 16 | /// conventions. For example, the lookAt function generates a transform from world 17 | /// space into the specific eye space that the projective matrix functions 18 | /// (perspective, ortho, etc) are designed to expect. The OpenGL compatibility 19 | /// specifications defines the particular layout of this eye space. 20 | 21 | #pragma once 22 | 23 | // Dependencies 24 | #include "../mat4x4.hpp" 25 | #include "../vec2.hpp" 26 | #include "../vec3.hpp" 27 | #include "../vec4.hpp" 28 | #include "../ext/matrix_projection.hpp" 29 | #include "../ext/matrix_clip_space.hpp" 30 | #include "../ext/matrix_transform.hpp" 31 | 32 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 33 | # pragma message("GLM: GLM_GTC_matrix_transform extension included") 34 | #endif 35 | 36 | #include "matrix_transform.inl" 37 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtc/matrix_transform.inl: -------------------------------------------------------------------------------- 1 | #include "../geometric.hpp" 2 | #include "../trigonometric.hpp" 3 | #include "../matrix.hpp" 4 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtc/quaternion_simd.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ActivePeter/VoxelFrame/4399b8238b2af027ec2942a5846f43f790243878/CppClient/third/glm/include/glm/gtc/quaternion_simd.inl -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtc/type_precision.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtc_precision 2 | 3 | namespace glm 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/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/vector_bool1.hpp" 17 | #include "../ext/vector_bool1_precision.hpp" 18 | #include "../ext/vector_float1.hpp" 19 | #include "../ext/vector_float1_precision.hpp" 20 | #include "../ext/vector_double1.hpp" 21 | #include "../ext/vector_double1_precision.hpp" 22 | #include "../ext/vector_int1.hpp" 23 | #include "../ext/vector_int1_precision.hpp" 24 | #include "../ext/vector_uint1.hpp" 25 | #include "../ext/vector_uint1_precision.hpp" 26 | 27 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 28 | # pragma message("GLM: GLM_GTC_vec1 extension included") 29 | #endif 30 | 31 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/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 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 19 | # ifndef GLM_ENABLE_EXPERIMENTAL 20 | # pragma message("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.") 21 | # else 22 | # pragma message("GLM: GLM_GTX_closest_point extension included") 23 | # endif 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 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/closest_point.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_closest_point 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER vec<3, T, Q> closestPointOnLine 7 | ( 8 | vec<3, T, Q> const& point, 9 | vec<3, T, Q> const& a, 10 | vec<3, T, Q> const& b 11 | ) 12 | { 13 | T LineLength = distance(a, b); 14 | vec<3, T, Q> Vector = point - a; 15 | vec<3, T, Q> LineDirection = (b - a) / LineLength; 16 | 17 | // Project Vector to LineDirection to get the distance of point from a 18 | T Distance = dot(Vector, LineDirection); 19 | 20 | if(Distance <= T(0)) return a; 21 | if(Distance >= LineLength) return b; 22 | return a + LineDirection * Distance; 23 | } 24 | 25 | template 26 | GLM_FUNC_QUALIFIER vec<2, T, Q> closestPointOnLine 27 | ( 28 | vec<2, T, Q> const& point, 29 | vec<2, T, Q> const& a, 30 | vec<2, T, Q> const& b 31 | ) 32 | { 33 | T LineLength = distance(a, b); 34 | vec<2, T, Q> Vector = point - a; 35 | vec<2, T, Q> LineDirection = (b - a) / LineLength; 36 | 37 | // Project Vector to LineDirection to get the distance of point from a 38 | T Distance = dot(Vector, LineDirection); 39 | 40 | if(Distance <= T(0)) return a; 41 | if(Distance >= LineLength) return b; 42 | return a + LineDirection * Distance; 43 | } 44 | 45 | }//namespace glm 46 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/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 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 19 | # ifndef GLM_ENABLE_EXPERIMENTAL 20 | # pragma message("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.") 21 | # else 22 | # pragma message("GLM: GLM_GTX_extend extension included") 23 | # endif 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 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/extend.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_extend 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER genType extend 7 | ( 8 | genType const& Origin, 9 | genType const& Source, 10 | genType const& Distance 11 | ) 12 | { 13 | return Origin + (Source - Origin) * Distance; 14 | } 15 | 16 | template 17 | GLM_FUNC_QUALIFIER vec<2, T, Q> extend 18 | ( 19 | vec<2, T, Q> const& Origin, 20 | vec<2, T, Q> const& Source, 21 | T const& Distance 22 | ) 23 | { 24 | return Origin + (Source - Origin) * Distance; 25 | } 26 | 27 | template 28 | GLM_FUNC_QUALIFIER vec<3, T, Q> extend 29 | ( 30 | vec<3, T, Q> const& Origin, 31 | vec<3, T, Q> const& Source, 32 | T const& Distance 33 | ) 34 | { 35 | return Origin + (Source - Origin) * Distance; 36 | } 37 | 38 | template 39 | GLM_FUNC_QUALIFIER vec<4, T, Q> extend 40 | ( 41 | vec<4, T, Q> const& Origin, 42 | vec<4, T, Q> const& Source, 43 | T const& Distance 44 | ) 45 | { 46 | return Origin + (Source - Origin) * Distance; 47 | } 48 | }//namespace glm 49 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/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_ENABLE && !defined(GLM_EXT_INCLUDED) 21 | # ifndef GLM_ENABLE_EXPERIMENTAL 22 | # pragma message("GLM: GLM_GTX_exterior_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.") 23 | # else 24 | # pragma message("GLM: GLM_GTX_exterior_product extension included") 25 | # endif 26 | #endif 27 | 28 | namespace glm 29 | { 30 | /// @addtogroup gtx_exterior_product 31 | /// @{ 32 | 33 | /// Returns the cross product of x and y. 34 | /// 35 | /// @tparam T Floating-point scalar types 36 | /// @tparam Q Value from qualifier enum 37 | /// 38 | /// @see Exterior product 39 | template 40 | GLM_FUNC_DECL T cross(vec<2, T, Q> const& v, vec<2, T, Q> const& u); 41 | 42 | /// @} 43 | } //namespace glm 44 | 45 | #include "exterior_product.inl" 46 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/exterior_product.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_exterior_product 2 | 3 | #include 4 | 5 | namespace glm { 6 | namespace detail 7 | { 8 | template 9 | struct compute_cross_vec2 10 | { 11 | GLM_FUNC_QUALIFIER static T call(vec<2, T, Q> const& v, vec<2, T, Q> const& u) 12 | { 13 | GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'cross' accepts only floating-point inputs"); 14 | 15 | return v.x * u.y - u.x * v.y; 16 | } 17 | }; 18 | }//namespace detail 19 | 20 | template 21 | GLM_FUNC_QUALIFIER T cross(vec<2, T, Q> const& x, vec<2, T, Q> const& y) 22 | { 23 | return detail::compute_cross_vec2::value>::call(x, y); 24 | } 25 | }//namespace glm 26 | 27 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/float_notmalize.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_float_normalize 2 | 3 | #include 4 | 5 | namespace glm 6 | { 7 | template 8 | GLM_FUNC_QUALIFIER vec floatNormalize(vec const& v) 9 | { 10 | return vec(v) / static_cast(std::numeric_limits::max()); 11 | } 12 | 13 | }//namespace glm 14 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/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_ENABLE && !defined(GLM_EXT_INCLUDED) 22 | # ifndef GLM_ENABLE_EXPERIMENTAL 23 | # pragma message("GLM: GLM_GTX_functions 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.") 24 | # else 25 | # pragma message("GLM: GLM_GTX_functions extension included") 26 | # endif 27 | #endif 28 | 29 | namespace glm 30 | { 31 | /// @addtogroup gtx_functions 32 | /// @{ 33 | 34 | /// 1D gauss function 35 | /// 36 | /// @see gtc_epsilon 37 | template 38 | GLM_FUNC_DECL T gauss( 39 | T x, 40 | T ExpectedValue, 41 | T StandardDeviation); 42 | 43 | /// 2D gauss function 44 | /// 45 | /// @see gtc_epsilon 46 | template 47 | GLM_FUNC_DECL T gauss( 48 | vec<2, T, Q> const& Coord, 49 | vec<2, T, Q> const& ExpectedValue, 50 | vec<2, T, Q> const& StandardDeviation); 51 | 52 | /// @} 53 | }//namespace glm 54 | 55 | #include "functions.inl" 56 | 57 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/functions.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_functions 2 | 3 | #include "../exponential.hpp" 4 | 5 | namespace glm 6 | { 7 | template 8 | GLM_FUNC_QUALIFIER T gauss 9 | ( 10 | T x, 11 | T ExpectedValue, 12 | T StandardDeviation 13 | ) 14 | { 15 | return exp(-((x - ExpectedValue) * (x - ExpectedValue)) / (static_cast(2) * StandardDeviation * StandardDeviation)) / (StandardDeviation * sqrt(static_cast(6.28318530717958647692528676655900576))); 16 | } 17 | 18 | template 19 | GLM_FUNC_QUALIFIER T gauss 20 | ( 21 | vec<2, T, Q> const& Coord, 22 | vec<2, T, Q> const& ExpectedValue, 23 | vec<2, T, Q> const& StandardDeviation 24 | ) 25 | { 26 | vec<2, T, Q> const Squared = ((Coord - ExpectedValue) * (Coord - ExpectedValue)) / (static_cast(2) * StandardDeviation * StandardDeviation); 27 | return exp(-(Squared.x + Squared.y)); 28 | } 29 | }//namespace glm 30 | 31 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/gradient_paint.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_gradient_paint 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER T radialGradient 7 | ( 8 | vec<2, T, Q> const& Center, 9 | T const& Radius, 10 | vec<2, T, Q> const& Focal, 11 | vec<2, T, Q> const& Position 12 | ) 13 | { 14 | vec<2, T, Q> F = Focal - Center; 15 | vec<2, T, Q> D = Position - Focal; 16 | T Radius2 = pow2(Radius); 17 | T Fx2 = pow2(F.x); 18 | T Fy2 = pow2(F.y); 19 | 20 | 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)); 21 | T Denominator = Radius2 - (Fx2 + Fy2); 22 | return Numerator / Denominator; 23 | } 24 | 25 | template 26 | GLM_FUNC_QUALIFIER T linearGradient 27 | ( 28 | vec<2, T, Q> const& Point0, 29 | vec<2, T, Q> const& Point1, 30 | vec<2, T, Q> const& Position 31 | ) 32 | { 33 | vec<2, T, Q> Dist = Point1 - Point0; 34 | return (Dist.x * (Position.x - Point0.x) + Dist.y * (Position.y - Point0.y)) / glm::dot(Dist, Dist); 35 | } 36 | }//namespace glm 37 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/handed_coordinate_space.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_handed_coordinate_space 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER bool rightHanded 7 | ( 8 | vec<3, T, Q> const& tangent, 9 | vec<3, T, Q> const& binormal, 10 | vec<3, T, Q> const& normal 11 | ) 12 | { 13 | return dot(cross(normal, tangent), binormal) > T(0); 14 | } 15 | 16 | template 17 | GLM_FUNC_QUALIFIER bool leftHanded 18 | ( 19 | vec<3, T, Q> const& tangent, 20 | vec<3, T, Q> const& binormal, 21 | vec<3, T, Q> const& normal 22 | ) 23 | { 24 | return dot(cross(normal, tangent), binormal) < T(0); 25 | } 26 | }//namespace glm 27 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/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 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 19 | # ifndef GLM_ENABLE_EXPERIMENTAL 20 | # pragma message("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.") 21 | # else 22 | # pragma message("GLM: GLM_GTX_log_base extension included") 23 | # endif 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 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/log_base.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_log_base 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER genType log(genType const& x, genType const& base) 7 | { 8 | return glm::log(x) / glm::log(base); 9 | } 10 | 11 | template 12 | GLM_FUNC_QUALIFIER vec log(vec const& x, vec const& base) 13 | { 14 | return glm::log(x) / glm::log(base); 15 | } 16 | }//namespace glm 17 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/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 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 20 | # ifndef GLM_ENABLE_EXPERIMENTAL 21 | # pragma message("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.") 22 | # else 23 | # pragma message("GLM: GLM_GTX_matrix_cross_product extension included") 24 | # endif 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 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/matrix_cross_product.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_matrix_cross_product 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER mat<3, 3, T, Q> matrixCross3 7 | ( 8 | vec<3, T, Q> const& x 9 | ) 10 | { 11 | mat<3, 3, T, Q> Result(T(0)); 12 | Result[0][1] = x.z; 13 | Result[1][0] = -x.z; 14 | Result[0][2] = -x.y; 15 | Result[2][0] = x.y; 16 | Result[1][2] = x.x; 17 | Result[2][1] = -x.x; 18 | return Result; 19 | } 20 | 21 | template 22 | GLM_FUNC_QUALIFIER mat<4, 4, T, Q> matrixCross4 23 | ( 24 | vec<3, T, Q> const& x 25 | ) 26 | { 27 | mat<4, 4, T, Q> Result(T(0)); 28 | Result[0][1] = x.z; 29 | Result[1][0] = -x.z; 30 | Result[0][2] = -x.y; 31 | Result[2][0] = x.y; 32 | Result[1][2] = x.x; 33 | Result[2][1] = -x.x; 34 | return Result; 35 | } 36 | 37 | }//namespace glm 38 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/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 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 24 | # ifndef GLM_ENABLE_EXPERIMENTAL 25 | # pragma message("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.") 26 | # else 27 | # pragma message("GLM: GLM_GTX_matrix_decompose extension included") 28 | # endif 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, qua & orientation, vec<3, T, Q> & translation, vec<3, T, Q> & skew, vec<4, T, Q> & perspective); 42 | 43 | /// @} 44 | }//namespace glm 45 | 46 | #include "matrix_decompose.inl" 47 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/matrix_factorisation.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ActivePeter/VoxelFrame/4399b8238b2af027ec2942a5846f43f790243878/CppClient/third/glm/include/glm/gtx/matrix_factorisation.inl -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/matrix_transform_2d.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_matrix_transform_2d 2 | /// @author Miguel Ángel Pérez Martínez 3 | 4 | #include "../trigonometric.hpp" 5 | 6 | namespace glm 7 | { 8 | 9 | template 10 | GLM_FUNC_QUALIFIER mat<3, 3, T, Q> translate( 11 | mat<3, 3, T, Q> const& m, 12 | vec<2, T, Q> const& v) 13 | { 14 | mat<3, 3, T, Q> Result(m); 15 | Result[2] = m[0] * v[0] + m[1] * v[1] + m[2]; 16 | return Result; 17 | } 18 | 19 | 20 | template 21 | GLM_FUNC_QUALIFIER mat<3, 3, T, Q> rotate( 22 | mat<3, 3, T, Q> const& m, 23 | T angle) 24 | { 25 | T const a = angle; 26 | T const c = cos(a); 27 | T const s = sin(a); 28 | 29 | mat<3, 3, T, Q> Result; 30 | Result[0] = m[0] * c + m[1] * s; 31 | Result[1] = m[0] * -s + m[1] * c; 32 | Result[2] = m[2]; 33 | return Result; 34 | } 35 | 36 | template 37 | GLM_FUNC_QUALIFIER mat<3, 3, T, Q> scale( 38 | mat<3, 3, T, Q> const& m, 39 | vec<2, T, Q> const& v) 40 | { 41 | mat<3, 3, T, Q> Result; 42 | Result[0] = m[0] * v[0]; 43 | Result[1] = m[1] * v[1]; 44 | Result[2] = m[2]; 45 | return Result; 46 | } 47 | 48 | template 49 | GLM_FUNC_QUALIFIER mat<3, 3, T, Q> shearX( 50 | mat<3, 3, T, Q> const& m, 51 | T y) 52 | { 53 | mat<3, 3, T, Q> Result(1); 54 | Result[0][1] = y; 55 | return m * Result; 56 | } 57 | 58 | template 59 | GLM_FUNC_QUALIFIER mat<3, 3, T, Q> shearY( 60 | mat<3, 3, T, Q> const& m, 61 | T x) 62 | { 63 | mat<3, 3, T, Q> Result(1); 64 | Result[1][0] = x; 65 | return m * Result; 66 | } 67 | 68 | }//namespace glm 69 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/mixed_product.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_mixed_product 2 | /// @file glm/gtx/mixed_product.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_mixed_product GLM_GTX_mixed_producte 7 | /// @ingroup gtx 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// Mixed product of 3 vectors. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 19 | # ifndef GLM_ENABLE_EXPERIMENTAL 20 | # pragma message("GLM: GLM_GTX_mixed_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 | # else 22 | # pragma message("GLM: GLM_GTX_mixed_product extension included") 23 | # endif 24 | #endif 25 | 26 | namespace glm 27 | { 28 | /// @addtogroup gtx_mixed_product 29 | /// @{ 30 | 31 | /// @brief Mixed product of 3 vectors (from GLM_GTX_mixed_product extension) 32 | template 33 | GLM_FUNC_DECL T mixedProduct( 34 | vec<3, T, Q> const& v1, 35 | vec<3, T, Q> const& v2, 36 | vec<3, T, Q> const& v3); 37 | 38 | /// @} 39 | }// namespace glm 40 | 41 | #include "mixed_product.inl" 42 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/mixed_product.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_mixed_product 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER T mixedProduct 7 | ( 8 | vec<3, T, Q> const& v1, 9 | vec<3, T, Q> const& v2, 10 | vec<3, T, Q> const& v3 11 | ) 12 | { 13 | return dot(cross(v1, v2), v3); 14 | } 15 | }//namespace glm 16 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/normal.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_normal 2 | /// @file glm/gtx/normal.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtx_extented_min_max (dependence) 6 | /// 7 | /// @defgroup gtx_normal GLM_GTX_normal 8 | /// @ingroup gtx 9 | /// 10 | /// Include to use the features of this extension. 11 | /// 12 | /// Compute the normal of a triangle. 13 | 14 | #pragma once 15 | 16 | // Dependency: 17 | #include "../glm.hpp" 18 | 19 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 20 | # ifndef GLM_ENABLE_EXPERIMENTAL 21 | # pragma message("GLM: GLM_GTX_normal 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 | # else 23 | # pragma message("GLM: GLM_GTX_normal extension included") 24 | # endif 25 | #endif 26 | 27 | namespace glm 28 | { 29 | /// @addtogroup gtx_normal 30 | /// @{ 31 | 32 | /// Computes triangle normal from triangle points. 33 | /// 34 | /// @see gtx_normal 35 | template 36 | GLM_FUNC_DECL vec<3, T, Q> triangleNormal(vec<3, T, Q> const& p1, vec<3, T, Q> const& p2, vec<3, T, Q> const& p3); 37 | 38 | /// @} 39 | }//namespace glm 40 | 41 | #include "normal.inl" 42 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/normal.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_normal 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER vec<3, T, Q> triangleNormal 7 | ( 8 | vec<3, T, Q> const& p1, 9 | vec<3, T, Q> const& p2, 10 | vec<3, T, Q> const& p3 11 | ) 12 | { 13 | return normalize(cross(p1 - p2, p1 - p3)); 14 | } 15 | }//namespace glm 16 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/normalize_dot.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_normalize_dot 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER T normalizeDot(vec const& x, vec const& y) 7 | { 8 | return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y)); 9 | } 10 | 11 | template 12 | GLM_FUNC_QUALIFIER T fastNormalizeDot(vec const& x, vec const& y) 13 | { 14 | return glm::dot(x, y) * glm::fastInverseSqrt(glm::dot(x, x) * glm::dot(y, y)); 15 | } 16 | }//namespace glm 17 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/number_precision.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_number_precision 2 | 3 | namespace glm 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/optimum_pow.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_optimum_pow 2 | /// @file glm/gtx/optimum_pow.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_optimum_pow GLM_GTX_optimum_pow 7 | /// @ingroup gtx 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// Integer exponentiation of power functions. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 19 | # ifndef GLM_ENABLE_EXPERIMENTAL 20 | # pragma message("GLM: GLM_GTX_optimum_pow 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 | # else 22 | # pragma message("GLM: GLM_GTX_optimum_pow extension included") 23 | # endif 24 | #endif 25 | 26 | namespace glm{ 27 | namespace gtx 28 | { 29 | /// @addtogroup gtx_optimum_pow 30 | /// @{ 31 | 32 | /// Returns x raised to the power of 2. 33 | /// 34 | /// @see gtx_optimum_pow 35 | template 36 | GLM_FUNC_DECL genType pow2(genType const& x); 37 | 38 | /// Returns x raised to the power of 3. 39 | /// 40 | /// @see gtx_optimum_pow 41 | template 42 | GLM_FUNC_DECL genType pow3(genType const& x); 43 | 44 | /// Returns x raised to the power of 4. 45 | /// 46 | /// @see gtx_optimum_pow 47 | template 48 | GLM_FUNC_DECL genType pow4(genType const& x); 49 | 50 | /// @} 51 | }//namespace gtx 52 | }//namespace glm 53 | 54 | #include "optimum_pow.inl" 55 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/optimum_pow.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_optimum_pow 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER genType pow2(genType const& x) 7 | { 8 | return x * x; 9 | } 10 | 11 | template 12 | GLM_FUNC_QUALIFIER genType pow3(genType const& x) 13 | { 14 | return x * x * x; 15 | } 16 | 17 | template 18 | GLM_FUNC_QUALIFIER genType pow4(genType const& x) 19 | { 20 | return (x * x) * (x * x); 21 | } 22 | }//namespace glm 23 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/orthonormalize.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_orthonormalize 2 | /// @file glm/gtx/orthonormalize.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtx_extented_min_max (dependence) 6 | /// 7 | /// @defgroup gtx_orthonormalize GLM_GTX_orthonormalize 8 | /// @ingroup gtx 9 | /// 10 | /// Include to use the features of this extension. 11 | /// 12 | /// Orthonormalize matrices. 13 | 14 | #pragma once 15 | 16 | // Dependency: 17 | #include "../vec3.hpp" 18 | #include "../mat3x3.hpp" 19 | #include "../geometric.hpp" 20 | 21 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 22 | # ifndef GLM_ENABLE_EXPERIMENTAL 23 | # pragma message("GLM: GLM_GTX_orthonormalize 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.") 24 | # else 25 | # pragma message("GLM: GLM_GTX_orthonormalize extension included") 26 | # endif 27 | #endif 28 | 29 | namespace glm 30 | { 31 | /// @addtogroup gtx_orthonormalize 32 | /// @{ 33 | 34 | /// Returns the orthonormalized matrix of m. 35 | /// 36 | /// @see gtx_orthonormalize 37 | template 38 | GLM_FUNC_DECL mat<3, 3, T, Q> orthonormalize(mat<3, 3, T, Q> const& m); 39 | 40 | /// Orthonormalizes x according y. 41 | /// 42 | /// @see gtx_orthonormalize 43 | template 44 | GLM_FUNC_DECL vec<3, T, Q> orthonormalize(vec<3, T, Q> const& x, vec<3, T, Q> const& y); 45 | 46 | /// @} 47 | }//namespace glm 48 | 49 | #include "orthonormalize.inl" 50 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/orthonormalize.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_orthonormalize 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER mat<3, 3, T, Q> orthonormalize(mat<3, 3, T, Q> const& m) 7 | { 8 | mat<3, 3, T, Q> r = m; 9 | 10 | r[0] = normalize(r[0]); 11 | 12 | T d0 = dot(r[0], r[1]); 13 | r[1] -= r[0] * d0; 14 | r[1] = normalize(r[1]); 15 | 16 | T d1 = dot(r[1], r[2]); 17 | d0 = dot(r[0], r[2]); 18 | r[2] -= r[0] * d0 + r[1] * d1; 19 | r[2] = normalize(r[2]); 20 | 21 | return r; 22 | } 23 | 24 | template 25 | GLM_FUNC_QUALIFIER vec<3, T, Q> orthonormalize(vec<3, T, Q> const& x, vec<3, T, Q> const& y) 26 | { 27 | return normalize(x - y * dot(y, x)); 28 | } 29 | }//namespace glm 30 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/perpendicular.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_perpendicular 2 | /// @file glm/gtx/perpendicular.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtx_projection (dependence) 6 | /// 7 | /// @defgroup gtx_perpendicular GLM_GTX_perpendicular 8 | /// @ingroup gtx 9 | /// 10 | /// Include to use the features of this extension. 11 | /// 12 | /// Perpendicular of a vector from other one 13 | 14 | #pragma once 15 | 16 | // Dependency: 17 | #include "../glm.hpp" 18 | #include "../gtx/projection.hpp" 19 | 20 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 21 | # ifndef GLM_ENABLE_EXPERIMENTAL 22 | # pragma message("GLM: GLM_GTX_perpendicular 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.") 23 | # else 24 | # pragma message("GLM: GLM_GTX_perpendicular extension included") 25 | # endif 26 | #endif 27 | 28 | namespace glm 29 | { 30 | /// @addtogroup gtx_perpendicular 31 | /// @{ 32 | 33 | //! Projects x a perpendicular axis of Normal. 34 | //! From GLM_GTX_perpendicular extension. 35 | template 36 | GLM_FUNC_DECL genType perp(genType const& x, genType const& Normal); 37 | 38 | /// @} 39 | }//namespace glm 40 | 41 | #include "perpendicular.inl" 42 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/perpendicular.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_perpendicular 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER genType perp(genType const& x, genType const& Normal) 7 | { 8 | return x - proj(x, Normal); 9 | } 10 | }//namespace glm 11 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/polar_coordinates.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_polar_coordinates 2 | /// @file glm/gtx/polar_coordinates.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_polar_coordinates GLM_GTX_polar_coordinates 7 | /// @ingroup gtx 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// Conversion from Euclidean space to polar space and revert. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 19 | # ifndef GLM_ENABLE_EXPERIMENTAL 20 | # pragma message("GLM: GLM_GTX_polar_coordinates 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 | # else 22 | # pragma message("GLM: GLM_GTX_polar_coordinates extension included") 23 | # endif 24 | #endif 25 | 26 | namespace glm 27 | { 28 | /// @addtogroup gtx_polar_coordinates 29 | /// @{ 30 | 31 | /// Convert Euclidean to Polar coordinates, x is the xz distance, y, the latitude and z the longitude. 32 | /// 33 | /// @see gtx_polar_coordinates 34 | template 35 | GLM_FUNC_DECL vec<3, T, Q> polar( 36 | vec<3, T, Q> const& euclidean); 37 | 38 | /// Convert Polar to Euclidean coordinates. 39 | /// 40 | /// @see gtx_polar_coordinates 41 | template 42 | GLM_FUNC_DECL vec<3, T, Q> euclidean( 43 | vec<2, T, Q> const& polar); 44 | 45 | /// @} 46 | }//namespace glm 47 | 48 | #include "polar_coordinates.inl" 49 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/polar_coordinates.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_polar_coordinates 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER vec<3, T, Q> polar 7 | ( 8 | vec<3, T, Q> const& euclidean 9 | ) 10 | { 11 | T const Length(length(euclidean)); 12 | vec<3, T, Q> const tmp(euclidean / Length); 13 | T const xz_dist(sqrt(tmp.x * tmp.x + tmp.z * tmp.z)); 14 | 15 | return vec<3, T, Q>( 16 | asin(tmp.y), // latitude 17 | atan(tmp.x, tmp.z), // longitude 18 | xz_dist); // xz distance 19 | } 20 | 21 | template 22 | GLM_FUNC_QUALIFIER vec<3, T, Q> euclidean 23 | ( 24 | vec<2, T, Q> const& polar 25 | ) 26 | { 27 | T const latitude(polar.x); 28 | T const longitude(polar.y); 29 | 30 | return vec<3, T, Q>( 31 | cos(latitude) * sin(longitude), 32 | sin(latitude), 33 | cos(latitude) * cos(longitude)); 34 | } 35 | 36 | }//namespace glm 37 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/projection.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_projection 2 | /// @file glm/gtx/projection.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_projection GLM_GTX_projection 7 | /// @ingroup gtx 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// Projection of a vector to other one 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../geometric.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 19 | # ifndef GLM_ENABLE_EXPERIMENTAL 20 | # pragma message("GLM: GLM_GTX_projection 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 | # else 22 | # pragma message("GLM: GLM_GTX_projection extension included") 23 | # endif 24 | #endif 25 | 26 | namespace glm 27 | { 28 | /// @addtogroup gtx_projection 29 | /// @{ 30 | 31 | /// Projects x on Normal. 32 | /// 33 | /// @param[in] x A vector to project 34 | /// @param[in] Normal A normal that doesn't need to be of unit length. 35 | /// 36 | /// @see gtx_projection 37 | template 38 | GLM_FUNC_DECL genType proj(genType const& x, genType const& Normal); 39 | 40 | /// @} 41 | }//namespace glm 42 | 43 | #include "projection.inl" 44 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/projection.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_projection 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER genType proj(genType const& x, genType const& Normal) 7 | { 8 | return glm::dot(x, Normal) / glm::dot(Normal, Normal) * Normal; 9 | } 10 | }//namespace glm 11 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/raw_data.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_raw_data 2 | /// @file glm/gtx/raw_data.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_raw_data GLM_GTX_raw_data 7 | /// @ingroup gtx 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// Projection of a vector to other one 12 | 13 | #pragma once 14 | 15 | // Dependencies 16 | #include "../ext/scalar_uint_sized.hpp" 17 | #include "../detail/setup.hpp" 18 | 19 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 20 | # ifndef GLM_ENABLE_EXPERIMENTAL 21 | # pragma message("GLM: GLM_GTX_raw_data 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 | # else 23 | # pragma message("GLM: GLM_GTX_raw_data extension included") 24 | # endif 25 | #endif 26 | 27 | namespace glm 28 | { 29 | /// @addtogroup gtx_raw_data 30 | /// @{ 31 | 32 | //! Type for byte numbers. 33 | //! From GLM_GTX_raw_data extension. 34 | typedef detail::uint8 byte; 35 | 36 | //! Type for word numbers. 37 | //! From GLM_GTX_raw_data extension. 38 | typedef detail::uint16 word; 39 | 40 | //! Type for dword numbers. 41 | //! From GLM_GTX_raw_data extension. 42 | typedef detail::uint32 dword; 43 | 44 | //! Type for qword numbers. 45 | //! From GLM_GTX_raw_data extension. 46 | typedef detail::uint64 qword; 47 | 48 | /// @} 49 | }// namespace glm 50 | 51 | #include "raw_data.inl" 52 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/raw_data.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_raw_data 2 | 3 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/scalar_relational.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_scalar_relational 2 | /// @file glm/gtx/scalar_relational.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_scalar_relational GLM_GTX_scalar_relational 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 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 19 | # ifndef GLM_ENABLE_EXPERIMENTAL 20 | # pragma message("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.") 21 | # else 22 | # pragma message("GLM: GLM_GTX_extend extension included") 23 | # endif 24 | #endif 25 | 26 | namespace glm 27 | { 28 | /// @addtogroup gtx_scalar_relational 29 | /// @{ 30 | 31 | 32 | 33 | /// @} 34 | }//namespace glm 35 | 36 | #include "scalar_relational.inl" 37 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/scalar_relational.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_scalar_relational 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER bool lessThan 7 | ( 8 | T const& x, 9 | T const& y 10 | ) 11 | { 12 | return x < y; 13 | } 14 | 15 | template 16 | GLM_FUNC_QUALIFIER bool lessThanEqual 17 | ( 18 | T const& x, 19 | T const& y 20 | ) 21 | { 22 | return x <= y; 23 | } 24 | 25 | template 26 | GLM_FUNC_QUALIFIER bool greaterThan 27 | ( 28 | T const& x, 29 | T const& y 30 | ) 31 | { 32 | return x > y; 33 | } 34 | 35 | template 36 | GLM_FUNC_QUALIFIER bool greaterThanEqual 37 | ( 38 | T const& x, 39 | T const& y 40 | ) 41 | { 42 | return x >= y; 43 | } 44 | 45 | template 46 | GLM_FUNC_QUALIFIER bool equal 47 | ( 48 | T const& x, 49 | T const& y 50 | ) 51 | { 52 | return detail::compute_equal::is_iec559>::call(x, y); 53 | } 54 | 55 | template 56 | GLM_FUNC_QUALIFIER bool notEqual 57 | ( 58 | T const& x, 59 | T const& y 60 | ) 61 | { 62 | return !detail::compute_equal::is_iec559>::call(x, y); 63 | } 64 | 65 | GLM_FUNC_QUALIFIER bool any 66 | ( 67 | bool const& x 68 | ) 69 | { 70 | return x; 71 | } 72 | 73 | GLM_FUNC_QUALIFIER bool all 74 | ( 75 | bool const& x 76 | ) 77 | { 78 | return x; 79 | } 80 | 81 | GLM_FUNC_QUALIFIER bool not_ 82 | ( 83 | bool const& x 84 | ) 85 | { 86 | return !x; 87 | } 88 | }//namespace glm 89 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/std_based_type.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_std_based_type 2 | 3 | namespace glm 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/string_cast.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_string_cast 2 | /// @file glm/gtx/string_cast.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtx_integer (dependence) 6 | /// @see gtx_quaternion (dependence) 7 | /// 8 | /// @defgroup gtx_string_cast GLM_GTX_string_cast 9 | /// @ingroup gtx 10 | /// 11 | /// Include to use the features of this extension. 12 | /// 13 | /// Setup strings for GLM type values 14 | /// 15 | /// This extension is not supported with CUDA 16 | 17 | #pragma once 18 | 19 | // Dependency: 20 | #include "../glm.hpp" 21 | #include "../gtc/type_precision.hpp" 22 | #include "../gtc/quaternion.hpp" 23 | #include "../gtx/dual_quaternion.hpp" 24 | #include 25 | #include 26 | 27 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 28 | # ifndef GLM_ENABLE_EXPERIMENTAL 29 | # pragma message("GLM: GLM_GTX_string_cast 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.") 30 | # else 31 | # pragma message("GLM: GLM_GTX_string_cast extension included") 32 | # endif 33 | #endif 34 | 35 | #if(GLM_COMPILER & GLM_COMPILER_CUDA) 36 | # error "GLM_GTX_string_cast is not supported on CUDA compiler" 37 | #endif 38 | 39 | namespace glm 40 | { 41 | /// @addtogroup gtx_string_cast 42 | /// @{ 43 | 44 | /// Create a string from a GLM vector or matrix typed variable. 45 | /// @see gtx_string_cast extension. 46 | template 47 | GLM_FUNC_DECL std::string to_string(genType const& x); 48 | 49 | /// @} 50 | }//namespace glm 51 | 52 | #include "string_cast.inl" 53 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/texture.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_texture 2 | /// @file glm/gtx/texture.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_texture GLM_GTX_texture 7 | /// @ingroup gtx 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// Wrapping mode of texture coordinates. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | #include "../gtc/integer.hpp" 18 | #include "../gtx/component_wise.hpp" 19 | 20 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 21 | # ifndef GLM_ENABLE_EXPERIMENTAL 22 | # pragma message("GLM: GLM_GTX_texture 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.") 23 | # else 24 | # pragma message("GLM: GLM_GTX_texture extension included") 25 | # endif 26 | #endif 27 | 28 | namespace glm 29 | { 30 | /// @addtogroup gtx_texture 31 | /// @{ 32 | 33 | /// Compute the number of mipmaps levels necessary to create a mipmap complete texture 34 | /// 35 | /// @param Extent Extent of the texture base level mipmap 36 | /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector 37 | /// @tparam T Floating-point or signed integer scalar types 38 | /// @tparam Q Value from qualifier enum 39 | template 40 | T levels(vec const& Extent); 41 | 42 | /// @} 43 | }// namespace glm 44 | 45 | #include "texture.inl" 46 | 47 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/texture.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_texture 2 | 3 | namespace glm 4 | { 5 | template 6 | inline T levels(vec const& Extent) 7 | { 8 | return glm::log2(compMax(Extent)) + static_cast(1); 9 | } 10 | 11 | template 12 | inline T levels(T Extent) 13 | { 14 | return vec<1, T, defaultp>(Extent).x; 15 | } 16 | }//namespace glm 17 | 18 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/transform.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_transform 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER mat<4, 4, T, Q> translate(vec<3, T, Q> const& v) 7 | { 8 | return translate(mat<4, 4, T, Q>(static_cast(1)), v); 9 | } 10 | 11 | template 12 | GLM_FUNC_QUALIFIER mat<4, 4, T, Q> rotate(T angle, vec<3, T, Q> const& v) 13 | { 14 | return rotate(mat<4, 4, T, Q>(static_cast(1)), angle, v); 15 | } 16 | 17 | template 18 | GLM_FUNC_QUALIFIER mat<4, 4, T, Q> scale(vec<3, T, Q> const& v) 19 | { 20 | return scale(mat<4, 4, T, Q>(static_cast(1)), v); 21 | } 22 | 23 | }//namespace glm 24 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/type_aligned.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtc_type_aligned 2 | 3 | namespace glm 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/vector_angle.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_vector_angle 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER genType angle 7 | ( 8 | genType const& x, 9 | genType const& y 10 | ) 11 | { 12 | GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'angle' only accept floating-point inputs"); 13 | return acos(clamp(dot(x, y), genType(-1), genType(1))); 14 | } 15 | 16 | template 17 | GLM_FUNC_QUALIFIER T angle(vec const& x, vec const& y) 18 | { 19 | GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'angle' only accept floating-point inputs"); 20 | return acos(clamp(dot(x, y), T(-1), T(1))); 21 | } 22 | 23 | //! \todo epsilon is hard coded to 0.01 24 | template 25 | GLM_FUNC_QUALIFIER T orientedAngle(vec<2, T, Q> const& x, vec<2, T, Q> const& y) 26 | { 27 | GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'orientedAngle' only accept floating-point inputs"); 28 | T const Angle(acos(clamp(dot(x, y), T(-1), T(1)))); 29 | 30 | if(all(epsilonEqual(y, glm::rotate(x, Angle), T(0.0001)))) 31 | return Angle; 32 | else 33 | return -Angle; 34 | } 35 | 36 | template 37 | GLM_FUNC_QUALIFIER T orientedAngle(vec<3, T, Q> const& x, vec<3, T, Q> const& y, vec<3, T, Q> const& ref) 38 | { 39 | GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'orientedAngle' only accept floating-point inputs"); 40 | 41 | T const Angle(acos(clamp(dot(x, y), T(-1), T(1)))); 42 | return mix(Angle, -Angle, dot(ref, cross(x, y)) < T(0)); 43 | } 44 | }//namespace glm 45 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/gtx/wrap.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_wrap 2 | /// @file glm/gtx/wrap.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_wrap GLM_GTX_wrap 7 | /// @ingroup gtx 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// Wrapping mode of texture coordinates. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | #include "../gtc/vec1.hpp" 18 | 19 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 20 | # ifndef GLM_ENABLE_EXPERIMENTAL 21 | # pragma message("GLM: GLM_GTX_wrap 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 | # else 23 | # pragma message("GLM: GLM_GTX_wrap extension included") 24 | # endif 25 | #endif 26 | 27 | namespace glm 28 | { 29 | /// @addtogroup gtx_wrap 30 | /// @{ 31 | 32 | /// Simulate GL_CLAMP OpenGL wrap mode 33 | /// @see gtx_wrap extension. 34 | template 35 | GLM_FUNC_DECL genType clamp(genType const& Texcoord); 36 | 37 | /// Simulate GL_REPEAT OpenGL wrap mode 38 | /// @see gtx_wrap extension. 39 | template 40 | GLM_FUNC_DECL genType repeat(genType const& Texcoord); 41 | 42 | /// Simulate GL_MIRRORED_REPEAT OpenGL wrap mode 43 | /// @see gtx_wrap extension. 44 | template 45 | GLM_FUNC_DECL genType mirrorClamp(genType const& Texcoord); 46 | 47 | /// Simulate GL_MIRROR_REPEAT OpenGL wrap mode 48 | /// @see gtx_wrap extension. 49 | template 50 | GLM_FUNC_DECL genType mirrorRepeat(genType const& Texcoord); 51 | 52 | /// @} 53 | }// namespace glm 54 | 55 | #include "wrap.inl" 56 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/mat2x2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/mat2x2.hpp 3 | 4 | #pragma once 5 | #include "./ext/matrix_double2x2.hpp" 6 | #include "./ext/matrix_double2x2_precision.hpp" 7 | #include "./ext/matrix_float2x2.hpp" 8 | #include "./ext/matrix_float2x2_precision.hpp" 9 | 10 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/mat2x3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/mat2x3.hpp 3 | 4 | #pragma once 5 | #include "./ext/matrix_double2x3.hpp" 6 | #include "./ext/matrix_double2x3_precision.hpp" 7 | #include "./ext/matrix_float2x3.hpp" 8 | #include "./ext/matrix_float2x3_precision.hpp" 9 | 10 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/mat2x4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/mat2x4.hpp 3 | 4 | #pragma once 5 | #include "./ext/matrix_double2x4.hpp" 6 | #include "./ext/matrix_double2x4_precision.hpp" 7 | #include "./ext/matrix_float2x4.hpp" 8 | #include "./ext/matrix_float2x4_precision.hpp" 9 | 10 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/mat3x2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/mat3x2.hpp 3 | 4 | #pragma once 5 | #include "./ext/matrix_double3x2.hpp" 6 | #include "./ext/matrix_double3x2_precision.hpp" 7 | #include "./ext/matrix_float3x2.hpp" 8 | #include "./ext/matrix_float3x2_precision.hpp" 9 | 10 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/mat3x3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/mat3x3.hpp 3 | 4 | #pragma once 5 | #include "./ext/matrix_double3x3.hpp" 6 | #include "./ext/matrix_double3x3_precision.hpp" 7 | #include "./ext/matrix_float3x3.hpp" 8 | #include "./ext/matrix_float3x3_precision.hpp" 9 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/mat3x4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/mat3x4.hpp 3 | 4 | #pragma once 5 | #include "./ext/matrix_double3x4.hpp" 6 | #include "./ext/matrix_double3x4_precision.hpp" 7 | #include "./ext/matrix_float3x4.hpp" 8 | #include "./ext/matrix_float3x4_precision.hpp" 9 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/mat4x2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/mat4x2.hpp 3 | 4 | #pragma once 5 | #include "./ext/matrix_double4x2.hpp" 6 | #include "./ext/matrix_double4x2_precision.hpp" 7 | #include "./ext/matrix_float4x2.hpp" 8 | #include "./ext/matrix_float4x2_precision.hpp" 9 | 10 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/mat4x3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/mat4x3.hpp 3 | 4 | #pragma once 5 | #include "./ext/matrix_double4x3.hpp" 6 | #include "./ext/matrix_double4x3_precision.hpp" 7 | #include "./ext/matrix_float4x3.hpp" 8 | #include "./ext/matrix_float4x3_precision.hpp" 9 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/mat4x4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/mat4x4.hpp 3 | 4 | #pragma once 5 | #include "./ext/matrix_double4x4.hpp" 6 | #include "./ext/matrix_double4x4_precision.hpp" 7 | #include "./ext/matrix_float4x4.hpp" 8 | #include "./ext/matrix_float4x4_precision.hpp" 9 | 10 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/simd/exponential.h: -------------------------------------------------------------------------------- 1 | /// @ref simd 2 | /// @file glm/simd/experimental.h 3 | 4 | #pragma once 5 | 6 | #include "platform.h" 7 | 8 | #if GLM_ARCH & GLM_ARCH_SSE2_BIT 9 | 10 | GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec1_sqrt_lowp(glm_f32vec4 x) 11 | { 12 | return _mm_mul_ss(_mm_rsqrt_ss(x), x); 13 | } 14 | 15 | GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_sqrt_lowp(glm_f32vec4 x) 16 | { 17 | return _mm_mul_ps(_mm_rsqrt_ps(x), x); 18 | } 19 | 20 | #endif//GLM_ARCH & GLM_ARCH_SSE2_BIT 21 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/simd/packing.h: -------------------------------------------------------------------------------- 1 | /// @ref simd 2 | /// @file glm/simd/packing.h 3 | 4 | #pragma once 5 | 6 | #if GLM_ARCH & GLM_ARCH_SSE2_BIT 7 | 8 | #endif//GLM_ARCH & GLM_ARCH_SSE2_BIT 9 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/simd/trigonometric.h: -------------------------------------------------------------------------------- 1 | /// @ref simd 2 | /// @file glm/simd/trigonometric.h 3 | 4 | #pragma once 5 | 6 | #if GLM_ARCH & GLM_ARCH_SSE2_BIT 7 | 8 | #endif//GLM_ARCH & GLM_ARCH_SSE2_BIT 9 | 10 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/simd/vector_relational.h: -------------------------------------------------------------------------------- 1 | /// @ref simd 2 | /// @file glm/simd/vector_relational.h 3 | 4 | #pragma once 5 | 6 | #if GLM_ARCH & GLM_ARCH_SSE2_BIT 7 | 8 | #endif//GLM_ARCH & GLM_ARCH_SSE2_BIT 9 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/vec2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/vec2.hpp 3 | 4 | #pragma once 5 | #include "./ext/vector_bool2.hpp" 6 | #include "./ext/vector_bool2_precision.hpp" 7 | #include "./ext/vector_float2.hpp" 8 | #include "./ext/vector_float2_precision.hpp" 9 | #include "./ext/vector_double2.hpp" 10 | #include "./ext/vector_double2_precision.hpp" 11 | #include "./ext/vector_int2.hpp" 12 | #include "./ext/vector_int2_precision.hpp" 13 | #include "./ext/vector_uint2.hpp" 14 | #include "./ext/vector_uint2_precision.hpp" 15 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/vec3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/vec3.hpp 3 | 4 | #pragma once 5 | #include "./ext/vector_bool3.hpp" 6 | #include "./ext/vector_bool3_precision.hpp" 7 | #include "./ext/vector_float3.hpp" 8 | #include "./ext/vector_float3_precision.hpp" 9 | #include "./ext/vector_double3.hpp" 10 | #include "./ext/vector_double3_precision.hpp" 11 | #include "./ext/vector_int3.hpp" 12 | #include "./ext/vector_int3_precision.hpp" 13 | #include "./ext/vector_uint3.hpp" 14 | #include "./ext/vector_uint3_precision.hpp" 15 | -------------------------------------------------------------------------------- /CppClient/third/glm/include/glm/vec4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/vec4.hpp 3 | 4 | #pragma once 5 | #include "./ext/vector_bool4.hpp" 6 | #include "./ext/vector_bool4_precision.hpp" 7 | #include "./ext/vector_float4.hpp" 8 | #include "./ext/vector_float4_precision.hpp" 9 | #include "./ext/vector_double4.hpp" 10 | #include "./ext/vector_double4_precision.hpp" 11 | #include "./ext/vector_int4.hpp" 12 | #include "./ext/vector_int4_precision.hpp" 13 | #include "./ext/vector_uint4.hpp" 14 | #include "./ext/vector_uint4_precision.hpp" 15 | 16 | -------------------------------------------------------------------------------- /CppClient/xmake/README.md: -------------------------------------------------------------------------------- 1 | Open this folder with vscode, and use xmake extension to easily build and debug. 2 | 3 | -------------------------------------------------------------------------------- /CppClient/xmake/pac.lua: -------------------------------------------------------------------------------- 1 | function mirror(url) 2 | return url:gsub("github.com", "hub.fastgit.org") 3 | end -------------------------------------------------------------------------------- /CppClient/xmake/xmake.lua: -------------------------------------------------------------------------------- 1 | 2 | 3 | -- add_requires("glfw") 4 | add_requires("conan::glm/0.9.9.8",{alias="glm"}) 5 | add_requires("conan::parallel-hashmap/1.33",{alias="phmap"}) 6 | 7 | add_repositories("local-repo local") 8 | add_requires("libsdl_local") 9 | -- add_requires("conan::opencv/4.5.0",{alias = "opencv"}) 10 | add_requires("opencv", {proxy = false}) 11 | -- add_requires() 12 | 13 | -- add_requires() 14 | target("VoxelFrame") 15 | set_kind("binary") 16 | set_languages("c++11") 17 | add_defines("SDL_MAIN_HANDLED") 18 | 19 | if is_plat("windows") then 20 | add_syslinks("ws2_32") 21 | end 22 | 23 | add_packages( 24 | "sdl2","glm","phmap","opencv" 25 | ) 26 | 27 | -- main 28 | add_files("../src/**.cpp") 29 | add_includedirs("../src") 30 | 31 | -- glad 32 | add_files("../third/glad/src/**") 33 | add_includedirs("../third/glad/include") 34 | 35 | -- imgui 36 | add_files("../third/vf_imgui/imgui/imgui.cpp", 37 | "../third/vf_imgui/imgui/imgui_draw.cpp") 38 | add_includedirs("../third/vf_imgui/imgui") 39 | 40 | -- rp3d 41 | add_files("../third/reactphysics3d/src/**") 42 | add_includedirs("../third/reactphysics3d/include") 43 | 44 | -- paecs 45 | add_files("../third/paecs/src/**.cpp") 46 | add_includedirs("../third/paecs/src") 47 | 48 | -- brynet 49 | add_includedirs("../third/brynet/include") 50 | 51 | -- ThreadPool 52 | add_includedirs("../third/ThreadPool") -------------------------------------------------------------------------------- /RustClient/VoxelFrame/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | edition = "2018" 3 | name = "VoxelFrame" 4 | version = "0.1.0" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | bevy = "0.5" # make sure this is the latest version 10 | -------------------------------------------------------------------------------- /VoxelFrameServerRust/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "voxelframe_server" 3 | version = "0.1.0" 4 | edition = "2018" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | tokio = { version = "1.7.0", features = ["full"] } -------------------------------------------------------------------------------- /VoxelFrameServerRust/README.md: -------------------------------------------------------------------------------- 1 | ## run 2 | cargo run -------------------------------------------------------------------------------- /VoxelFrameServerRust/src/main.rs: -------------------------------------------------------------------------------- 1 | mod net; 2 | use tokio::io::{AsyncReadExt, AsyncWriteExt}; 3 | use tokio::net::TcpListener; 4 | // fn main() { 5 | // // println!("Hello, world!"); 6 | // let server = net::Server::new(); 7 | // server.start(); 8 | // } 9 | #[tokio::main] 10 | async fn main() -> Result<(), Box> { 11 | let listener = TcpListener::bind("127.0.0.1:8080").await?; 12 | 13 | loop { 14 | let (mut socket, _) = listener.accept().await?; 15 | 16 | tokio::spawn(async move { 17 | let mut buf = [0; 1024]; 18 | 19 | // In a loop, read data from the socket and write the data back. 20 | loop { 21 | let n = match socket.read(&mut buf).await { 22 | // socket closed 23 | Ok(n) if n == 0 => return, 24 | Ok(n) => n, 25 | Err(e) => { 26 | eprintln!("failed to read from socket; err = {:?}", e); 27 | return; 28 | } 29 | }; 30 | 31 | // Write the data back 32 | if let Err(e) = socket.write_all(&buf[0..n]).await { 33 | eprintln!("failed to write to socket; err = {:?}", e); 34 | return; 35 | } 36 | } 37 | }); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /VoxelFrameServerRust/src/net.rs: -------------------------------------------------------------------------------- 1 | pub struct Server {} 2 | 3 | impl Server { 4 | pub fn new() -> Server { 5 | Server {} 6 | } 7 | pub fn start(&self) { 8 | println!("server start"); 9 | } 10 | // pub fn public_method(&self) { 11 | // println!("from public method"); 12 | // self.private_method(); 13 | // } 14 | 15 | // fn private_method(&self) { 16 | // println!("from private method"); 17 | // } 18 | } 19 | -------------------------------------------------------------------------------- /markdown/方块顶点顺序.md: -------------------------------------------------------------------------------- 1 | ![image-20210604230752925](https://hanbaoaaa.xyz/tuchuang/images/2021/06/04/image-20210604230752925.png) 2 | 3 | --------------------------------------------------------------------------------