├── JellySimulation.sln ├── JellySimulation ├── AnimCharacter.cpp ├── AnimCharacter.h ├── Animation.cpp ├── Animation.h ├── Animator.cpp ├── Animator.h ├── AssetImporter.cpp ├── AssetImporter.h ├── Camera.cpp ├── Camera.h ├── Collider.cpp ├── Collider.h ├── CollisionDetection.cpp ├── CollisionDetection.h ├── ConstraintSolver.cpp ├── ConstraintSolver.h ├── Constraints.cpp ├── Constraints.h ├── Cube.cpp ├── Cube.h ├── Floor.cpp ├── Floor.h ├── GLFWApp.cpp ├── GLFWApp.h ├── GLFunctions.cpp ├── GLFunctions.h ├── GUIManager.cpp ├── GUIManager.h ├── GameObject.cpp ├── GameObject.h ├── Jelly.cpp ├── Jelly.h ├── JellySimulation.vcxproj ├── JellySimulation.vcxproj.filters ├── Joint.cpp ├── Joint.h ├── Mesh.cpp ├── Mesh.h ├── Particle.cpp ├── Particle.h ├── Renderer.cpp ├── Renderer.h ├── ResourceManager.cpp ├── ResourceManager.h ├── Rigidbody.cpp ├── Rigidbody.h ├── Shader.cpp ├── Shader.h ├── Simulation.cpp ├── Simulation.h ├── Transform.cpp ├── Transform.h ├── common.h ├── imgui │ ├── imconfig.h │ ├── imgui.cpp │ ├── imgui.h │ ├── imgui_demo.cpp │ ├── imgui_draw.cpp │ ├── imgui_impl_glfw_gl3.cpp │ ├── imgui_impl_glfw_gl3.h │ ├── imgui_internal.h │ ├── stb_rect_pack.h │ ├── stb_textedit.h │ └── stb_truetype.h ├── include │ ├── GL │ │ ├── glew.h │ │ ├── glxew.h │ │ └── wglew.h │ ├── GLFW │ │ ├── glfw3.h │ │ └── glfw3native.h │ ├── SOIL │ │ ├── SOIL.c │ │ ├── SOIL.h │ │ ├── image_DXT.c │ │ ├── image_DXT.h │ │ ├── image_helper.c │ │ ├── image_helper.h │ │ ├── original │ │ │ ├── stb_image-1.09.c │ │ │ └── stb_image-1.16.c │ │ ├── stb_image_aug.c │ │ ├── stb_image_aug.h │ │ ├── stbi_DDS_aug.h │ │ ├── stbi_DDS_aug_c.h │ │ └── test_SOIL.cpp │ ├── assimp │ │ ├── .editorconfig │ │ ├── Compiler │ │ │ ├── poppack1.h │ │ │ ├── pstdint.h │ │ │ └── pushpack1.h │ │ ├── DefaultLogger.hpp │ │ ├── Exporter.hpp │ │ ├── IOStream.hpp │ │ ├── IOSystem.hpp │ │ ├── Importer.hpp │ │ ├── LogStream.hpp │ │ ├── Logger.hpp │ │ ├── NullLogger.hpp │ │ ├── ProgressHandler.hpp │ │ ├── ai_assert.h │ │ ├── anim.h │ │ ├── camera.h │ │ ├── cexport.h │ │ ├── cfileio.h │ │ ├── cimport.h │ │ ├── color4.h │ │ ├── color4.inl │ │ ├── config.h │ │ ├── defs.h │ │ ├── importerdesc.h │ │ ├── light.h │ │ ├── material.h │ │ ├── material.inl │ │ ├── matrix3x3.h │ │ ├── matrix3x3.inl │ │ ├── matrix4x4.h │ │ ├── matrix4x4.inl │ │ ├── mesh.h │ │ ├── metadata.h │ │ ├── port │ │ │ └── AndroidJNI │ │ │ │ └── AndroidJNIIOSystem.h │ │ ├── postprocess.h │ │ ├── quaternion.h │ │ ├── quaternion.inl │ │ ├── scene.h │ │ ├── texture.h │ │ ├── types.h │ │ ├── vector2.h │ │ ├── vector2.inl │ │ ├── vector3.h │ │ ├── vector3.inl │ │ └── version.h │ └── glm │ │ ├── CMakeLists.txt │ │ ├── common.hpp │ │ ├── detail │ │ ├── _features.hpp │ │ ├── _fixes.hpp │ │ ├── _noise.hpp │ │ ├── _swizzle.hpp │ │ ├── _swizzle_func.hpp │ │ ├── _vectorize.hpp │ │ ├── dummy.cpp │ │ ├── func_common.hpp │ │ ├── func_common.inl │ │ ├── func_exponential.hpp │ │ ├── func_exponential.inl │ │ ├── func_geometric.hpp │ │ ├── func_geometric.inl │ │ ├── func_integer.hpp │ │ ├── func_integer.inl │ │ ├── func_matrix.hpp │ │ ├── func_matrix.inl │ │ ├── func_packing.hpp │ │ ├── func_packing.inl │ │ ├── func_trigonometric.hpp │ │ ├── func_trigonometric.inl │ │ ├── func_vector_relational.hpp │ │ ├── func_vector_relational.inl │ │ ├── glm.cpp │ │ ├── intrinsic_common.hpp │ │ ├── intrinsic_common.inl │ │ ├── intrinsic_exponential.hpp │ │ ├── intrinsic_exponential.inl │ │ ├── intrinsic_geometric.hpp │ │ ├── intrinsic_geometric.inl │ │ ├── intrinsic_integer.hpp │ │ ├── intrinsic_integer.inl │ │ ├── intrinsic_matrix.hpp │ │ ├── intrinsic_matrix.inl │ │ ├── intrinsic_trigonometric.hpp │ │ ├── intrinsic_trigonometric.inl │ │ ├── intrinsic_vector_relational.hpp │ │ ├── intrinsic_vector_relational.inl │ │ ├── precision.hpp │ │ ├── setup.hpp │ │ ├── type_float.hpp │ │ ├── type_gentype.hpp │ │ ├── type_gentype.inl │ │ ├── type_half.hpp │ │ ├── type_half.inl │ │ ├── type_int.hpp │ │ ├── type_mat.hpp │ │ ├── type_mat.inl │ │ ├── type_mat2x2.hpp │ │ ├── type_mat2x2.inl │ │ ├── type_mat2x3.hpp │ │ ├── type_mat2x3.inl │ │ ├── type_mat2x4.hpp │ │ ├── type_mat2x4.inl │ │ ├── type_mat3x2.hpp │ │ ├── type_mat3x2.inl │ │ ├── type_mat3x3.hpp │ │ ├── type_mat3x3.inl │ │ ├── type_mat3x4.hpp │ │ ├── type_mat3x4.inl │ │ ├── type_mat4x2.hpp │ │ ├── type_mat4x2.inl │ │ ├── type_mat4x3.hpp │ │ ├── type_mat4x3.inl │ │ ├── type_mat4x4.hpp │ │ ├── type_mat4x4.inl │ │ ├── type_vec.hpp │ │ ├── type_vec.inl │ │ ├── type_vec1.hpp │ │ ├── type_vec1.inl │ │ ├── type_vec2.hpp │ │ ├── type_vec2.inl │ │ ├── type_vec3.hpp │ │ ├── type_vec3.inl │ │ ├── type_vec4.hpp │ │ ├── type_vec4.inl │ │ ├── type_vec4_avx.inl │ │ ├── type_vec4_avx2.inl │ │ └── type_vec4_sse2.inl │ │ ├── exponential.hpp │ │ ├── ext.hpp │ │ ├── fwd.hpp │ │ ├── geometric.hpp │ │ ├── glm.hpp │ │ ├── gtc │ │ ├── bitfield.hpp │ │ ├── bitfield.inl │ │ ├── color_space.hpp │ │ ├── color_space.inl │ │ ├── constants.hpp │ │ ├── constants.inl │ │ ├── epsilon.hpp │ │ ├── epsilon.inl │ │ ├── integer.hpp │ │ ├── integer.inl │ │ ├── matrix_access.hpp │ │ ├── matrix_access.inl │ │ ├── matrix_integer.hpp │ │ ├── matrix_inverse.hpp │ │ ├── matrix_inverse.inl │ │ ├── matrix_transform.hpp │ │ ├── matrix_transform.inl │ │ ├── noise.hpp │ │ ├── noise.inl │ │ ├── packing.hpp │ │ ├── packing.inl │ │ ├── quaternion.hpp │ │ ├── quaternion.inl │ │ ├── random.hpp │ │ ├── random.inl │ │ ├── reciprocal.hpp │ │ ├── reciprocal.inl │ │ ├── round.hpp │ │ ├── round.inl │ │ ├── type_precision.hpp │ │ ├── type_precision.inl │ │ ├── type_ptr.hpp │ │ ├── type_ptr.inl │ │ ├── ulp.hpp │ │ ├── ulp.inl │ │ ├── vec1.hpp │ │ └── vec1.inl │ │ ├── gtx │ │ ├── associated_min_max.hpp │ │ ├── associated_min_max.inl │ │ ├── bit.hpp │ │ ├── bit.inl │ │ ├── closest_point.hpp │ │ ├── closest_point.inl │ │ ├── color_space.hpp │ │ ├── color_space.inl │ │ ├── color_space_YCoCg.hpp │ │ ├── color_space_YCoCg.inl │ │ ├── common.hpp │ │ ├── common.inl │ │ ├── compatibility.hpp │ │ ├── compatibility.inl │ │ ├── component_wise.hpp │ │ ├── component_wise.inl │ │ ├── dual_quaternion.hpp │ │ ├── dual_quaternion.inl │ │ ├── euler_angles.hpp │ │ ├── euler_angles.inl │ │ ├── extend.hpp │ │ ├── extend.inl │ │ ├── extented_min_max.hpp │ │ ├── extented_min_max.inl │ │ ├── fast_exponential.hpp │ │ ├── fast_exponential.inl │ │ ├── fast_square_root.hpp │ │ ├── fast_square_root.inl │ │ ├── fast_trigonometry.hpp │ │ ├── fast_trigonometry.inl │ │ ├── gradient_paint.hpp │ │ ├── gradient_paint.inl │ │ ├── handed_coordinate_space.hpp │ │ ├── handed_coordinate_space.inl │ │ ├── hash.hpp │ │ ├── hash.inl │ │ ├── integer.hpp │ │ ├── integer.inl │ │ ├── intersect.hpp │ │ ├── intersect.inl │ │ ├── io.hpp │ │ ├── io.inl │ │ ├── log_base.hpp │ │ ├── log_base.inl │ │ ├── matrix_cross_product.hpp │ │ ├── matrix_cross_product.inl │ │ ├── matrix_decompose.hpp │ │ ├── matrix_decompose.inl │ │ ├── matrix_interpolation.hpp │ │ ├── matrix_interpolation.inl │ │ ├── matrix_major_storage.hpp │ │ ├── matrix_major_storage.inl │ │ ├── matrix_operation.hpp │ │ ├── matrix_operation.inl │ │ ├── matrix_query.hpp │ │ ├── matrix_query.inl │ │ ├── matrix_transform_2d.hpp │ │ ├── matrix_transform_2d.inl │ │ ├── mixed_product.hpp │ │ ├── mixed_product.inl │ │ ├── norm.hpp │ │ ├── norm.inl │ │ ├── normal.hpp │ │ ├── normal.inl │ │ ├── normalize_dot.hpp │ │ ├── normalize_dot.inl │ │ ├── number_precision.hpp │ │ ├── number_precision.inl │ │ ├── optimum_pow.hpp │ │ ├── optimum_pow.inl │ │ ├── orthonormalize.hpp │ │ ├── orthonormalize.inl │ │ ├── perpendicular.hpp │ │ ├── perpendicular.inl │ │ ├── polar_coordinates.hpp │ │ ├── polar_coordinates.inl │ │ ├── projection.hpp │ │ ├── projection.inl │ │ ├── quaternion.hpp │ │ ├── quaternion.inl │ │ ├── range.hpp │ │ ├── raw_data.hpp │ │ ├── raw_data.inl │ │ ├── rotate_normalized_axis.hpp │ │ ├── rotate_normalized_axis.inl │ │ ├── rotate_vector.hpp │ │ ├── rotate_vector.inl │ │ ├── scalar_multiplication.hpp │ │ ├── scalar_relational.hpp │ │ ├── scalar_relational.inl │ │ ├── simd_mat4.hpp │ │ ├── simd_mat4.inl │ │ ├── simd_quat.hpp │ │ ├── simd_quat.inl │ │ ├── simd_vec4.hpp │ │ ├── simd_vec4.inl │ │ ├── spline.hpp │ │ ├── spline.inl │ │ ├── std_based_type.hpp │ │ ├── std_based_type.inl │ │ ├── string_cast.hpp │ │ ├── string_cast.inl │ │ ├── transform.hpp │ │ ├── transform.inl │ │ ├── transform2.hpp │ │ ├── transform2.inl │ │ ├── type_aligned.hpp │ │ ├── type_aligned.inl │ │ ├── vector_angle.hpp │ │ ├── vector_angle.inl │ │ ├── vector_query.hpp │ │ ├── vector_query.inl │ │ ├── wrap.hpp │ │ └── wrap.inl │ │ ├── integer.hpp │ │ ├── mat2x2.hpp │ │ ├── mat2x3.hpp │ │ ├── mat2x4.hpp │ │ ├── mat3x2.hpp │ │ ├── mat3x3.hpp │ │ ├── mat3x4.hpp │ │ ├── mat4x2.hpp │ │ ├── mat4x3.hpp │ │ ├── mat4x4.hpp │ │ ├── matrix.hpp │ │ ├── packing.hpp │ │ ├── trigonometric.hpp │ │ ├── vec2.hpp │ │ ├── vec3.hpp │ │ ├── vec4.hpp │ │ └── vector_relational.hpp ├── lib │ ├── SOIL.lib │ ├── SOIL_debug.lib │ ├── SOIL_release.lib │ ├── assimp-vc141-md.lib │ ├── assimp.lib │ ├── assimp │ │ ├── assimp-vc141-md.dll │ │ ├── assimp-vc141-md.exp │ │ └── assimp-vc141-md.lib │ ├── glew32.lib │ ├── glew32s.lib │ ├── glfw3.lib │ └── glfw3dll.lib ├── main.cpp └── resources │ ├── images │ ├── black.png │ ├── consolas256X256.bmp │ ├── consolas_regular.bmp │ ├── consolas_regular_32.bmp │ ├── consolas_regular_32.png │ ├── poro.jpg │ └── red.png │ ├── mocap │ ├── 02_01.bvh │ ├── 07_02.bvh │ ├── 131_01.bvh │ ├── 131_02.bvh │ ├── 131_03.bvh │ ├── 21_01.bvh │ ├── 79_02.bvh │ ├── 79_03.bvh │ ├── Example.bvh │ ├── Example1.bvh │ ├── scaled_131_01.bvh │ ├── walk.asf │ └── walk_01.amc │ ├── models │ ├── QAQ.obj │ ├── bone.mtl │ ├── bone.obj │ ├── bone_c.obj │ ├── bone_c_inv.obj │ ├── bone_inv.obj │ ├── bone_n.obj │ ├── bone_s.mtl │ ├── bone_s.obj │ ├── bone_t.obj │ ├── capsule.obj │ ├── cube.obj │ ├── monkey.obj │ ├── robot.obj │ ├── robot_Lforearm.obj │ ├── robot_Rforearm.obj │ ├── robot_body.obj │ ├── robot_hat.obj │ ├── robot_head.obj │ ├── robot_leftArm.obj │ ├── robot_leftLeg.obj │ ├── robot_rightArm.obj │ ├── robot_rightLeg.obj │ ├── robot_tail.obj │ ├── sphere.obj │ ├── sphere_s.obj │ └── sphere_xs.obj │ └── shader │ ├── debug_quad_fs.glsl │ ├── debug_quad_vs.glsl │ ├── df_fs.glsl │ ├── df_vs.glsl │ ├── dfdx_fragment.glsl │ ├── dfdx_vertex.glsl │ ├── flat_fragment.glsl │ ├── flat_geometry.glsl │ ├── flat_vertex.glsl │ ├── font_fragment.glsl │ ├── font_vertex.glsl │ ├── fragment.glsl │ ├── phong_fs.glsl │ ├── phong_vs.glsl │ ├── point_sprite_fs.glsl │ ├── point_sprite_vs.glsl │ ├── shadow_mapping_fs.glsl │ ├── shadow_mapping_vs.glsl │ ├── shadow_mapping_vs_adv.glsl │ ├── simple_depth_fs.glsl │ ├── simple_depth_vs.glsl │ └── vertex.glsl └── README.md /JellySimulation.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.852 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "JellySimulation", "JellySimulation\JellySimulation.vcxproj", "{54EF462A-3764-4465-AD9E-F623B985F3EE}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {54EF462A-3764-4465-AD9E-F623B985F3EE}.Debug|x64.ActiveCfg = Debug|x64 17 | {54EF462A-3764-4465-AD9E-F623B985F3EE}.Debug|x64.Build.0 = Debug|x64 18 | {54EF462A-3764-4465-AD9E-F623B985F3EE}.Debug|x86.ActiveCfg = Debug|Win32 19 | {54EF462A-3764-4465-AD9E-F623B985F3EE}.Debug|x86.Build.0 = Debug|Win32 20 | {54EF462A-3764-4465-AD9E-F623B985F3EE}.Release|x64.ActiveCfg = Release|x64 21 | {54EF462A-3764-4465-AD9E-F623B985F3EE}.Release|x64.Build.0 = Release|x64 22 | {54EF462A-3764-4465-AD9E-F623B985F3EE}.Release|x86.ActiveCfg = Release|Win32 23 | {54EF462A-3764-4465-AD9E-F623B985F3EE}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {CA513F46-65F9-4124-AB7A-DAACD777FBC4} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /JellySimulation/AnimCharacter.h: -------------------------------------------------------------------------------- 1 | #ifndef _ANIM_CHARACTER_H_ 2 | #define _ANIM_CHARACTER_H_ 3 | 4 | #include "GameObject.h" 5 | #include "Mesh.h" 6 | //#include "MotionParser/Character.h" 7 | #include "Transform.h" 8 | #include "Animation.h" 9 | #include "Joint.h" 10 | #include 11 | #include 12 | 13 | class Bone; 14 | class AnimCharacter; 15 | 16 | 17 | /* 18 | * Bone is the implied connection between joints 19 | */ 20 | class Bone : public GameObject 21 | { 22 | public: 23 | 24 | Bone(std::shared_ptr start_joint, std::shared_ptr end_joint); 25 | ~Bone(); 26 | 27 | void Initialize(); 28 | void Initialize(Transform& trans); 29 | void Update(); 30 | 31 | // bone config 32 | float length; 33 | //glm::vec3 direction; 34 | 35 | private: 36 | std::shared_ptr m_start_joint; 37 | std::shared_ptr m_end_joint; 38 | 39 | }; 40 | 41 | class AnimCharacter 42 | { 43 | public: 44 | AnimCharacter(); 45 | ~AnimCharacter(); 46 | 47 | void Initialize(); 48 | //void Initialize(MotionParser::Character& mocap_cahracter); 49 | void Update(); 50 | 51 | void setName(std::string name); 52 | void setRoot(std::shared_ptr root); 53 | void setJoints(const std::vector>& joints); 54 | void setBones(const std::vector>& bones); 55 | void setAnimation(std::shared_ptr animation); 56 | 57 | inline std::string getName() { return m_name; }; 58 | inline std::vector>& getJoints() { return m_joints; }; 59 | inline std::shared_ptr getAnimation() { return m_animation; }; 60 | inline std::shared_ptr getRoot() { return m_root; }; 61 | 62 | 63 | private: 64 | //void LoadFromASFCharacter(MotionParser::Character& mocap_character); 65 | 66 | // Inner setup functions 67 | void SetUpJointMeshes(); 68 | void SetUpBoneMeshes(); 69 | 70 | // Sub-function of LoadFromASFCharacter 71 | //void CreateBones(const std::map& bone_name_map); 72 | 73 | // Sub-function to update joint information 74 | void UpdateJointTransform(); 75 | 76 | // Basic class member 77 | std::string m_name; 78 | 79 | // root transform 80 | Transform m_transform; 81 | std::vector> m_bones; 82 | std::shared_ptr m_root; 83 | std::vector> m_joints; 84 | std::shared_ptr m_animation; 85 | }; 86 | 87 | #endif -------------------------------------------------------------------------------- /JellySimulation/Animation.h: -------------------------------------------------------------------------------- 1 | #ifndef _ANIMATION_H_ 2 | #define _ANIMATION_H_ 3 | 4 | #include "Joint.h" 5 | #include "common.h" 6 | #include 7 | #include 8 | #include 9 | 10 | /** 11 | * [Caution] 12 | * - Channels stores rotation as degree 13 | * 14 | **/ 15 | 16 | struct Channel 17 | { 18 | enum class Channel_Type 19 | { 20 | X_TRANSLATION, 21 | Y_TRANSLATION, 22 | Z_TRANSLATION, 23 | X_ROTATION, 24 | Y_ROTATION, 25 | Z_ROTATION 26 | }type; 27 | float value; 28 | }; 29 | 30 | struct FrameData 31 | { 32 | bool movable; 33 | glm::vec3 translation = glm::vec3(0); 34 | glm::quat quaternion = glm::quat(); 35 | }; 36 | 37 | struct Frame 38 | { 39 | uint32_t frame_id; 40 | std::unordered_map, std::vector> joint_channel_map; 41 | std::unordered_map, FrameData> joint_framedata_map; 42 | }; 43 | 44 | // getCurrentFrameData() specific frame -> step() to next frame 45 | // getCurrentFrameTime(); --> for synchronization 46 | // 47 | 48 | class Animation 49 | { 50 | public: 51 | Animation(); 52 | ~Animation(); 53 | 54 | void Pause(); 55 | void Step(); 56 | 57 | void setFrames(std::vector& frames); 58 | void setCurrentFrame(size_t frame_count); 59 | 60 | inline const std::vector& getFrames() { return m_frames; }; 61 | inline const Frame& getCurrentFrame() { return m_frames[m_current_frame]; }; 62 | inline const size_t getCurrentFrameTime() { return m_current_frame; }; 63 | inline const size_t getKeyFrameSize() { return m_frames.size(); }; 64 | 65 | float m_frame_time; 66 | uint32_t m_frame_count; 67 | 68 | private: 69 | 70 | // Sub-function of setFrames() 71 | void PrecomputeFrameData(); 72 | 73 | std::vector m_frames; 74 | size_t m_current_frame; 75 | bool m_pause; 76 | 77 | }; 78 | 79 | #endif -------------------------------------------------------------------------------- /JellySimulation/Animator.cpp: -------------------------------------------------------------------------------- 1 | #include "Animator.h" 2 | #include 3 | 4 | Animator::Animator() :m_type(INTERPOLATE_LINEAR) , m_isLoop (false) , m_count(0), m_totalFrameCount(0), m_currentKeyIndex(0) 5 | { 6 | } 7 | 8 | 9 | Animator::~Animator() 10 | { 11 | } 12 | 13 | inline void Animator::setInterpolationType(InterpolationType theType) 14 | { 15 | m_type = theType; 16 | } 17 | 18 | void Animator::Initialize() 19 | { 20 | m_currentFrame.position = glm::vec3(0, 0, 0); 21 | } 22 | 23 | void Animator::Load() 24 | { 25 | /* 26 | load keyframes 27 | */ 28 | } 29 | 30 | inline const FrameState& Animator::getCurrentFrameState() 31 | { 32 | m_count++; 33 | 34 | if (m_count > m_totalFrameCount) 35 | { 36 | m_count = m_isLoop ? 0 : m_totalFrameCount; 37 | } 38 | 39 | InterpolateFrame(); 40 | return m_currentFrame; 41 | } 42 | 43 | void Animator::setControlVectors(glm::vec4 p1 , glm::vec4 p2) 44 | { 45 | /* 46 | handle invalid control vectors 47 | */ 48 | m_controlPoint1 = p1; 49 | m_controlPoint2 = p2; 50 | } 51 | 52 | 53 | void Animator::InterpolateFrame() 54 | { 55 | /* 56 | Interpolate between two keyframe 57 | */ 58 | if (m_count == m_keyframes[m_currentKeyIndex].key) 59 | { 60 | m_currentFrame = m_keyframes[m_currentKeyIndex].frame; 61 | return; 62 | } 63 | 64 | const glm::vec3 p0 = m_keyframes[m_currentKeyIndex].frame.position; 65 | const glm::vec3 p1 = m_keyframes[m_currentKeyIndex + 1].frame.position; 66 | const int current_key = m_keyframes[m_currentKeyIndex].key; 67 | const int next_key = m_keyframes[m_currentKeyIndex + 1].key; 68 | const float a = static_cast(m_count - current_key) / static_cast(next_key - current_key); 69 | 70 | switch (m_type) 71 | { 72 | case INTERPOLATE_LINEAR: 73 | { 74 | m_currentFrame.position = glm::lerp(p0, p1, a); 75 | break; 76 | } 77 | case INTERPOLATE_CUBIC_BEZIER: 78 | { 79 | interpolateAsBezierCurve(p0, p1, a, m_currentFrame.position); 80 | break; 81 | } 82 | default: 83 | break; 84 | } 85 | 86 | } 87 | 88 | void Animator::interpolateAsBezierCurve(const glm::vec3& p1 , const glm::vec3& p2 , float a, glm::vec3& result) 89 | { 90 | const glm::vec4 p1_vec4 = glm::vec4(p1 , 0); 91 | const glm::vec4 p2_vec4 = glm::vec4(p2 , 1); 92 | 93 | const glm::vec4 control1 = p1_vec4 + m_controlPoint1; 94 | const glm::vec4 control2 = p2_vec4 + m_controlPoint2; 95 | 96 | glm::vec4 top = glm::lerp(control1 , control2 , a); 97 | glm::vec4 left = glm::lerp(p1_vec4 , control1 , a); 98 | glm::vec4 right = glm::lerp(control2 , p2_vec4 , a); 99 | 100 | glm::vec4 left_top_lerp = glm::lerp(left , top , a); 101 | glm::vec4 top_right_lerp = glm::lerp(top , right , a); 102 | 103 | glm::vec4 tangent_point = glm::lerp(left_top_lerp , top_right_lerp , a); 104 | 105 | result = glm::vec3(tangent_point); 106 | 107 | } 108 | -------------------------------------------------------------------------------- /JellySimulation/Animator.h: -------------------------------------------------------------------------------- 1 | #ifndef _ANIMATOR_H_ 2 | #define _ANIMATOR_H_ 3 | 4 | #include 5 | #include 6 | /* 7 | TODO: 8 | < Implement position interpolations > 9 | < Implement rotation interpolations > 10 | 1. Load Functions 11 | 2. linear interpolation 12 | 3. curve interpolation 13 | 4. Test 14 | */ 15 | 16 | struct FrameState 17 | { 18 | glm::vec3 position; 19 | }; 20 | 21 | struct Keyframe 22 | { 23 | FrameState frame; 24 | int key; //count 25 | }; 26 | 27 | enum InterpolationType 28 | { 29 | INTERPOLATE_LINEAR , 30 | INTERPOLATE_CUBIC_BEZIER 31 | }; 32 | 33 | 34 | class Animator 35 | { 36 | public: 37 | Animator(); 38 | ~Animator(); 39 | 40 | inline void setInterpolationType(InterpolationType theType); 41 | 42 | void Initialize(); 43 | void Load(); 44 | 45 | inline const FrameState& getCurrentFrameState(); 46 | 47 | 48 | //Control Vector => ( (deltaPos) , (deltaTime) ) 49 | //End points => depend on key-frames 50 | void setControlVectors(glm::vec4 p1 , glm::vec4 p2); 51 | 52 | private: 53 | 54 | void InterpolateFrame(); 55 | //in next patch will use framesate as the input reference 56 | void interpolateAsBezierCurve(const glm::vec3& p1 , const glm::vec3& p2 , float a, glm::vec3& result); 57 | 58 | InterpolationType m_type; 59 | bool m_isLoop; 60 | int m_count; 61 | int m_totalFrameCount; 62 | unsigned int m_currentKeyIndex; 63 | FrameState m_currentFrame; 64 | 65 | std::vector m_keyframes; 66 | 67 | glm::vec4 m_controlPoint1 , m_controlPoint2; 68 | 69 | }; 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /JellySimulation/AssetImporter.h: -------------------------------------------------------------------------------- 1 | #ifndef _ASSET_IMPORTER_H_ 2 | #define _ASSET_IMPORTER_H_ 3 | 4 | #include "Mesh.h" 5 | #include "GameObject.h" 6 | #include "AnimCharacter.h" 7 | #include 8 | #include 9 | 10 | enum IMPORT_STATUS 11 | { 12 | IMPORT_FAILED, 13 | IMPORT_SUCCESS 14 | }; 15 | 16 | class AssetImporter 17 | { 18 | public: 19 | AssetImporter(); 20 | ~AssetImporter(); 21 | 22 | // Cleanup Importer member data 23 | void CleanUpImporter(); 24 | 25 | std::shared_ptr LoadMesh(std::string path, std::shared_ptr shader, IMPORT_STATUS& status); 26 | std::shared_ptr LoadBVH(std::string path, IMPORT_STATUS& status); 27 | std::shared_ptr LoadBVHAssimp(std::string path, IMPORT_STATUS& status); 28 | 29 | private: 30 | //void LoadBones(unsigned int index, const aiMesh* mesh, ); 31 | bool OpenFile(std::string path); 32 | std::shared_ptr CreateJoint(std::string name); 33 | void CreateChannel(Channel& channel, std::string type); 34 | std::shared_ptr CreateBones(std::shared_ptr start, std::shared_ptr end); 35 | //bool ParseHierarchy_BVH(); 36 | //bool ParseAnimation_BVH(); 37 | 38 | 39 | std::stringstream ss_; 40 | IMPORT_STATUS m_status; 41 | std::string m_file_content; 42 | 43 | }; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /JellySimulation/Camera.cpp: -------------------------------------------------------------------------------- 1 | #include "Camera.h" 2 | #include 3 | #include 4 | #include 5 | 6 | Camera::Camera(CameraDesc desc) : 7 | m_projection(desc.projection), 8 | m_lookAt(desc.lookAt), 9 | m_position(desc.position), 10 | m_fov(desc.fov), 11 | m_screen_width(desc.screen_width), 12 | m_screen_height(desc.screen_height), 13 | m_near_plane(desc.near_plane), 14 | m_far_plane(desc.far_plane), 15 | m_camera_ubo(desc.ubo), 16 | m_rotate_radius(m_position.z), 17 | m_camera_height(m_position.y), 18 | m_target_position(desc.target_position) 19 | { 20 | } 21 | 22 | Camera::Camera(glm::mat4 projection, glm::mat4 lookAt, glm::vec3 position, GLuint ubo) 23 | : m_lock_on_mode(false), 24 | m_camera_ubo(ubo), 25 | m_theta(0.0f) 26 | { 27 | this->m_projection = projection; 28 | this->m_lookAt = lookAt; 29 | this->m_position = position; 30 | m_cameraMat = projection * lookAt; 31 | } 32 | 33 | Camera::~Camera() 34 | { 35 | } 36 | 37 | void Camera::Zoom(float change) 38 | { 39 | //fov += change; 40 | //projection = glm::perspective(fov, screen_width / screen_height, 0.1f, 100.0f); 41 | m_rotate_radius += change; 42 | m_position = glm::vec3(m_rotate_radius * glm::sin(m_theta), m_camera_height, m_rotate_radius * glm::cos(m_theta)); 43 | m_lookAt = glm::lookAt(m_position, m_target_position, glm::vec3(0.0f, 1.0f, 0.0f)); 44 | } 45 | 46 | void Camera::Rotate(float change) 47 | { 48 | this->m_theta += change; 49 | m_position = glm::vec3(m_rotate_radius * glm::sin(m_theta), m_camera_height, m_rotate_radius * glm::cos(m_theta)); 50 | m_lookAt = glm::lookAt(m_position, m_target_position, glm::vec3(0.0f, 1.0f, 0.0f)); 51 | } 52 | 53 | void Camera::Update() 54 | { 55 | if (m_camera_ubo != -1) 56 | { 57 | glBindBuffer(GL_UNIFORM_BUFFER, m_camera_ubo); 58 | glBufferSubData( 59 | GL_UNIFORM_BUFFER, 60 | 0, 61 | sizeof(glm::mat4), 62 | glm::value_ptr(m_projection)); 63 | glBufferSubData( 64 | GL_UNIFORM_BUFFER, 65 | sizeof(glm::mat4), 66 | sizeof(glm::mat4), 67 | glm::value_ptr(m_lookAt)); 68 | glBindBuffer(GL_UNIFORM_BUFFER, 0); 69 | } 70 | 71 | m_cameraMat = m_projection * m_lookAt; 72 | 73 | /* 74 | if (!lock_on_mode) 75 | return; 76 | position = lookAtObj->m_mesh->m_tranlation + glm::vec3(0, 10, -5); 77 | 78 | const glm::vec3 up = glm::vec3(0, 1, 0); 79 | const glm::vec3 front = lookAtObj->m_mesh->m_tranlation - position; 80 | const glm::vec3 right = glm::normalize(glm::cross(up , front)); 81 | const glm::vec3 camUp = glm::cross(front, right); 82 | 83 | lookAt = glm::lookAt(position , position + front , camUp); 84 | */ 85 | } 86 | -------------------------------------------------------------------------------- /JellySimulation/Camera.h: -------------------------------------------------------------------------------- 1 | #ifndef _CAMERA_H_ 2 | #define _CAMERA_H_ 3 | 4 | #include 5 | #include 6 | #include "GameObject.h" 7 | 8 | 9 | struct CameraDesc 10 | { 11 | float fov; 12 | float screen_width; 13 | float screen_height; 14 | float near_plane; 15 | float far_plane; 16 | glm::vec3 target_position; 17 | glm::mat4 projection; 18 | glm::mat4 lookAt; 19 | glm::vec3 position; 20 | GLuint ubo; 21 | 22 | }; 23 | 24 | class Camera 25 | { 26 | public: 27 | Camera(CameraDesc desc); 28 | Camera(glm::mat4 projection, glm::mat4 lookAt, glm::vec3 position, GLuint ubo); 29 | ~Camera(); 30 | 31 | void Zoom(float change); 32 | void Rotate(float change); 33 | void Update(); 34 | 35 | glm::mat4 m_cameraMat; 36 | glm::mat4 m_projection; 37 | glm::mat4 m_lookAt; 38 | glm::vec3 m_position; 39 | 40 | bool m_lock_on_mode; 41 | GLuint m_camera_ubo; 42 | //std::weak_ptr lookAtObj; 43 | 44 | private: 45 | float m_near_plane; 46 | float m_far_plane; 47 | float m_rotate_radius; 48 | float m_camera_height; 49 | float m_theta = 0.0f; 50 | float m_fov; 51 | float m_screen_width; 52 | float m_screen_height; 53 | glm::vec3 m_target_position; 54 | }; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /JellySimulation/Collider.h: -------------------------------------------------------------------------------- 1 | #ifndef _COLLIDER_H_ 2 | #define _COLLIDER_H_ 3 | 4 | #include 5 | #include 6 | 7 | class Collider 8 | { 9 | public: 10 | enum class ColliderTypes 11 | { 12 | POINT = 0, 13 | SPHERE, 14 | AABB, 15 | OBB, 16 | PLANE 17 | }; 18 | 19 | Collider() = delete; 20 | Collider(ColliderTypes type); 21 | ~Collider(); 22 | 23 | virtual bool TestCollision(Collider* other) = 0; 24 | 25 | // getters 26 | __forceinline ColliderTypes getColliderTypes() { return m_type; }; 27 | 28 | private: 29 | ColliderTypes m_type; 30 | 31 | }; 32 | 33 | /* 34 | * Performance issue: Extra allocation needed 35 | */ 36 | class PointCollider final : public Collider 37 | { 38 | public: 39 | PointCollider(glm::vec3 pos); 40 | ~PointCollider(); 41 | 42 | virtual bool TestCollision(Collider* other); 43 | 44 | glm::vec3 m_position; 45 | }; 46 | 47 | class SphereCollider final : public Collider 48 | { 49 | public: 50 | SphereCollider() = delete; 51 | SphereCollider(glm::vec3 center, float radius); 52 | ~SphereCollider(); 53 | 54 | virtual bool TestCollision(Collider* other); 55 | 56 | glm::vec3 m_center; 57 | float m_radius; 58 | 59 | }; 60 | 61 | class AABB final : public Collider 62 | { 63 | public: 64 | AABB() = delete; 65 | AABB(glm::vec3 min, glm::vec3 max); 66 | ~AABB(); 67 | 68 | virtual bool TestCollision(Collider* other); 69 | 70 | //getters 71 | inline glm::vec3 getCenter() { return (m_max + m_min) * 0.5f; }; 72 | inline glm::vec3 getExtends() { return (m_max - m_min) * 0.5f; }; 73 | 74 | glm::vec3 m_min; 75 | glm::vec3 m_max; 76 | }; 77 | 78 | class OBB final : public Collider 79 | { 80 | public: 81 | OBB() = delete; 82 | OBB(glm::vec3 center, 83 | glm::vec3 local_x_axis, 84 | glm::vec3 local_y_axis, 85 | glm::vec3 local_z_axis, 86 | glm::vec3 extend); 87 | ~OBB(); 88 | 89 | virtual bool TestCollision(Collider* other); 90 | 91 | glm::vec3 m_center; 92 | glm::vec3 m_local_axis[3]; 93 | glm::vec3 m_extend; 94 | 95 | }; 96 | 97 | class PlaneCollider final : public Collider 98 | { 99 | public: 100 | PlaneCollider() = delete; 101 | PlaneCollider(glm::vec3 plane_normal, float distance_from_orgin); 102 | ~PlaneCollider(); 103 | 104 | virtual bool TestCollision(Collider* other); 105 | 106 | glm::vec3 m_normal; 107 | float m_d; 108 | 109 | }; 110 | 111 | 112 | #endif 113 | -------------------------------------------------------------------------------- /JellySimulation/CollisionDetection.h: -------------------------------------------------------------------------------- 1 | #ifndef _COLLISION_DETECTION_H_ 2 | #define _COLLISION_DETECTION_H_ 3 | 4 | #include 5 | #include "Collider.h" 6 | 7 | // forward declaration 8 | class Collider; 9 | class PointCollider; 10 | class SphereCollider; 11 | class AABB; 12 | class OBB; 13 | class PlaneCollider; 14 | 15 | namespace CollisionDetection 16 | { 17 | bool PointSphereIntersection(PointCollider* point, SphereCollider* sphere); 18 | bool PointSphereIntersection(const glm::vec3& point, SphereCollider* sphere); 19 | bool PointAABBIntersection(PointCollider* point, AABB* aabb); 20 | bool PointAABBIntersection(const glm::vec3& point, AABB* aabb); 21 | bool PointOBBIntersection(PointCollider* point, OBB* obb); 22 | bool PointOBBIntersection(const glm::vec3& point, OBB* obb); 23 | bool PointPlaneIntersection(PointCollider* point, PlaneCollider* plane); 24 | bool PointPlaneIntersection(const glm::vec3& p, PlaneCollider* plane); 25 | 26 | bool SphereSphereIntersection(SphereCollider* sphere0, SphereCollider* sphere1); 27 | bool SphereAABBIntersection(SphereCollider* sphere, AABB* aabb); 28 | bool SphereOBBIntersection(SphereCollider* sphere, OBB* obb); 29 | bool SpherePlaneIntersection(SphereCollider* sphere, PlaneCollider* plane); 30 | 31 | bool AABBAABBIntersection(AABB* box0, AABB* box1); 32 | bool AABBOBBIntersection(AABB* aabb, OBB* obb); 33 | bool AABBPlaneIntersection(AABB* aabb, PlaneCollider* plane); 34 | 35 | bool OBBOBBIntersection(OBB* box0, OBB* box1); 36 | bool OBBPlaneIntersection(OBB* obb, PlaneCollider* plane); 37 | }; 38 | 39 | #endif -------------------------------------------------------------------------------- /JellySimulation/ConstraintSolver.cpp: -------------------------------------------------------------------------------- 1 | #include "ConstraintSolver.h" 2 | 3 | ConstraintSolver::ConstraintSolver(PBD_MODE mode) 4 | : m_solver_iteration(1), m_mode(mode) 5 | { 6 | } 7 | 8 | ConstraintSolver::~ConstraintSolver() 9 | { 10 | } 11 | 12 | bool ConstraintSolver::SolveConstraints( 13 | const float &dt, 14 | std::vector& static_constraints, 15 | std::vector& collision_constraints) 16 | { 17 | if (m_mode == PBD_MODE::PBD) 18 | SolvePBDConstraints(static_constraints, collision_constraints); 19 | else if (m_mode == PBD_MODE::XPBD) 20 | SolveXPBDConstraints(dt, static_constraints, collision_constraints); 21 | 22 | return true; 23 | } 24 | 25 | void ConstraintSolver::setSolverIteration(uint32_t iteration_num) 26 | { 27 | m_solver_iteration = iteration_num; 28 | } 29 | 30 | void ConstraintSolver::setPBDMode(PBD_MODE mode) 31 | { 32 | m_mode = mode; 33 | } 34 | 35 | bool ConstraintSolver::SolvePBDConstraints( 36 | std::vector& static_constraints, 37 | std::vector& collision_constraints) 38 | { 39 | for (uint32_t i = 0; i < m_solver_iteration; ++i) 40 | { 41 | for (Constraint* c : static_constraints) 42 | { 43 | if (!c->SolvePBDConstraint()) 44 | return false; 45 | } 46 | } 47 | 48 | return true; 49 | } 50 | 51 | bool ConstraintSolver::SolveXPBDConstraints( 52 | const float &dt, 53 | std::vector& static_constraints, 54 | std::vector& collision_constraints) 55 | { 56 | // Initialize Lambda 57 | for (Constraint* c : static_constraints) 58 | { 59 | c->InitLambda(); 60 | c->ComputeCompliance(dt); 61 | } 62 | 63 | for (uint32_t i = 0; i < m_solver_iteration; ++i) 64 | { 65 | for (Constraint* c : static_constraints) 66 | { 67 | if (!c->SolveXPBDConstraint()) 68 | return false; 69 | } 70 | } 71 | return true; 72 | } 73 | -------------------------------------------------------------------------------- /JellySimulation/ConstraintSolver.h: -------------------------------------------------------------------------------- 1 | #ifndef _CONSTRAINT_SOLVER_H_ 2 | #define _CONSTRAINT_SOLVER_H_ 3 | 4 | #include 5 | #include 6 | #include "Constraints.h" 7 | 8 | enum class PBD_MODE 9 | { 10 | PBD, 11 | XPBD 12 | }; 13 | 14 | class ConstraintSolver 15 | { 16 | public: 17 | ConstraintSolver() = delete; 18 | ConstraintSolver(PBD_MODE mode); 19 | ~ConstraintSolver(); 20 | 21 | bool SolveConstraints( 22 | const float &dt, 23 | std::vector& static_constraints, 24 | std::vector& collision_constraints 25 | ); 26 | 27 | // setter 28 | void setSolverIteration(uint32_t iteration_num); 29 | void setPBDMode(PBD_MODE mode); 30 | 31 | //getter 32 | uint32_t getSolverIteration() { return m_solver_iteration; } 33 | PBD_MODE getPBDMode() { return m_mode; } 34 | 35 | private: 36 | 37 | bool SolvePBDConstraints( 38 | std::vector& static_constraints, 39 | std::vector& collision_constraints 40 | ); 41 | 42 | bool SolveXPBDConstraints( 43 | const float &dt, 44 | std::vector& static_constraints, 45 | std::vector& collision_constraints 46 | ); 47 | 48 | 49 | uint32_t m_solver_iteration; 50 | PBD_MODE m_mode; 51 | 52 | 53 | }; 54 | 55 | #endif -------------------------------------------------------------------------------- /JellySimulation/Constraints.h: -------------------------------------------------------------------------------- 1 | #ifndef _CONSTRAINTS_H_ 2 | #define _CONSTRAINTS_H_ 3 | 4 | #include 5 | #include 6 | #include "Particle.h" 7 | 8 | enum class CONSTRAINT_TYPE 9 | { 10 | CONSTRAINT_DISTANCE, 11 | CONSTRAINT_BEND 12 | }; 13 | 14 | class Constraint 15 | { 16 | public: 17 | 18 | Constraint() = delete; 19 | Constraint(size_t numOfRigidbodies); 20 | ~Constraint(); 21 | 22 | void InitLambda() { m_lambda = 0.0f; }; 23 | void ComputeCompliance(const float &dt); 24 | 25 | virtual bool SolvePBDConstraint() = 0; 26 | virtual bool SolveXPBDConstraint() = 0; 27 | 28 | virtual float ConstraintFunction() = 0; 29 | virtual std::vector> GradientFunction() = 0; 30 | 31 | // setters 32 | void setStiffness(float stiffness); 33 | void setCompliance(float compliance); 34 | 35 | // getter 36 | virtual CONSTRAINT_TYPE getConstraintType() = 0; 37 | 38 | /* 39 | * Constraint caches particles but not owning it 40 | * TODO: Rewrite this (Not generic solution) 41 | */ 42 | std::vector m_particles; 43 | float m_lambda; 44 | 45 | // stiffness is the value between 0-1 46 | float m_stiffness; 47 | 48 | // XPBD 49 | float m_compliance; 50 | // compliance_tmp = compliance / (dt * dt) 51 | float m_compliance_tmp; 52 | 53 | }; 54 | 55 | class DistanceConstraint final: public Constraint 56 | { 57 | public: 58 | 59 | // Not allow to use C++ default constructor 60 | DistanceConstraint() = delete; 61 | /* 62 | * @param p1 First particle 63 | * @param p2 Second paritcle 64 | * @param d Rest length of two particle 65 | */ 66 | DistanceConstraint(Particle_Ptr p0, Particle_Ptr p1, float rest_length); 67 | ~DistanceConstraint(); 68 | 69 | virtual bool SolvePBDConstraint(); 70 | virtual bool SolveXPBDConstraint(); 71 | 72 | virtual float ConstraintFunction(); 73 | virtual std::vector> GradientFunction(); 74 | 75 | 76 | // getters 77 | CONSTRAINT_TYPE getConstraintType() { return CONSTRAINT_TYPE::CONSTRAINT_DISTANCE; }; 78 | 79 | private: 80 | 81 | float m_rest_length; 82 | 83 | }; 84 | 85 | 86 | class BendConstraint final: public Constraint 87 | { 88 | public: 89 | 90 | // Not allow to use C++ default constructor 91 | BendConstraint() = delete; 92 | /* 93 | * @param p1 First particle 94 | * @param p2 Second paritcle 95 | * @param d Initial distance of two particle 96 | */ 97 | BendConstraint(Particle* p1, Particle* p2, float d); 98 | ~BendConstraint(); 99 | 100 | virtual bool SolvePBDConstraint(); 101 | virtual bool SolveXPBDConstraint(); 102 | 103 | virtual float ConstraintFunction(); 104 | virtual std::vector> GradientFunction(); 105 | 106 | CONSTRAINT_TYPE getConstraintType() { return CONSTRAINT_TYPE::CONSTRAINT_BEND; }; 107 | 108 | }; 109 | 110 | 111 | 112 | 113 | #endif 114 | -------------------------------------------------------------------------------- /JellySimulation/Cube.cpp: -------------------------------------------------------------------------------- 1 | #include "Cube.h" 2 | #include "GLFWApp.h" 3 | #include 4 | #include 5 | 6 | Cube::Cube() : GameObject() 7 | { 8 | 9 | } 10 | 11 | Cube::~Cube() 12 | { 13 | } 14 | 15 | void Cube::Initialize(const glm::vec3& position) 16 | { 17 | m_transform.m_translation = position; 18 | GameObject::Initialize(); 19 | //GameObject::Initialize(position); 20 | auto res_manager = GLFWApp::getInstance()->getResourceManager(); 21 | auto mesh_list = res_manager->getMeshes(); 22 | 23 | setMesh(mesh_list[1]); 24 | } 25 | 26 | void Cube::Update() 27 | { 28 | /*random move*/ 29 | /* 30 | float dx = static_cast(rand() % 100)/1000.0f; 31 | float dy = static_cast(rand() % 100)/1000.0f; 32 | float dz = static_cast(rand() % 100)/1000.0f; 33 | 34 | //this->m_transform->m_translation += glm::vec3(dx, dy, dz); 35 | */ 36 | GameObject::Update(); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /JellySimulation/Cube.h: -------------------------------------------------------------------------------- 1 | #ifndef _CUBE_H_ 2 | #define _CUBE_H_ 3 | 4 | #include "GameObject.h" 5 | class Cube : public GameObject 6 | { 7 | public: 8 | Cube(); 9 | ~Cube(); 10 | 11 | void Initialize(const glm::vec3& position) override; 12 | void Update() override; 13 | 14 | }; 15 | 16 | #endif -------------------------------------------------------------------------------- /JellySimulation/Floor.cpp: -------------------------------------------------------------------------------- 1 | #include "Floor.h" 2 | #include "GLFWApp.h" 3 | 4 | Floor::Floor() 5 | :m_collider(nullptr) 6 | { 7 | } 8 | 9 | Floor::~Floor() 10 | { 11 | if (m_collider) delete m_collider; 12 | m_collider = nullptr; 13 | } 14 | 15 | void Floor::Initialize(const glm::vec3& init_pos, const std::shared_ptr& shader) 16 | { 17 | 18 | //std::shared_ptr shader = std::make_shared(); 19 | //shader->SetupShader("resources/shader/shadow_mapping_vs.glsl", 20 | // "resources/shader/shadow_mapping_fs.glsl"); 21 | 22 | std::shared_ptr mesh = std::make_shared(); 23 | std::vector vertex_pos; 24 | std::vector indices; 25 | 26 | mesh->Initialize(shader); 27 | 28 | vertex_pos.reserve(4); 29 | vertex_pos.push_back(glm::vec3( 100.0f, 0.0f, -100.0f)); 30 | vertex_pos.push_back(glm::vec3( 100.0f, 0.0f, 100.0f)); 31 | vertex_pos.push_back(glm::vec3( -100.0f, 0.0f, 100.0f)); 32 | vertex_pos.push_back(glm::vec3( -100.0f, 0.0f, -100.0f)); 33 | 34 | vertex_pos.reserve(6); 35 | indices.push_back(0); 36 | indices.push_back(1); 37 | indices.push_back(2); 38 | indices.push_back(0); 39 | indices.push_back(2); 40 | indices.push_back(3); 41 | 42 | mesh->setPositions(vertex_pos); 43 | mesh->setIndices(indices); 44 | mesh->SetupGLBuffers(); 45 | 46 | GameObject::setMesh(mesh); 47 | GameObject::Initialize(init_pos); 48 | 49 | m_collider = new PlaneCollider(glm::vec3(0,1,0), 0); 50 | 51 | } 52 | 53 | -------------------------------------------------------------------------------- /JellySimulation/Floor.h: -------------------------------------------------------------------------------- 1 | #ifndef _FLOOR_H_ 2 | #define _FLOOR_H_ 3 | 4 | #include "GameObject.h" 5 | #include "Shader.h" 6 | #include "Collider.h" 7 | 8 | class Floor : 9 | public GameObject 10 | { 11 | public: 12 | Floor(); 13 | ~Floor(); 14 | 15 | void Initialize(const glm::vec3& init_pos, const std::shared_ptr& shader); 16 | 17 | // getters 18 | inline PlaneCollider* getCollider() { return m_collider; }; 19 | 20 | private: 21 | PlaneCollider* m_collider; 22 | 23 | }; 24 | 25 | #endif -------------------------------------------------------------------------------- /JellySimulation/GLFunctions.cpp: -------------------------------------------------------------------------------- 1 | #include "GLFunctions.h" 2 | /* Descrepted: Moved to Shader 3 | void GLFunctions::SetUniformMat4(const std::string & name, const glm::mat4 & mat, const GLuint program) 4 | { 5 | //glUseProgram(program); 6 | GLint loc = glGetUniformLocation(program, name.c_str()); 7 | if (loc == -1) 8 | return; 9 | 10 | glUniformMatrix4fv(loc, 1, GL_FALSE, glm::value_ptr(mat)); 11 | } 12 | 13 | void GLFunctions::SetUniformVec3(const std::string & name, const glm::vec3 & vec, const GLuint program) 14 | { 15 | //glUseProgram(program); 16 | GLint loc = glGetUniformLocation(program, name.c_str()); 17 | if (loc == -1) 18 | return; 19 | 20 | glUniform3fv(loc, 1, glm::value_ptr(vec)); 21 | } 22 | 23 | void GLFunctions::SetUniformInt(const std::string & name, const GLint value, const GLuint program) 24 | { 25 | GLint loc = glGetUniformLocation(program, name.c_str()); 26 | if (loc == -1) 27 | return; 28 | 29 | glUniform1i(loc, value); 30 | } 31 | */ 32 | 33 | GLuint GLFunctions::LoadTexture(GLchar * path, GLboolean alpha) 34 | { 35 | //Generate texture ID and load texture data 36 | GLuint textureID; 37 | glGenTextures(1, &textureID); 38 | int width, height; 39 | unsigned char* image = SOIL_load_image(path, &width, &height, 0, alpha ? SOIL_LOAD_RGBA : SOIL_LOAD_RGB); 40 | // Assign texture to ID 41 | glBindTexture(GL_TEXTURE_2D, textureID); 42 | glTexImage2D(GL_TEXTURE_2D, 0, alpha ? GL_RGBA : GL_RGB, width, height, 0, alpha ? GL_RGBA : GL_RGB, GL_UNSIGNED_BYTE, image); 43 | glGenerateMipmap(GL_TEXTURE_2D); 44 | 45 | // Parameters 46 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, alpha ? GL_CLAMP_TO_EDGE : GL_REPEAT); // Use GL_CLAMP_TO_EDGE to prevent semi-transparent borders. Due to interpolation it takes value from next repeat 47 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, alpha ? GL_CLAMP_TO_EDGE : GL_REPEAT); 48 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); 49 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 50 | glBindTexture(GL_TEXTURE_2D, 0); 51 | SOIL_free_image_data(image); 52 | return textureID; 53 | 54 | } 55 | -------------------------------------------------------------------------------- /JellySimulation/GLFunctions.h: -------------------------------------------------------------------------------- 1 | #ifndef _GL_FUNCTIONS_H_ 2 | #define _GL_FUNCTIONS_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | namespace GLFunctions 11 | { 12 | //void SetUniformMat4(const std::string& name, const glm::mat4& mat, const GLuint program); 13 | //void SetUniformVec3(const std::string& name, const glm::vec3& mat, const GLuint program); 14 | //void SetUniformInt(const std::string& name, const GLint value, const GLuint program); 15 | 16 | GLuint LoadTexture(GLchar* path, GLboolean alpha); 17 | 18 | }; 19 | 20 | #endif // ! _GL_FUNCTIONS_H_ 21 | -------------------------------------------------------------------------------- /JellySimulation/GUIManager.cpp: -------------------------------------------------------------------------------- 1 | #include "GUIManager.h" 2 | #include "imgui/imgui_impl_glfw_gl3.h" 3 | #include 4 | 5 | 6 | GUIManager::GUIManager() 7 | { 8 | } 9 | 10 | 11 | GUIManager::~GUIManager() 12 | { 13 | } 14 | 15 | void GUIManager::Initialize(GLFWwindow * window) 16 | { 17 | if (window == nullptr) 18 | { 19 | std::cout << "No window detected" << std::endl; 20 | return; 21 | } 22 | //Set up imgui binding 23 | ImGui::CreateContext(); 24 | ImGuiIO &io = ImGui::GetIO(); (void)io; 25 | ImGui_ImplGlfwGL3_Init(window, false); 26 | ImGui::StyleColorsDark(); 27 | } 28 | 29 | void GUIManager::Update() 30 | { 31 | for (auto it = m_gui_functions.begin(); it != m_gui_functions.end(); ++it) 32 | { 33 | (*it).func(); 34 | } 35 | } 36 | 37 | void GUIManager::Render() 38 | { 39 | ImGui::Render(); 40 | ImGui_ImplGlfwGL3_RenderDrawData(ImGui::GetDrawData()); 41 | } 42 | 43 | void GUIManager::AddGUIFunction(std::function func, bool visiblility) 44 | { 45 | m_gui_functions.push_back(GUIFunction(func,visiblility)); 46 | } 47 | -------------------------------------------------------------------------------- /JellySimulation/GUIManager.h: -------------------------------------------------------------------------------- 1 | #ifndef _GUI_MANAGER_H_ 2 | #define _GUI_MANAGER_H_ 3 | 4 | #include "imgui/imgui.h" 5 | #include 6 | #include 7 | #include 8 | 9 | struct GUIFunction 10 | { 11 | GUIFunction(std::function gui_func, bool visibility) : 12 | func(gui_func), 13 | is_visible(visibility) 14 | {} 15 | std::function func; 16 | bool is_visible; 17 | }; 18 | 19 | class GUIManager 20 | { 21 | public: 22 | GUIManager(); 23 | ~GUIManager(); 24 | 25 | void Initialize(GLFWwindow* window); 26 | void Update(); 27 | void Render(); 28 | 29 | void AddGUIFunction(std::function func, bool visiblility=true); 30 | 31 | private: 32 | std::vector m_gui_functions; 33 | 34 | }; 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /JellySimulation/GameObject.cpp: -------------------------------------------------------------------------------- 1 | #include "GameObject.h" 2 | #include "GLFWApp.h" 3 | 4 | GameObject::GameObject() : m_parent(nullptr), m_mesh(nullptr), m_object_type(OBJECT_NORMAL)//, m_animator(nullptr)//, m_collider(nullptr) 5 | { 6 | } 7 | 8 | GameObject::~GameObject() 9 | { 10 | #ifdef _DEBUG 11 | std::cout << "Obj Dtor\n"; 12 | #endif 13 | Release(); 14 | } 15 | 16 | void GameObject::Initialize() 17 | { 18 | m_transform.Update(); 19 | } 20 | 21 | void GameObject::Initialize(const glm::vec3& init_pos) 22 | { 23 | m_transform.m_translation = init_pos; 24 | m_transform.Update(); 25 | } 26 | 27 | void GameObject::Initialize(Transform & trans) 28 | { 29 | m_transform = trans; 30 | m_transform.Update(); 31 | } 32 | 33 | void GameObject::Update() 34 | { 35 | if (m_object_type == OBJECT_FLAG_ENUM::OBJECT_STATIC) 36 | return; 37 | 38 | m_transform.Update(); 39 | } 40 | 41 | void GameObject::Release() 42 | { 43 | m_mesh.reset(); 44 | //m_animator.reset(); 45 | //delete m_transform; 46 | } 47 | 48 | void GameObject::AddChild(std::shared_ptr child) 49 | { 50 | m_childs.push_back(child); 51 | } 52 | 53 | void GameObject::setParent(std::shared_ptr parent) 54 | { 55 | m_parent = parent; 56 | m_transform.setParent(&(parent->m_transform)); 57 | } 58 | 59 | void GameObject::setMesh(std::shared_ptr obj) 60 | { 61 | m_mesh = obj; 62 | } 63 | void GameObject::setObjectType(OBJECT_FLAG_ENUM type) 64 | { 65 | m_object_type = type; 66 | } 67 | void GameObject::setName(std::string name) 68 | { 69 | m_name = name; 70 | } 71 | /* 72 | void GameObject::setAnimator(std::shared_ptr animator) 73 | { 74 | //m_animator = animator; 75 | } 76 | */ 77 | -------------------------------------------------------------------------------- /JellySimulation/GameObject.h: -------------------------------------------------------------------------------- 1 | #ifndef _GAMEOBJECT_H_ 2 | #define _GAMEOBJECT_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include "Mesh.h" 8 | #include "Animator.h" 9 | #include "Transform.h" 10 | 11 | /* 12 | * A GameObject is an object in the scene with the following properties 13 | * - Named object 14 | * - Has Transform (scale ,position, rotation) 15 | * - Either updatable or static 16 | * - May have mesh 17 | * - May have hierarchical structure 18 | */ 19 | 20 | // Unchangable after setting 21 | enum OBJECT_FLAG_ENUM 22 | { 23 | OBJECT_STATIC, 24 | OBJECT_INSTANCED, 25 | OBJECT_NORMAL, 26 | OBJECT_INVISIBLE 27 | }; 28 | 29 | class GameObject; 30 | 31 | class GameObject 32 | { 33 | public: 34 | GameObject(); 35 | ~GameObject(); 36 | 37 | virtual void Initialize(); 38 | virtual void Initialize(const glm::vec3& init_pos); 39 | virtual void Initialize(Transform& trans); 40 | virtual void Update(); 41 | virtual void Release(); 42 | 43 | void AddChild(std::shared_ptr child); 44 | void setParent(std::shared_ptr parent); 45 | void setMesh(std::shared_ptr obj); 46 | void setObjectType(OBJECT_FLAG_ENUM type); 47 | void setName(std::string name); 48 | 49 | inline bool hasMesh() { return (m_mesh != nullptr) ? true : false; }; 50 | inline const std::shared_ptr& getMesh() { return m_mesh; }; 51 | inline const std::vector>& getChilds() { return m_childs; }; 52 | inline const std::shared_ptr getParent() { return m_parent; } 53 | inline const OBJECT_FLAG_ENUM& getObjectType() { return m_object_type; }; 54 | inline std::string getName() { return m_name; }; 55 | 56 | Transform m_transform; 57 | 58 | protected: 59 | std::string m_name; 60 | std::vector> m_childs; 61 | std::shared_ptr m_parent; 62 | std::shared_ptr m_mesh; 63 | 64 | private: 65 | OBJECT_FLAG_ENUM m_object_type; 66 | 67 | 68 | }; 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /JellySimulation/Jelly.cpp: -------------------------------------------------------------------------------- 1 | #include "Jelly.h" 2 | #include "GLFWApp.h" 3 | #include "ResourceManager.h" 4 | 5 | 6 | Jelly::Jelly() 7 | :m_num_of_particles(0) 8 | { 9 | } 10 | 11 | 12 | Jelly::~Jelly() 13 | { 14 | } 15 | 16 | void Jelly::Update() 17 | { 18 | /*Particle move test*/ 19 | /* 20 | size_t jelly_dim = m_particles.size(); 21 | for (size_t i = 0; i < jelly_dim; ++i) 22 | { 23 | for (size_t j = 0; j < jelly_dim; ++j) 24 | { 25 | for (size_t k = 0; k < jelly_dim; ++k) 26 | { 27 | size_t idx = 28 | i * (jelly_dim*jelly_dim) 29 | + j * jelly_dim 30 | + k; 31 | 32 | m_particles[i][j][k]->m_data->position += glm::vec3(0, 0.001f, 0); 33 | } 34 | } 35 | } 36 | */ 37 | UpdateVBO(); 38 | } 39 | 40 | void Jelly::Initialize(std::vector>>& particles, std::vector indices) 41 | { 42 | auto resource_manager = GLFWApp::getInstance()->getResourceManager(); 43 | auto shader = resource_manager->FindShaderByName("ShadowMapping"); 44 | 45 | setParticles(particles); 46 | 47 | m_jelly_mesh = std::make_shared(); 48 | m_jelly_mesh->setShader(shader); 49 | m_jelly_mesh->setPositions(m_positions); 50 | m_jelly_mesh->setIndices(indices); 51 | m_jelly_mesh->SetupGLBuffers(); 52 | 53 | } 54 | 55 | void Jelly::setParticles(std::vector>>& particles) 56 | { 57 | // n^3 particles 58 | m_num_of_particles = particles.size() * particles.size() * particles.size(); 59 | m_particles = particles; 60 | m_positions.resize(m_num_of_particles); 61 | /*Update member particle positions*/ 62 | UpdateParticlePositions(); 63 | } 64 | 65 | void Jelly::UpdateVBO() 66 | { 67 | //std::vector new_positions(m_num_of_particles); 68 | UpdateParticlePositions(); 69 | m_jelly_mesh->ResetPositions(m_positions); 70 | } 71 | 72 | void Jelly::UpdateParticlePositions() 73 | { 74 | size_t jelly_dim = m_particles.size(); 75 | for (size_t i = 0; i < jelly_dim; ++i) 76 | { 77 | for (size_t j = 0; j < jelly_dim; ++j) 78 | { 79 | for (size_t k = 0; k < jelly_dim; ++k) 80 | { 81 | size_t idx = 82 | i * (jelly_dim*jelly_dim) 83 | + j * jelly_dim 84 | + k; 85 | 86 | m_positions[idx] = m_particles[i][j][k]->m_data->position; 87 | } 88 | } 89 | } 90 | } 91 | 92 | -------------------------------------------------------------------------------- /JellySimulation/Jelly.h: -------------------------------------------------------------------------------- 1 | #ifndef _JELLY_H_ 2 | #define _JELLY_H_ 3 | 4 | #include 5 | #include "Mesh.h" 6 | #include "Particle.h" 7 | #include "Constraints.h" 8 | 9 | 10 | // forward declaration 11 | struct Spring; 12 | class Jelly; 13 | 14 | using Jelly_Ptr = std::shared_ptr; 15 | 16 | 17 | /** 18 | * A jelly is represented by mass-spring system. 19 | */ 20 | class Jelly 21 | { 22 | public: 23 | Jelly(); 24 | ~Jelly(); 25 | 26 | void Update(); 27 | 28 | void Initialize(std::vector>>& particles, std::vector indices); 29 | 30 | // setter 31 | void setParticles(std::vector>>& particles); 32 | //void setSprings(std::vector<) 33 | 34 | //getters 35 | std::shared_ptr getJellyMesh() { return m_jelly_mesh; }; 36 | 37 | private: 38 | 39 | // Refresh GPU vertex buffer data (positions) 40 | void UpdateVBO(); 41 | 42 | /*Particles*/ 43 | void UpdateParticlePositions(); 44 | 45 | /*Basic properties*/ 46 | std::vector m_positions; 47 | 48 | 49 | std::vector>> m_particles; 50 | size_t m_num_of_particles; 51 | // Buffer in Jelly class for faster update 52 | // TODO: Change to SOA (Structure of Array) 53 | // Or find a way using pointer to manage these 54 | 55 | /*Springs*/ 56 | std::vector m_shear_springs; 57 | std::vector m_structural_springs; 58 | std::vector m_bend_springs; 59 | 60 | /*Mesh of jelly*/ 61 | std::shared_ptr m_jelly_mesh; 62 | 63 | /*Mesh of Particles*/ 64 | std::shared_ptr m_particle_mesh; 65 | 66 | }; 67 | 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /JellySimulation/Joint.cpp: -------------------------------------------------------------------------------- 1 | #include "Joint.h" 2 | #include "GLFWApp.h" 3 | 4 | // Joint 5 | Joint::Joint(std::string name) : m_offset_from_parent(glm::vec3(0,0,0)), m_num_channels(0), m_parent(nullptr) 6 | { 7 | GameObject::setName(name); 8 | for (int i = 0; i < 6; ++i) 9 | m_joint_limit[i] = { 0,0 }; 10 | } 11 | 12 | Joint::~Joint() 13 | { 14 | } 15 | 16 | void Joint::Initialize() 17 | { 18 | GameObject::Initialize(); 19 | } 20 | 21 | void Joint::Initialize(Transform& trans) 22 | { 23 | auto resource_manager = GLFWApp::getInstance()->getResourceManager(); 24 | const auto mesh_list = resource_manager->getMeshes(); 25 | // TODO: remember to replace this with findMesh(name) / setMesh() 26 | auto mesh = mesh_list[2]; 27 | 28 | GameObject::Initialize(trans.m_translation); 29 | } 30 | 31 | void Joint::setParent(std::shared_ptr parent) 32 | { 33 | m_parent = parent; 34 | m_transform.setParent(&(parent->m_transform)); 35 | } 36 | 37 | void Joint::AddChild(std::shared_ptr child) 38 | { 39 | m_childs.push_back(child); 40 | } 41 | -------------------------------------------------------------------------------- /JellySimulation/Joint.h: -------------------------------------------------------------------------------- 1 | #ifndef _JOINT_H_ 2 | #define _JOINT_H_ 3 | 4 | #include "GameObject.h" 5 | #include 6 | #include 7 | 8 | /* 9 | * Joint has channels decribing its degree of freedom and an offset from its parent 10 | * PS. Root is also a joint 11 | */ 12 | 13 | class Joint; 14 | 15 | /* 16 | enum JOINT_DOF_ENUM 17 | { 18 | DOF_NONE, 19 | DOF_RX, 20 | DOF_RY, 21 | DOF_RZ, 22 | DOF_RX_RY, 23 | DOF_RY_RZ, 24 | DOF_RX_RZ, 25 | DOF_RX_RY_RZ, 26 | DOF_6DOF 27 | }; 28 | */ 29 | 30 | struct JointLimit 31 | { 32 | float min = 0, max = 0; 33 | }; 34 | 35 | class Joint : public GameObject 36 | { 37 | public: 38 | Joint(std::string name); 39 | ~Joint(); 40 | 41 | void Initialize(); 42 | void Initialize(Transform& trans); 43 | 44 | void AddChild(std::shared_ptr child); 45 | 46 | void setParent(std::shared_ptr parent); 47 | inline std::shared_ptr getParent() { return m_parent; }; 48 | inline std::vector>& getChilds() { return m_childs; }; 49 | 50 | //Joint config 51 | glm::vec3 m_offset_from_parent; 52 | JointLimit m_joint_limit[6]; 53 | std::vector m_channel_order; 54 | uint16_t m_num_channels; 55 | 56 | //uint16_t id; 57 | 58 | private: 59 | //JOINT_DOF_ENUM dof_type; 60 | std::shared_ptr m_parent; 61 | std::vector> m_childs; 62 | 63 | }; 64 | 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /JellySimulation/Particle.h: -------------------------------------------------------------------------------- 1 | #ifndef _PARTICLE_H_ 2 | #define _PARTICLE_H_ 3 | 4 | #include 5 | #include 6 | #include "Collider.h" 7 | 8 | class Particle; 9 | using Particle_Ptr = std::shared_ptr; 10 | 11 | struct ParticleData 12 | { 13 | ParticleData(glm::vec3 pos, float m): 14 | position(pos), 15 | velocity(glm::vec3(0)), 16 | force(glm::vec3(0)), 17 | prev_position(glm::vec3(0)), 18 | prev_velocity(glm::vec3(0)), 19 | prev_force(glm::vec3(0)), 20 | new_position(glm::vec3(0)), 21 | new_velocity(glm::vec3(0)), 22 | new_force(glm::vec3(0)), 23 | mass(m), 24 | massInv(1.f/mass) 25 | { 26 | } 27 | glm::vec3 position; 28 | glm::vec3 velocity; 29 | glm::vec3 force; 30 | 31 | glm::vec3 prev_position; 32 | glm::vec3 prev_velocity; 33 | glm::vec3 prev_force; 34 | 35 | glm::vec3 new_position; 36 | glm::vec3 new_velocity; 37 | glm::vec3 new_force; 38 | 39 | float mass; 40 | float massInv; 41 | }; 42 | 43 | class Particle 44 | { 45 | public: 46 | Particle(glm::vec3 pos, float mass); 47 | ~Particle(); 48 | 49 | void Update(float dt); 50 | void UpdateCollider(); 51 | 52 | bool TestCollision(Collider* other); 53 | void OnCollision(Collider* other, const float& dt); 54 | // Attributes 55 | // use pointer to maximize CPU cache performance 56 | ParticleData* m_data; 57 | PointCollider* m_collider; 58 | }; 59 | 60 | 61 | 62 | 63 | #endif 64 | 65 | -------------------------------------------------------------------------------- /JellySimulation/Renderer.h: -------------------------------------------------------------------------------- 1 | #ifndef _RENDERER_H_ 2 | #define _RENDERER_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include "Mesh.h" 8 | #include "Transform.h" 9 | #include "Camera.h" 10 | #include "ResourceManager.h" 11 | 12 | 13 | /* 14 | Renderer only handle process of render and renderable resources 15 | */ 16 | 17 | using Shader_Object_Map = std::unordered_map< std::shared_ptr, std::vector> >; 18 | 19 | class Renderer 20 | { 21 | public: 22 | Renderer(std::shared_ptr resource_manager); 23 | ~Renderer(); 24 | 25 | void Initialize(std::shared_ptr camera,int screenWidth, int screenHeight); 26 | 27 | void SetShaderObjectMap(std::shared_ptr shader, std::shared_ptr object); 28 | void RemoveObjectMapCache(std::shared_ptr shader, std::shared_ptr object); 29 | 30 | void Render(); 31 | 32 | void SetMainCamera(std::shared_ptr camera); 33 | void SetupParticleGLBuffers(const std::vector& particles); 34 | 35 | bool renderQuad = false; 36 | 37 | inline const glm::mat4& getLightMat() { return light_mat; }; 38 | inline Shader_Object_Map& getShaderObjectMap() { return m_shader_object_map; }; 39 | 40 | private: 41 | 42 | void RenderScene(); 43 | //void RenderStaticObject(); 44 | //void RenderInstancedObject(); 45 | void RenderShadowMappingObject( 46 | const std::shared_ptr& shader, 47 | const std::shared_ptr& mesh, 48 | const Transform& transform); 49 | void RenderInstancedObject(const std::shared_ptr& mesh, const Transform& transform); 50 | void RenderDepth(const std::shared_ptr& mesh, const Transform& transform); 51 | void RenderSceneDepth(); 52 | void RenderShadowMappedScene(); 53 | 54 | void RenderParticles(const std::vector& particles); 55 | 56 | void RenderQuad(); 57 | 58 | std::shared_ptr m_resource_manager; 59 | Shader_Object_Map m_shader_object_map; 60 | 61 | glm::mat4 light_mat; 62 | std::shared_ptr m_mainCamera; 63 | 64 | int m_screenWidth; 65 | int m_screenHeight; 66 | 67 | // GL buffers 68 | GLuint m_depthMapFBO; 69 | GLuint m_depthMap; 70 | GLuint m_indirectBuffer; 71 | GLuint m_indirect_VAO; 72 | GLuint m_indirect_VBO; 73 | GLuint m_indirect_EBO; 74 | 75 | GLuint m_particles_VAO; 76 | GLuint m_particles_VBO; 77 | GLuint m_particles_EBO; 78 | 79 | 80 | 81 | 82 | std::shared_ptr m_simpleDepthShader; 83 | std::shared_ptr m_quad_shader; 84 | 85 | GLuint quadVAO, quadVBO; 86 | 87 | }; 88 | 89 | #endif 90 | -------------------------------------------------------------------------------- /JellySimulation/Rigidbody.cpp: -------------------------------------------------------------------------------- 1 | #include "Rigidbody.h" 2 | 3 | Rigidbody::Rigidbody(glm::vec3 pos, float mass, float inertia=1.f) 4 | : m_position(pos), 5 | m_velocity(glm::vec3()), 6 | m_mass(mass), 7 | m_force(mass), 8 | m_massInv( (mass==0)? 100000.f: 1.f / mass), 9 | m_inertia(inertia), 10 | m_isStatic(false), 11 | m_collider(nullptr) 12 | { 13 | 14 | } 15 | 16 | Rigidbody::~Rigidbody() 17 | { 18 | } 19 | 20 | void Rigidbody::Update() 21 | { 22 | if (m_isStatic) 23 | return; 24 | m_prev_position = m_position; 25 | m_prev_velocity = m_velocity; 26 | 27 | m_position = m_new_position; 28 | m_velocity = m_new_velocity; 29 | } 30 | 31 | void Rigidbody::setCollider(Collider* collider) 32 | { 33 | m_collider = collider; 34 | } 35 | -------------------------------------------------------------------------------- /JellySimulation/Rigidbody.h: -------------------------------------------------------------------------------- 1 | #ifndef _RIGIDBODY_H_ 2 | #define _RIGIDBODY_H_ 3 | 4 | #include "common.h" 5 | #include "Collider.h" 6 | 7 | /* Provide Rigidbody class in this project but not going to use this for jelly */ 8 | 9 | class Rigidbody 10 | { 11 | public: 12 | Rigidbody() = delete; 13 | Rigidbody(glm::vec3 pos, float mass, float inertia); 14 | ~Rigidbody(); 15 | 16 | void Update(); 17 | 18 | glm::vec3 m_position; 19 | glm::vec3 m_velocity; 20 | glm::vec3 m_force; 21 | 22 | glm::vec3 m_new_position; 23 | glm::vec3 m_new_velocity; 24 | 25 | glm::vec3 m_prev_position; 26 | glm::vec3 m_prev_velocity; 27 | 28 | bool m_isStatic; 29 | 30 | // setters 31 | void setCollider(Collider* collider); 32 | 33 | // getters for members unchange members 34 | inline float getMass() { return m_mass; }; 35 | inline float getMassInv() { return m_massInv; }; 36 | inline float getInertia() { return m_inertia; }; 37 | 38 | inline Collider* getCollider() { return m_collider; }; 39 | 40 | 41 | private: 42 | 43 | float m_mass; 44 | float m_massInv; 45 | float m_inertia; 46 | 47 | Collider* m_collider; 48 | 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /JellySimulation/Shader.h: -------------------------------------------------------------------------------- 1 | #ifndef _SHADER_H_ 2 | #define _SHADER_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | using namespace std; 14 | 15 | enum ShaderEnum 16 | { 17 | SHADER_MODE_FLAT, 18 | SHADER_MODE_PHONG, 19 | SHADER_MODE_TEXTURED_FLAT, 20 | SHADER_MODE_TEXTURED_PHONG 21 | }; 22 | 23 | class Shader : public std::enable_shared_from_this 24 | { 25 | public: 26 | Shader(std::string name); 27 | ~Shader(); 28 | 29 | bool SetupShader(); 30 | bool SetupShader(const GLchar* vsPath, const GLchar* fsPath , const GLchar* gsPath); 31 | bool SetupShader(const GLchar* vsPath, const GLchar* fsPath); 32 | bool SetupShader(ShaderEnum); 33 | void SetUniformMat4(const std::string& name, const glm::mat4& mat); 34 | void SetUniformVec3(const std::string& name, const glm::vec3& mat); 35 | void SetUniformInt(const std::string& name, const GLint value); 36 | void SetUniformFloat(const std::string& name, const float value); 37 | void Use(); 38 | 39 | //getter 40 | inline std::string getName() { return m_name; }; 41 | inline const GLuint& getProgram() const { return m_program; }; 42 | 43 | private: 44 | std::string m_name; 45 | GLuint m_program; 46 | GLuint m_vertex_shader, m_geometry_shader, m_fragment_shader; 47 | 48 | void RegistToManager(); 49 | 50 | }; 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /JellySimulation/Simulation.h: -------------------------------------------------------------------------------- 1 | #ifndef _SIMULATION_H_ 2 | #define _SIMULATION_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include "Constraints.h" 8 | #include "ConstraintSolver.h" 9 | #include "Collider.h" 10 | #include "Rigidbody.h" 11 | 12 | struct SimWorldDesc 13 | { 14 | SimWorldDesc(float g, float damping) : gravity(g), global_velocity_damping(damping) {}; 15 | 16 | float gravity; 17 | float global_velocity_damping; 18 | }; 19 | 20 | 21 | class Simulation 22 | { 23 | 24 | public: 25 | Simulation(); 26 | Simulation(SimWorldDesc desc); 27 | ~Simulation(); 28 | 29 | void Initialize(PBD_MODE mode); 30 | bool Step(float dt); 31 | void AddParticle(Particle_Ptr particle); 32 | void AddCollider(Collider* collider); 33 | void AddStaticConstraint(Constraint* constraint); 34 | void AddStaticConstraints(std::vector constraints); 35 | void SetSolverIteration(uint32_t iter_count); 36 | 37 | void Pause(); 38 | 39 | // setters 40 | void setGravity(float gravity); 41 | 42 | // getters 43 | inline float getGravity() { return m_world_desc.gravity; }; 44 | private: 45 | 46 | void UpdatePhysics(float dt); 47 | void CollisionDetection(float dt); 48 | void HandleCollisionResponse(); 49 | void GenerateCollisionConstraint(); 50 | bool ProjectConstraints(const float &dt); 51 | 52 | void AddCollisionConstraint(Constraint* constraint); 53 | void ApplySolverResults(float dt); 54 | 55 | SimWorldDesc m_world_desc; 56 | bool m_initialized; 57 | bool m_pause; 58 | 59 | std::shared_ptr m_solver; 60 | 61 | std::vector m_particles; 62 | std::vector m_colliders; 63 | std::vector m_rigidbodies; 64 | std::vector m_static_constraints; 65 | std::vector m_collision_constraints; 66 | 67 | /* The collision table record who contact with who */ 68 | std::vector> m_collision_table; 69 | 70 | }; 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /JellySimulation/Transform.cpp: -------------------------------------------------------------------------------- 1 | #include "Transform.h" 2 | #include 3 | #include 4 | 5 | Transform::Transform() : m_translation(glm::vec3(0,0,0)) , m_eulerAngles(glm::vec3(0,0,0)) , m_modelMat(glm::mat4(1)) , 6 | m_front(glm::vec3(0, 0, 1)) , m_up(glm::vec3(0, 1, 0)) , m_right(glm::vec3(1, 0, 0)) , m_scale(1.0f), 7 | m_parent(nullptr) 8 | { 9 | 10 | } 11 | 12 | Transform::Transform(const glm::vec3 &translation, const glm::vec3 &eulerAngles, const glm::vec3 &scale) 13 | : m_scale(scale), m_eulerAngles(eulerAngles), m_translation(translation) 14 | { 15 | m_quaternion = glm::quat(eulerAngles); 16 | 17 | m_translationMat = glm::translate(glm::mat4(1), m_translation); 18 | m_rotationMat = glm::toMat4(m_quaternion); 19 | m_scaleMat = glm::scale(glm::mat4(1), m_scale); 20 | 21 | m_modelMat = m_scaleMat * m_rotationMat * m_translationMat; 22 | } 23 | 24 | Transform::~Transform() 25 | { 26 | } 27 | 28 | void Transform::Update() 29 | { 30 | /* 31 | Use quternion for rotation 32 | Model = Translation * Rotation * Scale 33 | */ 34 | m_translationMat = glm::translate(glm::mat4(1), m_translation); 35 | m_rotationMat = glm::toMat4(m_quaternion); 36 | m_scaleMat = glm::scale(glm::mat4(1), m_scale); 37 | 38 | // Same as Unity3D transformation order 39 | m_modelMat = m_translationMat * m_rotationMat * m_scaleMat; 40 | 41 | Compute_ModelMat_World(); 42 | } 43 | 44 | void Transform::Compute_ModelMat_World() 45 | { 46 | auto node = m_parent; 47 | m_modelMat_world = m_modelMat; 48 | while (node) 49 | { 50 | m_modelMat_world = node->m_modelMat * m_modelMat_world; 51 | node = node->m_parent; 52 | } 53 | 54 | } 55 | 56 | void Transform::CopyTo(Transform & other) 57 | { 58 | // TODO: insert return statement here 59 | if (this != &other) 60 | { 61 | m_front = other.m_front; 62 | m_up = other.m_up; 63 | m_right = other.m_right; 64 | 65 | m_scale = other.m_scale; 66 | m_eulerAngles = other.m_eulerAngles; 67 | m_translation = other.m_translation; 68 | m_modelMat = other.m_modelMat; 69 | m_quaternion = other.m_quaternion; 70 | m_scaleMat = other.m_scaleMat; 71 | m_rotationMat = other.m_rotationMat; 72 | m_translationMat = other.m_translationMat; 73 | } 74 | } 75 | 76 | void Transform::setRotation(glm::quat input) 77 | { 78 | m_quaternion = input; 79 | m_eulerAngles = glm::eulerAngles(m_quaternion); 80 | } 81 | 82 | void Transform::setRotation(glm::vec3 eulerAngles) 83 | { 84 | m_eulerAngles = eulerAngles; 85 | m_quaternion = glm::quat(eulerAngles); 86 | } 87 | 88 | void Transform::setRotationDegree(glm::vec3 degree) 89 | { 90 | m_eulerAngles = glm::radians(degree); 91 | m_quaternion = glm::quat(m_eulerAngles); 92 | } 93 | 94 | void Transform::setParent(Transform * transform) 95 | { 96 | m_parent = transform; 97 | } 98 | -------------------------------------------------------------------------------- /JellySimulation/Transform.h: -------------------------------------------------------------------------------- 1 | #ifndef _TRANSFORM_H_ 2 | #define _TRANSFORM_H_ 3 | 4 | #include "common.h" 5 | 6 | class Transform; 7 | 8 | class Transform 9 | { 10 | public: 11 | Transform(); 12 | Transform(const glm::vec3 &translation, const glm::vec3 &eulerAngles, const glm::vec3 &scale); 13 | 14 | ~Transform(); 15 | 16 | void Update(); 17 | void Compute_ModelMat_World(); 18 | void CopyTo(Transform& other); 19 | void setRotation(glm::quat input); 20 | void setRotation(glm::vec3 input); 21 | void setRotationDegree(glm::vec3 input); 22 | void setParent(Transform* transform); 23 | 24 | inline const glm::vec3& getEulerAngles() const { return m_eulerAngles; } 25 | inline const glm::quat& getQuaternion() const { return m_quaternion; } 26 | 27 | // Expose state matrix 28 | inline const glm::mat4& getModelMat() const { return m_modelMat; } 29 | inline const glm::mat4& getModelMatWorld() const { return m_modelMat_world; } 30 | inline const glm::mat4& getScaleMat() const { return m_scaleMat; } 31 | inline const glm::mat4& getRotationMat() const { return m_rotationMat; } 32 | inline const glm::mat4& getTranslationMat() const { return m_translationMat; } 33 | inline Transform* getParent() { return m_parent; } 34 | 35 | // Object-oriented axis 36 | glm::vec3 m_front; 37 | glm::vec3 m_up; 38 | glm::vec3 m_right; 39 | 40 | glm::vec3 m_scale; 41 | glm::vec3 m_translation; 42 | 43 | protected: 44 | 45 | glm::mat4 m_modelMat; 46 | glm::mat4 m_modelMat_world; 47 | 48 | glm::quat m_quaternion; 49 | 50 | glm::mat4 m_scaleMat; 51 | glm::mat4 m_rotationMat; 52 | glm::mat4 m_translationMat; 53 | 54 | Transform* m_parent; 55 | 56 | private: 57 | // DO NOT ALLOW DIRECT ACESS EULER ANGLES 58 | glm::vec3 m_eulerAngles; 59 | 60 | }; 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /JellySimulation/common.h: -------------------------------------------------------------------------------- 1 | #ifndef _COMMON_H_ 2 | #define _COMMON_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #define M_PI 3.1415926f 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /JellySimulation/imgui/imgui_impl_glfw_gl3.h: -------------------------------------------------------------------------------- 1 | // ImGui GLFW binding with OpenGL3 + shaders 2 | // (GLFW is a cross-platform general purpose library for handling windows, inputs, OpenGL/Vulkan graphics context creation, etc.) 3 | // (GL3W is a helper library to access OpenGL functions since there is no standard header to access modern OpenGL functions easily. Alternatives are GLEW, Glad, etc.) 4 | 5 | // Implemented features: 6 | // [X] User texture binding. Cast 'GLuint' OpenGL texture identifier as void*/ImTextureID. Read the FAQ about ImTextureID in imgui.cpp. 7 | // [X] Gamepad navigation mapping. Enable with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'. 8 | 9 | // You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this. 10 | // If you use this binding you'll need to call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), ImGui::Render() and ImGui_ImplXXXX_Shutdown(). 11 | // If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp. 12 | // https://github.com/ocornut/imgui 13 | 14 | struct GLFWwindow; 15 | 16 | IMGUI_API bool ImGui_ImplGlfwGL3_Init(GLFWwindow *window, bool install_callbacks, const char *glsl_version = NULL); 17 | IMGUI_API void ImGui_ImplGlfwGL3_Shutdown(); 18 | IMGUI_API void ImGui_ImplGlfwGL3_NewFrame(); 19 | IMGUI_API void ImGui_ImplGlfwGL3_RenderDrawData(ImDrawData *draw_data); 20 | 21 | // Use if you want to reset your rendering device without losing ImGui state. 22 | IMGUI_API void ImGui_ImplGlfwGL3_InvalidateDeviceObjects(); 23 | IMGUI_API bool ImGui_ImplGlfwGL3_CreateDeviceObjects(); 24 | 25 | // GLFW callbacks (installed by default if you enable 'install_callbacks' during initialization) 26 | // Provided here if you want to chain callbacks. 27 | // You can also handle inputs yourself and use those as a reference. 28 | 29 | IMGUI_API const char *ImGui_ImplGlfwGL3_GetClipboardText(void *user_data); 30 | IMGUI_API void ImGui_ImplGlfwGL3_SetClipboardText(void *user_data, const char *text); 31 | IMGUI_API void ImGui_ImplGlfw_MouseButtonCallback(GLFWwindow *window, int button, int action, int mods); 32 | IMGUI_API void ImGui_ImplGlfw_ScrollCallback(GLFWwindow *window, double xoffset, double yoffset); 33 | IMGUI_API void ImGui_ImplGlfw_KeyCallback(GLFWwindow *window, int key, int scancode, int action, int mods); 34 | IMGUI_API void ImGui_ImplGlfw_CharCallback(GLFWwindow *window, unsigned int c); 35 | -------------------------------------------------------------------------------- /JellySimulation/include/SOIL/image_helper.h: -------------------------------------------------------------------------------- 1 | /* 2 | Jonathan Dummer 3 | 4 | Image helper functions 5 | 6 | MIT license 7 | */ 8 | 9 | #ifndef HEADER_IMAGE_HELPER 10 | #define HEADER_IMAGE_HELPER 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | /** 17 | This function upscales an image. 18 | Not to be used to create MIPmaps, 19 | but to make it square, 20 | or to make it a power-of-two sized. 21 | **/ 22 | int 23 | up_scale_image 24 | ( 25 | const unsigned char* const orig, 26 | int width, int height, int channels, 27 | unsigned char* resampled, 28 | int resampled_width, int resampled_height 29 | ); 30 | 31 | /** 32 | This function downscales an image. 33 | Used for creating MIPmaps, 34 | the incoming image should be a 35 | power-of-two sized. 36 | **/ 37 | int 38 | mipmap_image 39 | ( 40 | const unsigned char* const orig, 41 | int width, int height, int channels, 42 | unsigned char* resampled, 43 | int block_size_x, int block_size_y 44 | ); 45 | 46 | /** 47 | This function takes the RGB components of the image 48 | and scales each channel from [0,255] to [16,235]. 49 | This makes the colors "Safe" for display on NTSC 50 | displays. Note that this is _NOT_ a good idea for 51 | loading images like normal- or height-maps! 52 | **/ 53 | int 54 | scale_image_RGB_to_NTSC_safe 55 | ( 56 | unsigned char* orig, 57 | int width, int height, int channels 58 | ); 59 | 60 | /** 61 | This function takes the RGB components of the image 62 | and converts them into YCoCg. 3 components will be 63 | re-ordered to CoYCg (for optimum DXT1 compression), 64 | while 4 components will be ordered CoCgAY (for DXT5 65 | compression). 66 | **/ 67 | int 68 | convert_RGB_to_YCoCg 69 | ( 70 | unsigned char* orig, 71 | int width, int height, int channels 72 | ); 73 | 74 | /** 75 | This function takes the YCoCg components of the image 76 | and converts them into RGB. See above. 77 | **/ 78 | int 79 | convert_YCoCg_to_RGB 80 | ( 81 | unsigned char* orig, 82 | int width, int height, int channels 83 | ); 84 | 85 | /** 86 | Converts an HDR image from an array 87 | of unsigned chars (RGBE) to RGBdivA 88 | \return 0 if failed, otherwise returns 1 89 | **/ 90 | int 91 | RGBE_to_RGBdivA 92 | ( 93 | unsigned char *image, 94 | int width, int height, 95 | int rescale_to_max 96 | ); 97 | 98 | /** 99 | Converts an HDR image from an array 100 | of unsigned chars (RGBE) to RGBdivA2 101 | \return 0 if failed, otherwise returns 1 102 | **/ 103 | int 104 | RGBE_to_RGBdivA2 105 | ( 106 | unsigned char *image, 107 | int width, int height, 108 | int rescale_to_max 109 | ); 110 | 111 | #ifdef __cplusplus 112 | } 113 | #endif 114 | 115 | #endif /* HEADER_IMAGE_HELPER */ 116 | -------------------------------------------------------------------------------- /JellySimulation/include/SOIL/stbi_DDS_aug.h: -------------------------------------------------------------------------------- 1 | /* 2 | adding DDS loading support to stbi 3 | */ 4 | 5 | #ifndef HEADER_STB_IMAGE_DDS_AUGMENTATION 6 | #define HEADER_STB_IMAGE_DDS_AUGMENTATION 7 | 8 | // is it a DDS file? 9 | extern int stbi_dds_test_memory (stbi_uc const *buffer, int len); 10 | 11 | extern stbi_uc *stbi_dds_load (char *filename, int *x, int *y, int *comp, int req_comp); 12 | extern stbi_uc *stbi_dds_load_from_memory (stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp); 13 | #ifndef STBI_NO_STDIO 14 | extern int stbi_dds_test_file (FILE *f); 15 | extern stbi_uc *stbi_dds_load_from_file (FILE *f, int *x, int *y, int *comp, int req_comp); 16 | #endif 17 | 18 | // 19 | // 20 | //// end header file ///////////////////////////////////////////////////// 21 | #endif // HEADER_STB_IMAGE_DDS_AUGMENTATION 22 | -------------------------------------------------------------------------------- /JellySimulation/include/assimp/.editorconfig: -------------------------------------------------------------------------------- 1 | # See for details 2 | 3 | [*.{h,hpp,inl}] 4 | end_of_line = lf 5 | insert_final_newline = true 6 | trim_trailing_whitespace = true 7 | indent_size = 4 8 | indent_style = space 9 | -------------------------------------------------------------------------------- /JellySimulation/include/assimp/Compiler/poppack1.h: -------------------------------------------------------------------------------- 1 | 2 | // =============================================================================== 3 | // May be included multiple times - resets structure packing to the defaults 4 | // for all supported compilers. Reverts the changes made by #include 5 | // 6 | // Currently this works on the following compilers: 7 | // MSVC 7,8,9 8 | // GCC 9 | // BORLAND (complains about 'pack state changed but not reverted', but works) 10 | // =============================================================================== 11 | 12 | #ifndef AI_PUSHPACK_IS_DEFINED 13 | # error pushpack1.h must be included after poppack1.h 14 | #endif 15 | 16 | // reset packing to the original value 17 | #if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__) 18 | # pragma pack( pop ) 19 | #endif 20 | #undef PACK_STRUCT 21 | 22 | #undef AI_PUSHPACK_IS_DEFINED 23 | -------------------------------------------------------------------------------- /JellySimulation/include/assimp/Compiler/pushpack1.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | // =============================================================================== 4 | // May be included multiple times - sets structure packing to 1 5 | // for all supported compilers. #include reverts the changes. 6 | // 7 | // Currently this works on the following compilers: 8 | // MSVC 7,8,9 9 | // GCC 10 | // BORLAND (complains about 'pack state changed but not reverted', but works) 11 | // Clang 12 | // 13 | // 14 | // USAGE: 15 | // 16 | // struct StructToBePacked { 17 | // } PACK_STRUCT; 18 | // 19 | // =============================================================================== 20 | 21 | #ifdef AI_PUSHPACK_IS_DEFINED 22 | # error poppack1.h must be included after pushpack1.h 23 | #endif 24 | 25 | #if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__) 26 | # pragma pack(push,1) 27 | # define PACK_STRUCT 28 | #elif defined( __GNUC__ ) 29 | # if !defined(HOST_MINGW) 30 | # define PACK_STRUCT __attribute__((__packed__)) 31 | # else 32 | # define PACK_STRUCT __attribute__((gcc_struct, __packed__)) 33 | # endif 34 | #else 35 | # error Compiler not supported 36 | #endif 37 | 38 | #if defined(_MSC_VER) 39 | 40 | // C4103: Packing was changed after the inclusion of the header, probably missing #pragma pop 41 | # pragma warning (disable : 4103) 42 | #endif 43 | 44 | #define AI_PUSHPACK_IS_DEFINED 45 | 46 | 47 | -------------------------------------------------------------------------------- /JellySimulation/include/assimp/ai_assert.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Open Asset Import Library (assimp) 4 | --------------------------------------------------------------------------- 5 | 6 | Copyright (c) 2006-2016, assimp team 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use of this software in source and binary forms, 11 | with or without modification, are permitted provided that the following 12 | conditions are met: 13 | 14 | * Redistributions of source code must retain the above 15 | copyright notice, this list of conditions and the 16 | following disclaimer. 17 | 18 | * Redistributions in binary form must reproduce the above 19 | copyright notice, this list of conditions and the 20 | following disclaimer in the documentation and/or other 21 | materials provided with the distribution. 22 | 23 | * Neither the name of the assimp team, nor the names of its 24 | contributors may be used to endorse or promote products 25 | derived from this software without specific prior 26 | written permission of the assimp team. 27 | 28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 34 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 35 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 36 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 38 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | --------------------------------------------------------------------------- 40 | */ 41 | #ifndef AI_DEBUG_H_INC 42 | #define AI_DEBUG_H_INC 43 | 44 | #ifdef ASSIMP_BUILD_DEBUG 45 | # include 46 | # define ai_assert(expression) assert(expression) 47 | #else 48 | # define ai_assert(expression) 49 | #endif 50 | 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(NAME glm_dummy) 2 | 3 | file(GLOB ROOT_SOURCE *.cpp) 4 | file(GLOB ROOT_INLINE *.inl) 5 | file(GLOB ROOT_HEADER *.hpp) 6 | file(GLOB ROOT_TEXT ../*.txt) 7 | file(GLOB ROOT_MD ../*.md) 8 | file(GLOB ROOT_NAT ../util/glm.natvis) 9 | 10 | file(GLOB_RECURSE CORE_SOURCE ./detail/*.cpp) 11 | file(GLOB_RECURSE CORE_INLINE ./detail/*.inl) 12 | file(GLOB_RECURSE CORE_HEADER ./detail/*.hpp) 13 | 14 | file(GLOB_RECURSE GTC_SOURCE ./gtc/*.cpp) 15 | file(GLOB_RECURSE GTC_INLINE ./gtc/*.inl) 16 | file(GLOB_RECURSE GTC_HEADER ./gtc/*.hpp) 17 | 18 | file(GLOB_RECURSE GTX_SOURCE ./gtx/*.cpp) 19 | file(GLOB_RECURSE GTX_INLINE ./gtx/*.inl) 20 | file(GLOB_RECURSE GTX_HEADER ./gtx/*.hpp) 21 | 22 | source_group("Text Files" FILES ${ROOT_TEXT} ${ROOT_MD}) 23 | source_group("Core Files" FILES ${CORE_SOURCE}) 24 | source_group("Core Files" FILES ${CORE_INLINE}) 25 | source_group("Core Files" FILES ${CORE_HEADER}) 26 | source_group("GTC Files" FILES ${GTC_SOURCE}) 27 | source_group("GTC Files" FILES ${GTC_INLINE}) 28 | source_group("GTC Files" FILES ${GTC_HEADER}) 29 | source_group("GTX Files" FILES ${GTX_SOURCE}) 30 | source_group("GTX Files" FILES ${GTX_INLINE}) 31 | source_group("GTX Files" FILES ${GTX_HEADER}) 32 | 33 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..) 34 | 35 | if(GLM_TEST_ENABLE) 36 | add_executable(${NAME} ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT} 37 | ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER} 38 | ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER} 39 | ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER} 40 | ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER}) 41 | endif(GLM_TEST_ENABLE) 42 | 43 | #add_library(glm STATIC glm.cpp) 44 | #add_library(glm_shared SHARED glm.cpp) 45 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/common.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/common.hpp 29 | /// @date 2013-12-24 / 2013-12-24 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | #pragma once 34 | 35 | #include "detail/func_common.hpp" 36 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/detail/_fixes.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/detail/_fixes.hpp 29 | /// @date 2011-02-21 / 2011-11-22 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | #include 34 | 35 | //! Workaround for compatibility with other libraries 36 | #ifdef max 37 | #undef max 38 | #endif 39 | 40 | //! Workaround for compatibility with other libraries 41 | #ifdef min 42 | #undef min 43 | #endif 44 | 45 | //! Workaround for Android 46 | #ifdef isnan 47 | #undef isnan 48 | #endif 49 | 50 | //! Workaround for Android 51 | #ifdef isinf 52 | #undef isinf 53 | #endif 54 | 55 | //! Workaround for Chrone Native Client 56 | #ifdef log2 57 | #undef log2 58 | #endif 59 | 60 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/detail/intrinsic_common.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/detail/intrinsic_common.hpp 25 | /// @date 2009-05-11 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #pragma once 30 | 31 | #include "setup.hpp" 32 | 33 | #if(!(GLM_ARCH & GLM_ARCH_SSE2)) 34 | # error "SSE2 instructions not supported or enabled" 35 | #else 36 | 37 | namespace glm{ 38 | namespace detail 39 | { 40 | __m128 sse_abs_ps(__m128 x); 41 | 42 | __m128 sse_sgn_ps(__m128 x); 43 | 44 | //floor 45 | __m128 sse_flr_ps(__m128 v); 46 | 47 | //trunc 48 | __m128 sse_trc_ps(__m128 v); 49 | 50 | //round 51 | __m128 sse_nd_ps(__m128 v); 52 | 53 | //roundEven 54 | __m128 sse_rde_ps(__m128 v); 55 | 56 | __m128 sse_rnd_ps(__m128 x); 57 | 58 | __m128 sse_ceil_ps(__m128 v); 59 | 60 | __m128 sse_frc_ps(__m128 x); 61 | 62 | __m128 sse_mod_ps(__m128 x, __m128 y); 63 | 64 | __m128 sse_modf_ps(__m128 x, __m128i & i); 65 | 66 | //GLM_FUNC_QUALIFIER __m128 sse_min_ps(__m128 x, __m128 y) 67 | 68 | //GLM_FUNC_QUALIFIER __m128 sse_max_ps(__m128 x, __m128 y) 69 | 70 | __m128 sse_clp_ps(__m128 v, __m128 minVal, __m128 maxVal); 71 | 72 | __m128 sse_mix_ps(__m128 v1, __m128 v2, __m128 a); 73 | 74 | __m128 sse_stp_ps(__m128 edge, __m128 x); 75 | 76 | __m128 sse_ssp_ps(__m128 edge0, __m128 edge1, __m128 x); 77 | 78 | __m128 sse_nan_ps(__m128 x); 79 | 80 | __m128 sse_inf_ps(__m128 x); 81 | 82 | }//namespace detail 83 | }//namespace glm 84 | 85 | #include "intrinsic_common.inl" 86 | 87 | #endif//GLM_ARCH 88 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/detail/intrinsic_exponential.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/detail/intrinsic_exponential.inl 25 | /// @date 2011-06-15 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/detail/intrinsic_geometric.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/detail/intrinsic_geometric.hpp 25 | /// @date 2009-05-08 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #pragma once 30 | 31 | #include "setup.hpp" 32 | 33 | #if(!(GLM_ARCH & GLM_ARCH_SSE2)) 34 | # error "SSE2 instructions not supported or enabled" 35 | #else 36 | 37 | #include "intrinsic_common.hpp" 38 | 39 | namespace glm{ 40 | namespace detail 41 | { 42 | //length 43 | __m128 sse_len_ps(__m128 x); 44 | 45 | //distance 46 | __m128 sse_dst_ps(__m128 p0, __m128 p1); 47 | 48 | //dot 49 | __m128 sse_dot_ps(__m128 v1, __m128 v2); 50 | 51 | // SSE1 52 | __m128 sse_dot_ss(__m128 v1, __m128 v2); 53 | 54 | //cross 55 | __m128 sse_xpd_ps(__m128 v1, __m128 v2); 56 | 57 | //normalize 58 | __m128 sse_nrm_ps(__m128 v); 59 | 60 | //faceforward 61 | __m128 sse_ffd_ps(__m128 N, __m128 I, __m128 Nref); 62 | 63 | //reflect 64 | __m128 sse_rfe_ps(__m128 I, __m128 N); 65 | 66 | //refract 67 | __m128 sse_rfa_ps(__m128 I, __m128 N, __m128 eta); 68 | 69 | }//namespace detail 70 | }//namespace glm 71 | 72 | #include "intrinsic_geometric.inl" 73 | 74 | #endif//GLM_ARCH 75 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/detail/intrinsic_integer.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/detail/intrinsic_integer.hpp 25 | /// @date 2009-05-11 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #pragma once 30 | 31 | #include "glm/glm.hpp" 32 | 33 | #if(!(GLM_ARCH & GLM_ARCH_SSE2)) 34 | # error "SSE2 instructions not supported or enabled" 35 | #else 36 | 37 | namespace glm{ 38 | namespace detail 39 | { 40 | __m128i _mm_bit_interleave_si128(__m128i x); 41 | __m128i _mm_bit_interleave_si128(__m128i x, __m128i y); 42 | 43 | }//namespace detail 44 | }//namespace glm 45 | 46 | #include "intrinsic_integer.inl" 47 | 48 | #endif//GLM_ARCH 49 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/detail/intrinsic_matrix.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/detail/intrinsic_common.hpp 25 | /// @date 2009-06-05 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #pragma once 30 | 31 | #include "setup.hpp" 32 | 33 | #if(!(GLM_ARCH & GLM_ARCH_SSE2)) 34 | # error "SSE2 instructions not supported or enabled" 35 | #else 36 | 37 | #include "intrinsic_geometric.hpp" 38 | 39 | namespace glm{ 40 | namespace detail 41 | { 42 | void sse_add_ps(__m128 in1[4], __m128 in2[4], __m128 out[4]); 43 | 44 | void sse_sub_ps(__m128 in1[4], __m128 in2[4], __m128 out[4]); 45 | 46 | __m128 sse_mul_ps(__m128 m[4], __m128 v); 47 | 48 | __m128 sse_mul_ps(__m128 v, __m128 m[4]); 49 | 50 | void sse_mul_ps(__m128 const in1[4], __m128 const in2[4], __m128 out[4]); 51 | 52 | void sse_transpose_ps(__m128 const in[4], __m128 out[4]); 53 | 54 | void sse_inverse_ps(__m128 const in[4], __m128 out[4]); 55 | 56 | void sse_rotate_ps(__m128 const in[4], float Angle, float const v[3], __m128 out[4]); 57 | 58 | __m128 sse_det_ps(__m128 const m[4]); 59 | 60 | __m128 sse_slow_det_ps(__m128 const m[4]); 61 | 62 | }//namespace detail 63 | }//namespace glm 64 | 65 | #include "intrinsic_matrix.inl" 66 | 67 | #endif//GLM_ARCH 68 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/detail/intrinsic_trigonometric.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/detail/intrinsic_trigonometric.hpp 25 | /// @date 2009-06-09 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #pragma once 30 | 31 | #include "setup.hpp" 32 | 33 | #if(!(GLM_ARCH & GLM_ARCH_SSE2)) 34 | # error "SSE2 instructions not supported or enabled" 35 | #else 36 | 37 | namespace glm{ 38 | namespace detail 39 | { 40 | 41 | }//namespace detail 42 | }//namespace glm 43 | 44 | #include "intrinsic_trigonometric.inl" 45 | 46 | #endif//GLM_ARCH 47 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/detail/intrinsic_trigonometric.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/detail/intrinsic_trigonometric.inl 25 | /// @date 2011-06-15 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/detail/intrinsic_vector_relational.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/detail/intrinsic_vector_relational.hpp 25 | /// @date 2009-06-09 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #pragma once 30 | 31 | #include "setup.hpp" 32 | 33 | #if(!(GLM_ARCH & GLM_ARCH_SSE2)) 34 | # error "SSE2 instructions not supported or enabled" 35 | #else 36 | 37 | namespace glm{ 38 | namespace detail 39 | { 40 | 41 | }//namespace detail 42 | }//namespace glm 43 | 44 | #include "intrinsic_vector_relational.inl" 45 | 46 | #endif//GLM_ARCH 47 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/detail/precision.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/detail/precision.hpp 29 | /// @date 2013-04-01 / 2013-04-01 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | #pragma once 34 | 35 | namespace glm 36 | { 37 | enum precision 38 | { 39 | highp, 40 | mediump, 41 | lowp, 42 | simd, 43 | defaultp = highp 44 | }; 45 | }//namespace glm 46 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/detail/type_half.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/detail/type_half.hpp 29 | /// @date 2008-08-17 / 2011-09-20 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | #pragma once 34 | 35 | #include "setup.hpp" 36 | 37 | namespace glm{ 38 | namespace detail 39 | { 40 | typedef short hdata; 41 | 42 | GLM_FUNC_DECL float toFloat32(hdata value); 43 | GLM_FUNC_DECL hdata toFloat16(float const & value); 44 | 45 | }//namespace detail 46 | }//namespace glm 47 | 48 | #include "type_half.inl" 49 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/detail/type_mat.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/detail/type_mat.inl 29 | /// @date 2011-06-15 / 2011-06-15 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/detail/type_vec.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/detail/type_vec.inl 29 | /// @date 2011-06-15 / 2011-06-15 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/detail/type_vec4_avx.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/detail/type_tvec4_avx.inl 29 | /// @date 2014-12-01 / 2014-12-01 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm{ 34 | namespace detail 35 | { 36 | 37 | }//namespace detail 38 | 39 | 40 | 41 | }//namespace glm 42 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/detail/type_vec4_avx2.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/detail/type_tvec4_avx2.inl 29 | /// @date 2014-12-01 / 2014-12-01 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm{ 34 | namespace detail 35 | { 36 | 37 | }//namespace detail 38 | 39 | 40 | 41 | }//namespace glm 42 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/exponential.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/exponential.hpp 29 | /// @date 2013-12-24 / 2013-12-24 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | #pragma once 34 | 35 | #include "detail/func_exponential.hpp" 36 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/geometric.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/geometric.hpp 29 | /// @date 2013-12-24 / 2013-12-24 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | #pragma once 34 | 35 | #include "detail/func_geometric.hpp" 36 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/gtc/integer.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtc_integer 28 | /// @file glm/gtc/integer.inl 29 | /// @date 2014-11-17 / 2014-11-17 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm{ 34 | namespace detail 35 | { 36 | template class vecType> 37 | struct compute_log2 38 | { 39 | GLM_FUNC_QUALIFIER static vecType call(vecType const & vec) 40 | { 41 | //Equivalent to return findMSB(vec); but save one function call in ASM with VC 42 | //return findMSB(vec); 43 | return vecType(detail::compute_findMSB_vec::call(vec)); 44 | } 45 | }; 46 | 47 | # if GLM_HAS_BITSCAN_WINDOWS 48 | template 49 | struct compute_log2 50 | { 51 | GLM_FUNC_QUALIFIER static tvec4 call(tvec4 const & vec) 52 | { 53 | tvec4 Result(glm::uninitialize); 54 | 55 | _BitScanReverse(reinterpret_cast(&Result.x), vec.x); 56 | _BitScanReverse(reinterpret_cast(&Result.y), vec.y); 57 | _BitScanReverse(reinterpret_cast(&Result.z), vec.z); 58 | _BitScanReverse(reinterpret_cast(&Result.w), vec.w); 59 | 60 | return Result; 61 | } 62 | }; 63 | # endif//GLM_HAS_BITSCAN_WINDOWS 64 | }//namespace detail 65 | }//namespace glm 66 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/gtc/type_precision.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtc_swizzle 28 | /// @file glm/gtc/swizzle.inl 29 | /// @date 2009-06-14 / 2011-06-15 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | 36 | } 37 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/gtc/vec1.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtc_vec1 28 | /// @file glm/gtc/vec1.inl 29 | /// @date 2013-03-16 / 2013-03-16 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/gtx/extend.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_extend 28 | /// @file glm/gtx/extend.hpp 29 | /// @date 2006-01-07 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// 34 | /// @defgroup gtx_extend GLM_GTX_extend 35 | /// @ingroup gtx 36 | /// 37 | /// @brief Extend a position from a source to a position at a defined length. 38 | /// 39 | /// need to be included to use these functionalities. 40 | /////////////////////////////////////////////////////////////////////////////////// 41 | 42 | #pragma once 43 | 44 | // Dependency: 45 | #include "../glm.hpp" 46 | 47 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 48 | # pragma message("GLM: GLM_GTX_extend extension included") 49 | #endif 50 | 51 | namespace glm 52 | { 53 | /// @addtogroup gtx_extend 54 | /// @{ 55 | 56 | /// Extends of Length the Origin position using the (Source - Origin) direction. 57 | /// @see gtx_extend 58 | template 59 | GLM_FUNC_DECL genType extend( 60 | genType const & Origin, 61 | genType const & Source, 62 | typename genType::value_type const Length); 63 | 64 | /// @} 65 | }//namespace glm 66 | 67 | #include "extend.inl" 68 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/gtx/extend.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_extend 28 | /// @file glm/gtx/extend.inl 29 | /// @date 2006-01-07 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER genType extend 37 | ( 38 | genType const & Origin, 39 | genType const & Source, 40 | genType const & Distance 41 | ) 42 | { 43 | return Origin + (Source - Origin) * Distance; 44 | } 45 | 46 | template 47 | GLM_FUNC_QUALIFIER tvec2 extend 48 | ( 49 | tvec2 const & Origin, 50 | tvec2 const & Source, 51 | T const & Distance 52 | ) 53 | { 54 | return Origin + (Source - Origin) * Distance; 55 | } 56 | 57 | template 58 | GLM_FUNC_QUALIFIER tvec3 extend 59 | ( 60 | tvec3 const & Origin, 61 | tvec3 const & Source, 62 | T const & Distance 63 | ) 64 | { 65 | return Origin + (Source - Origin) * Distance; 66 | } 67 | 68 | template 69 | GLM_FUNC_QUALIFIER tvec4 extend 70 | ( 71 | tvec4 const & Origin, 72 | tvec4 const & Source, 73 | T const & Distance 74 | ) 75 | { 76 | return Origin + (Source - Origin) * Distance; 77 | } 78 | }//namespace glm 79 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/gtx/gradient_paint.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_gradient_paint 28 | /// @file glm/gtx/gradient_paint.inl 29 | /// @date 2009-03-06 / 2013-04-09 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER T radialGradient 37 | ( 38 | tvec2 const & Center, 39 | T const & Radius, 40 | tvec2 const & Focal, 41 | tvec2 const & Position 42 | ) 43 | { 44 | tvec2 F = Focal - Center; 45 | tvec2 D = Position - Focal; 46 | T Radius2 = pow2(Radius); 47 | T Fx2 = pow2(F.x); 48 | T Fy2 = pow2(F.y); 49 | 50 | T Numerator = (D.x * F.x + D.y * F.y) + sqrt(Radius2 * (pow2(D.x) + pow2(D.y)) - pow2(D.x * F.y - D.y * F.x)); 51 | T Denominator = Radius2 - (Fx2 + Fy2); 52 | return Numerator / Denominator; 53 | } 54 | 55 | template 56 | GLM_FUNC_QUALIFIER T linearGradient 57 | ( 58 | tvec2 const & Point0, 59 | tvec2 const & Point1, 60 | tvec2 const & Position 61 | ) 62 | { 63 | tvec2 Dist = Point1 - Point0; 64 | return (Dist.x * (Position.x - Point0.x) + Dist.y * (Position.y - Point0.y)) / glm::dot(Dist, Dist); 65 | } 66 | }//namespace glm 67 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/gtx/handed_coordinate_space.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_handed_coordinate_space 28 | /// @file glm/gtx/handed_coordinate_space.inl 29 | /// @date 2005-12-21 / 2009-02-19 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER bool rightHanded 37 | ( 38 | tvec3 const & tangent, 39 | tvec3 const & binormal, 40 | tvec3 const & normal 41 | ) 42 | { 43 | return dot(cross(normal, tangent), binormal) > T(0); 44 | } 45 | 46 | template 47 | GLM_FUNC_QUALIFIER bool leftHanded 48 | ( 49 | tvec3 const & tangent, 50 | tvec3 const & binormal, 51 | tvec3 const & normal 52 | ) 53 | { 54 | return dot(cross(normal, tangent), binormal) < T(0); 55 | } 56 | }//namespace glm 57 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/gtx/log_base.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_log_base 28 | /// @file glm/gtx/log_base.hpp 29 | /// @date 2008-10-24 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// 34 | /// @defgroup gtx_log_base GLM_GTX_log_base 35 | /// @ingroup gtx 36 | /// 37 | /// @brief Logarithm for any base. base can be a vector or a scalar. 38 | /// 39 | /// need to be included to use these functionalities. 40 | /////////////////////////////////////////////////////////////////////////////////// 41 | 42 | #pragma once 43 | 44 | // Dependency: 45 | #include "../glm.hpp" 46 | 47 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 48 | # pragma message("GLM: GLM_GTX_log_base extension included") 49 | #endif 50 | 51 | namespace glm 52 | { 53 | /// @addtogroup gtx_log_base 54 | /// @{ 55 | 56 | //! Logarithm for any base. 57 | //! From GLM_GTX_log_base. 58 | template 59 | GLM_FUNC_DECL genType log( 60 | genType x, 61 | genType base); 62 | 63 | //! Logarithm for any base. 64 | //! From GLM_GTX_log_base. 65 | template class vecType> 66 | GLM_FUNC_DECL vecType sign( 67 | vecType const & x, 68 | vecType const & base); 69 | 70 | /// @} 71 | }//namespace glm 72 | 73 | #include "log_base.inl" 74 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/gtx/log_base.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_log_base 28 | /// @file glm/gtx/log_base.inl 29 | /// @date 2008-10-24 / 2014-11-25 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER genType log(genType const & x, genType const & base) 37 | { 38 | assert(x != genType(0)); 39 | return glm::log(x) / glm::log(base); 40 | } 41 | 42 | template class vecType> 43 | GLM_FUNC_QUALIFIER vecType log(vecType const & x, vecType const & base) 44 | { 45 | return glm::log(x) / glm::log(base); 46 | } 47 | }//namespace glm 48 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/gtx/matrix_cross_product.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_matrix_cross_product 28 | /// @file glm/gtx/matrix_cross_product.hpp 29 | /// @date 2005-12-21 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// @see gtx_extented_min_max (dependence) 34 | /// 35 | /// @defgroup gtx_matrix_cross_product GLM_GTX_matrix_cross_product 36 | /// @ingroup gtx 37 | /// 38 | /// @brief Build cross product matrices 39 | /// 40 | /// need to be included to use these functionalities. 41 | /////////////////////////////////////////////////////////////////////////////////// 42 | 43 | #pragma once 44 | 45 | // Dependency: 46 | #include "../glm.hpp" 47 | 48 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 49 | # pragma message("GLM: GLM_GTX_matrix_cross_product extension included") 50 | #endif 51 | 52 | namespace glm 53 | { 54 | /// @addtogroup gtx_matrix_cross_product 55 | /// @{ 56 | 57 | //! Build a cross product matrix. 58 | //! From GLM_GTX_matrix_cross_product extension. 59 | template 60 | GLM_FUNC_DECL tmat3x3 matrixCross3( 61 | tvec3 const & x); 62 | 63 | //! Build a cross product matrix. 64 | //! From GLM_GTX_matrix_cross_product extension. 65 | template 66 | GLM_FUNC_DECL tmat4x4 matrixCross4( 67 | tvec3 const & x); 68 | 69 | /// @} 70 | }//namespace glm 71 | 72 | #include "matrix_cross_product.inl" 73 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/gtx/matrix_cross_product.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_matrix_cross_product 28 | /// @file glm/gtx/matrix_cross_product.inl 29 | /// @date 2005-12-21 / 2005-12-21 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER tmat3x3 matrixCross3 37 | ( 38 | tvec3 const & x 39 | ) 40 | { 41 | tmat3x3 Result(T(0)); 42 | Result[0][1] = x.z; 43 | Result[1][0] = -x.z; 44 | Result[0][2] = -x.y; 45 | Result[2][0] = x.y; 46 | Result[1][2] = x.x; 47 | Result[2][1] = -x.x; 48 | return Result; 49 | } 50 | 51 | template 52 | GLM_FUNC_QUALIFIER tmat4x4 matrixCross4 53 | ( 54 | tvec3 const & x 55 | ) 56 | { 57 | tmat4x4 Result(T(0)); 58 | Result[0][1] = x.z; 59 | Result[1][0] = -x.z; 60 | Result[0][2] = -x.y; 61 | Result[2][0] = x.y; 62 | Result[1][2] = x.x; 63 | Result[2][1] = -x.x; 64 | return Result; 65 | } 66 | 67 | }//namespace glm 68 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/gtx/mixed_product.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_mixed_product 28 | /// @file glm/gtx/mixed_product.hpp 29 | /// @date 2007-04-03 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// 34 | /// @defgroup gtx_mixed_product GLM_GTX_mixed_producte 35 | /// @ingroup gtx 36 | /// 37 | /// @brief Mixed product of 3 vectors. 38 | /// 39 | /// need to be included to use these functionalities. 40 | /////////////////////////////////////////////////////////////////////////////////// 41 | 42 | #pragma once 43 | 44 | // Dependency: 45 | #include "../glm.hpp" 46 | 47 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 48 | # pragma message("GLM: GLM_GTX_mixed_product extension included") 49 | #endif 50 | 51 | namespace glm 52 | { 53 | /// @addtogroup gtx_mixed_product 54 | /// @{ 55 | 56 | /// @brief Mixed product of 3 vectors (from GLM_GTX_mixed_product extension) 57 | template 58 | GLM_FUNC_DECL T mixedProduct( 59 | tvec3 const & v1, 60 | tvec3 const & v2, 61 | tvec3 const & v3); 62 | 63 | /// @} 64 | }// namespace glm 65 | 66 | #include "mixed_product.inl" 67 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/gtx/mixed_product.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_mixed_product 28 | /// @file glm/gtx/mixed_product.inl 29 | /// @date 2007-04-03 / 2008-09-17 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER T mixedProduct 37 | ( 38 | tvec3 const & v1, 39 | tvec3 const & v2, 40 | tvec3 const & v3 41 | ) 42 | { 43 | return dot(cross(v1, v2), v3); 44 | } 45 | }//namespace glm 46 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/gtx/normal.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_normal 28 | /// @file glm/gtx/normal.hpp 29 | /// @date 2005-12-21 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// @see gtx_extented_min_max (dependence) 34 | /// 35 | /// @defgroup gtx_normal GLM_GTX_normal 36 | /// @ingroup gtx 37 | /// 38 | /// @brief Compute the normal of a triangle. 39 | /// 40 | /// need to be included to use these functionalities. 41 | /////////////////////////////////////////////////////////////////////////////////// 42 | 43 | #pragma once 44 | 45 | // Dependency: 46 | #include "../glm.hpp" 47 | 48 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 49 | # pragma message("GLM: GLM_GTX_normal extension included") 50 | #endif 51 | 52 | namespace glm 53 | { 54 | /// @addtogroup gtx_normal 55 | /// @{ 56 | 57 | //! Computes triangle normal from triangle points. 58 | //! From GLM_GTX_normal extension. 59 | template 60 | GLM_FUNC_DECL tvec3 triangleNormal( 61 | tvec3 const & p1, 62 | tvec3 const & p2, 63 | tvec3 const & p3); 64 | 65 | /// @} 66 | }//namespace glm 67 | 68 | #include "normal.inl" 69 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/gtx/normal.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_normal 28 | /// @file glm/gtx/normal.inl 29 | /// @date 2005-12-21 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER tvec3 triangleNormal 37 | ( 38 | tvec3 const & p1, 39 | tvec3 const & p2, 40 | tvec3 const & p3 41 | ) 42 | { 43 | return normalize(cross(p1 - p2, p1 - p3)); 44 | } 45 | }//namespace glm 46 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/gtx/normalize_dot.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_normalize_dot 28 | /// @file glm/gtx/normalize_dot.inl 29 | /// @date 2007-09-28 / 2008-10-07 30 | /// @author Christophe Riccio 31 | ////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template class vecType> 36 | GLM_FUNC_QUALIFIER T normalizeDot(vecType const & x, vecType const & y) 37 | { 38 | return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y)); 39 | } 40 | 41 | template class vecType> 42 | GLM_FUNC_QUALIFIER T fastNormalizeDot(vecType const & x, vecType const & y) 43 | { 44 | return glm::dot(x, y) * glm::fastInverseSqrt(glm::dot(x, x) * glm::dot(y, y)); 45 | } 46 | }//namespace glm 47 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/gtx/number_precision.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_number_precision 28 | /// @file glm/gtx/number_precision.inl 29 | /// @date 2007-05-10 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | 36 | } 37 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/gtx/optimum_pow.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_optimum_pow 28 | /// @file glm/gtx/optimum_pow.inl 29 | /// @date 2005-12-21 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER genType pow2(genType const & x) 37 | { 38 | return x * x; 39 | } 40 | 41 | template 42 | GLM_FUNC_QUALIFIER genType pow3(genType const & x) 43 | { 44 | return x * x * x; 45 | } 46 | 47 | template 48 | GLM_FUNC_QUALIFIER genType pow4(genType const & x) 49 | { 50 | return (x * x) * (x * x); 51 | } 52 | }//namespace glm 53 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/gtx/orthonormalize.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_orthonormalize 28 | /// @file glm/gtx/orthonormalize.inl 29 | /// @date 2005-12-21 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER tmat3x3 orthonormalize(tmat3x3 const & m) 37 | { 38 | tmat3x3 r = m; 39 | 40 | r[0] = normalize(r[0]); 41 | 42 | T d0 = dot(r[0], r[1]); 43 | r[1] -= r[0] * d0; 44 | r[1] = normalize(r[1]); 45 | 46 | T d1 = dot(r[1], r[2]); 47 | d0 = dot(r[0], r[2]); 48 | r[2] -= r[0] * d0 + r[1] * d1; 49 | r[2] = normalize(r[2]); 50 | 51 | return r; 52 | } 53 | 54 | template 55 | GLM_FUNC_QUALIFIER tvec3 orthonormalize(tvec3 const & x, tvec3 const & y) 56 | { 57 | return normalize(x - y * dot(y, x)); 58 | } 59 | }//namespace glm 60 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/gtx/perpendicular.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_perpendicular 28 | /// @file glm/gtx/perpendicular.hpp 29 | /// @date 2005-12-21 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// @see gtx_projection (dependence) 34 | /// 35 | /// @defgroup gtx_perpendicular GLM_GTX_perpendicular 36 | /// @ingroup gtx 37 | /// 38 | /// @brief Perpendicular of a vector from other one 39 | /// 40 | /// need to be included to use these functionalities. 41 | /////////////////////////////////////////////////////////////////////////////////// 42 | 43 | #pragma once 44 | 45 | // Dependency: 46 | #include "../glm.hpp" 47 | #include "../gtx/projection.hpp" 48 | 49 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 50 | # pragma message("GLM: GLM_GTX_perpendicular extension included") 51 | #endif 52 | 53 | namespace glm 54 | { 55 | /// @addtogroup gtx_perpendicular 56 | /// @{ 57 | 58 | //! Projects x a perpendicular axis of Normal. 59 | //! From GLM_GTX_perpendicular extension. 60 | template 61 | GLM_FUNC_DECL vecType perp( 62 | vecType const & x, 63 | vecType const & Normal); 64 | 65 | /// @} 66 | }//namespace glm 67 | 68 | #include "perpendicular.inl" 69 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/gtx/perpendicular.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_perpendicular 28 | /// @file glm/gtx/perpendicular.inl 29 | /// @date 2005-12-21 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER vecType perp 37 | ( 38 | vecType const & x, 39 | vecType const & Normal 40 | ) 41 | { 42 | return x - proj(x, Normal); 43 | } 44 | }//namespace glm 45 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/gtx/polar_coordinates.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_polar_coordinates 28 | /// @file glm/gtx/polar_coordinates.inl 29 | /// @date 2007-03-06 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER tvec3 polar 37 | ( 38 | tvec3 const & euclidean 39 | ) 40 | { 41 | T const Length(length(euclidean)); 42 | tvec3 const tmp(euclidean / Length); 43 | T const xz_dist(sqrt(tmp.x * tmp.x + tmp.z * tmp.z)); 44 | 45 | return tvec3( 46 | atan(xz_dist, tmp.y), // latitude 47 | atan(tmp.x, tmp.z), // longitude 48 | xz_dist); // xz distance 49 | } 50 | 51 | template 52 | GLM_FUNC_QUALIFIER tvec3 euclidean 53 | ( 54 | tvec2 const & polar 55 | ) 56 | { 57 | T const latitude(polar.x); 58 | T const longitude(polar.y); 59 | 60 | return tvec3( 61 | cos(latitude) * sin(longitude), 62 | sin(latitude), 63 | cos(latitude) * cos(longitude)); 64 | } 65 | 66 | }//namespace glm 67 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/gtx/projection.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_projection 28 | /// @file glm/gtx/projection.hpp 29 | /// @date 2005-12-21 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// 34 | /// @defgroup gtx_projection GLM_GTX_projection 35 | /// @ingroup gtx 36 | /// 37 | /// @brief Projection of a vector to other one 38 | /// 39 | /// need to be included to use these functionalities. 40 | /////////////////////////////////////////////////////////////////////////////////// 41 | 42 | #pragma once 43 | 44 | // Dependency: 45 | #include "../geometric.hpp" 46 | 47 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 48 | # pragma message("GLM: GLM_GTX_projection extension included") 49 | #endif 50 | 51 | namespace glm 52 | { 53 | /// @addtogroup gtx_projection 54 | /// @{ 55 | 56 | /// Projects x on Normal. 57 | /// 58 | /// @see gtx_projection 59 | template 60 | GLM_FUNC_DECL vecType proj(vecType const & x, vecType const & Normal); 61 | 62 | /// @} 63 | }//namespace glm 64 | 65 | #include "projection.inl" 66 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/gtx/projection.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_projection 28 | /// @file glm/gtx/projection.inl 29 | /// @date 2005-12-21 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER vecType proj(vecType const & x, vecType const & Normal) 37 | { 38 | return glm::dot(x, Normal) / glm::dot(Normal, Normal) * Normal; 39 | } 40 | }//namespace glm 41 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/gtx/raw_data.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_raw_data 28 | /// @file glm/gtx/raw_data.hpp 29 | /// @date 2008-11-19 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// 34 | /// @defgroup gtx_raw_data GLM_GTX_raw_data 35 | /// @ingroup gtx 36 | /// 37 | /// @brief Projection of a vector to other one 38 | /// 39 | /// need to be included to use these functionalities. 40 | /////////////////////////////////////////////////////////////////////////////////// 41 | 42 | #pragma once 43 | 44 | // Dependencies 45 | #include "../detail/setup.hpp" 46 | #include "../detail/type_int.hpp" 47 | 48 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 49 | # pragma message("GLM: GLM_GTX_raw_data extension included") 50 | #endif 51 | 52 | namespace glm 53 | { 54 | /// @addtogroup gtx_raw_data 55 | /// @{ 56 | 57 | //! Type for byte numbers. 58 | //! From GLM_GTX_raw_data extension. 59 | typedef detail::uint8 byte; 60 | 61 | //! Type for word numbers. 62 | //! From GLM_GTX_raw_data extension. 63 | typedef detail::uint16 word; 64 | 65 | //! Type for dword numbers. 66 | //! From GLM_GTX_raw_data extension. 67 | typedef detail::uint32 dword; 68 | 69 | //! Type for qword numbers. 70 | //! From GLM_GTX_raw_data extension. 71 | typedef detail::uint64 qword; 72 | 73 | /// @} 74 | }// namespace glm 75 | 76 | #include "raw_data.inl" 77 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/gtx/raw_data.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_raw_data 28 | /// @file glm/gtx/raw_data.inl 29 | /// @date 2008-11-19 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/gtx/scalar_relational.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_scalar_relational 28 | /// @file glm/gtx/scalar_relational.hpp 29 | /// @date 2013-02-04 / 2013-02-04 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// 34 | /// @defgroup gtx_scalar_relational GLM_GTX_scalar_relational 35 | /// @ingroup gtx 36 | /// 37 | /// @brief Extend a position from a source to a position at a defined length. 38 | /// 39 | /// need to be included to use these functionalities. 40 | /////////////////////////////////////////////////////////////////////////////////// 41 | 42 | #pragma once 43 | 44 | // Dependency: 45 | #include "../glm.hpp" 46 | 47 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 48 | # pragma message("GLM: GLM_GTX_extend extension included") 49 | #endif 50 | 51 | namespace glm 52 | { 53 | /// @addtogroup gtx_scalar_relational 54 | /// @{ 55 | 56 | 57 | 58 | /// @} 59 | }//namespace glm 60 | 61 | #include "scalar_relational.inl" 62 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/gtx/std_based_type.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_std_based_type 28 | /// @file glm/gtx/std_based_type.inl 29 | /// @date 2008-06-08 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | 36 | } 37 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/gtx/transform.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_transform 28 | /// @file glm/gtx/transform.inl 29 | /// @date 2005-12-21 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER tmat4x4 translate( 37 | tvec3 const & v) 38 | { 39 | return translate( 40 | tmat4x4(1.0f), v); 41 | } 42 | 43 | template 44 | GLM_FUNC_QUALIFIER tmat4x4 rotate( 45 | T angle, 46 | tvec3 const & v) 47 | { 48 | return rotate( 49 | tmat4x4(1), angle, v); 50 | } 51 | 52 | template 53 | GLM_FUNC_QUALIFIER tmat4x4 scale( 54 | tvec3 const & v) 55 | { 56 | return scale( 57 | tmat4x4(1.0f), v); 58 | } 59 | 60 | }//namespace glm 61 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/gtx/type_aligned.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtc_type_aligned 28 | /// @file glm/gtc/type_aligned.inl 29 | /// @date 2014-11-23 / 2014-11-23 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | 36 | } 37 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/integer.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/integer.hpp 29 | /// @date 2013-12-24 / 2013-12-24 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | #pragma once 34 | 35 | #include "detail/func_integer.hpp" 36 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/matrix.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/matrix.hpp 29 | /// @date 2013-12-24 / 2013-12-24 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | #pragma once 34 | 35 | #include "detail/func_matrix.hpp" 36 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/packing.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/packing.hpp 29 | /// @date 2013-12-24 / 2013-12-24 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | #pragma once 34 | 35 | #include "detail/func_packing.hpp" 36 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/trigonometric.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/trigonometric.hpp 29 | /// @date 2013-12-24 / 2013-12-24 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | #pragma once 34 | 35 | #include "detail/func_trigonometric.hpp" 36 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/vec2.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/vec2.hpp 29 | /// @date 2013-12-24 / 2013-12-24 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | #pragma once 34 | 35 | #include "detail/type_vec2.hpp" 36 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/vec3.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/vec3.hpp 29 | /// @date 2013-12-24 / 2013-12-24 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | #pragma once 34 | 35 | #include "detail/type_vec3.hpp" 36 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/vec4.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/vec4.hpp 29 | /// @date 2013-12-24 / 2013-12-24 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | #pragma once 34 | 35 | #include "detail/type_vec4.hpp" 36 | -------------------------------------------------------------------------------- /JellySimulation/include/glm/vector_relational.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/vector_relational.hpp 29 | /// @date 2013-12-24 / 2013-12-24 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | #pragma once 34 | 35 | #include "detail/func_vector_relational.hpp" 36 | -------------------------------------------------------------------------------- /JellySimulation/lib/SOIL.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FZzzz/JellySimulation/432ebb06bcfc1e17424898f7cacb1d2369214fe8/JellySimulation/lib/SOIL.lib -------------------------------------------------------------------------------- /JellySimulation/lib/SOIL_debug.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FZzzz/JellySimulation/432ebb06bcfc1e17424898f7cacb1d2369214fe8/JellySimulation/lib/SOIL_debug.lib -------------------------------------------------------------------------------- /JellySimulation/lib/SOIL_release.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FZzzz/JellySimulation/432ebb06bcfc1e17424898f7cacb1d2369214fe8/JellySimulation/lib/SOIL_release.lib -------------------------------------------------------------------------------- /JellySimulation/lib/assimp-vc141-md.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FZzzz/JellySimulation/432ebb06bcfc1e17424898f7cacb1d2369214fe8/JellySimulation/lib/assimp-vc141-md.lib -------------------------------------------------------------------------------- /JellySimulation/lib/assimp.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FZzzz/JellySimulation/432ebb06bcfc1e17424898f7cacb1d2369214fe8/JellySimulation/lib/assimp.lib -------------------------------------------------------------------------------- /JellySimulation/lib/assimp/assimp-vc141-md.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FZzzz/JellySimulation/432ebb06bcfc1e17424898f7cacb1d2369214fe8/JellySimulation/lib/assimp/assimp-vc141-md.dll -------------------------------------------------------------------------------- /JellySimulation/lib/assimp/assimp-vc141-md.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FZzzz/JellySimulation/432ebb06bcfc1e17424898f7cacb1d2369214fe8/JellySimulation/lib/assimp/assimp-vc141-md.exp -------------------------------------------------------------------------------- /JellySimulation/lib/assimp/assimp-vc141-md.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FZzzz/JellySimulation/432ebb06bcfc1e17424898f7cacb1d2369214fe8/JellySimulation/lib/assimp/assimp-vc141-md.lib -------------------------------------------------------------------------------- /JellySimulation/lib/glew32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FZzzz/JellySimulation/432ebb06bcfc1e17424898f7cacb1d2369214fe8/JellySimulation/lib/glew32.lib -------------------------------------------------------------------------------- /JellySimulation/lib/glew32s.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FZzzz/JellySimulation/432ebb06bcfc1e17424898f7cacb1d2369214fe8/JellySimulation/lib/glew32s.lib -------------------------------------------------------------------------------- /JellySimulation/lib/glfw3.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FZzzz/JellySimulation/432ebb06bcfc1e17424898f7cacb1d2369214fe8/JellySimulation/lib/glfw3.lib -------------------------------------------------------------------------------- /JellySimulation/lib/glfw3dll.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FZzzz/JellySimulation/432ebb06bcfc1e17424898f7cacb1d2369214fe8/JellySimulation/lib/glfw3dll.lib -------------------------------------------------------------------------------- /JellySimulation/main.cpp: -------------------------------------------------------------------------------- 1 | #include "GLFWApp.h" 2 | #include 3 | #define _CRTDBG_MAP_ALLOC 4 | #include 5 | 6 | // Replace _NORMAL_BLOCK with _CLIENT_BLOCK if you want the 7 | // allocations to be of _CLIENT_BLOCK type 8 | 9 | int main() 10 | { 11 | std::string file_path; 12 | //Create GLFWApp 13 | std::unique_ptr demoApp(GLFWApp::getInstance()); 14 | 15 | demoApp->Initialize(1600, 900, "GLEngine"); 16 | 17 | /* 18 | Add text to App 19 | */ 20 | if (demoApp->GetAppStatus()) 21 | { 22 | demoApp->Run(); 23 | } 24 | 25 | 26 | //release resources 27 | demoApp->ReleaseResources(); 28 | 29 | demoApp.reset(); 30 | #ifdef _DEBUG 31 | //system("pause"); 32 | //_CrtDumpMemoryLeaks(); 33 | #endif 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /JellySimulation/resources/images/black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FZzzz/JellySimulation/432ebb06bcfc1e17424898f7cacb1d2369214fe8/JellySimulation/resources/images/black.png -------------------------------------------------------------------------------- /JellySimulation/resources/images/consolas256X256.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FZzzz/JellySimulation/432ebb06bcfc1e17424898f7cacb1d2369214fe8/JellySimulation/resources/images/consolas256X256.bmp -------------------------------------------------------------------------------- /JellySimulation/resources/images/consolas_regular.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FZzzz/JellySimulation/432ebb06bcfc1e17424898f7cacb1d2369214fe8/JellySimulation/resources/images/consolas_regular.bmp -------------------------------------------------------------------------------- /JellySimulation/resources/images/consolas_regular_32.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FZzzz/JellySimulation/432ebb06bcfc1e17424898f7cacb1d2369214fe8/JellySimulation/resources/images/consolas_regular_32.bmp -------------------------------------------------------------------------------- /JellySimulation/resources/images/consolas_regular_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FZzzz/JellySimulation/432ebb06bcfc1e17424898f7cacb1d2369214fe8/JellySimulation/resources/images/consolas_regular_32.png -------------------------------------------------------------------------------- /JellySimulation/resources/images/poro.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FZzzz/JellySimulation/432ebb06bcfc1e17424898f7cacb1d2369214fe8/JellySimulation/resources/images/poro.jpg -------------------------------------------------------------------------------- /JellySimulation/resources/images/red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FZzzz/JellySimulation/432ebb06bcfc1e17424898f7cacb1d2369214fe8/JellySimulation/resources/images/red.png -------------------------------------------------------------------------------- /JellySimulation/resources/models/bone.mtl: -------------------------------------------------------------------------------- 1 | newmtl initialShadingGroup 2 | illum 4 3 | Kd 0.50 0.50 0.50 4 | Ka 0.00 0.00 0.00 5 | Tf 1.00 1.00 1.00 6 | Ni 1.00 7 | -------------------------------------------------------------------------------- /JellySimulation/resources/models/bone_s.mtl: -------------------------------------------------------------------------------- 1 | newmtl initialShadingGroup 2 | illum 4 3 | Kd 0.50 0.50 0.50 4 | Ka 0.00 0.00 0.00 5 | Tf 1.00 1.00 1.00 6 | Ni 1.00 7 | -------------------------------------------------------------------------------- /JellySimulation/resources/models/cube.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.79 (sub 0) OBJ File: '' 2 | # www.blender.org 3 | mtllib cube.mtl 4 | o Cube 5 | v 1.000000 -1.000000 -1.000000 6 | v 1.000000 -1.000000 1.000000 7 | v -1.000000 -1.000000 1.000000 8 | v -1.000000 -1.000000 -1.000000 9 | v 1.000000 1.000000 -0.999999 10 | v 0.999999 1.000000 1.000001 11 | v -1.000000 1.000000 1.000000 12 | v -1.000000 1.000000 -1.000000 13 | vn 0.0000 -1.0000 0.0000 14 | vn 0.0000 1.0000 0.0000 15 | vn 1.0000 -0.0000 0.0000 16 | vn 0.0000 -0.0000 1.0000 17 | vn -1.0000 -0.0000 -0.0000 18 | vn 0.0000 0.0000 -1.0000 19 | usemtl Material 20 | s off 21 | f 2//1 4//1 1//1 22 | f 8//2 6//2 5//2 23 | f 5//3 2//3 1//3 24 | f 6//4 3//4 2//4 25 | f 3//5 8//5 4//5 26 | f 1//6 8//6 5//6 27 | f 2//1 3//1 4//1 28 | f 8//2 7//2 6//2 29 | f 5//3 6//3 2//3 30 | f 6//4 7//4 3//4 31 | f 3//5 7//5 8//5 32 | f 1//6 4//6 8//6 33 | -------------------------------------------------------------------------------- /JellySimulation/resources/models/robot_body.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.75 (sub 0) OBJ File: 'robot.blend' 2 | # www.blender.org 3 | mtllib robot_body.mtl 4 | o Body_Cube 5 | v 0.437000 -0.303147 -0.587458 6 | v 0.437000 -0.303147 0.287458 7 | v -0.437000 -0.303147 0.287458 8 | v -0.437000 -0.303147 -0.587458 9 | v 0.437000 1.791768 -0.587457 10 | v 0.437000 1.791768 0.287458 11 | v -0.437000 1.791768 0.287458 12 | v -0.437000 1.791768 -0.587458 13 | vn 0.000000 -1.000000 0.000000 14 | vn 0.000000 1.000000 0.000000 15 | vn 1.000000 0.000000 0.000000 16 | vn -0.000000 0.000000 1.000000 17 | vn -1.000000 -0.000000 -0.000000 18 | vn 0.000000 0.000000 -1.000000 19 | usemtl Material 20 | s off 21 | f 1//1 2//1 3//1 22 | f 8//2 7//2 6//2 23 | f 5//3 6//3 2//3 24 | f 6//4 7//4 3//4 25 | f 3//5 7//5 8//5 26 | f 1//6 4//6 8//6 27 | f 4//1 1//1 3//1 28 | f 5//2 8//2 6//2 29 | f 1//3 5//3 2//3 30 | f 2//4 6//4 3//4 31 | f 4//5 3//5 8//5 32 | f 5//6 1//6 8//6 33 | -------------------------------------------------------------------------------- /JellySimulation/resources/models/robot_leftArm.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.75 (sub 0) OBJ File: 'robot.blend' 2 | # www.blender.org 3 | mtllib robot_leftArm.mtl 4 | o LeftArm_Cube.004 5 | v 0.799489 1.489612 0.901735 6 | v 0.799489 1.700217 0.901735 7 | v 0.799489 1.489612 -0.598265 8 | v 0.799489 1.700217 -0.598265 9 | v 1.010094 1.489612 0.901735 10 | v 1.010094 1.700217 0.901735 11 | v 1.010094 1.489612 -0.598265 12 | v 1.010094 1.700217 -0.598265 13 | v 1.025050 1.489612 0.901735 14 | v 1.025050 1.700217 0.901735 15 | v 1.025050 1.489612 -0.598265 16 | v 1.025050 1.700217 -0.598265 17 | v 1.235655 1.489612 0.901735 18 | v 1.235655 1.700217 0.901735 19 | v 1.235655 1.489612 -0.598265 20 | v 1.235655 1.700217 -0.598265 21 | v 0.894697 1.710746 0.901735 22 | v 0.894697 1.921352 0.901735 23 | v 0.894697 1.710746 -0.598265 24 | v 0.894697 1.921352 -0.598265 25 | v 1.105303 1.710746 0.901735 26 | v 1.105303 1.921352 0.901735 27 | v 1.105303 1.710746 -0.598265 28 | v 1.105303 1.921352 -0.598265 29 | vn -1.000000 0.000000 0.000000 30 | vn 0.000000 0.000000 -1.000000 31 | vn 1.000000 0.000000 0.000000 32 | vn 0.000000 0.000000 1.000000 33 | vn 0.000000 -1.000000 0.000000 34 | vn 0.000000 1.000000 0.000000 35 | usemtl None 36 | s off 37 | f 4//1 3//1 1//1 38 | f 8//2 7//2 3//2 39 | f 6//3 5//3 7//3 40 | f 2//4 1//4 5//4 41 | f 3//5 7//5 5//5 42 | f 8//6 4//6 2//6 43 | f 12//1 11//1 9//1 44 | f 16//2 15//2 11//2 45 | f 14//3 13//3 15//3 46 | f 10//4 9//4 13//4 47 | f 11//5 15//5 13//5 48 | f 16//6 12//6 10//6 49 | f 20//1 19//1 17//1 50 | f 24//2 23//2 19//2 51 | f 22//3 21//3 23//3 52 | f 18//4 17//4 21//4 53 | f 19//5 23//5 21//5 54 | f 24//6 20//6 18//6 55 | f 2//1 4//1 1//1 56 | f 4//2 8//2 3//2 57 | f 8//3 6//3 7//3 58 | f 6//4 2//4 5//4 59 | f 1//5 3//5 5//5 60 | f 6//6 8//6 2//6 61 | f 10//1 12//1 9//1 62 | f 12//2 16//2 11//2 63 | f 16//3 14//3 15//3 64 | f 14//4 10//4 13//4 65 | f 9//5 11//5 13//5 66 | f 14//6 16//6 10//6 67 | f 18//1 20//1 17//1 68 | f 20//2 24//2 19//2 69 | f 24//3 22//3 23//3 70 | f 22//4 18//4 21//4 71 | f 17//5 19//5 21//5 72 | f 22//6 24//6 18//6 73 | -------------------------------------------------------------------------------- /JellySimulation/resources/models/robot_rightArm.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.75 (sub 0) OBJ File: 'robot.blend' 2 | # www.blender.org 3 | mtllib robot_rightArm.mtl 4 | o RightArm_Cube.005 5 | v -1.200511 1.489612 0.900000 6 | v -1.200511 1.700217 0.900000 7 | v -1.200511 1.489612 -0.600000 8 | v -1.200511 1.700217 -0.600000 9 | v -0.989906 1.489612 0.900000 10 | v -0.989906 1.700217 0.900000 11 | v -0.989906 1.489612 -0.600000 12 | v -0.989906 1.700217 -0.600000 13 | v -0.974950 1.489612 0.900000 14 | v -0.974950 1.700217 0.900000 15 | v -0.974950 1.489612 -0.600000 16 | v -0.974950 1.700217 -0.600000 17 | v -0.764345 1.489612 0.900000 18 | v -0.764345 1.700217 0.900000 19 | v -0.764345 1.489612 -0.600000 20 | v -0.764345 1.700217 -0.600000 21 | v -1.105303 1.710746 0.900000 22 | v -1.105303 1.921352 0.900000 23 | v -1.105303 1.710746 -0.600000 24 | v -1.105303 1.921352 -0.600000 25 | v -0.894697 1.710746 0.900000 26 | v -0.894697 1.921352 0.900000 27 | v -0.894697 1.710746 -0.600000 28 | v -0.894697 1.921352 -0.600000 29 | vn -1.000000 0.000000 0.000000 30 | vn 0.000000 0.000000 -1.000000 31 | vn 1.000000 0.000000 0.000000 32 | vn 0.000000 0.000000 1.000000 33 | vn 0.000000 -1.000000 0.000000 34 | vn 0.000000 1.000000 0.000000 35 | usemtl None 36 | s off 37 | f 4//1 3//1 1//1 38 | f 8//2 7//2 3//2 39 | f 6//3 5//3 7//3 40 | f 2//4 1//4 5//4 41 | f 3//5 7//5 5//5 42 | f 8//6 4//6 2//6 43 | f 12//1 11//1 9//1 44 | f 16//2 15//2 11//2 45 | f 14//3 13//3 15//3 46 | f 10//4 9//4 13//4 47 | f 11//5 15//5 13//5 48 | f 16//6 12//6 10//6 49 | f 20//1 19//1 17//1 50 | f 24//2 23//2 19//2 51 | f 22//3 21//3 23//3 52 | f 18//4 17//4 21//4 53 | f 19//5 23//5 21//5 54 | f 24//6 20//6 18//6 55 | f 2//1 4//1 1//1 56 | f 4//2 8//2 3//2 57 | f 8//3 6//3 7//3 58 | f 6//4 2//4 5//4 59 | f 1//5 3//5 5//5 60 | f 6//6 8//6 2//6 61 | f 10//1 12//1 9//1 62 | f 12//2 16//2 11//2 63 | f 16//3 14//3 15//3 64 | f 14//4 10//4 13//4 65 | f 9//5 11//5 13//5 66 | f 14//6 16//6 10//6 67 | f 18//1 20//1 17//1 68 | f 20//2 24//2 19//2 69 | f 24//3 22//3 23//3 70 | f 22//4 18//4 21//4 71 | f 17//5 19//5 21//5 72 | f 22//6 24//6 18//6 73 | -------------------------------------------------------------------------------- /JellySimulation/resources/models/robot_tail.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.75 (sub 0) OBJ File: 'robot.blend' 2 | # www.blender.org 3 | mtllib robot_tail.mtl 4 | o tail_Cube.006 5 | v -0.045698 0.347368 -0.563098 6 | v -0.045698 0.438764 -0.563098 7 | v -0.045698 0.347368 -2.309788 8 | v -0.045698 0.438764 -2.309788 9 | v 0.045698 0.347368 -0.563098 10 | v 0.045698 0.438764 -0.563098 11 | v 0.045698 0.347368 -2.309788 12 | v 0.045698 0.438764 -2.309788 13 | vn -1.000000 0.000000 0.000000 14 | vn 0.000000 0.000000 -1.000000 15 | vn 1.000000 0.000000 0.000000 16 | vn 0.000000 0.000000 1.000000 17 | vn 0.000000 -1.000000 0.000000 18 | vn 0.000000 1.000000 0.000000 19 | usemtl None 20 | s off 21 | f 4//1 3//1 1//1 22 | f 8//2 7//2 3//2 23 | f 6//3 5//3 7//3 24 | f 2//4 1//4 5//4 25 | f 3//5 7//5 5//5 26 | f 8//6 4//6 2//6 27 | f 2//1 4//1 1//1 28 | f 4//2 8//2 3//2 29 | f 8//3 6//3 7//3 30 | f 6//4 2//4 5//4 31 | f 1//5 3//5 5//5 32 | f 6//6 8//6 2//6 33 | -------------------------------------------------------------------------------- /JellySimulation/resources/shader/debug_quad_fs.glsl: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | out vec4 FragColor; 3 | 4 | in vec2 TexCoords; 5 | 6 | uniform sampler2D depthMap; 7 | 8 | // required when using a perspective projection matrix 9 | float LinearizeDepth(float depth) 10 | { 11 | float near_plane = 1.0f; 12 | float far_plane = 7.5f; 13 | float z = depth * 2.0 - 1.0; // Back to NDC 14 | return (2.0 * near_plane * far_plane) / (far_plane + near_plane - z * (far_plane - near_plane)); 15 | } 16 | 17 | void main() 18 | { 19 | float depthValue = texture(depthMap, TexCoords).r; 20 | // FragColor = vec4(vec3(LinearizeDepth(depthValue) / far_plane), 1.0); // perspective 21 | FragColor = vec4(vec3(depthValue), 1.0); // orthographic 22 | } -------------------------------------------------------------------------------- /JellySimulation/resources/shader/debug_quad_vs.glsl: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec3 aPos; 3 | layout (location = 1) in vec2 aTexCoords; 4 | 5 | out vec2 TexCoords; 6 | 7 | void main() 8 | { 9 | TexCoords = aTexCoords; 10 | gl_Position = vec4(aPos, 1.0); 11 | } -------------------------------------------------------------------------------- /JellySimulation/resources/shader/df_fs.glsl: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | out vec4 fragColor; 3 | 4 | in vec3 fpos; 5 | 6 | void main() 7 | { 8 | 9 | //vec3 light_pos = vec3(5.0f , 5.0f , 5.0f); 10 | vec3 light_color = vec3(1.0f , 1.0f , 1.0f); 11 | vec3 object_color = vec3(1.0f , 1.0f , 1.0f); 12 | 13 | // ambient 14 | float ambientStrength = 0.1; 15 | vec3 ambient = ambientStrength * light_color; 16 | 17 | // diffuse 18 | vec3 fdx = dFdx(fpos); 19 | vec3 fdy = dFdy(fpos); 20 | vec3 normal = normalize(cross(fdx , fdy)); 21 | vec3 litDir = normalize( vec3(1,2,3)); 22 | float diff = max(dot(normal, litDir), 0.0); 23 | vec3 diffuse = diff * light_color; 24 | 25 | // (x, y, z) * (a, b, c) = (ax, by, cz) 26 | vec3 result = (ambient + diffuse) * object_color; 27 | fragColor = vec4(result, 1.0); 28 | } -------------------------------------------------------------------------------- /JellySimulation/resources/shader/df_vs.glsl: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec3 posIn; 3 | layout (location = 1) in vec3 normalIn; 4 | 5 | out vec3 fpos; 6 | 7 | uniform mat4 pvm; 8 | uniform mat4 modelMat; 9 | 10 | void main() 11 | { 12 | fpos = vec3(modelMat * vec4(posIn, 1.0)); 13 | 14 | gl_Position = pvm * vec4(posIn, 1.0); 15 | } 16 | -------------------------------------------------------------------------------- /JellySimulation/resources/shader/dfdx_fragment.glsl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FZzzz/JellySimulation/432ebb06bcfc1e17424898f7cacb1d2369214fe8/JellySimulation/resources/shader/dfdx_fragment.glsl -------------------------------------------------------------------------------- /JellySimulation/resources/shader/dfdx_vertex.glsl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FZzzz/JellySimulation/432ebb06bcfc1e17424898f7cacb1d2369214fe8/JellySimulation/resources/shader/dfdx_vertex.glsl -------------------------------------------------------------------------------- /JellySimulation/resources/shader/flat_fragment.glsl: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | // Default color buffer location is 0 4 | // If you create framebuffer your own, you need to take care of it 5 | in vec3 fColor; 6 | 7 | out vec4 color; 8 | 9 | void main() 10 | { 11 | color = vec4(fColor, 1.0); 12 | //color = vec4( 1.0f , 1.0f , 1.0f , 1.0f ); 13 | 14 | } -------------------------------------------------------------------------------- /JellySimulation/resources/shader/flat_geometry.glsl: -------------------------------------------------------------------------------- 1 | #version 330 2 | layout(triangles) in; 3 | layout(triangle_strip, max_vertices = 3) out; 4 | //simple calculate normals and output fColor 5 | 6 | //uniform vec3 light_pos; 7 | //uniform vec3 light_color; 8 | 9 | in vec3 pos[3]; 10 | //in vec3 vertexColor[3]; 11 | 12 | out vec3 fColor; 13 | 14 | 15 | void main() 16 | { 17 | 18 | //vec3 light_pos = vec3(5.0f , 5.0f , 5.0f); 19 | 20 | vec3 light_color = vec3(1.0f , 1.0f , 1.0f); 21 | 22 | vec3 object_color = vec3(1.0f , 1.0f , 1.0f); 23 | 24 | vec3 v1 = pos[1] - pos[0]; 25 | vec3 v2 = pos[2] - pos[0]; 26 | 27 | vec3 center = ( pos[0] + pos[1] + pos[2] )/ 3.0f; 28 | vec3 normal = normalize(cross(v1,v2)); 29 | 30 | float ambientStrength = 0.05f; 31 | vec3 ambient = ambientStrength * light_color; 32 | 33 | vec3 light_dir = normalize( vec3(-1,-1,-1) ); 34 | float diff = max(dot(normal , light_dir) , 0.0); 35 | vec3 diffuse = diff * light_color; 36 | 37 | fColor = (ambient + diffuse) * object_color; 38 | //fColor = vec3(1.0f,1.0f,1.0f); 39 | for(int i=0;i<3;i++) 40 | { 41 | gl_Position = gl_in[i].gl_Position; 42 | //fColor = vec3(1.0f,1.0f,1.0f); 43 | EmitVertex(); 44 | } 45 | 46 | EndPrimitive(); 47 | } -------------------------------------------------------------------------------- /JellySimulation/resources/shader/flat_vertex.glsl: -------------------------------------------------------------------------------- 1 | #version 330 2 | layout(location=0) in vec3 position; 3 | layout(location=1) in vec3 normal; 4 | layout(location=2) in vec3 color; 5 | 6 | uniform mat4 pvm; 7 | uniform mat4 modelMat; 8 | uniform bool hasNormal; 9 | 10 | out vec3 pos; 11 | //out vec3 vertexColor; 12 | 13 | void main() 14 | { 15 | 16 | pos = mat3(modelMat) * position; 17 | gl_Position = pvm * vec4(position, 1.0f); 18 | 19 | //pos = vec3(modelMat * vec4(position , 1.0f)); 20 | 21 | //vertexColor = color; 22 | 23 | } -------------------------------------------------------------------------------- /JellySimulation/resources/shader/font_fragment.glsl: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | // Default color buffer location is 0 4 | // If you create framebuffer your own, you need to take care of it 5 | in vec3 vertexColor; 6 | in vec2 vertexTex; 7 | 8 | out vec4 color; 9 | 10 | uniform sampler2D tex1; 11 | 12 | void main() 13 | { 14 | //color = vec4(vertexColor, 1.0); 15 | //color = vec4( 1.0f , 1.0f , 1.0f , 1.0f ); 16 | vec4 texColor = texture( tex1 , vertexTex); 17 | 18 | if(texColor.a < 0.1f) 19 | discard; 20 | color = texColor; 21 | } 22 | -------------------------------------------------------------------------------- /JellySimulation/resources/shader/font_vertex.glsl: -------------------------------------------------------------------------------- 1 | #version 330 2 | layout(location=0) in vec3 position; 3 | layout(location=1) in vec3 color; 4 | layout(location=2) in vec2 texcoord; 5 | 6 | uniform mat4 pvm; 7 | uniform mat4 modelMat; 8 | 9 | out vec3 vertexColor; 10 | out vec2 vertexTex; 11 | 12 | void main() 13 | { 14 | 15 | gl_Position = pvm * vec4(position, 1.0f); 16 | 17 | vertexColor = color; 18 | vertexTex = vec2(texcoord.x , 1-texcoord.y); 19 | } 20 | -------------------------------------------------------------------------------- /JellySimulation/resources/shader/fragment.glsl: -------------------------------------------------------------------------------- 1 | #version 410 2 | 3 | // Default color buffer location is 0 4 | // If you create framebuffer your own, you need to take care of it 5 | flat in vec3 vertexColor; 6 | 7 | out vec4 color; 8 | 9 | void main() 10 | { 11 | color = vec4(vertexColor, 1.0); 12 | //color = vec4( 1.0f , 1.0f , 1.0f , 1.0f ); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /JellySimulation/resources/shader/phong_fs.glsl: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | out vec4 fragColor; 3 | 4 | in vec3 fpos; 5 | in vec3 fnormal; 6 | 7 | void main() 8 | { 9 | 10 | vec3 light_pos = vec3(5.0f , 5.0f , 5.0f); 11 | vec3 view_pos = vec3(5.0f,5.0f,5.0f); 12 | 13 | vec3 light_color = vec3(1.0f , 1.0f , 1.0f); 14 | vec3 object_color = vec3(1.0f , 1.0f , 1.0f); 15 | 16 | // ambient 17 | float ambientStrength = 0.1; 18 | vec3 ambient = ambientStrength * light_color; 19 | 20 | // diffuse 21 | vec3 litDir = normalize(light_pos- fpos); 22 | float diff = max(dot(fnormal, litDir), 0.0); 23 | vec3 diffuse = diff * light_color; 24 | 25 | //spceular 26 | float specStrength = 0.5; 27 | 28 | vec3 view_dir = normalize(view_pos - fpos); 29 | vec3 reflect_dir = reflect(-litDir, fnormal); 30 | float spec = pow(max( dot(view_dir, reflect_dir), 0.0) , 32); 31 | vec3 specular = specStrength * spec * light_color; 32 | 33 | 34 | // (x, y, z) * (a, b, c) = (ax, by, cz) 35 | vec3 result = (ambient + diffuse + specular) * object_color; 36 | fragColor = vec4(result, 1.0); 37 | } -------------------------------------------------------------------------------- /JellySimulation/resources/shader/phong_vs.glsl: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec3 posIn; 3 | layout (location = 1) in vec3 normalIn; 4 | 5 | out vec3 fpos; 6 | out vec3 fnormal; 7 | 8 | uniform mat4 pvm; 9 | uniform mat4 modelMat; 10 | 11 | void main() 12 | { 13 | fpos = vec3(modelMat * vec4(posIn, 1.0)); 14 | fnormal = normalize( vec3(modelMat * vec4(normalIn, 0.0)) ); 15 | 16 | gl_Position = pvm * vec4(posIn, 1.0); 17 | } 18 | -------------------------------------------------------------------------------- /JellySimulation/resources/shader/point_sprite_fs.glsl: -------------------------------------------------------------------------------- 1 | #version 410 2 | 3 | in vec3 light_dir; 4 | 5 | uniform mat4 view; 6 | 7 | out vec4 frag_color; 8 | 9 | void main() 10 | { 11 | vec3 n; 12 | n.xy = gl_PointCoord.xy * 2.f - 1.f; 13 | n.z = 1.f - dot(n.xy, n.xy); 14 | 15 | if(n.z < 0.f) 16 | discard; 17 | 18 | n.z = sqrt(n.z); 19 | /*transform with modelview matrix*/ 20 | //vec3 m = normalize(gl_NormalMatrix * n); 21 | float diffuse = dot(light_dir, n); 22 | frag_color.xyz = vec3(diffuse); 23 | frag_color.w = 1.f; 24 | } -------------------------------------------------------------------------------- /JellySimulation/resources/shader/point_sprite_vs.glsl: -------------------------------------------------------------------------------- 1 | #version 410 2 | 3 | layout (location = 0) in vec3 aPos; 4 | 5 | uniform mat4 pvm; 6 | uniform float point_size; 7 | uniform vec3 light_pos; 8 | uniform mat4 view; 9 | 10 | out vec3 light_dir; 11 | 12 | void main() 13 | { 14 | light_dir = normalize(vec3(light_pos - vec3(view * vec4(aPos, 1.f)))); 15 | gl_Position = pvm * vec4(aPos, 1.0f); 16 | gl_PointSize = point_size; 17 | } -------------------------------------------------------------------------------- /JellySimulation/resources/shader/shadow_mapping_vs.glsl: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec3 aPos; 3 | layout (location = 1) in vec3 aNormal; 4 | layout (location = 2) in vec2 aTexCoords; 5 | 6 | out vec2 TexCoords; 7 | 8 | out VS_OUT { 9 | vec3 FragPos; 10 | vec2 TexCoords; 11 | vec4 FragPosLightSpace; 12 | } vs_out; 13 | 14 | uniform mat4 pvm; 15 | //uniform mat4 view; 16 | uniform mat4 modelMat; 17 | uniform mat4 lightSpaceMatrix; 18 | 19 | void main() 20 | { 21 | vs_out.FragPos = vec3(modelMat * vec4(aPos, 1.0)); 22 | //vs_out.Normal = transpose(inverse(mat3(model))) * aNormal; 23 | //vs_out.TexCoords = aTexCoords; 24 | vs_out.FragPosLightSpace = lightSpaceMatrix * vec4(vs_out.FragPos, 1.0); 25 | gl_Position = pvm * vec4(aPos, 1.0); 26 | } -------------------------------------------------------------------------------- /JellySimulation/resources/shader/shadow_mapping_vs_adv.glsl: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec3 aPos; 3 | layout (location = 1) in vec3 aNormal; 4 | layout (location = 2) in vec2 aTexCoords; 5 | 6 | layout (std140) uniform Matrices 7 | { 8 | mat4 projection; 9 | mat4 view; 10 | mat4 lightSpaceMatrix; 11 | }; 12 | 13 | out VS_OUT { 14 | vec3 FragPos; 15 | vec2 TexCoords; 16 | vec4 FragPosLightSpace; 17 | } vs_out; 18 | 19 | //uniform mat4 pvm; 20 | //uniform mat4 view; 21 | uniform mat4 modelMat; 22 | //uniform mat4 lightSpaceMatrix; 23 | 24 | void main() 25 | { 26 | vs_out.FragPos = vec3(modelMat * vec4(aPos, 1.0)); 27 | //vs_out.Normal = transpose(inverse(mat3(model))) * aNormal; 28 | //vs_out.TexCoords = aTexCoords; 29 | vs_out.FragPosLightSpace = lightSpaceMatrix * vec4(vs_out.FragPos, 1.0); 30 | gl_Position = projection * view * modelMat * vec4(aPos, 1.0); 31 | } 32 | -------------------------------------------------------------------------------- /JellySimulation/resources/shader/simple_depth_fs.glsl: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | 3 | void main() 4 | { 5 | // gl_FragDepth = gl_FragCoord.z; 6 | } -------------------------------------------------------------------------------- /JellySimulation/resources/shader/simple_depth_vs.glsl: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | layout (location = 0) in vec3 aPos; 3 | 4 | uniform mat4 lightSpaceMatrix; 5 | uniform mat4 modelMat; 6 | 7 | void main() 8 | { 9 | gl_Position = lightSpaceMatrix * modelMat * vec4(aPos, 1.0); 10 | } -------------------------------------------------------------------------------- /JellySimulation/resources/shader/vertex.glsl: -------------------------------------------------------------------------------- 1 | #version 410 2 | layout(location=0) in vec3 position; 3 | layout(location=1) in vec3 normal; 4 | 5 | //layout(location=2) in vec3 color; 6 | 7 | uniform mat4 pvm; 8 | uniform mat4 modelMat; 9 | 10 | flat out vec3 vertexColor; 11 | 12 | void main() 13 | { 14 | /* 15 | 16 | vec3 obj_color = vec3(1,1,1); 17 | float ambient = 0.1f; 18 | vec3 light_color = vec3(1.0); 19 | vec3 light_pos = vec3(10,10,10); 20 | vec3 light_dir = normalize(light_pos - position); 21 | float diff = max(dot(normal , light_dir) , 0.0); 22 | vec3 diffuse = diff * light_color; 23 | 24 | */ 25 | gl_Position = pvm * vec4(position, 1.0f); 26 | 27 | //vertexColor = (ambient + diffuse) * obj_color;//vec3(1.0f,1.0f,1.0f); 28 | vertexColor = vec3(1.0,1.0,1.0); 29 | 30 | } 31 | --------------------------------------------------------------------------------