├── .clang-format
├── .gitignore
├── .gitmodules
├── Arche-cpp.xcodeproj
├── project.pbxproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
└── xcshareddata
│ └── xcschemes
│ ├── apps.xcscheme
│ ├── asset_pipeline.xcscheme
│ ├── editor.xcscheme
│ └── test.base.xcscheme
├── CMakeLists.txt
├── LICENSE
├── README.md
├── apps
├── CMakeLists.txt
├── animation
│ ├── animation_additive_app.cpp
│ ├── animation_additive_app.h
│ ├── animation_attach_app.cpp
│ ├── animation_attach_app.h
│ ├── animation_blend_app.cpp
│ ├── animation_blend_app.h
│ ├── animation_create_app.cpp
│ ├── animation_create_app.h
│ ├── animation_ik_floor_app.cpp
│ ├── animation_ik_floor_app.h
│ ├── animation_ik_hand_app.cpp
│ ├── animation_ik_hand_app.h
│ ├── animation_ik_lookat_app.cpp
│ ├── animation_ik_lookat_app.h
│ ├── animation_partial_blend_app.cpp
│ ├── animation_partial_blend_app.h
│ ├── animation_sample.h
│ ├── skinning_app.cpp
│ └── skinning_app.h
├── apps.entitlements
├── assimp_app.cpp
├── assimp_app.h
├── atomic_compute_app.cpp
├── atomic_compute_app.h
├── example
│ ├── BUILD.gn
│ ├── BackendBinding.cpp
│ ├── BackendBinding.h
│ ├── CMakeLists.txt
│ ├── ComboRenderBundleEncoderDescriptor.cpp
│ ├── ComboRenderBundleEncoderDescriptor.h
│ ├── ComboRenderPipelineDescriptor.cpp
│ ├── ComboRenderPipelineDescriptor.h
│ ├── EmptyDebugLogger.cpp
│ ├── GLFWUtils.cpp
│ ├── GLFWUtils.h
│ ├── GLFWUtils_metal.mm
│ ├── Glfw3Fuchsia.cpp
│ ├── MetalBinding.mm
│ ├── NullBinding.cpp
│ ├── OSXTimer.cpp
│ ├── ObjCUtils.h
│ ├── ObjCUtils.mm
│ ├── PlatformDebugLogger.h
│ ├── PosixTimer.cpp
│ ├── SampleUtils.cpp
│ ├── SampleUtils.h
│ ├── SystemUtils.cpp
│ ├── SystemUtils.h
│ ├── TerribleCommandBuffer.cpp
│ ├── TerribleCommandBuffer.h
│ ├── TestUtils.cpp
│ ├── TestUtils.h
│ ├── TextureUtils.cpp
│ ├── TextureUtils.h
│ ├── Timer.h
│ ├── WGPUHelpers.cpp
│ ├── WGPUHelpers.h
│ ├── WindowsDebugLogger.cpp
│ ├── WindowsTimer.cpp
│ ├── WireHelper.cpp
│ ├── WireHelper.h
│ └── main_example.cpp
├── gui_app.cpp
├── gui_app.h
├── main.cpp
├── physics_collision_app.cpp
├── physics_collision_app.h
├── physics_samples
│ ├── constraints
│ │ ├── cone_constraint_app.cpp
│ │ ├── cone_constraint_app.h
│ │ ├── constraint_singularity_app.cpp
│ │ ├── constraint_singularity_app.h
│ │ ├── distance_constraint_app.cpp
│ │ ├── distance_constraint_app.h
│ │ ├── fixed_constraint_app.cpp
│ │ ├── fixed_constraint_app.h
│ │ ├── gear_constraint_app.cpp
│ │ ├── gear_constraint_app.h
│ │ ├── hinge_constraint_app.cpp
│ │ ├── hinge_constraint_app.h
│ │ ├── path_constraint_app.cpp
│ │ ├── path_constraint_app.h
│ │ ├── point_constraint_app.cpp
│ │ ├── point_constraint_app.h
│ │ ├── powered_hinge_constraint_app.cpp
│ │ ├── powered_hinge_constraint_app.h
│ │ ├── powered_slider_constraint_app.cpp
│ │ ├── powered_slider_constraint_app.h
│ │ ├── powered_swing_twist_constraint_app.cpp
│ │ ├── powered_swing_twist_constraint_app.h
│ │ ├── pulley_constraint_app.cpp
│ │ ├── pulley_constraint_app.h
│ │ ├── rack_and_pinion_constraint_app.cpp
│ │ ├── rack_and_pinion_constraint_app.h
│ │ ├── six_dof_constraint_app.cpp
│ │ ├── six_dof_constraint_app.h
│ │ ├── slider_constraint_app.cpp
│ │ ├── slider_constraint_app.h
│ │ ├── spring_app.cpp
│ │ ├── spring_app.h
│ │ ├── swing_twist_constraint_app.cpp
│ │ ├── swing_twist_constraint_app.h
│ │ ├── swing_twist_constraint_friction_app.cpp
│ │ └── swing_twist_constraint_friction_app.h
│ ├── general
│ │ ├── activate_during_update_app.cpp
│ │ ├── activate_during_update_app.h
│ │ ├── active_edges_app.cpp
│ │ ├── active_edges_app.h
│ │ ├── big_vs_small_app.cpp
│ │ ├── big_vs_small_app.h
│ │ ├── center_of_mass_app.cpp
│ │ ├── center_of_mass_app.h
│ │ ├── change_motion_type_app.cpp
│ │ ├── change_motion_type_app.h
│ │ ├── change_object_layer_app.cpp
│ │ ├── change_object_layer_app.h
│ │ ├── change_shape_app.cpp
│ │ ├── change_shape_app.h
│ │ ├── contact_manifold_app.cpp
│ │ ├── contact_manifold_app.h
│ │ ├── damping_app.cpp
│ │ ├── damping_app.h
│ │ ├── dynamic_mesh_app.cpp
│ │ ├── dynamic_mesh_app.h
│ │ ├── friction_app.cpp
│ │ ├── friction_app.h
│ │ ├── funnel_app.cpp
│ │ ├── funnel_app.h
│ │ ├── gravity_factor_app.cpp
│ │ ├── gravity_factor_app.h
│ │ ├── heavy_on_light_app.cpp
│ │ ├── heavy_on_light_app.h
│ │ ├── high_speed_app.cpp
│ │ ├── high_speed_app.h
│ │ ├── island_app.cpp
│ │ ├── island_app.h
│ │ ├── kinematic_app.cpp
│ │ ├── kinematic_app.h
│ │ ├── manifold_reduction_app.cpp
│ │ ├── manifold_reduction_app.h
│ │ ├── restitution_app.cpp
│ │ ├── restitution_app.h
│ │ ├── stack_app.cpp
│ │ ├── stack_app.h
│ │ ├── wall_app.cpp
│ │ └── wall_app.h
│ ├── physics_debug_app.cpp
│ ├── physics_debug_app.h
│ ├── physics_samples.h
│ ├── physics_utils.cpp
│ ├── physics_utils.h
│ ├── scaled_shapes
│ │ ├── scaled_box_shape_app.cpp
│ │ ├── scaled_box_shape_app.h
│ │ ├── scaled_capsule_shape_app.cpp
│ │ ├── scaled_capsule_shape_app.h
│ │ ├── scaled_convex_hull_shape_app.cpp
│ │ ├── scaled_convex_hull_shape_app.h
│ │ ├── scaled_cylinder_shape_app.cpp
│ │ ├── scaled_cylinder_shape_app.h
│ │ ├── scaled_height_field_shape_app.cpp
│ │ ├── scaled_height_field_shape_app.h
│ │ ├── scaled_mesh_shape_app.cpp
│ │ ├── scaled_mesh_shape_app.h
│ │ ├── scaled_mutable_compound_shape_app.cpp
│ │ ├── scaled_mutable_compound_shape_app.h
│ │ ├── scaled_offset_center_of_mass_shape_app.cpp
│ │ ├── scaled_offset_center_of_mass_shape_app.h
│ │ ├── scaled_sphere_shape_app.cpp
│ │ ├── scaled_sphere_shape_app.h
│ │ ├── scaled_static_compound_shape_app.cpp
│ │ ├── scaled_static_compound_shape_app.h
│ │ ├── scaled_tapered_capsule_shape_app.cpp
│ │ ├── scaled_tapered_capsule_shape_app.h
│ │ ├── scaled_triangle_shape_app.cpp
│ │ └── scaled_triangle_shape_app.h
│ ├── shapes
│ │ ├── box_shape_app.cpp
│ │ ├── box_shape_app.h
│ │ ├── capsule_shape_app.cpp
│ │ ├── capsule_shape_app.h
│ │ ├── convex_hull_shape_app.cpp
│ │ ├── convex_hull_shape_app.h
│ │ ├── cylinder_shape_app.cpp
│ │ ├── cylinder_shape_app.h
│ │ ├── mesh_shape_app.cpp
│ │ ├── mesh_shape_app.h
│ │ ├── mutable_compound_shape_app.cpp
│ │ ├── mutable_compound_shape_app.h
│ │ ├── offset_center_of_mass_shape_app.cpp
│ │ ├── offset_center_of_mass_shape_app.h
│ │ ├── rotated_translated_shape_app.cpp
│ │ ├── rotated_translated_shape_app.h
│ │ ├── sphere_shape_app.cpp
│ │ ├── sphere_shape_app.h
│ │ ├── static_compound_shape_app.cpp
│ │ ├── static_compound_shape_app.h
│ │ ├── tapered_capsule_shape_app.cpp
│ │ ├── tapered_capsule_shape_app.h
│ │ ├── triangle_shape_app.cpp
│ │ └── triangle_shape_app.h
│ └── water
│ │ ├── water_shape_app.cpp
│ │ └── water_shape_app.h
├── physx
│ ├── api
│ │ ├── angular_velocity_app.cpp
│ │ ├── angular_velocity_app.h
│ │ ├── collision_groups_app.cpp
│ │ ├── collision_groups_app.h
│ │ ├── local_torque_app.cpp
│ │ ├── local_torque_app.h
│ │ ├── maas_local_offset_app.cpp
│ │ └── mass_local_offset_app.h
│ ├── physx_helper.cpp
│ ├── physx_helper.h
│ └── physx_samples.h
├── plugins
│ ├── CMakeLists.txt
│ ├── benchmark_mode
│ │ ├── benchmark_mode.cpp
│ │ └── benchmark_mode.h
│ ├── file_logger
│ │ ├── file_logger.cpp
│ │ └── file_logger.h
│ ├── fps_logger
│ │ ├── fps_logger.cpp
│ │ └── fps_logger.h
│ ├── plugins.cpp
│ ├── plugins.cpp.in
│ ├── plugins.h
│ ├── stop_after
│ │ ├── stop_after.cpp
│ │ └── stop_after.h
│ └── window_options
│ │ ├── window_options.cpp
│ │ └── window_options.h
├── primitive_app.cpp
├── primitive_app.h
├── rendering
│ ├── cascade_shadowmap_app.cpp
│ ├── cascade_shadowmap_app.h
│ ├── cluster_forward_app.cpp
│ ├── cluster_forward_app.h
│ ├── ibl_app.cpp
│ ├── ibl_app.h
│ ├── irradiance_app.cpp
│ ├── irradiance_app.h
│ ├── multi_light_app.cpp
│ ├── multi_light_app.h
│ ├── omni_shadowmap_app.cpp
│ ├── omni_shadowmap_app.h
│ ├── particle_app.cpp
│ ├── particle_app.h
│ ├── pbr_app.cpp
│ ├── pbr_app.h
│ ├── rendering_sample.h
│ ├── shadowmap_app.cpp
│ ├── shadowmap_app.h
│ ├── skybox_app.cpp
│ └── skybox_app.h
├── scoped_autorelease_pool.cpp
├── scoped_autorelease_pool.h
├── scoped_autorelease_pool.mm
└── toolkit
│ ├── grid_app.cpp
│ ├── grid_app.h
│ └── toolkit_sample.h
├── asset_pipeline
├── CMakeLists.txt
├── asset_pipeline.entitlements
├── dump2ozz.cpp
├── export.h
├── fbx
│ ├── fbx.cpp
│ ├── fbx.h
│ ├── fbx2ozz.cpp
│ ├── fbx2ozz.h
│ ├── fbx2ozz_anim.cpp
│ ├── fbx2ozz_skel.cpp
│ ├── fbx_animation.cpp
│ ├── fbx_animation.h
│ ├── fbx_skeleton.cpp
│ └── fbx_skeleton.h
├── fbx2skin.cpp
├── gltf2ozz.cpp
├── importer
│ ├── import2ozz.cpp
│ ├── import2ozz.h
│ ├── import2ozz_anim.cpp
│ ├── import2ozz_anim.h
│ ├── import2ozz_config.cpp
│ ├── import2ozz_config.h
│ ├── import2ozz_skel.cpp
│ ├── import2ozz_skel.h
│ ├── import2ozz_track.cpp
│ ├── import2ozz_track.h
│ └── reference.json
├── options.cpp
└── options.h
├── bldsys
├── cmake
│ ├── android_package.cmake
│ ├── android_sync_folder.cmake
│ ├── check_atomic.cmake
│ ├── create_gradle_project.cmake
│ ├── create_sample_project.cmake
│ ├── global_options.cmake
│ ├── module
│ │ ├── FindAdb.cmake
│ │ └── FindGradle.cmake
│ ├── sample_helper.cmake
│ ├── template
│ │ ├── gradle
│ │ │ ├── build.gradle.in
│ │ │ ├── gradle-wrapper.jar
│ │ │ ├── gradle-wrapper.properties.in
│ │ │ ├── gradle.properties.in
│ │ │ ├── gradlew
│ │ │ ├── gradlew.bat
│ │ │ └── settings.gradle.in
│ │ └── sample
│ │ │ ├── CMakeLists.txt.in
│ │ │ ├── sample.cpp.in
│ │ │ └── sample.h.in
│ └── utils.cmake
├── scripts
│ ├── generate_android_gradle.bat
│ ├── generate_android_gradle.sh
│ ├── generate_sample.bat
│ └── generate_sample.sh
└── toolchain
│ ├── android_gradle.cmake
│ └── android_nsight_tegra.cmake
├── editor
├── CMakeLists.txt
├── editor.entitlements
├── main.cpp
├── simple_editor.cpp
└── simple_editor.h
├── imgui.ini
├── shaders
├── blinn-phong.frag
├── blinn-phong.vert
├── common.h
├── compute
│ ├── atomic_counter.comp
│ └── atomic_counter.frag
├── cubemap-debugger.frag
├── cubemap-debugger.vert
├── editor
│ ├── color_picker.frag
│ ├── grid.frag
│ └── grid.vert
├── ibl.comp
├── light
│ ├── cluster_bounds.comp
│ ├── cluster_common.comp
│ ├── cluster_debug.frag
│ ├── cluster_light.comp
│ ├── light_sprite.frag
│ └── light_sprite.vert
├── noise
│ ├── noise_cellular.h
│ ├── noise_cellular_2D.h
│ ├── noise_cellular_2x2.h
│ ├── noise_cellular_2x2x2.h
│ ├── noise_cellular_3D.h
│ ├── noise_common.h
│ ├── noise_perlin.h
│ ├── noise_perlin_2D.h
│ ├── noise_perlin_3D.h
│ ├── noise_perlin_4D.h
│ ├── noise_psrd_2D.h
│ ├── noise_simplex.h
│ ├── noise_simplex_2D.h
│ ├── noise_simplex_3D.h
│ ├── noise_simplex_3D_grad.h
│ └── noise_simplex_4D.h
├── particle
│ ├── particle_calculate_dp.comp
│ ├── particle_config.h
│ ├── particle_curl_noise.comp
│ ├── particle_distance_func.comp
│ ├── particle_distance_utils.comp
│ ├── particle_emission.comp
│ ├── particle_fill_indices.comp
│ ├── particle_math.comp
│ ├── particle_perlin.comp
│ ├── particle_perlin_2d.comp
│ ├── particle_perlin_3d.comp
│ ├── particle_render_common.comp
│ ├── particle_render_instancing.frag
│ ├── particle_render_instancing.vert
│ ├── particle_simulation.comp
│ ├── particle_sort_final.comp
│ └── particle_sort_step.comp
├── pbr.frag
├── pbr
│ ├── brdf.h
│ ├── direct_irradiance_frag_define.h
│ ├── ibl_frag_define.h
│ ├── pbr.frag
│ ├── pbr_frag_define.h
│ └── pbr_helper.h
├── shadow
│ ├── cascade-shadow-debugger.frag
│ ├── shadow-map.vert
│ ├── shadow_frag_define.h
│ └── shadow_sample_tent.h
├── skybox.frag
├── skybox.vert
├── snippet
│ ├── begin_mobile.frag
│ ├── begin_normal.vert
│ ├── begin_position.vert
│ ├── begin_viewdir.frag
│ ├── blendShape.vert
│ ├── blendShape_define.h
│ ├── color.vert
│ ├── color_define.h
│ ├── common_define.h
│ ├── common_frag_define.h
│ ├── common_vert_define.h
│ ├── fog.frag
│ ├── fog.vert
│ ├── fog_define.h
│ ├── light_define.h
│ ├── mobile_blinnphong.frag
│ ├── mobile_material_define.h
│ ├── normal.vert
│ ├── normal_define.h
│ ├── normal_frag_define.h
│ ├── position.vert
│ ├── skinning.vert
│ ├── uv.vert
│ ├── uv_define.h
│ ├── worldpos.vert
│ └── worldpos_define.h
├── toolkit
│ ├── grid
│ │ ├── grid.frag
│ │ └── grid.vert
│ ├── physics_view
│ │ ├── line.frag
│ │ ├── line.vert
│ │ ├── triangle.frag
│ │ └── triangle.vert
│ └── skeleton_view
│ │ ├── bone.vert
│ │ ├── joint.vert
│ │ └── skeleton.frag
├── unlit.frag
├── unlit.vert
├── wireframe.frag
└── wireframe.vert
├── test.animation
├── CMakeLists.txt
├── gtest_helper.h
├── gtest_math_helper.h
├── offline
│ ├── additive_animation_builder_tests.cpp
│ ├── animation_builder_tests.cpp
│ ├── animation_optimizer_tests.cpp
│ ├── raw_animation_archive_tests.cpp
│ ├── raw_animation_utils_tests.cpp
│ ├── raw_skeleton_archive_tests.cpp
│ ├── raw_track_archive_tests.cpp
│ ├── skeleton_builder_tests.cpp
│ ├── track_builder_tests.cpp
│ └── track_optimizer_tests.cpp
├── runtime
│ ├── animation_archive_tests.cpp
│ ├── animation_utils_tests.cpp
│ ├── blending_job_tests.cpp
│ ├── ik_aim_job_tests.cpp
│ ├── ik_two_bone_job_tests.cpp
│ ├── local_to_model_job_tests.cpp
│ ├── sampling_job_tests.cpp
│ ├── skeleton_archive_tests.cpp
│ ├── skeleton_utils_tests.cpp
│ ├── track_archive_tests.cpp
│ ├── track_sampling_job_tests.cpp
│ ├── track_triggering_job_tests.cpp
│ └── track_triggering_job_trait_tests.cpp
└── test.animation.entitlements
├── test.base
├── CMakeLists.txt
├── containers
│ ├── intrusive_list_tests.cpp
│ ├── std_containers_archive_tests.cpp
│ └── std_containers_tests.cpp
├── endianness_tests.cpp
├── gtest_helper.h
├── io
│ ├── archive_tests.cpp
│ ├── archive_tests_objects.cpp
│ ├── archive_tests_objects.h
│ └── stream_tests.cpp
├── memory
│ ├── allocator_tests.cpp
│ └── unique_ptr_tests.cpp
├── platform_tests.cpp
├── span_tests.cpp
└── test.base.entitlements
├── test.geometry
├── CMakeLists.txt
├── array1_tests.cpp
├── array2_tests.cpp
├── array3_tests.cpp
├── array_accessor1_tests.cpp
├── array_accessor2_tests.cpp
├── array_accessor3_tests.cpp
├── array_samplers_tests.cpp
├── array_utils_tests.cpp
├── blas_tests.cpp
├── box2_tests.cpp
├── box3_tests.cpp
├── bvh2_tests.cpp
├── bvh3_tests.cpp
├── cell_centered_scalar_grid2_tests.cpp
├── cell_centered_scalar_grid3_tests.cpp
├── cell_centered_vector_grid2_tests.cpp
├── cell_centered_vector_grid3_tests.cpp
├── cg_tests.cpp
├── custom_implicit_surface2_tests.cpp
├── custom_implicit_surface3_tests.cpp
├── cylinder3_tests.cpp
├── face_centered_grid2_tests.cpp
├── face_centered_grid3_tests.cpp
├── fdm_cg_solver2_tests.cpp
├── fdm_cg_solver3_tests.cpp
├── fdm_gauss_seidel_solver2_tests.cpp
├── fdm_gauss_seidel_solver3_tests.cpp
├── fdm_iccg_solver2_tests.cpp
├── fdm_iccg_solver3_tests.cpp
├── fdm_jacobi_solver2_tests.cpp
├── fdm_jacobi_solver3_tests.cpp
├── fdm_linear_system_solver_test_helper2.h
├── fdm_linear_system_solver_test_helper3.h
├── fdm_mg_linear_system2_tests.cpp.cpp
├── fdm_mg_solver2_tests.cpp
├── fdm_mg_solver3_tests.cpp
├── fdm_mgpcg_solver2_tests.cpp
├── fdm_mgpcg_solver3_tests.cpp
├── fdm_utils_tests.cpp
├── frame_tests.cpp
├── grid_emitter2_tests.cpp
├── grid_emitter3_tests.cpp
├── implicit_surface_set2_tests.cpp
├── implicit_surface_set3_tests.cpp
├── implicit_triangle_mesh3_tests.cpp
├── list_query_engine2_tests.cpp
├── list_query_engine3_tests.cpp
├── marching_cubes_tests.cpp
├── matrix_csr_tests.cpp
├── matrix_mxn_tests.cpp
├── mg_tests.cpp
├── octree_tests.cpp
├── parallel_tests.cpp
├── particle_system_data2_tests.cpp
├── particle_system_data3_tests.cpp
├── plane2_tests.cpp
├── plane3_tests.cpp
├── point_hash_grid_searcher2_tests.cpp
├── point_hash_grid_searcher3_tests.cpp
├── point_kdtree_searcher2_tests.cpp
├── point_kdtree_searcher3_tests.cpp
├── point_parallel_hash_grid_searcher2_tests.cpp
├── point_parallel_hash_grid_searcher3_tests.cpp
├── point_particle_emitter2_tests.cpp
├── point_particle_emitter3_tests.cpp
├── point_simple_list_searcher2_tests.cpp
├── point_simple_list_searcher3_tests.cpp
├── quadtree_tests.cpp
├── samplers_tests.cpp
├── serial_tests.cpp
├── sphere2_tests.cpp
├── sphere3_tests.cpp
├── surface_set2_tests.cpp
├── surface_set3_tests.cpp
├── surface_to_implicit2_tests.cpp
├── surface_to_implicit3_tests.cpp
├── svd_tests.cpp
├── test.geometry.entitlements
├── triangle3_tests.cpp
├── triangle_mesh3_tests.cpp
├── triangle_mesh_to_sdf_tests.cpp
├── unit_tests_utils.cpp
├── unit_tests_utils.h
├── vector_n_tests.cpp
├── vertex_centered_scalar_grid2_tests.cpp
├── vertex_centered_scalar_grid3_tests.cpp
├── vertex_centered_vector_grid2_tests.cpp
├── vertex_centered_vector_grid3_tests.cpp
├── volume_particle_emitter2_tests.cpp
└── volume_particle_emitter3_tests.cpp
├── test.math
├── CMakeLists.txt
├── bounding_box2_tests.cpp
├── bounding_box3_tests.cpp
├── bounding_box_tests.cpp
├── bounding_frustum_tests.cpp
├── collision_util_tests.cpp
├── color_tests.cpp
├── gtest_math_helper.h
├── math_archive_tests.cpp
├── math_utils_tests.cpp
├── matrix2x2_tests.cpp
├── matrix3x3_tests.cpp
├── matrix4x4_tests.cpp
├── matrix_tests.cpp
├── point2_tests.cpp
├── point3_tests.cpp
├── point_tests.cpp
├── quaternion_tests.cpp
├── ray2_tests.cpp
├── ray3_tests.cpp
├── rect_tests.cpp
├── scalable_transform_tests.cpp
├── test.math.entitlements
├── transform2_tests.cpp
├── transform3_tests.cpp
├── unit_tests_utils.cpp
├── unit_tests_utils.h
├── vector2_tests.cpp
├── vector3_tests.cpp
├── vector4_tests.cpp
└── vector_tests.cpp
├── test.simd_math
├── CMakeLists.txt
├── gtest_helper.h
├── gtest_math_helper.h
├── simd_float4x4_tests.cpp
├── simd_float_math_tests.cpp
├── simd_int_math_tests.cpp
├── simd_math_archive_tests.cpp
├── simd_math_transpose_tests.cpp
├── simd_quaternion_math_tests.cpp
├── soa_float4x4_tests.cpp
├── soa_float_tests.cpp
├── soa_math_archive_tests.cpp
├── soa_quaternion_tests.cpp
├── soa_transform_tests.cpp
└── test.simd_math.entitlements
├── third_party
├── CMakeLists.txt
├── build.sh
└── clean.sh
├── vox.animation
├── CMakeLists.txt
├── offline
│ ├── additive_animation_builder.cpp
│ ├── additive_animation_builder.h
│ ├── animation_builder.cpp
│ ├── animation_builder.h
│ ├── animation_optimizer.cpp
│ ├── animation_optimizer.h
│ ├── decimate.h
│ ├── export.h
│ ├── raw_animation.cpp
│ ├── raw_animation.h
│ ├── raw_animation_archive.cpp
│ ├── raw_animation_utils.cpp
│ ├── raw_animation_utils.h
│ ├── raw_skeleton.cpp
│ ├── raw_skeleton.h
│ ├── raw_skeleton_archive.cpp
│ ├── raw_track.cpp
│ ├── raw_track.h
│ ├── skeleton_builder.cpp
│ ├── skeleton_builder.h
│ ├── track_builder.cpp
│ ├── track_builder.h
│ ├── track_optimizer.cpp
│ └── track_optimizer.h
└── runtime
│ ├── animation.cpp
│ ├── animation.h
│ ├── animation_keyframe.h
│ ├── animation_utils.cpp
│ ├── animation_utils.h
│ ├── blending_job.cpp
│ ├── blending_job.h
│ ├── export.h
│ ├── ik_aim_job.cpp
│ ├── ik_aim_job.h
│ ├── ik_two_bone_job.cpp
│ ├── ik_two_bone_job.h
│ ├── local_to_model_job.cpp
│ ├── local_to_model_job.h
│ ├── sampling_job.cpp
│ ├── sampling_job.h
│ ├── skeleton.cpp
│ ├── skeleton.h
│ ├── skeleton_utils.cpp
│ ├── skeleton_utils.h
│ ├── track.cpp
│ ├── track.h
│ ├── track_sampling_job.cpp
│ ├── track_sampling_job.h
│ ├── track_triggering_job.cpp
│ ├── track_triggering_job.h
│ └── track_triggering_job_trait.h
├── vox.base
├── CMakeLists.txt
├── constants.h
├── containers
│ ├── array.h
│ ├── array_archive.h
│ ├── deque.h
│ ├── intrusive_list.h
│ ├── list.h
│ ├── map.h
│ ├── queue.h
│ ├── set.h
│ ├── stack.h
│ ├── std_allocator.h
│ ├── string.h
│ ├── string_archive.cpp
│ ├── string_archive.h
│ ├── unordered_map.h
│ ├── unordered_set.h
│ ├── vector.h
│ └── vector_archive.h
├── cpp_utils-inl.h
├── cpp_utils.h
├── endianness.h
├── io
│ ├── archive.cpp
│ ├── archive.h
│ ├── archive_traits.h
│ ├── stream.cpp
│ └── stream.h
├── logging.h
├── macros.h
├── memory
│ ├── allocator.cpp
│ ├── allocator.h
│ └── unique_ptr.h
├── parallel-inl.h
├── parallel.cpp
├── parallel.h
├── private_helpers.h
├── serial-inl.h
├── serial.h
├── span.h
├── string_utils.cpp
├── string_utils.h
├── timer.cpp
├── timer.h
└── type_helpers.h
├── vox.editor
├── CMakeLists.txt
├── editor_actions-inl.h
├── editor_actions.cpp
├── editor_actions.h
├── editor_application.cpp
├── editor_application.h
├── editor_resources.cpp
├── editor_resources.h
├── editor_settings.h
├── editor_utils.cpp
├── editor_utils.h
├── entity_creation_menu.cpp
├── entity_creation_menu.h
├── imgui
│ ├── crude_json.cpp
│ ├── crude_json.h
│ ├── imgui_bezier_math.h
│ ├── imgui_bezier_math.inl
│ ├── imgui_canvas.cpp
│ ├── imgui_canvas.h
│ ├── imgui_curve.cpp
│ ├── imgui_curve.h
│ ├── imgui_extra_math.h
│ ├── imgui_extra_math.inl
│ ├── imgui_node_editor.cpp
│ ├── imgui_node_editor.h
│ ├── imgui_node_editor_api.cpp
│ ├── imgui_node_editor_internal.h
│ ├── imgui_node_editor_internal.inl
│ ├── imgui_shapes.cpp
│ ├── imgui_shapes.h
│ ├── imgui_zmo.cpp
│ └── imgui_zmo.h
├── ini_file-inl.h
├── ini_file.cpp
├── ini_file.h
├── panels_manager.cpp
├── panels_manager.h
├── profiling
│ ├── profiler.cpp
│ ├── profiler.h
│ ├── profiler_report.h
│ ├── profiler_spy.cpp
│ └── profiler_spy.h
├── raw_icon.h
├── size_converter.cpp
├── size_converter.h
├── ui
│ ├── asset_browser.cpp
│ ├── asset_browser.h
│ ├── asset_properties.cpp
│ ├── asset_properties.h
│ ├── console.cpp
│ ├── console.h
│ ├── hierarchy.cpp
│ ├── hierarchy.h
│ ├── inspector.cpp
│ ├── inspector.h
│ ├── material_editor.cpp
│ ├── material_editor.h
│ ├── menu_bar.cpp
│ ├── menu_bar.h
│ ├── profiler_window.cpp
│ ├── profiler_window.h
│ ├── project_settings.cpp
│ ├── project_settings.h
│ ├── tool_bar.cpp
│ └── tool_bar.h
└── view
│ ├── asset_view.cpp
│ ├── asset_view.h
│ ├── game_view.cpp
│ ├── game_view.h
│ ├── scene_view.cpp
│ ├── scene_view.h
│ ├── view.cpp
│ └── view.h
├── vox.geometry
├── CMakeLists.txt
├── array.h
├── array1-inl.h
├── array1.h
├── array2-inl.h
├── array2.h
├── array3-inl.h
├── array3.h
├── array_accessor.h
├── array_accessor1-inl.h
├── array_accessor1.h
├── array_accessor2-inl.h
├── array_accessor2.h
├── array_accessor3-inl.h
├── array_accessor3.h
├── array_samplers.h
├── array_samplers1-inl.h
├── array_samplers1.h
├── array_samplers2-inl.h
├── array_samplers2.h
├── array_samplers3-inl.h
├── array_samplers3.h
├── array_utils-inl.h
├── array_utils.h
├── bcc_lattice_point_generator.cpp
├── bcc_lattice_point_generator.h
├── blas-inl.h
├── blas.h
├── box2.cpp
├── box2.h
├── box3.cpp
├── box3.h
├── bvh2-inl.h
├── bvh2.h
├── bvh3-inl.h
├── bvh3.h
├── cell_centered_scalar_grid2.cpp
├── cell_centered_scalar_grid2.h
├── cell_centered_scalar_grid3.cpp
├── cell_centered_scalar_grid3.h
├── cell_centered_vector_grid2.cpp
├── cell_centered_vector_grid2.h
├── cell_centered_vector_grid3.cpp
├── cell_centered_vector_grid3.h
├── cg-inl.h
├── cg.h
├── collocated_vector_grid2.cpp
├── collocated_vector_grid2.h
├── collocated_vector_grid3.cpp
├── collocated_vector_grid3.h
├── constant_scalar_field2.cpp
├── constant_scalar_field2.h
├── constant_scalar_field3.cpp
├── constant_scalar_field3.h
├── constant_vector_field2.cpp
├── constant_vector_field2.h
├── constant_vector_field3.cpp
├── constant_vector_field3.h
├── custom_implicit_surface2.cpp
├── custom_implicit_surface2.h
├── custom_implicit_surface3.cpp
├── custom_implicit_surface3.h
├── custom_scalar_field2.cpp
├── custom_scalar_field2.h
├── custom_scalar_field3.cpp
├── custom_scalar_field3.h
├── custom_vector_field2.cpp
├── custom_vector_field2.h
├── custom_vector_field3.cpp
├── custom_vector_field3.h
├── cylinder3.cpp
├── cylinder3.h
├── face_centered_grid2.cpp
├── face_centered_grid2.h
├── face_centered_grid3.cpp
├── face_centered_grid3.h
├── fcc_lattice_point_generator.cpp
├── fcc_lattice_point_generator.h
├── fdm_cg_solver2.cpp
├── fdm_cg_solver2.h
├── fdm_cg_solver3.cpp
├── fdm_cg_solver3.h
├── fdm_gauss_seidel_solver2.cpp
├── fdm_gauss_seidel_solver2.h
├── fdm_gauss_seidel_solver3.cpp
├── fdm_gauss_seidel_solver3.h
├── fdm_iccg_solver2.cpp
├── fdm_iccg_solver2.h
├── fdm_iccg_solver3.cpp
├── fdm_iccg_solver3.h
├── fdm_jacobi_solver2.cpp
├── fdm_jacobi_solver2.h
├── fdm_jacobi_solver3.cpp
├── fdm_jacobi_solver3.h
├── fdm_linear_system2.cpp
├── fdm_linear_system2.h
├── fdm_linear_system3.cpp
├── fdm_linear_system3.h
├── fdm_linear_system_solver2.h
├── fdm_linear_system_solver3.h
├── fdm_mg_linear_system2-inl.h
├── fdm_mg_linear_system2.cpp
├── fdm_mg_linear_system2.h
├── fdm_mg_linear_system3-inl.h
├── fdm_mg_linear_system3.cpp
├── fdm_mg_linear_system3.h
├── fdm_mg_solver2.cpp
├── fdm_mg_solver2.h
├── fdm_mg_solver3.cpp
├── fdm_mg_solver3.h
├── fdm_mgpcg_solver2.cpp
├── fdm_mgpcg_solver2.h
├── fdm_mgpcg_solver3.cpp
├── fdm_mgpcg_solver3.h
├── fdm_utils.cpp
├── fdm_utils.h
├── field2.cpp
├── field2.h
├── field3.cpp
├── field3.h
├── frame.cpp
├── frame.h
├── grid2.cpp
├── grid2.h
├── grid3.cpp
├── grid3.h
├── grid_emitter2.cpp
├── grid_emitter2.h
├── grid_emitter3.cpp
├── grid_emitter3.h
├── grid_emitter_set2.cpp
├── grid_emitter_set2.h
├── grid_emitter_set3.cpp
├── grid_emitter_set3.h
├── grid_point_generator2.cpp
├── grid_point_generator2.h
├── grid_point_generator3.cpp
├── grid_point_generator3.h
├── implicit_surface2.cpp
├── implicit_surface2.h
├── implicit_surface3.cpp
├── implicit_surface3.h
├── implicit_surface_set2.cpp
├── implicit_surface_set2.h
├── implicit_surface_set3.cpp
├── implicit_surface_set3.h
├── implicit_triangle_mesh3.cpp
├── implicit_triangle_mesh3.h
├── intersection_query_engine2.h
├── intersection_query_engine3.h
├── kdtree-inl.h
├── kdtree.h
├── level_set_utils-inl.h
├── level_set_utils.h
├── list_query_engine2-inl.h
├── list_query_engine2.h
├── list_query_engine3-inl.h
├── list_query_engine3.h
├── marching_cubes.cpp
├── marching_cubes.h
├── marching_cubes_table.h
├── marching_squares_table.h
├── matrix_csr-inl.h
├── matrix_csr.h
├── matrix_mxn-inl.h
├── matrix_mxn.h
├── matrix_utils.h
├── mg-inl.h
├── mg.h
├── nearest_neighbor_query_engine2.h
├── nearest_neighbor_query_engine3.h
├── octree-inl.h
├── octree.h
├── particle_emitter2.cpp
├── particle_emitter2.h
├── particle_emitter3.cpp
├── particle_emitter3.h
├── particle_emitter_set2.cpp
├── particle_emitter_set2.h
├── particle_emitter_set3.cpp
├── particle_emitter_set3.h
├── particle_system_data2.cpp
├── particle_system_data2.h
├── particle_system_data3.cpp
├── particle_system_data3.h
├── plane2.cpp
├── plane2.h
├── plane3.cpp
├── plane3.h
├── point_generator2.cpp
├── point_generator2.h
├── point_generator3.cpp
├── point_generator3.h
├── point_hash_grid_searcher2.cpp
├── point_hash_grid_searcher2.h
├── point_hash_grid_searcher3.cpp
├── point_hash_grid_searcher3.h
├── point_kdtree_searcher2.cpp
├── point_kdtree_searcher2.h
├── point_kdtree_searcher3.cpp
├── point_kdtree_searcher3.h
├── point_neighbor_searcher2.cpp
├── point_neighbor_searcher2.h
├── point_neighbor_searcher3.cpp
├── point_neighbor_searcher3.h
├── point_parallel_hash_grid_searcher2.cpp
├── point_parallel_hash_grid_searcher2.h
├── point_parallel_hash_grid_searcher3.cpp
├── point_parallel_hash_grid_searcher3.h
├── point_particle_emitter2.cpp
├── point_particle_emitter2.h
├── point_particle_emitter3.cpp
├── point_particle_emitter3.h
├── point_simple_list_searcher2.cpp
├── point_simple_list_searcher2.h
├── point_simple_list_searcher3.cpp
├── point_simple_list_searcher3.h
├── quadtree-inl.h
├── quadtree.h
├── samplers-inl.h
├── samplers.h
├── scalar_field2.cpp
├── scalar_field2.h
├── scalar_field3.cpp
├── scalar_field3.h
├── scalar_grid2.cpp
├── scalar_grid2.h
├── scalar_grid3.cpp
├── scalar_grid3.h
├── sphere2.cpp
├── sphere2.h
├── sphere3.cpp
├── sphere3.h
├── surface2.cpp
├── surface2.h
├── surface3.cpp
├── surface3.h
├── surface_set2.cpp
├── surface_set2.h
├── surface_set3.cpp
├── surface_set3.h
├── surface_to_implicit2.cpp
├── surface_to_implicit2.h
├── surface_to_implicit3.cpp
├── surface_to_implicit3.h
├── svd-inl.h
├── svd.h
├── triangle3.cpp
├── triangle3.h
├── triangle_mesh3.cpp
├── triangle_mesh3.h
├── triangle_mesh_to_sdf.cpp
├── triangle_mesh_to_sdf.h
├── triangle_point_generator.cpp
├── triangle_point_generator.h
├── vector_field2.cpp
├── vector_field2.h
├── vector_field3.cpp
├── vector_field3.h
├── vector_grid2.cpp
├── vector_grid2.h
├── vector_grid3.cpp
├── vector_grid3.h
├── vector_n-inl.h
├── vector_n.h
├── vertex_centered_scalar_grid2.cpp
├── vertex_centered_scalar_grid2.h
├── vertex_centered_scalar_grid3.cpp
├── vertex_centered_scalar_grid3.h
├── vertex_centered_vector_grid2.cpp
├── vertex_centered_vector_grid2.h
├── vertex_centered_vector_grid3.cpp
├── vertex_centered_vector_grid3.h
├── volume_grid_emitter2.cpp
├── volume_grid_emitter2.h
├── volume_grid_emitter3.cpp
├── volume_grid_emitter3.h
├── volume_particle_emitter2.cpp
├── volume_particle_emitter2.h
├── volume_particle_emitter3.cpp
└── volume_particle_emitter3.h
├── vox.math
├── CMakeLists.txt
├── bounding_box-inl.h
├── bounding_box.h
├── bounding_box2-inl.h
├── bounding_box2.h
├── bounding_box3-inl.h
├── bounding_box3.h
├── bounding_frustum.cpp
├── bounding_frustum.h
├── bounding_plane.h
├── bounding_plane2-inl.h
├── bounding_plane2.h
├── bounding_plane3-inl.h
├── bounding_plane3.h
├── bounding_sphere.cpp
├── bounding_sphere.h
├── collision_utils.cpp
├── collision_utils.h
├── color.cpp
├── color.h
├── functors-inl.h
├── functors.h
├── math_archive.cpp
├── math_archive.h
├── math_utils-inl.h
├── math_utils.h
├── matrix-inl.h
├── matrix.h
├── matrix2x2-inl.h
├── matrix2x2.h
├── matrix3x3-inl.h
├── matrix3x3.h
├── matrix4x4-inl.h
├── matrix4x4.h
├── matrix_expression-inl.h
├── matrix_expression.h
├── perlin.cpp
├── perlin.h
├── point-inl.h
├── point.h
├── point2-inl.h
├── point2.h
├── point3-inl.h
├── point3.h
├── quaternion-inl.h
├── quaternion.h
├── ray.h
├── ray2-inl.h
├── ray2.h
├── ray3-inl.h
├── ray3.h
├── rect.h
├── scalable_transform.h
├── size-inl.h
├── size.h
├── size2-inl.h
├── size2.h
├── size3-inl.h
├── size3.h
├── spherical_harmonics3.cpp
├── spherical_harmonics3.h
├── transform2-inl.h
├── transform2.h
├── transform3-inl.h
├── transform3.h
├── vector-inl.h
├── vector.h
├── vector2-inl.h
├── vector2.h
├── vector3-inl.h
├── vector3.h
├── vector4-inl.h
├── vector4.h
├── vector_expression-inl.h
└── vector_expression.h
├── vox.render
├── CMakeLists.txt
├── animation
│ ├── animation_state.cpp
│ ├── animation_state.h
│ ├── animation_states
│ │ ├── animation_blending.cpp
│ │ ├── animation_blending.h
│ │ ├── animation_clip.cpp
│ │ ├── animation_clip.h
│ │ ├── animation_crossfade.cpp
│ │ └── animation_crossfade.h
│ ├── animator.cpp
│ ├── animator.h
│ ├── skin.cpp
│ ├── skin.h
│ ├── skinned_mesh_renderer.cpp
│ └── skinned_mesh_renderer.h
├── assimp_parser.cpp
├── assimp_parser.h
├── background.h
├── camera.cpp
├── camera.h
├── component.cpp
├── component.h
├── components_manager.cpp
├── components_manager.h
├── debug_info.cpp
├── debug_info.h
├── entity.cpp
├── entity.h
├── event-inl.h
├── event.h
├── fog
│ ├── exp2_fog.cpp
│ ├── exp2_fog.h
│ ├── fog.cpp
│ ├── fog.h
│ ├── linear_fog.cpp
│ └── linear_fog.h
├── forward_application.cpp
├── forward_application.h
├── graphics_application.cpp
├── graphics_application.h
├── helper.cpp
├── helper.h
├── image.cpp
├── image.h
├── image
│ ├── astc_img.cpp
│ ├── astc_img.h
│ ├── ktx_img.cpp
│ ├── ktx_img.h
│ ├── stb_img.cpp
│ └── stb_img.h
├── image_manager.cpp
├── image_manager.h
├── image_view.cpp
├── image_view.h
├── inspector_item.h
├── layer.h
├── lighting
│ ├── ambient_light.cpp
│ ├── ambient_light.h
│ ├── debug
│ │ ├── cluster_debug_material.cpp
│ │ ├── cluster_debug_material.h
│ │ ├── sprite_debug.cpp
│ │ └── sprite_debug.h
│ ├── direct_light.cpp
│ ├── direct_light.h
│ ├── light.cpp
│ ├── light.h
│ ├── light_manager.cpp
│ ├── light_manager.h
│ ├── point_light.cpp
│ ├── point_light.h
│ ├── spot_light.cpp
│ └── spot_light.h
├── material
│ ├── base_material.cpp
│ ├── base_material.h
│ ├── blinn_phong_material.cpp
│ ├── blinn_phong_material.h
│ ├── enums
│ │ ├── blend_mode.h
│ │ ├── render_face.h
│ │ ├── render_queue_type.h
│ │ └── texture_coordinate.h
│ ├── material.cpp
│ ├── material.h
│ ├── pbr_base_material.cpp
│ ├── pbr_base_material.h
│ ├── pbr_material.cpp
│ ├── pbr_material.h
│ ├── pbr_specular_material.cpp
│ ├── pbr_specular_material.h
│ ├── unlit_material.cpp
│ └── unlit_material.h
├── mesh
│ ├── buffer.cpp
│ ├── buffer.h
│ ├── buffer_mesh.cpp
│ ├── buffer_mesh.h
│ ├── buffer_pool.cpp
│ ├── buffer_pool.h
│ ├── index_buffer_binding.cpp
│ ├── index_buffer_binding.h
│ ├── mesh.cpp
│ ├── mesh.h
│ ├── mesh_manager.cpp
│ ├── mesh_manager.h
│ ├── mesh_renderer.cpp
│ ├── mesh_renderer.h
│ ├── model_mesh.cpp
│ ├── model_mesh.h
│ ├── primitive_mesh.cpp
│ ├── primitive_mesh.h
│ ├── sub_mesh.cpp
│ ├── sub_mesh.h
│ ├── wireframe_primitive_mesh.cpp
│ └── wireframe_primitive_mesh.h
├── particle
│ ├── particle_manager.cpp
│ ├── particle_manager.h
│ ├── particle_material.cpp
│ ├── particle_material.h
│ ├── particle_renderer.cpp
│ └── particle_renderer.h
├── physics
│ ├── collider.cpp
│ ├── collider.h
│ ├── physics_manager.cpp
│ └── physics_manager.h
├── physx
│ ├── physx_collider.cpp
│ ├── physx_collider.h
│ ├── physx_dynamic_collider.cpp
│ ├── physx_dynamic_collider.h
│ ├── physx_manager.cpp
│ ├── physx_manager.h
│ ├── physx_static_collider.cpp
│ └── physx_static_collider.h
├── platform
│ ├── android
│ │ ├── android_platform.cpp
│ │ ├── android_platform.h
│ │ ├── android_window.cpp
│ │ └── android_window.h
│ ├── application.cpp
│ ├── application.h
│ ├── configuration.cpp
│ ├── configuration.h
│ ├── filesystem.cpp
│ ├── filesystem.h
│ ├── glfw_window.cpp
│ ├── glfw_window.h
│ ├── headless_window.cpp
│ ├── headless_window.h
│ ├── input_events.cpp
│ ├── input_events.h
│ ├── parser.cpp
│ ├── parser.h
│ ├── parsers
│ │ ├── CLI11.cpp
│ │ ├── CLI11.h
│ │ ├── help_formatter.cpp
│ │ └── help_formatter.h
│ ├── platform.cpp
│ ├── platform.h
│ ├── plugins
│ │ ├── plugin.cpp
│ │ ├── plugin.h
│ │ └── plugin_base.h
│ ├── unix
│ │ ├── direct_window.cpp
│ │ ├── direct_window.h
│ │ ├── unix_d2d_platform.cpp
│ │ ├── unix_d2d_platform.h
│ │ ├── unix_platform.cpp
│ │ └── unix_platform.h
│ ├── window.cpp
│ ├── window.h
│ └── windows
│ │ ├── windows_platform.cpp
│ │ └── windows_platform.h
├── plugins
│ ├── force_close.cpp
│ └── force_close.h
├── renderer.cpp
├── renderer.h
├── rendering
│ ├── compute_pass.cpp
│ ├── compute_pass.h
│ ├── render_context.cpp
│ ├── render_context.h
│ ├── render_element.cpp
│ ├── render_element.h
│ ├── render_pass.cpp
│ ├── render_pass.h
│ ├── resource_cache.cpp
│ ├── resource_cache.h
│ ├── subpass.cpp
│ ├── subpass.h
│ └── subpasses
│ │ ├── color_picker_subpass.cpp
│ │ ├── color_picker_subpass.h
│ │ ├── forward_subpass.cpp
│ │ ├── forward_subpass.h
│ │ ├── geometry_subpass.cpp
│ │ └── geometry_subpass.h
├── scene.cpp
├── scene.h
├── scene_forward.h
├── scene_manager.cpp
├── scene_manager.h
├── script.cpp
├── script.h
├── shader
│ ├── glsl_compiler.cpp
│ ├── glsl_compiler.h
│ ├── internal_variant_name.h
│ ├── shader_common.h
│ ├── shader_data.cpp
│ ├── shader_data.h
│ ├── shader_manager.cpp
│ ├── shader_manager.h
│ ├── shader_module.cpp
│ ├── shader_module.h
│ ├── shader_source.cpp
│ ├── shader_source.h
│ ├── shader_variant.cpp
│ ├── shader_variant.h
│ ├── spirv_reflection.cpp
│ ├── spirv_reflection.h
│ └── state
│ │ ├── blend_state.cpp
│ │ ├── blend_state.h
│ │ ├── depth_state.cpp
│ │ ├── depth_state.h
│ │ ├── raster_state.cpp
│ │ ├── raster_state.h
│ │ ├── render_state.cpp
│ │ ├── render_state.h
│ │ ├── render_target_blend_state.h
│ │ ├── stencil_state.cpp
│ │ └── stencil_state.h
├── shadow
│ ├── cascade_shadow_subpass.cpp
│ ├── cascade_shadow_subpass.h
│ ├── enum
│ │ ├── shadow_cascades_mode.h
│ │ ├── shadow_mode.h
│ │ └── shadow_resolution.h
│ ├── shadow_debug_material.cpp
│ ├── shadow_debug_material.h
│ ├── shadow_manager.cpp
│ ├── shadow_manager.h
│ ├── shadow_material.cpp
│ ├── shadow_material.h
│ ├── shadow_slice_data.h
│ ├── shadow_utils.cpp
│ └── shadow_utils.h
├── singleton.h
├── sky
│ ├── skybox_subpass.cpp
│ └── skybox_subpass.h
├── stats
│ ├── frame_time_stats_provider.cpp
│ ├── frame_time_stats_provider.h
│ ├── hwcpipe_stats_provider.cpp
│ ├── hwcpipe_stats_provider.h
│ ├── stats.cpp
│ ├── stats.h
│ ├── stats_common.h
│ ├── stats_provider.cpp
│ └── stats_provider.h
├── std_helpers.h
├── strings.cpp
├── strings.h
├── tags.h
├── transform.cpp
├── transform.h
├── ui
│ ├── canvas.cpp
│ ├── canvas.h
│ ├── drawable.h
│ ├── gui_drawer-inl.h
│ ├── gui_drawer.cpp
│ ├── gui_drawer.h
│ ├── imgui_impl_glfw.cpp
│ ├── imgui_impl_glfw.h
│ ├── imgui_impl_wgpu.cpp
│ ├── imgui_impl_wgpu.h
│ ├── plugins
│ │ ├── contextual_menu.cpp
│ │ ├── contextual_menu.h
│ │ ├── data_dispatcher.h
│ │ ├── drag_drop_source.h
│ │ ├── drag_drop_target.h
│ │ ├── plugin.h
│ │ └── pluginable.h
│ ├── ui_manager.cpp
│ ├── ui_manager.h
│ └── widgets
│ │ ├── alignment.h
│ │ ├── buttons
│ │ ├── button.h
│ │ ├── button_arrow.cpp
│ │ ├── button_arrow.h
│ │ ├── button_colored.cpp
│ │ ├── button_colored.h
│ │ ├── button_image.cpp
│ │ ├── button_image.h
│ │ ├── button_simple.cpp
│ │ ├── button_simple.h
│ │ ├── button_small.cpp
│ │ └── button_small.h
│ │ ├── converter.cpp
│ │ ├── converter.h
│ │ ├── data_widget.h
│ │ ├── drags
│ │ ├── drag_double.cpp
│ │ ├── drag_double.h
│ │ ├── drag_float.cpp
│ │ ├── drag_float.h
│ │ ├── drag_int.cpp
│ │ ├── drag_int.h
│ │ ├── drag_multiple_doubles.h
│ │ ├── drag_multiple_floats.h
│ │ ├── drag_multiple_ints.h
│ │ ├── drag_multiple_scalars.h
│ │ └── drag_single_scalar.h
│ │ ├── input_fields
│ │ ├── input_double.cpp
│ │ ├── input_double.h
│ │ ├── input_float.cpp
│ │ ├── input_float.h
│ │ ├── input_int.cpp
│ │ ├── input_int.h
│ │ ├── input_multiple_doubles.h
│ │ ├── input_multiple_floats.h
│ │ ├── input_multiple_ints.h
│ │ ├── input_multiple_scalars.h
│ │ ├── input_single_scalar.h
│ │ ├── input_text.cpp
│ │ └── input_text.h
│ │ ├── layout
│ │ ├── columns.h
│ │ ├── dummy.cpp
│ │ ├── dummy.h
│ │ ├── group.cpp
│ │ ├── group.h
│ │ ├── group_collapsable.cpp
│ │ ├── group_collapsable.h
│ │ ├── new_line.cpp
│ │ ├── new_line.h
│ │ ├── spacing.cpp
│ │ ├── spacing.h
│ │ ├── tree_node.cpp
│ │ └── tree_node.h
│ │ ├── menu
│ │ ├── menu_item.cpp
│ │ ├── menu_item.h
│ │ ├── menu_list.cpp
│ │ └── menu_list.h
│ │ ├── panel.cpp
│ │ ├── panel.h
│ │ ├── panel_transformable.cpp
│ │ ├── panel_transformable.h
│ │ ├── panel_transformables
│ │ ├── panel_undecorated.cpp
│ │ ├── panel_undecorated.h
│ │ ├── panel_window.cpp
│ │ └── panel_window.h
│ │ ├── panel_window_settings.h
│ │ ├── panels
│ │ ├── panel_menu_bar.cpp
│ │ └── panel_menu_bar.h
│ │ ├── plot
│ │ ├── plot.cpp
│ │ ├── plot.h
│ │ ├── plot_histogram.cpp
│ │ ├── plot_histogram.h
│ │ ├── plot_lines.cpp
│ │ └── plot_lines.h
│ │ ├── selection
│ │ ├── check_box.cpp
│ │ ├── check_box.h
│ │ ├── color_edit.cpp
│ │ ├── color_edit.h
│ │ ├── color_picker.cpp
│ │ ├── color_picker.h
│ │ ├── combo_box.cpp
│ │ ├── combo_box.h
│ │ ├── radio_button.cpp
│ │ ├── radio_button.h
│ │ ├── radio_button_linker.cpp
│ │ └── radio_button_linker.h
│ │ ├── sliders
│ │ ├── slider_double.cpp
│ │ ├── slider_double.h
│ │ ├── slider_float.cpp
│ │ ├── slider_float.h
│ │ ├── slider_int.cpp
│ │ ├── slider_int.h
│ │ ├── slider_multiple_doubles.h
│ │ ├── slider_multiple_floats.h
│ │ ├── slider_multiple_ints.h
│ │ ├── slider_multiple_scalars.h
│ │ └── slider_single_scalar.h
│ │ ├── texts
│ │ ├── text.cpp
│ │ ├── text.h
│ │ ├── text_clickable.cpp
│ │ ├── text_clickable.h
│ │ ├── text_colored.cpp
│ │ ├── text_colored.h
│ │ ├── text_disabled.cpp
│ │ ├── text_disabled.h
│ │ ├── text_labelled.cpp
│ │ ├── text_labelled.h
│ │ ├── text_selectable.cpp
│ │ ├── text_selectable.h
│ │ ├── text_wrapped.cpp
│ │ └── text_wrapped.h
│ │ ├── visual
│ │ ├── bullet.cpp
│ │ ├── bullet.h
│ │ ├── image.cpp
│ │ ├── image.h
│ │ ├── progress_bar.cpp
│ │ ├── progress_bar.h
│ │ ├── separator.cpp
│ │ └── separator.h
│ │ ├── widget.cpp
│ │ ├── widget.h
│ │ ├── widget_container.cpp
│ │ └── widget_container.h
├── update_flag.cpp
├── update_flag.h
├── update_flag_manager.cpp
├── update_flag_manager.h
├── utils.cpp
├── utils.h
├── utils
│ ├── D3D12Binding.cpp
│ ├── OpenGLBinding.cpp
│ ├── VulkanBinding.cpp
│ ├── backend_binding.cpp
│ ├── backend_binding.h
│ ├── metal_binding.mm
│ └── null_binding.cpp
└── vobject.h
├── vox.simd_math
├── CMakeLists.txt
├── internal
│ ├── simd_math_config.h
│ ├── simd_math_ref-inl.h
│ └── simd_math_sse-inl.h
├── simd_math.cpp
├── simd_math.h
├── simd_math_archive.cpp
├── simd_math_archive.h
├── simd_quaternion.h
├── soa_float.h
├── soa_float4x4.h
├── soa_math_archive.cpp
├── soa_math_archive.h
├── soa_quaternion.h
└── soa_transform.h
└── vox.toolkit
├── CMakeLists.txt
├── controls
├── free_control.cpp
├── free_control.h
├── orbit_control.cpp
├── orbit_control.h
├── spherical.cpp
└── spherical.h
├── grid
├── grid_control.cpp
├── grid_control.h
├── grid_material.cpp
└── grid_material.h
├── physics_view
├── physics_view_subpass.cpp
├── physics_view_subpass.h
├── render_instances.cpp
├── render_instances.h
├── render_primitive.cpp
└── render_primitive.h
└── skeleton_view
├── skeleton_view.cpp
└── skeleton_view.h
/.clang-format:
--------------------------------------------------------------------------------
1 | BasedOnStyle: Google
2 | IndentWidth: 4
3 | ColumnLimit: 120
4 | UseTab: Never
5 | Standard: c++17
6 | ContinuationIndentWidth: 8
7 | AccessModifierOffset: -4
8 | BinPackParameters: false
9 | SortIncludes: "CaseInsensitive"
10 |
--------------------------------------------------------------------------------
/Arche-cpp.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Arche-cpp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/apps/animation/animation_additive_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 | #include "vox.render/ui/canvas.h"
11 | #include "vox.render/ui/widgets/panel_transformables/panel_window.h"
12 |
13 | namespace vox {
14 | class AnimationAdditiveApp : public ForwardApplication {
15 | public:
16 | void loadScene() override;
17 |
18 | private:
19 | ui::Canvas canvas_;
20 | ui::PanelWindow panel_;
21 | };
22 | } // namespace vox
--------------------------------------------------------------------------------
/apps/animation/animation_attach_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class AnimationAttachApp : public ForwardApplication {
13 | public:
14 | void loadScene() override;
15 | };
16 | } // namespace vox
--------------------------------------------------------------------------------
/apps/animation/animation_blend_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 | #include "vox.render/ui/canvas.h"
11 | #include "vox.render/ui/widgets/panel_transformables/panel_window.h"
12 |
13 | namespace vox {
14 | class AnimationBlendApp : public ForwardApplication {
15 | public:
16 | void loadScene() override;
17 |
18 | private:
19 | ui::Canvas canvas_;
20 | ui::PanelWindow panel_;
21 | };
22 | } // namespace vox
--------------------------------------------------------------------------------
/apps/animation/animation_ik_floor_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class AnimationIKFloorApp : public ForwardApplication {
13 | public:
14 | void loadScene() override;
15 | };
16 | } // namespace vox
--------------------------------------------------------------------------------
/apps/animation/animation_ik_hand_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class AnimationIKHandApp : public ForwardApplication {
13 | public:
14 | void loadScene() override;
15 | };
16 | } // namespace vox
--------------------------------------------------------------------------------
/apps/animation/animation_ik_lookat_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class AnimationIKLookAtApp : public ForwardApplication {
13 | public:
14 | void loadScene() override;
15 | };
16 | } // namespace vox
--------------------------------------------------------------------------------
/apps/animation/animation_partial_blend_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 | #include "vox.render/ui/canvas.h"
11 | #include "vox.render/ui/widgets/panel_transformables/panel_window.h"
12 |
13 | namespace vox {
14 | class AnimationPartialBlendApp : public ForwardApplication {
15 | public:
16 | void loadScene() override;
17 |
18 | private:
19 | ui::Canvas canvas_;
20 | ui::PanelWindow panel_;
21 | };
22 | } // namespace vox
--------------------------------------------------------------------------------
/apps/animation/animation_sample.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "apps/animation/animation_additive_app.h"
10 | #include "apps/animation/animation_attach_app.h"
11 | #include "apps/animation/animation_blend_app.h"
12 | #include "apps/animation/animation_create_app.h"
13 | #include "apps/animation/animation_ik_floor_app.h"
14 | #include "apps/animation/animation_ik_hand_app.h"
15 | #include "apps/animation/animation_ik_lookat_app.h"
16 | #include "apps/animation/animation_partial_blend_app.h"
17 | #include "apps/animation/skinning_app.h"
--------------------------------------------------------------------------------
/apps/animation/skinning_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class SkinningApp : public ForwardApplication {
13 | public:
14 | void loadScene() override;
15 | };
16 | } // namespace vox
--------------------------------------------------------------------------------
/apps/apps.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.cs.disable-library-validation
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/apps/assimp_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class AssimpApp : public ForwardApplication {
13 | public:
14 | void loadScene() override;
15 | };
16 |
17 | } // namespace vox
18 |
--------------------------------------------------------------------------------
/apps/atomic_compute_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 | #include "vox.render/rendering/compute_pass.h"
11 |
12 | namespace vox {
13 | class AtomicComputeApp : public ForwardApplication {
14 | public:
15 | bool prepare(Platform& platform) override;
16 |
17 | void loadScene() override;
18 |
19 | void updateGPUTask(wgpu::CommandEncoder& commandEncoder) override;
20 |
21 | private:
22 | std::shared_ptr _material{nullptr};
23 | std::unique_ptr _pass{nullptr};
24 | };
25 | } // namespace vox
--------------------------------------------------------------------------------
/apps/example/ObjCUtils.mm:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Dawn Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #include "ObjCUtils.h"
16 |
17 | #include
18 |
19 | namespace utils {
20 |
21 | void* CreateDummyCALayer() { return [CALayer layer]; }
22 |
23 | } // namespace utils
24 |
--------------------------------------------------------------------------------
/apps/example/SystemUtils.h:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Dawn Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef UTILS_SYSTEMUTILS_H_
16 | #define UTILS_SYSTEMUTILS_H_
17 |
18 | namespace utils {
19 |
20 | void USleep(unsigned int usecs);
21 | }
22 |
23 | #endif // UTILS_SYSTEMUTILS_H_
24 |
--------------------------------------------------------------------------------
/apps/gui_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 | #include "vox.render/ui/canvas.h"
11 | #include "vox.render/ui/widgets/panel_transformables/panel_window.h"
12 |
13 | namespace vox {
14 | class GuiApp : public ForwardApplication {
15 | public:
16 | void loadScene() override;
17 |
18 | private:
19 | ui::Canvas canvas_;
20 | ui::PanelWindow panel_;
21 | };
22 |
23 | } // namespace vox
24 |
--------------------------------------------------------------------------------
/apps/physics_collision_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsCollisionApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 |
19 | } // namespace vox
20 |
--------------------------------------------------------------------------------
/apps/physics_samples/constraints/cone_constraint_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsConeConstraintApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/constraints/constraint_singularity_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsConstraintSingularityApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/constraints/distance_constraint_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsDistanceConstraintApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/constraints/fixed_constraint_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsFixedConstraintApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/constraints/gear_constraint_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsGearConstraintApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/constraints/hinge_constraint_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsHingeConstraintApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/constraints/point_constraint_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsPointConstraintApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/constraints/pulley_constraint_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsPulleyConstraintApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/constraints/rack_and_pinion_constraint_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsRackAndPinionConstraintApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/constraints/slider_constraint_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsSliderConstraintApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/constraints/spring_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsSpringApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/constraints/swing_twist_constraint_friction_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 | //
11 | #include
12 |
13 | namespace vox {
14 | class PhysicsSwingTwistConstraintFrictionApp : public ForwardApplication {
15 | public:
16 | bool prepare(Platform &platform) override;
17 |
18 | void loadScene() override;
19 |
20 | private:
21 | float mTime = 0.0f;
22 | JPH::SwingTwistConstraint *mConstraint = nullptr;
23 | };
24 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/general/active_edges_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | // This app checks if coplanar triangles are properly merged for the simulation in order to avoid collisions with
13 | // invisible edges.
14 | class PhysicsActiveEdgesApp : public ForwardApplication {
15 | public:
16 | bool prepare(Platform &platform) override;
17 |
18 | void loadScene() override;
19 | };
20 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/general/big_vs_small_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | // Tests a small box falling on a big triangle to test for numerical precision errors.
13 | class PhysicsBigVsSmallApp : public ForwardApplication {
14 | public:
15 | bool prepare(Platform &platform) override;
16 |
17 | void loadScene() override;
18 | };
19 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/general/center_of_mass_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | // Tests that spawns various shapes with the center of mass not in the center of the object
13 | class PhysicsCenterOfMassApp : public ForwardApplication {
14 | public:
15 | bool prepare(Platform &platform) override;
16 |
17 | void loadScene() override;
18 | };
19 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/general/change_motion_type_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | // This test will switch a body between static, kinematic and dynamic
13 | class PhysicsChangeMotionTypeApp : public ForwardApplication {
14 | public:
15 | bool prepare(Platform &platform) override;
16 |
17 | void loadScene() override;
18 |
19 | private:
20 | JPH::Body *mBody = nullptr;
21 | float mTime = 0.0f;
22 | };
23 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/general/change_shape_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | // This test will make a dynamic body cyle through various shapes
13 | class PhysicChangeShapeApp : public ForwardApplication {
14 | public:
15 | bool prepare(Platform &platform) override;
16 |
17 | void loadScene() override;
18 |
19 | private:
20 | bool mActivateAfterSwitch = true;
21 | JPH::BodyID mBodyID;
22 | JPH::Array> mShapes;
23 | float mTime = 0.0f;
24 | int mShapeIdx = 0;
25 | };
26 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/general/contact_manifold_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | // This test spawns objects at an angle of each other to test if the contact manifold is calculated correctly
13 | class PhysicsContactManifoldApp : public ForwardApplication {
14 | public:
15 | bool prepare(Platform &platform) override;
16 |
17 | void loadScene() override;
18 | };
19 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/general/damping_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | // This test tests various values for linear and angular damping
13 | class PhysicsDampingApp : public ForwardApplication {
14 | public:
15 | bool prepare(Platform &platform) override;
16 |
17 | void loadScene() override;
18 | };
19 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/general/dynamic_mesh_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | // This test drops a mesh shape on a box
13 | class PhysicsDynamicMeshApp : public ForwardApplication {
14 | public:
15 | bool prepare(Platform &platform) override;
16 |
17 | void loadScene() override;
18 | };
19 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/general/friction_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | // This test tests various values for friction
13 | class PhysicsFrictionApp : public ForwardApplication {
14 | public:
15 | bool prepare(Platform &platform) override;
16 |
17 | void loadScene() override;
18 | };
19 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/general/funnel_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | // This test spawns a lot of objects and drops them into a funnel to check for performance / stability issues
13 | class PhysicsFunnelApp : public ForwardApplication {
14 | public:
15 | bool prepare(Platform &platform) override;
16 |
17 | void loadScene() override;
18 | };
19 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/general/gravity_factor_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | // This test tests various gravity factors
13 | class PhysicsGravityFactorApp : public ForwardApplication {
14 | public:
15 | bool prepare(Platform &platform) override;
16 |
17 | void loadScene() override;
18 | };
19 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/general/heavy_on_light_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | // This test spawns a number of heavy boxes (with increasing weight) on smaller boxes to see how the simulation handles this
13 | class PhysicsHeavyOnLightApp : public ForwardApplication {
14 | public:
15 | bool prepare(Platform &platform) override;
16 |
17 | void loadScene() override;
18 | };
19 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/general/island_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | // This test creates a number of disjoint piles of blocks to see if the islands are properly determined and that the simulation spreads them out over multiple CPUs
13 | class PhysicsIslandApp : public ForwardApplication {
14 | public:
15 | bool prepare(Platform &platform) override;
16 |
17 | void loadScene() override;
18 | };
19 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/general/kinematic_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | // This test tests kinematic objects against a pile of dynamic boxes
13 | class PhysicsKinematicApp : public ForwardApplication {
14 | public:
15 | bool prepare(Platform &platform) override;
16 |
17 | void loadScene() override;
18 |
19 | private:
20 | JPH::Body *mKinematic[2];
21 | };
22 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/general/manifold_reduction_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | // This test shows how many coplanar triangles are reduced to a single contact manifold
13 | class PhysicsManifoldReductionApp : public ForwardApplication {
14 | public:
15 | bool prepare(Platform &platform) override;
16 |
17 | void loadScene() override;
18 | };
19 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/general/restitution_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | // This test tests various different restitution values
13 | class PhysicsRestitutionApp : public ForwardApplication {
14 | public:
15 | bool prepare(Platform &platform) override;
16 |
17 | void loadScene() override;
18 | };
19 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/general/stack_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | // This test stacks a number of boxes to see if the simulation is stable
13 | class PhysicsStackApp : public ForwardApplication {
14 | public:
15 | bool prepare(Platform &platform) override;
16 |
17 | void loadScene() override;
18 | };
19 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/general/wall_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | // This test tests a large pile of boxes to check stacking and performance behavior.
13 | class PhysicsWallApp : public ForwardApplication {
14 | public:
15 | bool prepare(Platform &platform) override;
16 |
17 | void loadScene() override;
18 | };
19 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/physics_debug_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsDebugApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 |
18 | private:
19 | JPH::BodyID sphere_id;
20 | };
21 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/scaled_shapes/scaled_box_shape_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsScaledBoxShapeApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/scaled_shapes/scaled_capsule_shape_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsScaledCapsuleShapeApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/scaled_shapes/scaled_convex_hull_shape_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsScaledConvexHullShapeApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/scaled_shapes/scaled_cylinder_shape_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsScaledCylinderShapeApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/scaled_shapes/scaled_height_field_shape_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsScaledHeightFieldShapeApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/scaled_shapes/scaled_mesh_shape_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsScaledMeshShapeApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/scaled_shapes/scaled_mutable_compound_shape_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsScaledMutableCompoundShapeApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/scaled_shapes/scaled_offset_center_of_mass_shape_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsScaledOffsetCenterOfMassShapeApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/scaled_shapes/scaled_sphere_shape_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsScaledSphereShapeApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/scaled_shapes/scaled_static_compound_shape_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsScaledStaticCompoundShapeApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/scaled_shapes/scaled_tapered_capsule_shape_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsScaledTaperedCapsuleShapeApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/scaled_shapes/scaled_triangle_shape_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsScaledTriangleShapeApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/shapes/box_shape_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsBoxShapeApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/shapes/capsule_shape_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsCapsuleShapeApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/shapes/convex_hull_shape_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsConvexHullShapeApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/shapes/cylinder_shape_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsCylinderShapeApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/shapes/mesh_shape_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsMeshShapeApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/shapes/mutable_compound_shape_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsMutableCompoundShapeApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 |
18 | private:
19 | JPH::BodyIDVector mBodyIDs;
20 | JPH::RefConst mSubCompound;
21 | };
22 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/shapes/offset_center_of_mass_shape_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsOffsetCenterOfMassShapeApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/shapes/rotated_translated_shape_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsRotatedTranslatedShapeApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/shapes/sphere_shape_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsSphereShapeApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/shapes/static_compound_shape_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsStaticCompoundShapeApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/shapes/tapered_capsule_shape_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsTaperedCapsuleShapeApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/shapes/triangle_shape_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsTriangleShapeApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physics_samples/water/water_shape_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PhysicsWaterShapeApp : public ForwardApplication {
13 | public:
14 | bool prepare(Platform &platform) override;
15 |
16 | void loadScene() override;
17 | };
18 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physx/api/local_torque_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class LocalTorqueApp : public ForwardApplication {
13 | public:
14 | const std::string desc =
15 | "Tests that the AddLocalTorque function works as expected. "
16 | "Set the angular damping to zero in each plugin's UI "
17 | "if you want the angular velocity to remain constant. "
18 | "That way you can easily see which velocity has been reached in each engine, for the same torque.";
19 |
20 | void loadScene() override;
21 | };
22 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physx/api/mass_local_offset_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class MassLocalOffsetApp : public ForwardApplication {
13 | public:
14 | const std::string desc =
15 | "Tests that the center-of-mass (COM) local offset is properly taken into account. "
16 | "The box should rotate on its own if the test succeeds. "
17 | "The rendered RGB frame indicates the location of the COM.";
18 |
19 | void loadScene() override;
20 | };
21 | } // namespace vox
--------------------------------------------------------------------------------
/apps/physx/physx_samples.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | // scenes api
10 | #include "apps/physx/api/mass_local_offset_app.h"
11 | #include "apps/physx/api/angular_velocity_app.h"
12 | #include "apps/physx/api/local_torque_app.h"
13 | #include "apps/physx/api/collision_groups_app.h"
--------------------------------------------------------------------------------
/apps/plugins/plugins.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/platform/plugins/plugin.h"
10 |
11 | namespace plugins {
12 | extern std::vector GetAll();
13 | } // namespace plugins
14 |
--------------------------------------------------------------------------------
/apps/primitive_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class PrimitiveApp : public ForwardApplication {
13 | public:
14 | void loadScene() override;
15 | };
16 | } // namespace vox
--------------------------------------------------------------------------------
/apps/rendering/cascade_shadowmap_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class CascadeShadowMapApp : public ForwardApplication {
13 | public:
14 | void loadScene() override;
15 | };
16 | } // namespace vox
--------------------------------------------------------------------------------
/apps/rendering/cluster_forward_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class ClusterForwardApp : public ForwardApplication {
13 | public:
14 | void loadScene() override;
15 | };
16 |
17 | } // namespace vox
--------------------------------------------------------------------------------
/apps/rendering/irradiance_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 | #include "vox.render/image.h"
11 | #include "vox.toolkit/controls/orbit_control.h"
12 |
13 | namespace vox {
14 | class IrradianceApp : public ForwardApplication {
15 | public:
16 | void loadScene() override;
17 | };
18 | } // namespace vox
19 |
--------------------------------------------------------------------------------
/apps/rendering/multi_light_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class MultiLightApp : public ForwardApplication {
13 | public:
14 | void loadScene() override;
15 | };
16 |
17 | } // namespace vox
--------------------------------------------------------------------------------
/apps/rendering/omni_shadowmap_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 | #include "vox.toolkit/controls/orbit_control.h"
11 |
12 | namespace vox {
13 | class OminiShadowMapApp : public ForwardApplication {
14 | public:
15 | void loadScene() override;
16 | };
17 | } // namespace vox
--------------------------------------------------------------------------------
/apps/rendering/particle_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 | #include "vox.render/particle/particle_manager.h"
11 |
12 | namespace vox {
13 | class ParticleApp : public ForwardApplication {
14 | public:
15 | void loadScene() override;
16 | };
17 | } // namespace vox
--------------------------------------------------------------------------------
/apps/rendering/rendering_sample.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | // pbr
10 | #include "apps/rendering/ibl_app.h"
11 | #include "apps/rendering/irradiance_app.h"
12 | #include "apps/rendering/pbr_app.h"
13 |
14 | // shadow
15 | #include "apps/rendering/cascade_shadowmap_app.h"
16 | #include "apps/rendering/omni_shadowmap_app.h"
17 | #include "apps/rendering/shadowmap_app.h"
18 |
19 | // light
20 | #include "apps/rendering/cluster_forward_app.h"
21 | #include "apps/rendering/multi_light_app.h"
22 |
23 | // particle
24 | #include "apps/rendering/particle_app.h"
25 |
26 | // sky
27 | #include "apps/rendering/skybox_app.h"
--------------------------------------------------------------------------------
/apps/rendering/shadowmap_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class ShadowMapApp : public ForwardApplication {
13 | public:
14 | void loadScene() override;
15 | };
16 | } // namespace vox
--------------------------------------------------------------------------------
/apps/rendering/skybox_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 | #include "vox.toolkit/controls/orbit_control.h"
11 |
12 | namespace vox {
13 | class SkyboxApp : public ForwardApplication {
14 | public:
15 | bool prepare(Platform &platform) override;
16 |
17 | void loadScene() override;
18 | };
19 | } // namespace vox
--------------------------------------------------------------------------------
/apps/scoped_autorelease_pool.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "scoped_autorelease_pool.h"
8 |
9 | #include "common/Compiler.h"
10 |
11 | namespace utils {
12 | ScopedAutoreleasePool::ScopedAutoreleasePool() : mPool(nullptr) { DAWN_UNUSED(mPool); }
13 |
14 | ScopedAutoreleasePool::~ScopedAutoreleasePool() = default;
15 |
16 | ScopedAutoreleasePool::ScopedAutoreleasePool(ScopedAutoreleasePool&& rhs) {}
17 |
18 | ScopedAutoreleasePool& ScopedAutoreleasePool::operator=(ScopedAutoreleasePool&& rhs) { return *this; }
19 |
20 | } // namespace utils
21 |
--------------------------------------------------------------------------------
/apps/toolkit/grid_app.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/forward_application.h"
10 |
11 | namespace vox {
12 | class GridApp : public ForwardApplication {
13 | public:
14 | void loadScene() override;
15 | };
16 | } // namespace vox
--------------------------------------------------------------------------------
/apps/toolkit/toolkit_sample.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "apps/toolkit/grid_app.h"
--------------------------------------------------------------------------------
/asset_pipeline/asset_pipeline.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.cs.disable-library-validation
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/asset_pipeline/export.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #if defined(_MSC_VER) && defined(VOX_USE_DYNAMIC_LINKING)
10 |
11 | #ifdef VOX_BUILD_ASSET_LIB
12 | // Import/Export for dynamic linking while building vox
13 | #define VOX_ASSET_DLL __declspec(dllexport)
14 | #else
15 | #define VOX_ASSET_DLL __declspec(dllimport)
16 | #endif
17 | #else // defined(_MSC_VER) && defined(VOX_USE_DYNAMIC_LINKING)
18 | // Static or non msvc linking
19 | #define VOX_ASSET_DLL
20 | #endif // defined(_MSC_VER) && defined(VOX_USE_DYNAMIC_LINKING)
--------------------------------------------------------------------------------
/asset_pipeline/fbx/fbx_skeleton.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "asset_pipeline/export.h"
10 | #include "asset_pipeline/fbx/fbx.h"
11 | #include "asset_pipeline/importer/import2ozz.h"
12 |
13 | namespace vox::animation::offline {
14 | struct RawSkeleton;
15 | namespace fbx {
16 | VOX_ASSET_DLL bool ExtractSkeleton(FbxSceneLoader& _loader,
17 | const OzzImporter::NodeType& _types,
18 | RawSkeleton* _skeleton);
19 |
20 | } // namespace fbx
21 | } // namespace vox::animation::offline
--------------------------------------------------------------------------------
/asset_pipeline/importer/import2ozz_skel.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "asset_pipeline/export.h"
10 | #include "vox.base/endianness.h"
11 | #include "vox.base/macros.h"
12 |
13 | namespace Json {
14 | class Value;
15 | }
16 |
17 | namespace vox::animation::offline {
18 |
19 | class OzzImporter;
20 |
21 | VOX_ASSET_DLL bool ImportSkeleton(const Json::Value& _config,
22 | OzzImporter* _importer,
23 | vox::Endianness _endianness);
24 |
25 | } // namespace vox
--------------------------------------------------------------------------------
/bldsys/cmake/template/gradle/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangfengzzz/Arche-webgpu/1eb1c75d6980a07befa6827b5dd160fe72eb53a5/bldsys/cmake/template/gradle/gradle-wrapper.jar
--------------------------------------------------------------------------------
/bldsys/cmake/template/gradle/gradle-wrapper.properties.in:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
3 | distributionPath=wrapper/dists
4 | zipStorePath=wrapper/dists
5 | zipStoreBase=GRADLE_USER_HOME
6 |
--------------------------------------------------------------------------------
/bldsys/cmake/template/gradle/gradle.properties.in:
--------------------------------------------------------------------------------
1 | android.useAndroidX=true
2 | android.enableJetifier=true
3 | org.gradle.parallel=true
--------------------------------------------------------------------------------
/bldsys/cmake/template/gradle/settings.gradle.in:
--------------------------------------------------------------------------------
1 | rootProject.name = "@PROJECT_NAME@"
2 |
--------------------------------------------------------------------------------
/editor/editor.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.cs.disable-library-validation
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/editor/simple_editor.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.editor/editor_application.h"
10 |
11 | namespace vox::editor {
12 | class SimpleEditor : public EditorApplication {
13 | public:
14 | void setupUI() override;
15 |
16 | void updateViews(float deltaTime, wgpu::CommandEncoder& commandEncoder) override;
17 |
18 | void inputEvent(const InputEvent& inputEvent) override;
19 | };
20 | } // namespace vox::editor
--------------------------------------------------------------------------------
/shaders/blinn-phong.vert:
--------------------------------------------------------------------------------
1 | #version 450
2 | #define Vert_Shader
3 |
4 | #include "common.h"
5 | #include "snippet/common_define.h"
6 | #include "snippet/common_vert_define.h"
7 | #include "snippet/blendShape_define.h"
8 | #include "snippet/uv_define.h"
9 | #include "snippet/color_define.h"
10 | #include "snippet/normal_define.h"
11 | #include "snippet/worldpos_define.h"
12 |
13 | void main() {
14 | #include "snippet/begin_position.vert"
15 | #include "snippet/begin_normal.vert"
16 | #include "snippet/blendShape.vert"
17 | #include "snippet/skinning.vert"
18 | #include "snippet/uv.vert"
19 | #include "snippet/color.vert"
20 | #include "snippet/normal.vert"
21 | #include "snippet/worldpos.vert"
22 | #include "snippet/position.vert"
23 | }
--------------------------------------------------------------------------------
/shaders/compute/atomic_counter.comp:
--------------------------------------------------------------------------------
1 | #version 450
2 |
3 | layout(binding = 6) buffer u_atomicCounter {
4 | uint atomic_counter;
5 | };
6 |
7 | layout(local_size_x = 2, local_size_y = 2, local_size_z = 2) in;
8 |
9 | void main() {
10 | atomicAdd(atomic_counter, 1);
11 | }
--------------------------------------------------------------------------------
/shaders/compute/atomic_counter.frag:
--------------------------------------------------------------------------------
1 | #version 450
2 | #define Frag_Shader
3 | #include "common.h"
4 | #include "snippet/uv_define.h"
5 |
6 | layout(location = 0) out vec4 o_color;
7 | layout(binding = 50) buffer u_atomicCounter {
8 | uint atomic_counter;
9 | };
10 |
11 | void main() {
12 | uint atomic = atomic_counter % 255;
13 | o_color = vec4(atomic/255.0, 1 - atomic/255.0, atomic/255.0, 1.0);
14 | }
15 |
--------------------------------------------------------------------------------
/shaders/cubemap-debugger.frag:
--------------------------------------------------------------------------------
1 | #version 450
2 |
3 | layout(set = 0, binding = 5) uniform texture2D u_baseTexture;
4 | layout(set = 0, binding = 6) uniform sampler u_baseSampler;
5 | layout(set = 0, binding = 7) uniform u_faceIndex {
6 | int face_index;
7 | };
8 |
9 | layout (location = 0) in vec2 v_uv;
10 | layout(location = 0) out vec4 o_color;
11 |
12 | vec4 RGBMToLinear( in vec4 value, in float maxRange ) {
13 | return vec4( value.rgb * value.a * maxRange, 1.0 );
14 | }
15 |
16 | void main(){
17 | vec2 uv = v_uv;
18 | if(face_index == 2){
19 | uv.x = v_uv.y;
20 | uv.y= 1.0 - v_uv.x;
21 | }else if(face_index == 3){
22 | uv.x = 1.0 - v_uv.y;
23 | uv.y= v_uv.x;
24 | }
25 |
26 | o_color = texture(sampler2D(u_baseTexture, u_baseSampler), uv);
27 | }
--------------------------------------------------------------------------------
/shaders/cubemap-debugger.vert:
--------------------------------------------------------------------------------
1 | #version 450
2 |
3 | #include "common.h"
4 |
5 | layout(location = Position) in vec3 POSITION;
6 | layout(location = UV_0) in vec2 TEXCOORD_0;
7 |
8 | layout(set = 0, binding = 1) uniform u_cameraData {
9 | mat4 view_mat;
10 | mat4 proj_mat;
11 | mat4 vp_mat;
12 | mat4 view_inv_mat;
13 | mat4 proj_inv_mat;
14 | vec3 camera_pos;
15 | };
16 |
17 | layout(set = 0, binding = 2) uniform u_rendererData {
18 | mat4 local_mat;
19 | mat4 model_mat;
20 | mat4 normal_mat;
21 | };
22 |
23 | layout (location = 0) out vec2 v_uv;
24 |
25 | void main(){
26 | gl_Position = vp_mat * model_mat * vec4(POSITION, 1.0);
27 | v_uv = TEXCOORD_0;
28 | }
--------------------------------------------------------------------------------
/shaders/editor/color_picker.frag:
--------------------------------------------------------------------------------
1 | #version 450
2 |
3 | layout(set = 0, binding = 10) uniform baseColor {
4 | vec4 base_color;
5 | };
6 |
7 | layout(location = 0) out vec4 o_color;
8 |
9 | void main() {
10 | o_color = base_color;
11 | }
--------------------------------------------------------------------------------
/shaders/light/cluster_debug.frag:
--------------------------------------------------------------------------------
1 | #version 450
2 |
3 | #include "light/cluster_common.comp"
4 |
5 | layout(location = 0) in vec2 v_uv;
6 | layout(location = 0) out vec4 o_color;
7 |
8 | layout(set = 0, binding = 10) uniform clusterUniform {
9 | vec4 value;
10 | } cluster_uniform;
11 |
12 | layout(binding = 12) buffer clusterLights {
13 | ClusterLightGroup value;
14 | } cluster_lights;
15 |
16 | void main() {
17 | uint clusterIndex = getClusterIndex(cluster_uniform.value, gl_FragCoord);
18 | uint lightCount = cluster_lights.value.lights[clusterIndex].point_count + cluster_lights.value.lights[clusterIndex].spot_count;
19 | float lightFactor = float(lightCount) / float(MAX_LIGHTS_PER_CLUSTER);
20 |
21 | o_color = mix(vec4(0.0, 0.0, 1.0, 1.0), vec4(1.0, 0.0, 0.0, 1.0),
22 | vec4(lightFactor, lightFactor, lightFactor, lightFactor));
23 | }
--------------------------------------------------------------------------------
/shaders/light/light_sprite.frag:
--------------------------------------------------------------------------------
1 | #version 450
2 |
3 | layout (location = 0) in vec2 localPos;
4 | layout (location = 1) in vec3 color;
5 | layout(location = 0) out vec4 o_color;
6 |
7 | void main() {
8 | float distToCenter = length(localPos);
9 | float fade = (1.0 - distToCenter) * (1.0 / (distToCenter * distToCenter));
10 | o_color = vec4(color * fade, fade);
11 | }
--------------------------------------------------------------------------------
/shaders/noise/noise_cellular.h:
--------------------------------------------------------------------------------
1 | #include "noise/noise_cellular_2D.h"
2 | #include "noise/noise_cellular_3D.h"
3 | #include "noise/noise_cellular_2x2.h"
4 | #include "noise/noise_cellular_2x2x2.h"
5 |
--------------------------------------------------------------------------------
/shaders/noise/noise_perlin.h:
--------------------------------------------------------------------------------
1 | #include "noise/noise_perlin_2D.h"
2 | #include "noise/noise_perlin_3D.h"
3 | #include "noise/noise_perlin_4D.h"
4 |
--------------------------------------------------------------------------------
/shaders/noise/noise_simplex.h:
--------------------------------------------------------------------------------
1 | #include "noise/noise_simplex_2D.h"
2 | #include "noise/noise_simplex_3D.h"
3 | #include "noise/noise_simplex_3D_grad.h"
4 | #include "noise/noise_simplex_4D.h"
5 |
--------------------------------------------------------------------------------
/shaders/particle/particle_fill_indices.comp:
--------------------------------------------------------------------------------
1 | // ============================================================================
2 | /* Fill a buffer with continuous indices, used in the sorting stage. */
3 | // ============================================================================
4 |
5 | #version 450
6 |
7 | #include "particle/particle_config.h"
8 |
9 | layout(binding = STORAGE_BINDING_INDICES_FIRST)
10 | writeonly buffer IndexBuffer {
11 | uint indices[];
12 | };
13 |
14 | layout(local_size_x = PARTICLES_KERNEL_GROUP_WIDTH) in;
15 | void main() {
16 | uint tid = gl_GlobalInvocationID.x;
17 | indices[tid] = tid;
18 | }
--------------------------------------------------------------------------------
/shaders/particle/particle_render_instancing.frag:
--------------------------------------------------------------------------------
1 | #version 450
2 |
3 | #include "particle/particle_render_common.comp"
4 |
5 | layout (location = 0) in vec2 uv;
6 | layout (location = 1) in vec3 color;
7 | layout (location = 2) in float decay;
8 | layout(location = 0) out vec4 o_color;
9 |
10 | void main() {
11 | o_color = compute_color(color, decay, uv);
12 | }
--------------------------------------------------------------------------------
/shaders/pbr.frag:
--------------------------------------------------------------------------------
1 | #version 450
2 | #define Frag_Shader
3 | #define IS_METALLIC_WORKFLOW
4 |
5 | #include "common.h"
6 | #include "snippet/common_define.h"
7 | #include "snippet/common_frag_define.h"
8 |
9 | #include "snippet/uv_define.h"
10 | #include "snippet/normal_define.h"
11 | #include "snippet/color_define.h"
12 | #include "snippet/worldpos_define.h"
13 |
14 | #include "snippet/fog_define.h"
15 | #include "snippet/light_define.h"
16 | #include "snippet/normal_frag_define.h"
17 |
18 | #include "pbr/pbr_frag_define.h"
19 | #include "pbr/pbr_helper.h"
20 | #include "pbr/brdf.h"
21 | #include "pbr/direct_irradiance_frag_define.h"
22 | #include "pbr/ibl_frag_define.h"
23 | #include "shadow/shadow_frag_define.h"
24 |
25 | layout(location = 0) out vec4 o_color;
26 |
27 | void main() {
28 | #include "pbr/pbr.frag"
29 | #include "snippet/fog.frag"
30 | }
--------------------------------------------------------------------------------
/shaders/skybox.frag:
--------------------------------------------------------------------------------
1 | #version 450
2 |
3 | layout(set = 0, binding = 0) uniform textureCube u_cubeTexture;
4 | layout(set = 0, binding = 1) uniform sampler u_cubeSampler;
5 |
6 | layout(location = 0) in vec3 v_cubeUV;
7 | layout(location = 0) out vec4 o_color;
8 |
9 | void main() {
10 | o_color = texture(samplerCube(u_cubeTexture, u_cubeSampler), v_cubeUV);
11 | }
--------------------------------------------------------------------------------
/shaders/skybox.vert:
--------------------------------------------------------------------------------
1 | #version 450
2 |
3 | #include "common.h"
4 |
5 | layout(location = Position) in vec3 POSITION;
6 |
7 | layout(set = 0, binding = 10) uniform u_mvpNoscale {
8 | mat4 mvp_no_scale;
9 | };
10 |
11 | layout (location = 0) out vec3 v_cubeUV;
12 |
13 | void main() {
14 | v_cubeUV = POSITION.xyz;
15 | #ifdef NEED_FLIP_Y
16 | v_cubeUV.y *= -1;
17 | #endif
18 | gl_Position = mvp_no_scale * vec4(POSITION, 1.0);
19 | gl_Position.z = gl_Position.w;
20 | }
--------------------------------------------------------------------------------
/shaders/snippet/begin_normal.vert:
--------------------------------------------------------------------------------
1 | #ifndef OMIT_NORMAL
2 | #ifdef HAS_NORMAL
3 | vec3 normal = vec3( NORMAL );
4 | #endif
5 |
6 | #ifdef HAS_TANGENT
7 | vec4 tangent = vec4( TANGENT );
8 | #endif
9 | #endif
--------------------------------------------------------------------------------
/shaders/snippet/begin_position.vert:
--------------------------------------------------------------------------------
1 | vec4 position = vec4( POSITION , 1.0 );
2 |
--------------------------------------------------------------------------------
/shaders/snippet/begin_viewdir.frag:
--------------------------------------------------------------------------------
1 | #ifdef NEED_WORLDPOS
2 | vec3 V = normalize( u_cameraPos - v_pos );
3 | #endif
4 |
--------------------------------------------------------------------------------
/shaders/snippet/color.vert:
--------------------------------------------------------------------------------
1 | #ifdef HAS_VERTEXCOLOR
2 | v_color = COLOR_0;
3 | #endif
4 |
--------------------------------------------------------------------------------
/shaders/snippet/color_define.h:
--------------------------------------------------------------------------------
1 | #ifdef HAS_VERTEXCOLOR
2 | #ifdef Vert_Shader
3 | layout (location = V_Color) out vec4 v_color;
4 | #else
5 | layout (location = V_Color) in vec4 v_color;
6 | #endif
7 | #endif
8 |
--------------------------------------------------------------------------------
/shaders/snippet/common_define.h:
--------------------------------------------------------------------------------
1 | #define PI 3.14159265359
2 | #define RECIPROCAL_PI 0.31830988618
3 | #define EPSILON 1e-6
4 | #define LOG2 1.442695
5 |
6 | #define saturate( a ) clamp( a, 0.0, 1.0 )
7 | #define whiteCompliment(a) ( 1.0 - saturate( a ) )
8 |
9 | float pow2(float x ) {
10 | return x * x;
11 | }
12 |
13 | vec4 RGBMToLinear(vec4 value, float maxRange ) {
14 | return vec4( value.rgb * value.a * maxRange, 1.0 );
15 | }
16 |
17 | vec4 gammaToLinear(vec4 srgbIn){
18 | return vec4( pow(srgbIn.rgb, vec3(2.2)), srgbIn.a);
19 | }
20 |
21 | vec4 linearToGamma(vec4 linearIn){
22 | return vec4( pow(linearIn.rgb, vec3(1.0 / 2.2)), linearIn.a);
23 | }
--------------------------------------------------------------------------------
/shaders/snippet/common_frag_define.h:
--------------------------------------------------------------------------------
1 | layout(set = 0, binding = Camera_Location) uniform u_cameraData {
2 | mat4 u_viewMat;
3 | mat4 u_projMat;
4 | mat4 vp_mat;
5 | mat4 view_inv_mat;
6 | mat4 proj_inv_mat;
7 | vec3 u_cameraPos;
8 | };
9 |
10 | layout(set = 0, binding = Renderer_Location) uniform u_rendererData {
11 | mat4 u_localMat;
12 | mat4 u_modelMat;
13 | mat4 u_normalMat;
14 | };
--------------------------------------------------------------------------------
/shaders/snippet/fog.frag:
--------------------------------------------------------------------------------
1 | #ifdef HAS_FOG
2 | float fogDepth = length( v_fogDepth );
3 | #ifdef FOG_EXP2
4 | float fogFactor = whiteCompliment( exp2( - u_fogDensity * u_fogDensity * fogDepth * fogDepth * LOG2 ) );
5 | #else
6 | float fogFactor = smoothstep( u_fogNear, u_fogFar, fogDepth );
7 | #endif
8 | o_color.rgb = mix( o_color.rgb, u_fogColor, fogFactor );
9 | #endif
10 |
--------------------------------------------------------------------------------
/shaders/snippet/fog.vert:
--------------------------------------------------------------------------------
1 | #ifdef HAS_FOG
2 | v_fogDepth = ( u_MVMat * position ).xyz;
3 | #endif
4 |
--------------------------------------------------------------------------------
/shaders/snippet/fog_define.h:
--------------------------------------------------------------------------------
1 | #ifdef HAS_FOG
2 | #ifdef Vert_Shader
3 | layout (location = V_Fog_Depth) out vec3 v_fogDepth;
4 | #else
5 | layout (location = V_Fog_Depth) in vec3 v_fogDepth;
6 | #endif
7 |
8 | layout(set = 0, binding = Fog_Color_Location) vec3 u_fogColor;
9 | #ifdef FOG_EXP2
10 | layout(set = 0, binding = Fog_Density_Location) float u_fogDensity;
11 | #else
12 | layout(set = 0, binding = Fog_Near_Location) float u_fogNear;
13 | layout(set = 0, binding = Fog_Far_Location) float u_fogFar;
14 | #endif
15 | #endif
16 |
--------------------------------------------------------------------------------
/shaders/snippet/normal.vert:
--------------------------------------------------------------------------------
1 | #ifndef OMIT_NORMAL
2 | #ifdef HAS_NORMAL
3 | v_normal = normalize( mat3(u_normalMat) * normal );
4 |
5 | #if defined(HAS_TANGENT) && ( defined(HAS_NORMAL_TEXTURE) || defined(HAS_CLEARCOATNORMAL_TEXTURE) )
6 | vec3 normalW = normalize( mat3(u_normalMat) * normal.xyz );
7 | vec3 tangentW = normalize( mat3(u_normalMat) * tangent.xyz );
8 | vec3 bitangentW = cross( normalW, tangentW ) * tangent.w;
9 |
10 | v_TBN = mat3( tangentW, bitangentW, normalW );
11 | #endif
12 | #endif
13 | #endif
14 |
--------------------------------------------------------------------------------
/shaders/snippet/normal_define.h:
--------------------------------------------------------------------------------
1 | #ifndef OMIT_NORMAL
2 | #ifdef HAS_NORMAL
3 | #ifdef Vert_Shader
4 | layout (location = V_Normal) out vec3 v_normal;
5 | #else
6 | layout (location = V_Normal) in vec3 v_normal;
7 | #endif
8 | #if defined(HAS_TANGENT) && ( defined(HAS_NORMAL_TEXTURE) || defined(HAS_CLEARCOATNORMAL_TEXTURE) )
9 | #ifdef Vert_Shader
10 | layout (location = V_TBN) out mat3 v_TBN;
11 | #else
12 | layout (location = V_TBN) in mat3 v_TBN;
13 | #endif
14 | #endif
15 | #endif
16 | #endif
17 |
--------------------------------------------------------------------------------
/shaders/snippet/position.vert:
--------------------------------------------------------------------------------
1 | gl_Position = vp_mat * u_modelMat * position;
--------------------------------------------------------------------------------
/shaders/snippet/uv.vert:
--------------------------------------------------------------------------------
1 | #ifdef HAS_UV
2 | v_uv = TEXCOORD_0;
3 | #else
4 | // may need this calculate normal
5 | v_uv = vec2( 0., 0. );
6 | #endif
7 |
8 | #ifdef HAS_UV1
9 | v_uv1 = TEXCOORD_1;
10 | #endif
11 |
12 | #ifdef NEED_TILINGOFFSET
13 | v_uv = v_uv * tilingOffset.xy + tilingOffset.zw;
14 | #endif
--------------------------------------------------------------------------------
/shaders/snippet/uv_define.h:
--------------------------------------------------------------------------------
1 | #ifdef Vert_Shader
2 | layout (location = V_UV) out vec2 v_uv;
3 | #else
4 | layout (location = V_UV) in vec2 v_uv;
5 | #endif
6 |
7 | #ifdef HAS_UV1
8 | #ifdef Vert_Shader
9 | layout (location = V_UV1) out vec2 v_uv1;
10 | #else
11 | layout (location = V_UV1) in vec2 v_uv1;
12 | #endif
13 | #endif
--------------------------------------------------------------------------------
/shaders/snippet/worldpos.vert:
--------------------------------------------------------------------------------
1 | #ifdef NEED_WORLDPOS
2 | vec4 temp_pos = u_modelMat * position;
3 | v_pos = temp_pos.xyz / temp_pos.w;
4 | #endif
5 |
--------------------------------------------------------------------------------
/shaders/snippet/worldpos_define.h:
--------------------------------------------------------------------------------
1 | #ifdef NEED_WORLDPOS
2 | #ifdef Vert_Shader
3 | layout (location = V_Pos) out vec3 v_pos;
4 | #else
5 | layout (location = V_Pos) in vec3 v_pos;
6 | #endif
7 | #endif
8 |
--------------------------------------------------------------------------------
/shaders/toolkit/physics_view/line.frag:
--------------------------------------------------------------------------------
1 | #version 450
2 |
3 | layout(location = 0) in vec4 COLOR0;
4 | layout(location = 0) out vec4 o_color;
5 |
6 | void main() {
7 | o_color = COLOR0;
8 | }
--------------------------------------------------------------------------------
/shaders/toolkit/physics_view/line.vert:
--------------------------------------------------------------------------------
1 | #version 450
2 |
3 | layout(location = 0) in vec3 POSITION;
4 | layout(location = 1) in vec4 COLOR;
5 |
6 | layout(set = 0, binding = 10) uniform u_mvpNoscale {
7 | mat4 mvp_no_scale;
8 | };
9 |
10 | layout (location = 0) out vec4 COLOR0;
11 |
12 | void main() {
13 | gl_Position = mvp_no_scale * vec4(POSITION, 1.0);
14 | COLOR0 = COLOR;
15 | }
--------------------------------------------------------------------------------
/shaders/toolkit/skeleton_view/skeleton.frag:
--------------------------------------------------------------------------------
1 | #version 450
2 |
3 | vec4 GetAmbient(vec3 _world_normal) {
4 | vec3 normal = normalize(_world_normal);
5 | vec3 alpha = (normal + 1.) * .5;
6 | vec2 bt = mix(vec2(.3, .7), vec2(.4, .8), alpha.xz);
7 | vec3 ambient = mix(vec3(bt.x, .3, bt.x), vec3(bt.y, .8, bt.y), alpha.y);
8 | return vec4(ambient, 1.);
9 | }
10 |
11 | layout (location = 0) in vec3 v_world_normal;
12 | layout (location = 1) in vec4 v_vertex_color;
13 | layout(location = 0) out vec4 o_color;
14 |
15 | void main() {
16 | vec4 ambient = GetAmbient(v_world_normal);
17 | o_color = ambient * v_vertex_color;
18 | }
--------------------------------------------------------------------------------
/shaders/unlit.vert:
--------------------------------------------------------------------------------
1 | #version 450
2 | #define Vert_Shader
3 |
4 | #include "common.h"
5 | #include "snippet/common_vert_define.h"
6 | #include "snippet/blendShape_define.h"
7 | #include "snippet/uv_define.h"
8 |
9 | void main() {
10 | #include "snippet/begin_position.vert"
11 | #include "snippet/blendShape.vert"
12 | #include "snippet/skinning.vert"
13 | #include "snippet/uv.vert"
14 | #include "snippet/position.vert"
15 | }
--------------------------------------------------------------------------------
/shaders/wireframe.frag:
--------------------------------------------------------------------------------
1 | #version 450
2 |
3 | layout(location = 0) flat in uint v_color;
4 | layout(location = 0) out vec4 outColor;
5 |
6 | void main() {
7 | outColor = vec4(((v_color & 0xff0000) >> 16) / 255.0, ((v_color & 0xff00) >> 8) / 255.0, (v_color & 0xff) / 255.0, 1.0);
8 | }
--------------------------------------------------------------------------------
/shaders/wireframe.vert:
--------------------------------------------------------------------------------
1 | #version 450
2 |
3 | layout(location = 0) in vec3 POSITION;
4 | layout(location = 1) in uint COLOR;
5 |
6 | layout(set = 0, binding = 5) uniform cameraData {
7 | mat4 view_mat;
8 | mat4 proj_mat;
9 | mat4 vp_mat;
10 | mat4 view_inv_mat;
11 | mat4 proj_inv_mat;
12 | vec3 camera_pos;
13 | };
14 |
15 | layout(set = 0, binding = 6) uniform rendererData {
16 | mat4 local_mat;
17 | mat4 model_mat;
18 | mat4 normal_mat;
19 | };
20 |
21 | layout (location = 0) out uint v_color;
22 |
23 | void main() {
24 | v_color = COLOR;
25 | vec4 position = vec4(POSITION, 1.0);
26 | gl_Position = vp_mat * model_mat * position;
27 | }
--------------------------------------------------------------------------------
/test.animation/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.12)
2 |
3 | project(test.animation LANGUAGES C CXX)
4 |
5 | file(GLOB sources
6 | ${CMAKE_CURRENT_SOURCE_DIR}/offline/*.cpp
7 | ${CMAKE_CURRENT_SOURCE_DIR}/runtime/*.cpp)
8 |
9 | add_executable(${PROJECT_NAME} ${sources})
10 |
11 | target_include_directories(${PROJECT_NAME} PUBLIC ../
12 | ${CMAKE_SOURCE_DIR}/third_party/googletest/googlemock/include
13 | ${CMAKE_SOURCE_DIR}/third_party/googletest/googletest/include)
14 |
15 | # Link third party libraries
16 | target_link_directories(${PROJECT_NAME} PUBLIC ${CMAKE_SOURCE_DIR}/third_party/googletest/build/lib)
17 | target_link_libraries(${PROJECT_NAME} PUBLIC spdlog vox.base vox.math vox.simd_math vox.animation
18 | libgmock.a libgmock_main.a libgtest.a libgtest_main.a)
--------------------------------------------------------------------------------
/test.animation/test.animation.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.cs.disable-library-validation
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/test.base/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.12)
2 |
3 | project(test.base LANGUAGES C CXX)
4 |
5 | file(GLOB sources
6 | ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
7 | ${CMAKE_CURRENT_SOURCE_DIR}/containers/*.cpp
8 | ${CMAKE_CURRENT_SOURCE_DIR}/io/*.cpp
9 | ${CMAKE_CURRENT_SOURCE_DIR}/memory/*.cpp)
10 |
11 | add_executable(${PROJECT_NAME} ${sources})
12 |
13 | target_include_directories(${PROJECT_NAME} PUBLIC ../
14 | ${CMAKE_SOURCE_DIR}/third_party/googletest/googlemock/include
15 | ${CMAKE_SOURCE_DIR}/third_party/googletest/googletest/include)
16 |
17 | # Link third party libraries
18 | target_link_directories(${PROJECT_NAME} PUBLIC ${CMAKE_SOURCE_DIR}/third_party/googletest/build/lib)
19 | target_link_libraries(${PROJECT_NAME} PUBLIC spdlog vox.base
20 | libgmock.a libgmock_main.a libgtest.a libgtest_main.a)
--------------------------------------------------------------------------------
/test.base/test.base.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.cs.disable-library-validation
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/test.geometry/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.12)
2 |
3 | project(test.geometry LANGUAGES C CXX)
4 |
5 | file(GLOB sources
6 | ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
7 |
8 | add_executable(${PROJECT_NAME} ${sources})
9 |
10 | target_include_directories(${PROJECT_NAME} PUBLIC ../
11 | ${CMAKE_SOURCE_DIR}/third_party/googletest/googlemock/include
12 | ${CMAKE_SOURCE_DIR}/third_party/googletest/googletest/include)
13 |
14 | # Link third party libraries
15 | target_link_directories(${PROJECT_NAME} PUBLIC ${CMAKE_SOURCE_DIR}/third_party/googletest/build/lib)
16 | target_link_libraries(${PROJECT_NAME} PUBLIC spdlog vox.base vox.math vox.geometry
17 | libgmock.a libgmock_main.a libgtest.a libgtest_main.a)
--------------------------------------------------------------------------------
/test.geometry/plane2_tests.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include
8 |
9 | #include "vox.geometry/plane2.h"
10 |
11 | using namespace vox;
12 |
13 | TEST(Plane2, Builder) {
14 | Plane2 plane = Plane2::builder().withNormal({1, 0}).withPoint({2, 3}).build();
15 |
16 | EXPECT_EQ(Vector2D(1, 0), plane.normal);
17 | EXPECT_EQ(Point2D(2, 3), plane.point);
18 | }
19 |
--------------------------------------------------------------------------------
/test.geometry/plane3_tests.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include
8 |
9 | #include "vox.geometry/plane3.h"
10 |
11 | using namespace vox;
12 |
13 | TEST(Plane3, Builder) {
14 | Plane3 plane = Plane3::builder().withNormal({1, 0, 0}).withPoint({2, 3, 4}).build();
15 |
16 | EXPECT_EQ(Vector3D(1, 0, 0), plane.normal);
17 | EXPECT_EQ(Point3D(2, 3, 4), plane.point);
18 | }
19 |
--------------------------------------------------------------------------------
/test.geometry/test.geometry.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.cs.disable-library-validation
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/test.math/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.12)
2 |
3 | project(test.math LANGUAGES C CXX)
4 |
5 | file(GLOB sources
6 | ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
7 |
8 | add_executable(${PROJECT_NAME} ${sources})
9 |
10 | target_include_directories(${PROJECT_NAME} PUBLIC ../
11 | ${CMAKE_SOURCE_DIR}/third_party/googletest/googlemock/include
12 | ${CMAKE_SOURCE_DIR}/third_party/googletest/googletest/include)
13 |
14 | # Link third party libraries
15 | target_link_directories(${PROJECT_NAME} PUBLIC ${CMAKE_SOURCE_DIR}/third_party/googletest/build/lib)
16 | target_link_libraries(${PROJECT_NAME} PUBLIC spdlog vox.base vox.math
17 | libgmock.a libgmock_main.a libgtest.a libgtest_main.a)
--------------------------------------------------------------------------------
/test.math/scalable_transform_tests.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.math/scalable_transform.h"
8 |
9 | #include
10 | #include "test.math/gtest_math_helper.h"
11 |
12 | using vox::ScalableTransform;
13 |
14 | TEST(TransformConstant, ozz_math) {
15 | EXPECT_FLOAT3_EQ(ScalableTransform::identity().translation, 0.f, 0.f, 0.f);
16 | EXPECT_QUATERNION_EQ(ScalableTransform::identity().rotation, 0.f, 0.f, 0.f, 1.f);
17 | EXPECT_FLOAT3_EQ(ScalableTransform::identity().scale, 1.f, 1.f, 1.f);
18 | }
19 |
--------------------------------------------------------------------------------
/test.math/test.math.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.cs.disable-library-validation
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/test.simd_math/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.12)
2 |
3 | project(test.simd_math LANGUAGES C CXX)
4 |
5 | file(GLOB sources
6 | ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
7 |
8 | add_executable(${PROJECT_NAME} ${sources})
9 |
10 | target_include_directories(${PROJECT_NAME} PUBLIC ../
11 | ${CMAKE_SOURCE_DIR}/third_party/googletest/googlemock/include
12 | ${CMAKE_SOURCE_DIR}/third_party/googletest/googletest/include)
13 |
14 | # Link third party libraries
15 | target_link_directories(${PROJECT_NAME} PUBLIC ${CMAKE_SOURCE_DIR}/third_party/googletest/build/lib)
16 | target_link_libraries(${PROJECT_NAME} PUBLIC spdlog vox.base vox.math vox.simd_math
17 | libgmock.a libgmock_main.a libgtest.a libgtest_main.a)
--------------------------------------------------------------------------------
/test.simd_math/test.simd_math.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.cs.disable-library-validation
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/third_party/clean.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -x
3 |
4 | # ASSIMP #####################################
5 | cd assimp
6 | rm -rf build_release
7 | rm -rf build_debug
8 | cd ..
9 |
10 | # Jolt #####################################
11 | cd jolt/Build
12 | rm -rf build_release
13 | rm -rf build_debug
14 | cd ../..
15 |
16 | # GoogleTest ##############################
17 | cd googletest
18 | rm -rf build
19 | cd ..
20 |
21 |
22 | set +x
23 |
--------------------------------------------------------------------------------
/vox.animation/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.12)
2 |
3 | project(vox.animation LANGUAGES C CXX)
4 |
5 | file(GLOB sources
6 | ${CMAKE_CURRENT_SOURCE_DIR}/offline/*.cpp
7 | ${CMAKE_CURRENT_SOURCE_DIR}/runtime/*.cpp)
8 |
9 | add_library(${PROJECT_NAME} STATIC ${sources})
10 |
11 | target_include_directories(${PROJECT_NAME} PUBLIC ../)
12 |
13 | # Link third party libraries
14 | target_link_libraries(${PROJECT_NAME} PUBLIC
15 | ktx
16 | stb
17 | astc
18 | imgui
19 | glslang
20 | SPIRV
21 | hwcpipe
22 | spirv-cross-glsl
23 | glslang-default-resource-limits
24 | spdlog
25 | CLI11::CLI11)
--------------------------------------------------------------------------------
/vox.animation/offline/export.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #if defined(_MSC_VER) && defined(VOX_USE_DYNAMIC_LINKING)
10 |
11 | #ifdef VOX_BUILD_ANIMOFFLINE_LIB
12 | // Import/Export for dynamic linking while building vox
13 | #define VOX_ANIMOFFLINE_DLL __declspec(dllexport)
14 | #else
15 | #define VOX_ANIMOFFLINE_DLL __declspec(dllimport)
16 | #endif
17 | #else // defined(_MSC_VER) && defined(VOX_USE_DYNAMIC_LINKING)
18 | // Static or non msvc linking
19 | #define VOX_ANIMOFFLINE_DLL
20 | #endif // defined(_MSC_VER) && defined(VOX_USE_DYNAMIC_LINKING)
21 |
--------------------------------------------------------------------------------
/vox.animation/runtime/animation_utils.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.animation/runtime/animation.h"
10 | #include "vox.animation/runtime/export.h"
11 |
12 | namespace vox::animation {
13 |
14 | // Count translation, rotation or scale keyframes for a given track number. Use
15 | // a negative _track value to count all tracks.
16 | VOX_ANIMATION_DLL int CountTranslationKeyframes(const Animation& _animation, int _track = -1);
17 | VOX_ANIMATION_DLL int CountRotationKeyframes(const Animation& _animation, int _track = -1);
18 | VOX_ANIMATION_DLL int CountScaleKeyframes(const Animation& _animation, int _track = -1);
19 | } // namespace vox::animation
--------------------------------------------------------------------------------
/vox.animation/runtime/export.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #if defined(_MSC_VER) && defined(VOX_USE_DYNAMIC_LINKING)
10 |
11 | #ifdef VOX_BUILD_ANIMATION_LIB
12 | // Import/Export for dynamic linking while building vox
13 | #define VOX_ANIMATION_DLL __declspec(dllexport)
14 | #else
15 | #define VOX_ANIMATION_DLL __declspec(dllimport)
16 | #endif
17 | #else // defined(_MSC_VER) && defined(VOX_USE_DYNAMIC_LINKING)
18 | // Static or non msvc linking
19 | #define VOX_ANIMATION_DLL
20 | #endif // defined(_MSC_VER) && defined(VOX_USE_DYNAMIC_LINKING)
--------------------------------------------------------------------------------
/vox.base/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.12)
2 |
3 | project(vox.base LANGUAGES C CXX)
4 |
5 | file(GLOB sources
6 | ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
7 | ${CMAKE_CURRENT_SOURCE_DIR}/containers/*.cpp
8 | ${CMAKE_CURRENT_SOURCE_DIR}/io/*.cpp
9 | ${CMAKE_CURRENT_SOURCE_DIR}/memory/*.cpp)
10 |
11 | add_library(${PROJECT_NAME} STATIC ${sources})
12 |
13 | target_include_directories(${PROJECT_NAME} PUBLIC ../
14 | ${CMAKE_CURRENT_SOURCE_DIR})
15 |
16 | # Link third party libraries
17 | target_link_libraries(${PROJECT_NAME} PUBLIC
18 | ktx
19 | stb
20 | astc
21 | imgui
22 | glslang
23 | SPIRV
24 | hwcpipe
25 | spirv-cross-glsl
26 | glslang-default-resource-limits
27 | spdlog
28 | CLI11::CLI11)
--------------------------------------------------------------------------------
/vox.base/containers/deque.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include
10 |
11 | #include "vox.base/containers/std_allocator.h"
12 |
13 | namespace vox {
14 | // Redirects std::deque to vox::deque in order to replace std default allocator
15 | // by vox::StdAllocator.
16 | template >
17 | using deque = std::deque;
18 | } // namespace vox
19 |
--------------------------------------------------------------------------------
/vox.base/containers/list.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #ifdef _MSC_VER
10 | #pragma warning(push)
11 | // Removes constant conditional expression warning.
12 | #pragma warning(disable : 4127)
13 | #endif // _MSC_VER
14 |
15 | #include
16 |
17 | #ifdef _MSC_VER
18 | #pragma warning(pop)
19 | #endif // _MSC_VER
20 |
21 | #include "vox.base/containers/std_allocator.h"
22 |
23 | namespace vox {
24 | // Redirects std::list to vox::list in order to replace std default allocator by
25 | // vox::StdAllocator.
26 | template >
27 | using list = std::list;
28 | } // namespace vox
29 |
--------------------------------------------------------------------------------
/vox.base/containers/stack.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include
10 |
11 | #include "vox.base/containers/deque.h"
12 |
13 | namespace vox {
14 | // Redirects std::stack to vox::stack in order to replace std default allocator
15 | // by vox::StdAllocator.
16 | template >
17 | using stack = std::stack;
18 | } // namespace vox
19 |
--------------------------------------------------------------------------------
/vox.base/containers/string.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include
10 |
11 | #include "vox.base/containers/std_allocator.h"
12 |
13 | namespace vox {
14 | // Redirects std::basic_string to vox::string in order to replace std default
15 | // allocator by vox::StdAllocator.
16 | using string = std::basic_string, vox::StdAllocator>;
17 | } // namespace vox
--------------------------------------------------------------------------------
/vox.base/containers/string_archive.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.base/containers/string.h"
10 | #include "vox.base/io/archive_traits.h"
11 | #include "vox.base/macros.h"
12 |
13 | namespace vox::io {
14 |
15 | VOX_IO_TYPE_NOT_VERSIONABLE(vox::string)
16 |
17 | template <>
18 | struct VOX_BASE_DLL Extern {
19 | static void Save(OArchive& _archive, const vox::string* _values, size_t _count);
20 | static void Load(IArchive& _archive, vox::string* _values, size_t _count, uint32_t _version);
21 | };
22 | } // namespace vox
23 |
--------------------------------------------------------------------------------
/vox.base/cpp_utils.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include
10 |
11 | namespace vox {
12 |
13 | template >
14 | ForwardIt binaryFind(ForwardIt first, ForwardIt last, const T &value, Compare comp = {});
15 | } // namespace vox
16 |
17 | #include "vox.base/cpp_utils-inl.h"
18 |
--------------------------------------------------------------------------------
/vox.base/logging.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include
10 | #include
11 |
12 | #define LOGGER_FORMAT "[%^%l%$] %v"
13 | #define PROJECT_NAME "DigitalFlex"
14 |
15 | // Mainly for IDEs
16 | #ifndef ROOT_PATH_SIZE
17 | #define ROOT_PATH_SIZE 0
18 | #endif
19 |
20 | #define __FILENAME__ (static_cast(__FILE__) + ROOT_PATH_SIZE)
21 |
22 | #define LOGI(...) spdlog::info(__VA_ARGS__);
23 | #define LOGW(...) spdlog::warn(__VA_ARGS__);
24 | #define LOGE(...) spdlog::error("[{}:{}] {}", __FILENAME__, __LINE__, fmt::format(__VA_ARGS__));
25 | #define LOGD(...) spdlog::debug(__VA_ARGS__);
26 |
--------------------------------------------------------------------------------
/vox.base/string_utils.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.base/macros.h"
10 |
11 | namespace vox {
12 | // Case-sensitive wildcard string matching:
13 | // - a ? sign matches any character, except an empty string.
14 | // - a * sign matches any string, including an empty string.
15 | VOX_BASE_DLL bool strmatch(const char* _str, const char* _pattern);
16 | } // namespace vox
17 |
--------------------------------------------------------------------------------
/vox.base/type_helpers.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | namespace vox {
10 |
11 | //! Returns the type of the value itself.
12 | template
13 | struct ScalarType {
14 | using value = T;
15 | };
16 |
17 | } // namespace vox
18 |
--------------------------------------------------------------------------------
/vox.editor/editor_actions-inl.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.editor/editor_actions.h"
10 | #include "vox.render/entity.h"
11 |
12 | namespace vox::editor {
13 | template
14 | inline Entity* EditorActions::createMonoComponentEntity(bool p_focusOnCreation, Entity* p_parent) {
15 | auto instance = createEmptyEntity(false, p_parent);
16 |
17 | T* component = instance->addComponent();
18 |
19 | instance->name = component->name();
20 |
21 | if (p_focusOnCreation) selectEntity(instance);
22 |
23 | return instance;
24 | }
25 |
26 | } // namespace vox::editor
27 |
--------------------------------------------------------------------------------
/vox.editor/editor_utils.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "editor_utils.h"
8 |
9 | namespace vox::editor {
10 | void openURL(const std::string& url) {
11 | std::string op = std::string("open ").append(url);
12 | system(op.c_str());
13 | }
14 |
15 | std::string generateId(uint32_t length) {
16 | std::string id;
17 | srand(static_cast(time(nullptr)));
18 |
19 | for (int i = 0; i < length; i++) {
20 | id += std::to_string(rand() % 9);
21 | }
22 |
23 | return id;
24 | }
25 |
26 | } // namespace vox::editor
27 |
--------------------------------------------------------------------------------
/vox.editor/imgui/imgui_curve.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #ifndef imgui_curve_hpp
8 | #define imgui_curve_hpp
9 |
10 | #include
11 |
12 | namespace ImGui {
13 |
14 | int Curve(const char *label, const ImVec2 &size, int maxpoints, ImVec2 *points);
15 |
16 | float CurveValue(float p, int maxpoints, const ImVec2 *points);
17 |
18 | float CurveValueSmooth(float p, int maxpoints, const ImVec2 *points);
19 |
20 | }; // namespace ImGui
21 | #endif /* imgui_curve_hpp */
22 |
--------------------------------------------------------------------------------
/vox.editor/panels_manager.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.editor/panels_manager.h"
8 |
9 | namespace vox::editor::ui {
10 | PanelsManager::PanelsManager(Canvas& p_canvas) : _canvas(p_canvas) {}
11 |
12 | } // namespace vox::editor::ui
13 |
--------------------------------------------------------------------------------
/vox.editor/profiling/profiler_report.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include
10 | #include
11 |
12 | namespace vox {
13 | /**
14 | * Contains profiling data about a running period
15 | */
16 | struct ProfilerReport final {
17 | /**
18 | * Data about an action (Called method)
19 | */
20 | struct Action final {
21 | std::string name;
22 | double duration;
23 | double percentage;
24 | uint64_t calls;
25 | };
26 |
27 | double elapsed_time = 0.0;
28 | uint16_t working_threads = 0u;
29 | uint32_t elapsed_frames = 0u;
30 | std::vector actions{};
31 | };
32 |
33 | } // namespace vox
34 |
--------------------------------------------------------------------------------
/vox.editor/profiling/profiler_spy.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.editor/profiling/profiler_spy.h"
8 |
9 | #include
10 |
11 | namespace vox {
12 | ProfilerSpy::ProfilerSpy(std::string name) : name(std::move(name)), start(std::chrono::steady_clock::now()) {}
13 |
14 | ProfilerSpy::~ProfilerSpy() {
15 | end = std::chrono::steady_clock::now();
16 | Profiler::Save(*this);
17 | }
18 |
19 | } // namespace vox
20 |
--------------------------------------------------------------------------------
/vox.geometry/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.12)
2 |
3 | project(vox.geometry LANGUAGES C CXX)
4 |
5 | file(GLOB sources
6 | ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
7 |
8 | add_library(${PROJECT_NAME} STATIC ${sources})
9 |
10 | target_include_directories(${PROJECT_NAME} PUBLIC ../
11 | ${CMAKE_CURRENT_SOURCE_DIR}
12 | ../third_party/tinyobj)
13 |
14 | # Link third party libraries
15 | target_link_libraries(${PROJECT_NAME} PUBLIC
16 | ktx
17 | stb
18 | astc
19 | imgui
20 | glslang
21 | SPIRV
22 | hwcpipe
23 | spirv-cross-glsl
24 | glslang-default-resource-limits
25 | spdlog
26 | CLI11::CLI11)
--------------------------------------------------------------------------------
/vox.geometry/field2.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.geometry/field2.h"
8 |
9 | using namespace vox;
10 |
11 | Field2::Field2() = default;
12 |
13 | Field2::~Field2() = default;
14 |
--------------------------------------------------------------------------------
/vox.geometry/field2.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include
10 |
11 | namespace vox {
12 |
13 | //! Abstract base class for 2-D fields.
14 | class Field2 {
15 | public:
16 | Field2();
17 |
18 | virtual ~Field2();
19 | };
20 |
21 | typedef std::shared_ptr Field2Ptr;
22 |
23 | } // namespace vox
--------------------------------------------------------------------------------
/vox.geometry/field3.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.geometry/field3.h"
8 |
9 | using namespace vox;
10 |
11 | Field3::Field3() = default;
12 |
13 | Field3::~Field3() = default;
14 |
--------------------------------------------------------------------------------
/vox.geometry/field3.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include
10 |
11 | namespace vox {
12 |
13 | //! Abstract base class for 3-D fields.
14 | class Field3 {
15 | public:
16 | Field3();
17 |
18 | virtual ~Field3();
19 | };
20 |
21 | typedef std::shared_ptr Field3Ptr;
22 |
23 | } // namespace vox
--------------------------------------------------------------------------------
/vox.geometry/frame.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.geometry/frame.h"
8 |
9 | using namespace vox;
10 |
11 | Frame::Frame() = default;
12 |
13 | Frame::Frame(int newIndex, double newTimeIntervalInSeconds)
14 | : index(newIndex), timeIntervalInSeconds(newTimeIntervalInSeconds) {}
15 |
16 | double Frame::timeInSeconds() const { return index * timeIntervalInSeconds; }
17 |
18 | void Frame::advance() { ++index; }
19 |
20 | void Frame::advance(int delta) { index += delta; }
21 |
22 | Frame& Frame::operator++() {
23 | advance();
24 | return *this;
25 | }
26 |
27 | Frame Frame::operator++(int i) {
28 | Frame result = *this;
29 | advance();
30 | return result;
31 | }
32 |
--------------------------------------------------------------------------------
/vox.geometry/point_generator2.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.geometry/point_generator2.h"
8 |
9 | namespace vox {
10 |
11 | PointGenerator2::PointGenerator2() = default;
12 |
13 | PointGenerator2::~PointGenerator2() = default;
14 |
15 | void PointGenerator2::generate(const BoundingBox2D& boundingBox, double spacing, Array1* points) const {
16 | forEachPoint(boundingBox, spacing, [&points](const Point2D& point) {
17 | points->append(point);
18 | return true;
19 | });
20 | }
21 |
22 | } // namespace vox
23 |
--------------------------------------------------------------------------------
/vox.geometry/point_generator3.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.geometry/point_generator3.h"
8 |
9 | namespace vox {
10 |
11 | PointGenerator3::PointGenerator3() = default;
12 |
13 | PointGenerator3::~PointGenerator3() = default;
14 |
15 | void PointGenerator3::generate(const BoundingBox3D& boundingBox, double spacing, Array1* points) const {
16 | forEachPoint(boundingBox, spacing, [&points](const Point3D& point) {
17 | points->append(point);
18 | return true;
19 | });
20 | }
21 |
22 | } // namespace vox
23 |
--------------------------------------------------------------------------------
/vox.geometry/point_neighbor_searcher2.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.geometry/point_neighbor_searcher2.h"
8 |
9 | using namespace vox;
10 |
11 | PointNeighborSearcher2::PointNeighborSearcher2() = default;
12 |
13 | PointNeighborSearcher2::~PointNeighborSearcher2() = default;
14 |
--------------------------------------------------------------------------------
/vox.geometry/point_neighbor_searcher3.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.geometry/point_neighbor_searcher3.h"
8 |
9 | using namespace vox;
10 |
11 | PointNeighborSearcher3::PointNeighborSearcher3() = default;
12 |
13 | PointNeighborSearcher3::~PointNeighborSearcher3() = default;
14 |
--------------------------------------------------------------------------------
/vox.geometry/scalar_field2.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.geometry/scalar_field2.h"
8 |
9 | using namespace vox;
10 |
11 | ScalarField2::ScalarField2() = default;
12 |
13 | ScalarField2::~ScalarField2() = default;
14 |
15 | Vector2D ScalarField2::gradient(const Point2D &) const { return {}; }
16 |
17 | double ScalarField2::laplacian(const Point2D &) const { return 0.0; }
18 |
19 | std::function ScalarField2::sampler() const {
20 | const ScalarField2 *self = this;
21 | return [self](const Point2D &x) -> double { return self->sample(x); };
22 | }
23 |
--------------------------------------------------------------------------------
/vox.geometry/scalar_field3.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.geometry/scalar_field3.h"
8 |
9 | using namespace vox;
10 |
11 | ScalarField3::ScalarField3() = default;
12 |
13 | ScalarField3::~ScalarField3() = default;
14 |
15 | Vector3D ScalarField3::gradient(const Point3D &) const { return {}; }
16 |
17 | double ScalarField3::laplacian(const Point3D &) const { return 0.0; }
18 |
19 | std::function ScalarField3::sampler() const {
20 | const ScalarField3 *self = this;
21 | return [self](const Point3D &x) -> double { return self->sample(x); };
22 | }
23 |
--------------------------------------------------------------------------------
/vox.geometry/vector_field2.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.geometry/vector_field2.h"
8 |
9 | using namespace vox;
10 |
11 | VectorField2::VectorField2() = default;
12 |
13 | VectorField2::~VectorField2() = default;
14 |
15 | double VectorField2::divergence(const Point2D &) const { return 0.0; }
16 |
17 | double VectorField2::curl(const Point2D &) const { return 0.0; }
18 |
19 | std::function VectorField2::sampler() const {
20 | const VectorField2 *self = this;
21 | return [self](const Point2D &x) -> Vector2D { return self->sample(x); };
22 | }
23 |
--------------------------------------------------------------------------------
/vox.geometry/vector_field3.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.geometry/vector_field3.h"
8 |
9 | using namespace vox;
10 |
11 | VectorField3::VectorField3() = default;
12 |
13 | VectorField3::~VectorField3() = default;
14 |
15 | double VectorField3::divergence(const Point3D &) const { return 0.0; }
16 |
17 | Vector3D VectorField3::curl(const Point3D &) const { return {}; }
18 |
19 | std::function VectorField3::sampler() const {
20 | const VectorField3 *self = this;
21 | return [self](const Point3D &x) -> Vector3D { return self->sample(x); };
22 | }
23 |
--------------------------------------------------------------------------------
/vox.math/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.12)
2 |
3 | project(vox.math LANGUAGES C CXX)
4 |
5 | file(GLOB sources
6 | ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
7 |
8 | add_library(${PROJECT_NAME} STATIC ${sources})
9 |
10 | target_include_directories(${PROJECT_NAME} PUBLIC ../)
11 |
--------------------------------------------------------------------------------
/vox.math/bounding_plane.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.math/vector.h"
10 |
11 | namespace vox {
12 |
13 | //!
14 | //! \brief Class for ray.
15 | //!
16 | //! \tparam T The value type.
17 | //! \tparam N The dimension.
18 | //!
19 | template
20 | struct BoundingPlane {
21 | static_assert(N != 2 && N != 3, "Not implemented.");
22 | static_assert(std::is_floating_point::value, "Plane only can be instantiated with floating point types");
23 | };
24 |
25 | } // namespace vox
26 |
--------------------------------------------------------------------------------
/vox.math/functors-inl.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.math/functors.h"
10 |
11 | namespace vox {
12 |
13 | template
14 | constexpr U TypeCast::operator()(const T &a) const {
15 | return static_cast(a);
16 | }
17 |
18 | template
19 | constexpr T RMinus::operator()(const T &a, const T &b) const {
20 | return b - a;
21 | }
22 |
23 | template
24 | constexpr T RDivides::operator()(const T &a, const T &b) const {
25 | return b / a;
26 | }
27 |
28 | } // namespace vox
29 |
--------------------------------------------------------------------------------
/vox.math/functors.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include
10 |
11 | namespace vox {
12 |
13 | //! Type casting operator.
14 | template
15 | struct TypeCast {
16 | constexpr U operator()(const T &a) const;
17 | };
18 |
19 | //! Reverse minus operator.
20 | template
21 | struct RMinus {
22 | constexpr T operator()(const T &a, const T &b) const;
23 | };
24 |
25 | //! Reverse divides operator.
26 | template
27 | struct RDivides {
28 | constexpr T operator()(const T &a, const T &b) const;
29 | };
30 | } // namespace vox
31 |
32 | #include "vox.math/functors-inl.h"
33 |
--------------------------------------------------------------------------------
/vox.math/ray.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.math/vector.h"
10 |
11 | namespace vox {
12 |
13 | //!
14 | //! \brief Class for ray.
15 | //!
16 | //! \tparam T The value type.
17 | //! \tparam N The dimension.
18 | //!
19 | template
20 | struct Ray {
21 | static_assert(N != 2 && N != 3, "Not implemented.");
22 | static_assert(std::is_floating_point::value, "Ray only can be instantiated with floating point types");
23 | };
24 |
25 | } // namespace vox
26 |
--------------------------------------------------------------------------------
/vox.math/ray2-inl.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | namespace vox {
10 |
11 | template
12 | Ray::Ray() : Ray(Point2(), Vector2(1, 0)) {}
13 |
14 | template
15 | Ray::Ray(const Point2 &new_origin, const Vector2 &new_direction)
16 | : origin(new_origin), direction(new_direction.normalized()) {}
17 |
18 | template
19 | Ray::Ray(const Ray &other) : origin(other.origin), direction(other.direction) {}
20 |
21 | template
22 | Point2 Ray::pointAt(T t) const {
23 | return origin + t * direction;
24 | }
25 |
26 | } // namespace vox
27 |
--------------------------------------------------------------------------------
/vox.math/ray3-inl.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | namespace vox {
10 |
11 | template
12 | Ray::Ray() : Ray(Point3(), Vector3(1, 0, 0)) {}
13 |
14 | template
15 | Ray::Ray(const Point3 &new_origin, const Vector3 &new_direction)
16 | : origin(new_origin), direction(new_direction.normalized()) {}
17 |
18 | template
19 | Ray::Ray(const Ray &other) : origin(other.origin), direction(other.direction) {}
20 |
21 | template
22 | Point3 Ray::pointAt(T t) const {
23 | return origin + t * direction;
24 | }
25 |
26 | } // namespace vox
27 |
--------------------------------------------------------------------------------
/vox.math/size.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.math/point.h"
10 |
11 | namespace vox {
12 | //! \brief N-D size type.
13 | template
14 | using Size = Point;
15 |
16 | } // namespace vox
17 |
18 | // #include "vox.math/size-inl.h"
19 |
--------------------------------------------------------------------------------
/vox.render/debug_info.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.render/debug_info.h"
8 |
9 | namespace vox {
10 | std::vector> &DebugInfo::get_fields() { return fields_; }
11 |
12 | float DebugInfo::get_longest_label() const {
13 | float column_width = 0.0f;
14 | for (auto &field : fields_) {
15 | const std::string &label = field->label;
16 |
17 | if (label.size() > column_width) {
18 | column_width = static_cast(label.size());
19 | }
20 | }
21 | return column_width;
22 | }
23 |
24 | } // namespace vox
25 |
--------------------------------------------------------------------------------
/vox.render/fog/exp2_fog.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/fog/fog.h"
10 |
11 | namespace vox {
12 | class Exp2Fog : public Fog {
13 | /**
14 | * Density of fog.
15 | */
16 | [[nodiscard]] float getDensity() const;
17 |
18 | void setDensity(float value);
19 |
20 | explicit Exp2Fog(Entity* entity);
21 |
22 | void _onEnable() override;
23 |
24 | void _onDisable() override;
25 |
26 | private:
27 | float _density = 0.0025;
28 | static const std::string _densityProperty;
29 | };
30 | } // namespace vox
--------------------------------------------------------------------------------
/vox.render/fog/fog.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.render/fog/fog.h"
8 |
9 | #include "vox.render/scene.h"
10 |
11 | namespace vox {
12 | const std::string Fog::_colorProperty = "u_fogColor";
13 |
14 | Color Fog::getColor() const { return _color; }
15 |
16 | void Fog::setColor(const Color& value) {
17 | _color = value;
18 | scene()->shaderData.setData(_colorProperty, value);
19 | }
20 |
21 | Fog::Fog(Entity* entity) : Component(entity) { setColor(Color(1, 0, 0, 1)); }
22 |
23 | void Fog::_onEnable() { scene()->shaderData.addDefine("HAS_FOG"); }
24 |
25 | void Fog::_onDisable() { scene()->shaderData.removeDefine("HAS_FOG"); }
26 |
27 | } // namespace vox
--------------------------------------------------------------------------------
/vox.render/fog/fog.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.math/color.h"
10 | #include "vox.render/component.h"
11 |
12 | namespace vox {
13 | /**
14 | * Fog.
15 | */
16 | class Fog : public Component {
17 | public:
18 | /**
19 | * Fog color.
20 | */
21 | [[nodiscard]] Color getColor() const;
22 |
23 | void setColor(const Color& value);
24 |
25 | explicit Fog(Entity* entity);
26 |
27 | void _onEnable() override;
28 |
29 | void _onDisable() override;
30 |
31 | private:
32 | static const std::string _colorProperty;
33 | Color _color;
34 | };
35 | } // namespace vox
36 |
--------------------------------------------------------------------------------
/vox.render/image/ktx_img.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/image.h"
10 |
11 | namespace vox {
12 | class Ktx : public Image {
13 | public:
14 | Ktx(const std::string &name, const std::vector &data, bool flipY);
15 |
16 | ~Ktx() override = default;
17 | };
18 |
19 | } // namespace vox
--------------------------------------------------------------------------------
/vox.render/image/stb_img.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/image.h"
10 |
11 | namespace vox {
12 | class Stb : public Image {
13 | public:
14 | Stb(const std::string &name, const std::vector &data, bool flipY);
15 |
16 | ~Stb() override = default;
17 | };
18 |
19 | } // namespace vox
20 |
--------------------------------------------------------------------------------
/vox.render/lighting/debug/cluster_debug_material.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.render/lighting/debug/cluster_debug_material.h"
8 |
9 | #include "vox.render/shader/shader_manager.h"
10 |
11 | namespace vox {
12 | ClusterDebugMaterial::ClusterDebugMaterial(wgpu::Device& device) : BaseMaterial(device) {
13 | vertex_source_ = ShaderManager::GetSingleton().LoadShader("unlit.vert");
14 | fragment_source_ = ShaderManager::GetSingleton().LoadShader("light/cluster_debug.frag");
15 | }
16 |
17 | } // namespace vox
18 |
--------------------------------------------------------------------------------
/vox.render/lighting/debug/cluster_debug_material.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/material/base_material.h"
10 |
11 | namespace vox {
12 | class ClusterDebugMaterial : public BaseMaterial {
13 | public:
14 | explicit ClusterDebugMaterial(wgpu::Device& device);
15 | };
16 |
17 | } // namespace vox
--------------------------------------------------------------------------------
/vox.render/lighting/light.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.render/lighting/light.h"
8 |
9 | #include "vox.render/entity.h"
10 |
11 | namespace vox {
12 | Light::Light(Entity *entity) : Component(entity) {}
13 |
14 | Matrix4x4F Light::viewMatrix() { return entity()->transform->worldMatrix().inverse(); }
15 |
16 | Matrix4x4F Light::inverseViewMatrix() { return entity()->transform->worldMatrix(); }
17 |
18 | } // namespace vox
19 |
--------------------------------------------------------------------------------
/vox.render/material/enums/blend_mode.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | /**
10 | * Alpha blend mode.
11 | */
12 | enum class BlendMode {
13 | /** SRC ALPHA * SRC + (1 - SRC ALPHA) * DEST */
14 | Normal,
15 | /** SRC ALPHA * SRC + ONE * DEST */
16 | Additive
17 | };
--------------------------------------------------------------------------------
/vox.render/material/enums/render_face.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | /**
10 | * Set which face for render.
11 | */
12 | enum class RenderFace {
13 | /** Render front face. */
14 | Front,
15 | /** Render back face. */
16 | Back,
17 | /** Render double face. */
18 | Double
19 | };
--------------------------------------------------------------------------------
/vox.render/material/enums/render_queue_type.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | /**
10 | * Render queue type.
11 | */
12 | struct RenderQueueType {
13 | enum Enum {
14 | /** Opaque queue. */
15 | Opaque = 1000,
16 | /** Opaque queue, alpha cutoff. */
17 | AlphaTest = 2000,
18 | /** Transparent queue, rendering from back to front to ensure correct rendering of transparent objects. */
19 | Transparent = 3000
20 | };
21 | };
--------------------------------------------------------------------------------
/vox.render/material/enums/texture_coordinate.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 | /**
9 | * Texture UV coordinate.
10 | */
11 | enum TextureCoordinate : uint32_t { UV0 = 0, UV1, UV2, UV3, UV4, UV5, UV6, UV7 };
--------------------------------------------------------------------------------
/vox.render/material/material.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.render/material/material.h"
8 |
9 | namespace vox {
10 | Material::Material(wgpu::Device &device, std::string name)
11 | : device_(device), shaderData(device), name{std::move(name)} {}
12 |
13 | } // namespace vox
14 |
--------------------------------------------------------------------------------
/vox.render/mesh/index_buffer_binding.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.render/mesh/index_buffer_binding.h"
8 |
9 | namespace vox {
10 | IndexBufferBinding::IndexBufferBinding(Buffer buffer, wgpu::IndexFormat format)
11 | : _buffer(std::move(buffer)), _format(format) {}
12 |
13 | const wgpu::Buffer& IndexBufferBinding::buffer() const { return _buffer.handle(); }
14 |
15 | wgpu::IndexFormat IndexBufferBinding::format() const { return _format; }
16 |
17 | } // namespace vox
18 |
--------------------------------------------------------------------------------
/vox.render/mesh/sub_mesh.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.render/mesh/sub_mesh.h"
8 |
9 | namespace vox {
10 | SubMesh::SubMesh(uint32_t start, uint32_t count, wgpu::PrimitiveTopology topology)
11 | : _start(start), _count(count), _topology(topology) {}
12 |
13 | uint32_t SubMesh::start() const { return _start; }
14 |
15 | uint32_t SubMesh::count() const { return _count; }
16 |
17 | wgpu::PrimitiveTopology SubMesh::topology() const { return _topology; }
18 |
19 | } // namespace vox
20 |
--------------------------------------------------------------------------------
/vox.render/physx/physx_dynamic_collider.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/physx/physx_collider.h"
10 |
11 | namespace vox {
12 | class PhysxDynamicCollider: public PhysxCollider {
13 | public:
14 | explicit PhysxDynamicCollider(Entity *entity);
15 |
16 | private:
17 | void OnLateUpdate() override;
18 | };
19 | }
--------------------------------------------------------------------------------
/vox.render/physx/physx_static_collider.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.render/physx/physx_static_collider.h"
8 |
9 | #include "vox.render/entity.h"
10 | #include "vox.render/physx/physx_manager.h"
11 |
12 | namespace vox {
13 | using namespace physx;
14 | PhysxStaticCollider::PhysxStaticCollider(Entity *entity) : PhysxCollider(entity) {
15 | const auto &p = entity->transform->worldPosition();
16 | auto q = entity->transform->worldRotationQuaternion();
17 | q.normalize();
18 |
19 | native_actor_ = PhysxManager::GetSingleton().physics->createRigidStatic(
20 | PxTransform(PxVec3(p.x, p.y, p.z), PxQuat(q.x, q.y, q.z, q.w)));
21 | }
22 | } // namespace vox
--------------------------------------------------------------------------------
/vox.render/physx/physx_static_collider.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/physx/physx_collider.h"
10 |
11 | namespace vox {
12 | class PhysxStaticCollider: public PhysxCollider {
13 | public:
14 | explicit PhysxStaticCollider(Entity *entity);
15 | };
16 | }
--------------------------------------------------------------------------------
/vox.render/platform/headless_window.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.render/platform/headless_window.h"
8 |
9 | namespace vox {
10 | HeadlessWindow::HeadlessWindow(const Window::Properties &properties) : Window(properties) {}
11 |
12 | bool HeadlessWindow::ShouldClose() { return closed_; }
13 |
14 | void HeadlessWindow::Close() { closed_ = true; }
15 |
16 | float HeadlessWindow::GetDpiFactor() const {
17 | // This factor is used for scaling UI elements, so return 1.0f (1 x n = n)
18 | return 1.0f;
19 | }
20 |
21 | } // namespace vox
22 |
--------------------------------------------------------------------------------
/vox.render/platform/unix/unix_d2d_platform.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/platform/platform.h"
10 |
11 | namespace vox {
12 | class UnixD2DPlatform : public Platform {
13 | public:
14 | UnixD2DPlatform(int argc, char **argv);
15 |
16 | virtual ~UnixD2DPlatform() = default;
17 |
18 | virtual const char *GetSurfaceExtension() override;
19 |
20 | protected:
21 | virtual void CreateWindow(const Window::Properties &properties) override;
22 | };
23 |
24 | } // namespace vox
25 |
--------------------------------------------------------------------------------
/vox.render/platform/unix/unix_platform.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/platform/platform.h"
10 |
11 | namespace vox {
12 | enum UnixType { MAC, LINUX };
13 |
14 | class UnixPlatform : public Platform {
15 | public:
16 | UnixPlatform(const UnixType &type, int argc, char **argv);
17 |
18 | ~UnixPlatform() override = default;
19 |
20 | const char *GetSurfaceExtension() override;
21 |
22 | protected:
23 | void CreateWindow(const Window::Properties &properties) override;
24 |
25 | private:
26 | UnixType type_;
27 | };
28 |
29 | } // namespace vox
30 |
--------------------------------------------------------------------------------
/vox.render/platform/windows/windows_platform.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/platform/platform.h"
10 |
11 | namespace vox {
12 | class WindowsPlatform : public Platform {
13 | public:
14 | WindowsPlatform(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR lpCmdLine, INT nCmdShow);
15 |
16 | virtual ~WindowsPlatform() = default;
17 |
18 | virtual const char *GetSurfaceExtension() override;
19 |
20 | protected:
21 | virtual void CreateWindow(const Window::Properties &properties) override;
22 | };
23 |
24 | } // namespace vox
25 |
--------------------------------------------------------------------------------
/vox.render/plugins/force_close.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.render/plugins/force_close.h"
8 |
9 | #include
10 |
11 | namespace vox::plugins {
12 | ForceClose::ForceClose()
13 | : ForceCloseTags(
14 | "Force Close", "Force the application to close if it has been halted before exiting", {}, {&stop_cmd_}) {}
15 |
16 | bool ForceClose::IsActive(const CommandParser &parser) { return parser.Contains(&stop_cmd_); }
17 |
18 | void ForceClose::Init(const CommandParser &parser) {}
19 |
20 | } // namespace vox::plugins
21 |
--------------------------------------------------------------------------------
/vox.render/rendering/render_element.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.render/rendering/render_element.h"
8 |
9 | #include
10 |
11 | namespace vox {
12 | RenderElement::RenderElement(Renderer *renderer, MeshPtr mesh, const SubMesh *subMesh, MaterialPtr material)
13 | : renderer(renderer), mesh(std::move(mesh)), subMesh(subMesh), material(std::move(material)) {}
14 |
15 | } // namespace vox
16 |
--------------------------------------------------------------------------------
/vox.render/rendering/render_element.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/scene_forward.h"
10 |
11 | namespace vox {
12 | /**
13 | * Render element.
14 | */
15 | struct RenderElement {
16 | /** Render component. */
17 | Renderer *renderer;
18 | /** Mesh. */
19 | MeshPtr mesh;
20 | /** Sub mesh. */
21 | const SubMesh *subMesh;
22 | /** Material. */
23 | MaterialPtr material;
24 |
25 | RenderElement(Renderer *renderer, MeshPtr mesh, const SubMesh *subMesh, MaterialPtr material);
26 | };
27 |
28 | } // namespace vox
--------------------------------------------------------------------------------
/vox.render/shader/shader_common.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include
10 |
11 | namespace vox {
12 | enum class Attributes : uint32_t {
13 | POSITION = 0,
14 | NORMAL,
15 | COLOR_0,
16 | WEIGHTS_0,
17 | JOINTS_0,
18 | TANGENT,
19 | UV_0,
20 | UV_1,
21 | UV_2,
22 | UV_3,
23 | UV_4,
24 | UV_5,
25 | UV_6,
26 | UV_7,
27 | TOTAL_COUNT
28 | };
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/vox.render/shader/shader_source.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/helper.h"
10 |
11 | namespace vox {
12 | class ShaderSource {
13 | public:
14 | ShaderSource() = default;
15 |
16 | explicit ShaderSource(const std::string &filename);
17 |
18 | [[nodiscard]] size_t GetId() const;
19 |
20 | [[nodiscard]] const std::string &GetFilename() const;
21 |
22 | void SetSource(const std::string &source);
23 |
24 | [[nodiscard]] const std::string &GetSource() const;
25 |
26 | private:
27 | size_t id_{};
28 |
29 | std::string filename_;
30 |
31 | std::string source_;
32 | };
33 |
34 | } // namespace vox
35 |
--------------------------------------------------------------------------------
/vox.render/shader/state/depth_state.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.render/shader/state/depth_state.h"
8 |
9 | namespace vox {
10 | void DepthState::platformApply(wgpu::DepthStencilState *depthStencil) const {
11 | if (enabled && depthStencil) {
12 | // apply compare func.
13 | depthStencil->depthCompare = compareFunction;
14 |
15 | // apply write enabled.
16 | depthStencil->depthWriteEnabled = writeEnabled;
17 | }
18 | }
19 |
20 | } // namespace vox
21 |
--------------------------------------------------------------------------------
/vox.render/shadow/enum/shadow_cascades_mode.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include
10 |
11 | namespace vox {
12 | /**
13 | * Number of cascades to use for directional light shadows.
14 | */
15 | enum ShadowCascadesMode : uint32_t {
16 | /** No cascades */
17 | NoCascades = 1,
18 | /** Two cascades */
19 | TwoCascades = 2,
20 | /** Four cascades */
21 | FourCascades = 4
22 | };
23 |
24 | } // namespace vox
--------------------------------------------------------------------------------
/vox.render/shadow/enum/shadow_mode.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include
10 |
11 | namespace vox {
12 | /**
13 | * Determines which type of shadows should be used.
14 | */
15 | enum ShadowMode {
16 | /** Disable Shadows. */
17 | None,
18 | /** Hard Shadows Only. */
19 | Hard,
20 | /** Cast "soft" shadows with low range. */
21 | SoftLow,
22 | /** Cast "soft" shadows with large range. */
23 | SoftHigh
24 | };
25 |
26 | } // namespace vox
--------------------------------------------------------------------------------
/vox.render/shadow/enum/shadow_resolution.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include
10 |
11 | namespace vox {
12 | /**
13 | * Default shadow resolution.
14 | */
15 | enum ShadowResolution {
16 | /** Low shadow map resolution. */
17 | Low,
18 | /** Medium shadow map resolution. */
19 | Medium,
20 | /** High shadow map resolution. */
21 | High,
22 | /** Very high shadow map resolution. */
23 | VeryHigh
24 | };
25 |
26 | } // namespace vox
--------------------------------------------------------------------------------
/vox.render/shadow/shadow_debug_material.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.render/shadow/shadow_debug_material.h"
8 |
9 | namespace vox {
10 | ShadowDebugMaterial::ShadowDebugMaterial(wgpu::Device& device) : BaseMaterial(device) {}
11 |
12 | } // namespace vox
13 |
--------------------------------------------------------------------------------
/vox.render/shadow/shadow_debug_material.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/material/base_material.h"
10 |
11 | namespace vox {
12 | class ShadowDebugMaterial : public BaseMaterial {
13 | public:
14 | explicit ShadowDebugMaterial(wgpu::Device& device);
15 | };
16 |
17 | } // namespace vox
--------------------------------------------------------------------------------
/vox.render/shadow/shadow_material.cpp:
--------------------------------------------------------------------------------
1 |
2 | // Copyright (c) 2022 Feng Yang
3 | //
4 | // I am making my contributions/submissions to this project solely in my
5 | // personal capacity and am not conveying any rights to any intellectual
6 | // property of any third parties.
7 |
8 | #include "vox.render/shadow/shadow_material.h"
9 |
10 | #include "vox.render/shader/shader_manager.h"
11 |
12 | namespace vox {
13 | ShadowMaterial::ShadowMaterial(wgpu::Device& device) : BaseMaterial(device) {
14 | vertex_source_ = ShaderManager::GetSingleton().LoadShader("shadow/shadow-map.vert");
15 | }
16 | } // namespace vox
--------------------------------------------------------------------------------
/vox.render/shadow/shadow_material.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.math/matrix4x4.h"
10 | #include "vox.render/material/base_material.h"
11 |
12 | namespace vox {
13 | class ShadowMaterial : public BaseMaterial {
14 | public:
15 | /**
16 | * Create a ShadowMaterial instance.
17 | */
18 | explicit ShadowMaterial(wgpu::Device& device);
19 | };
20 |
21 | } // namespace vox
--------------------------------------------------------------------------------
/vox.render/ui/drawable.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | namespace vox::ui {
10 | /**
11 | * Interface for any drawable class
12 | */
13 | class Drawable {
14 | public:
15 | virtual void Draw() = 0;
16 |
17 | protected:
18 | virtual ~Drawable() = default;
19 | };
20 |
21 | } // namespace vox::ui
22 |
--------------------------------------------------------------------------------
/vox.render/ui/plugins/contextual_menu.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.render/ui/plugins/contextual_menu.h"
8 |
9 | namespace vox::ui {
10 | void ContextualMenu::Execute() {
11 | if (ImGui::BeginPopupContextItem()) {
12 | DrawWidgets();
13 | ImGui::EndPopup();
14 | }
15 | }
16 |
17 | void ContextualMenu::Close() { ImGui::CloseCurrentPopup(); }
18 |
19 | } // namespace vox::ui
20 |
--------------------------------------------------------------------------------
/vox.render/ui/plugins/plugin.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | namespace vox::ui {
10 | /**
11 | * Interface to any plugin of UI.
12 | * A plugin is basically a behaviour that you can plug to a widget
13 | */
14 | class Plugin {
15 | public:
16 | virtual ~Plugin() = default;
17 |
18 | /**
19 | * Execute the plugin behaviour
20 | */
21 | virtual void Execute() = 0;
22 |
23 | /* Feel free to store any data you want here */
24 | void *user_data_ = nullptr;
25 | };
26 |
27 | } // namespace vox::ui
28 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/alignment.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | namespace vox::ui {
10 | /**
11 | * Defines horizontal alignments
12 | */
13 | enum class HorizontalAlignment { LEFT, CENTER, RIGHT };
14 |
15 | /**
16 | * Defines vertical alignments
17 | */
18 | enum class VerticalAlignment { TOP, MIDDLE, BOTTOM };
19 |
20 | } // namespace vox::ui
21 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/buttons/button.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/event.h"
10 | #include "vox.render/ui/widgets/widget.h"
11 |
12 | namespace vox::ui {
13 | /**
14 | * Base class for any button widget
15 | */
16 | class Button : public Widget {
17 | public:
18 | Event<> clicked_event_;
19 | };
20 |
21 | } // namespace vox::ui
22 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/buttons/button_arrow.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.render/ui/widgets/buttons/button_arrow.h"
8 |
9 | namespace vox::ui {
10 | ButtonArrow::ButtonArrow(ImGuiDir direction) : direction_(direction) {}
11 |
12 | void ButtonArrow::DrawImpl() {
13 | if (ImGui::ArrowButton(widget_id_.c_str(), direction_)) clicked_event_.Invoke();
14 | }
15 |
16 | } // namespace vox::ui
17 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/buttons/button_arrow.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/ui/widgets/buttons/button.h"
10 |
11 | namespace vox::ui {
12 | /**
13 | * Button widget with an arrow image
14 | */
15 | class ButtonArrow : public Button {
16 | public:
17 | /**
18 | * Create the button
19 | */
20 | explicit ButtonArrow(ImGuiDir direction = ImGuiDir_None);
21 |
22 | protected:
23 | void DrawImpl() override;
24 |
25 | public:
26 | ImGuiDir direction_;
27 | };
28 |
29 | } // namespace vox::ui
30 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/converter.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.render/ui/widgets/converter.h"
8 |
9 | namespace vox::ui {
10 | ImVec4 Converter::ToImVec4(const Color &value) { return {value.r, value.g, value.b, value.a}; }
11 |
12 | Color Converter::ToColor(const ImVec4 &value) { return {value.x, value.y, value.z, value.w}; }
13 |
14 | ImVec2 Converter::ToImVec2(const Vector2F &value) { return {value.x, value.y}; }
15 |
16 | Vector2F Converter::ToVector2F(const ImVec2 &value) { return {value.x, value.y}; }
17 |
18 | } // namespace vox::ui
19 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/drags/drag_double.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.render/ui/widgets/drags/drag_double.h"
8 |
9 | namespace vox::ui {
10 | DragDouble::DragDouble(
11 | double min, double max, double value, float speed, const std::string &label, const std::string &format)
12 | : DragSingleScalar(ImGuiDataType_::ImGuiDataType_Double, min, max, value, speed, label, format) {}
13 |
14 | } // namespace vox::ui
15 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/drags/drag_double.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/ui/widgets/drags/drag_single_scalar.h"
10 |
11 | namespace vox::ui {
12 | /**
13 | * Drag widget of type double
14 | */
15 | class DragDouble : public DragSingleScalar {
16 | public:
17 | explicit DragDouble(double min = 0.0,
18 | double max = 1.0,
19 | double value = 0.5,
20 | float speed = 0.1f,
21 | const std::string &label = "",
22 | const std::string &format = "%.6f");
23 | };
24 |
25 | } // namespace vox::ui
26 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/drags/drag_float.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.render/ui/widgets/drags/drag_float.h"
8 |
9 | namespace vox::ui {
10 | DragFloat::DragFloat(
11 | float min, float max, float value, float speed, const std::string &label, const std::string &format)
12 | : DragSingleScalar(ImGuiDataType_::ImGuiDataType_Float, min, max, value, speed, label, format) {}
13 |
14 | } // namespace vox::ui
15 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/drags/drag_float.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/ui/widgets/drags/drag_single_scalar.h"
10 |
11 | namespace vox::ui {
12 | /**
13 | * Drag widget of type double
14 | */
15 | class DragFloat : public DragSingleScalar {
16 | public:
17 | explicit DragFloat(float min = 0.0,
18 | float max = 1.0,
19 | float value = 0.5,
20 | float speed = 0.1f,
21 | const std::string &label = "",
22 | const std::string &format = "%.3f");
23 | };
24 |
25 | } // namespace vox::ui
26 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/drags/drag_int.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.render/ui/widgets/drags/drag_int.h"
8 |
9 | namespace vox::ui {
10 | DragInt::DragInt(int min, int max, int value, float speed, const std::string &label, const std::string &format)
11 | : DragSingleScalar(ImGuiDataType_::ImGuiDataType_S32, min, max, value, speed, label, format) {}
12 |
13 | } // namespace vox::ui
14 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/drags/drag_int.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/ui/widgets/drags/drag_single_scalar.h"
10 |
11 | namespace vox::ui {
12 | /**
13 | * Drag widget of type int
14 | */
15 | class DragInt : public DragSingleScalar {
16 | public:
17 | explicit DragInt(int min = 0,
18 | int max = 100,
19 | int value = 50,
20 | float speed = 0.1f,
21 | const std::string &label = "",
22 | const std::string &format = "%d");
23 | };
24 |
25 | } // namespace vox::ui
26 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/input_fields/input_float.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.render/ui/widgets/input_fields/input_float.h"
8 |
9 | namespace vox::ui {
10 | InputFloat::InputFloat(float default_value,
11 | float step,
12 | float fast_step,
13 | const std::string &label,
14 | const std::string &format,
15 | bool select_all_on_click)
16 | : InputSingleScalar(
17 | ImGuiDataType_::ImGuiDataType_Float, default_value, step, fast_step, label, format, select_all_on_click) {
18 | }
19 |
20 | } // namespace vox::ui
21 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/input_fields/input_float.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/ui/widgets/input_fields/input_single_scalar.h"
10 |
11 | namespace vox::ui {
12 | /**
13 | * Input widget of type float
14 | */
15 | class InputFloat : public InputSingleScalar {
16 | public:
17 | explicit InputFloat(float default_value = 0.0f,
18 | float step = 0.1f,
19 | float fast_step = 0.0f,
20 | const std::string &label = "",
21 | const std::string &format = "%.3f",
22 | bool select_all_on_click = true);
23 | };
24 |
25 | } // namespace vox::ui
26 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/input_fields/input_int.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.render/ui/widgets/input_fields/input_int.h"
8 |
9 | namespace vox::ui {
10 | InputInt::InputInt(int default_value,
11 | int step,
12 | int fast_step,
13 | const std::string &label,
14 | const std::string &format,
15 | bool select_all_on_click)
16 | : InputSingleScalar(
17 | ImGuiDataType_::ImGuiDataType_S32, default_value, step, fast_step, label, format, select_all_on_click) {}
18 |
19 | } // namespace vox::ui
20 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/input_fields/input_int.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/ui/widgets/input_fields/input_single_scalar.h"
10 |
11 | namespace vox::ui {
12 | /**
13 | * Input widget of type int
14 | */
15 | class InputInt : public InputSingleScalar {
16 | public:
17 | explicit InputInt(int default_value = 0,
18 | int step = 1,
19 | int fast_step = 0,
20 | const std::string &label = "",
21 | const std::string &format = "%d",
22 | bool select_all_on_click = true);
23 | };
24 |
25 | } // namespace vox::ui
26 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/layout/dummy.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.render/ui/widgets/layout/dummy.h"
8 |
9 | #include "vox.render/ui/widgets/converter.h"
10 |
11 | namespace vox::ui {
12 | Dummy::Dummy(const Vector2F &size) : size_(size) {}
13 |
14 | void Dummy::DrawImpl() { ImGui::Dummy(Converter::ToImVec2(size_)); }
15 |
16 | } // namespace vox::ui
17 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/layout/dummy.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.math/vector2.h"
10 | #include "vox.render/ui/widgets/widget.h"
11 |
12 | namespace vox::ui {
13 | /**
14 | * Dummy widget that takes the given size as space in the panel
15 | */
16 | class Dummy : public Widget {
17 | public:
18 | explicit Dummy(const Vector2F &size = {0.0f, 0.0f});
19 |
20 | protected:
21 | void DrawImpl() override;
22 |
23 | public:
24 | Vector2F size_;
25 | };
26 |
27 | } // namespace vox::ui
28 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/layout/group.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.render/ui/widgets/layout/group.h"
8 |
9 | namespace vox::ui {
10 | void Group::DrawImpl() { DrawWidgets(); }
11 |
12 | } // namespace vox::ui
13 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/layout/group.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/ui/widgets/widget_container.h"
10 |
11 | namespace vox::ui {
12 | /**
13 | * Widget that can contains other widgets
14 | */
15 | class Group : public Widget, public WidgetContainer {
16 | protected:
17 | void DrawImpl() override;
18 | };
19 |
20 | } // namespace vox::ui
21 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/layout/group_collapsable.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.render/ui/widgets/layout/group_collapsable.h"
8 |
9 | #include
10 |
11 | namespace vox::ui {
12 | GroupCollapsable::GroupCollapsable(std::string name) : name_(std::move(name)) {}
13 |
14 | void GroupCollapsable::DrawImpl() {
15 | bool previously_opened = opened_;
16 |
17 | if (ImGui::CollapsingHeader(name_.c_str(), closable_ ? &opened_ : nullptr)) Group::DrawImpl();
18 |
19 | if (opened_ != previously_opened) {
20 | if (opened_)
21 | open_event_.Invoke();
22 | else
23 | close_event_.Invoke();
24 | }
25 | }
26 |
27 | } // namespace vox::ui
28 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/layout/group_collapsable.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/event.h"
10 | #include "vox.render/ui/widgets/layout/group.h"
11 |
12 | namespace vox::ui {
13 | /**
14 | * Widget that can contains other widgets and is collapsable
15 | */
16 | class GroupCollapsable : public Group {
17 | public:
18 | explicit GroupCollapsable(std::string name = "");
19 |
20 | protected:
21 | void DrawImpl() override;
22 |
23 | public:
24 | std::string name_;
25 | bool closable_ = false;
26 | bool opened_ = true;
27 | Event<> close_event_;
28 | Event<> open_event_;
29 | };
30 |
31 | } // namespace vox::ui
32 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/layout/new_line.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.render/ui/widgets/layout/new_line.h"
8 |
9 | namespace vox::ui {
10 | void NewLine::DrawImpl() { ImGui::NewLine(); }
11 |
12 | } // namespace vox::ui
13 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/layout/new_line.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/ui/widgets/widget.h"
10 |
11 | namespace vox::ui {
12 | /**
13 | * Widget that adds an empty line to the panel
14 | */
15 | class NewLine : public Widget {
16 | protected:
17 | void DrawImpl() override;
18 | };
19 |
20 | } // namespace vox::ui
21 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/layout/spacing.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.render/ui/widgets/layout/spacing.h"
8 |
9 | namespace vox::ui {
10 | Spacing::Spacing(uint16_t spaces) : spaces_(spaces) {}
11 |
12 | void Spacing::DrawImpl() {
13 | for (uint16_t i = 0; i < spaces_; ++i) {
14 | ImGui::Spacing();
15 |
16 | if (i + 1 < spaces_) ImGui::SameLine();
17 | }
18 | }
19 |
20 | } // namespace vox::ui
21 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/layout/spacing.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/ui/widgets/widget.h"
10 |
11 | namespace vox::ui {
12 | /**
13 | * Widget that adds a space to the panel line
14 | */
15 | class Spacing : public Widget {
16 | public:
17 | explicit Spacing(uint16_t spaces = 1);
18 |
19 | protected:
20 | void DrawImpl() override;
21 |
22 | public:
23 | uint16_t spaces_ = 1;
24 | };
25 |
26 | } // namespace vox::ui
27 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/menu/menu_list.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.render/ui/widgets/menu/menu_list.h"
8 |
9 | #include
10 |
11 | namespace vox::ui {
12 | MenuList::MenuList(std::string name, bool locked) : name_(std::move(name)), locked_(locked) {}
13 |
14 | void MenuList::DrawImpl() {
15 | if (ImGui::BeginMenu(name_.c_str(), !locked_)) {
16 | if (!opened_) {
17 | clicked_event_.Invoke();
18 | opened_ = true;
19 | }
20 |
21 | DrawWidgets();
22 | ImGui::EndMenu();
23 | } else {
24 | opened_ = false;
25 | }
26 | }
27 |
28 | } // namespace vox::ui
29 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/menu/menu_list.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/event.h"
10 | #include "vox.render/ui/widgets/layout/group.h"
11 |
12 | namespace vox::ui {
13 | /**
14 | * Widget that behave like a group with a menu display
15 | */
16 | class MenuList : public Group {
17 | public:
18 | explicit MenuList(std::string name, bool locked = false);
19 |
20 | protected:
21 | void DrawImpl() override;
22 |
23 | public:
24 | std::string name_;
25 | bool locked_;
26 | Event<> clicked_event_;
27 |
28 | private:
29 | bool opened_{};
30 | };
31 |
32 | } // namespace vox::ui
33 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/panel.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.render/ui/widgets/panel.h"
8 |
9 | namespace vox::ui {
10 | uint64_t Panel::panel_id_increment_ = 0;
11 |
12 | Panel::Panel() { panel_id_ = "##" + std::to_string(panel_id_increment_++); }
13 |
14 | void Panel::Draw() {
15 | if (enabled_) DrawImpl();
16 | }
17 |
18 | const std::string &Panel::PanelId() const { return panel_id_; }
19 |
20 | } // namespace vox::ui
21 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/panel_transformables/panel_undecorated.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/ui/widgets/panel_transformable.h"
10 |
11 | namespace vox::ui {
12 | /**
13 | * A simple panel that is transformable and without decorations (No background)
14 | */
15 | class PanelUndecorated : public PanelTransformable {
16 | public:
17 | void DrawImpl() override;
18 |
19 | private:
20 | int CollectFlags();
21 | };
22 |
23 | } // namespace vox::ui
24 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/panels/panel_menu_bar.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.render/ui/widgets/panels/panel_menu_bar.h"
8 |
9 | namespace vox::ui {
10 | void PanelMenuBar::DrawImpl() {
11 | if (!widgets_.empty() && ImGui::BeginMainMenuBar()) {
12 | DrawWidgets();
13 | ImGui::EndMainMenuBar();
14 | }
15 | }
16 |
17 | } // namespace vox::ui
18 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/panels/panel_menu_bar.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/ui/widgets/panel.h"
10 |
11 | namespace vox::ui {
12 | /**
13 | * A simple panel that will be displayed on the top side of the canvas
14 | */
15 | class PanelMenuBar : public Panel {
16 | protected:
17 | void DrawImpl() override;
18 | };
19 |
20 | } // namespace vox::ui
21 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/plot/plot.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.render/ui/widgets/plot/plot.h"
8 |
9 | #include
10 |
11 | namespace vox::ui {
12 | Plot::Plot(std::vector data,
13 | float min_scale,
14 | float max_scale,
15 | const Vector2F &size,
16 | std::string overlay,
17 | std::string label)
18 | : DataWidget(data_),
19 | data_(std::move(data)),
20 | min_scale_(min_scale),
21 | max_scale_(max_scale),
22 | size_(size),
23 | overlay_(std::move(overlay)),
24 | label_(std::move(label)) {}
25 |
26 | } // namespace vox::ui
27 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/selection/check_box.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #include "vox.render/ui/widgets/selection/check_box.h"
8 |
9 | #include
10 |
11 | namespace vox::ui {
12 | CheckBox::CheckBox(bool value, std::string label) : DataWidget(value_), value_(value), label_(std::move(label)) {}
13 |
14 | void CheckBox::DrawImpl() {
15 | bool previous_value = value_;
16 |
17 | ImGui::Checkbox((label_ + widget_id_).c_str(), &value_);
18 |
19 | if (value_ != previous_value) {
20 | value_changed_event_.Invoke(value_);
21 | NotifyChange();
22 | }
23 | }
24 |
25 | } // namespace vox::ui
26 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/selection/check_box.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.render/event.h"
10 | #include "vox.render/ui/widgets/data_widget.h"
11 |
12 | namespace vox::ui {
13 | /**
14 | * Checkbox widget that can be checked or not
15 | */
16 | class CheckBox : public DataWidget {
17 | public:
18 | explicit CheckBox(bool value = false, std::string label = "");
19 |
20 | protected:
21 | void DrawImpl() override;
22 |
23 | public:
24 | bool value_;
25 | std::string label_;
26 | Event value_changed_event_;
27 | };
28 |
29 | } // namespace vox::ui
30 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/selection/color_edit.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.math/color.h"
10 | #include "vox.render/event.h"
11 | #include "vox.render/ui/widgets/data_widget.h"
12 |
13 | namespace vox::ui {
14 | /**
15 | * Widget that can open a color picker on click
16 | */
17 | class ColorEdit : public DataWidget {
18 | public:
19 | explicit ColorEdit(bool enable_alpha = false, const Color &default_color = {});
20 |
21 | protected:
22 | void DrawImpl() override;
23 |
24 | public:
25 | bool enable_alpha_;
26 | Color color_;
27 | Event color_changed_event_;
28 | };
29 |
30 | } // namespace vox::ui
31 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/selection/color_picker.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include "vox.math/color.h"
10 | #include "vox.render/event.h"
11 | #include "vox.render/ui/widgets/data_widget.h"
12 |
13 | namespace vox::ui {
14 | /**
15 | * Widget that allow the selection of a color with a color picker
16 | */
17 | class ColorPicker : public DataWidget {
18 | public:
19 | explicit ColorPicker(bool enable_alpha = false, const Color &default_color = {});
20 |
21 | protected:
22 | void DrawImpl() override;
23 |
24 | public:
25 | bool enable_alpha_;
26 | Color color_;
27 | Event color_changed_event_;
28 | };
29 |
30 | } // namespace vox::ui
31 |
--------------------------------------------------------------------------------
/vox.render/ui/widgets/selection/combo_box.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2022 Feng Yang
2 | //
3 | // I am making my contributions/submissions to this project solely in my
4 | // personal capacity and am not conveying any rights to any intellectual
5 | // property of any third parties.
6 |
7 | #pragma once
8 |
9 | #include