.. _program_listing_file__home_runner_work_Legion-Engine_Legion-Engine_legion_engine_physics_systems_physics_fracture_test_system.hpp: Program Listing for File physics_fracture_test_system.hpp ========================================================= |exhale_lsh| :ref:`Return to documentation for file ` (``/home/runner/work/Legion-Engine/Legion-Engine/legion/engine/physics/systems/physics_fracture_test_system.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #pragma once #include #include #include using namespace legion; struct extendedPhysicsContinue : public app::input_action {}; struct nextPhysicsTimeStepContinue : public app::input_action {}; struct physics_split_test : public app::input_action {}; struct spawnEntity : public app::input_action {}; struct smallExplosion : public app::input_action {}; struct mediumExplosion : public app::input_action {}; struct largeExplosion : public app::input_action {}; struct explosion : public app::input_action {}; namespace legion::physics { class PhysicsFractureTestSystem final : public System { public: virtual void setup(); virtual void colliderDraw(time::span dt); private: void CreateElongatedFloor(math::vec3 position,math::quat rot, math::vec3 scale, rendering::material_handle mat, bool hasCollider =true); ecs::entity_handle CreateSplitTestBox(physics::cube_collider_params cubeParams, math::vec3 position, math::quat rotation, rendering::material_handle mat, bool isFracturable, bool hasRigidbody = false , math::vec3 velocity = math::vec3(), float explosionStrength = 0.0f, float explosionTime = FLT_MAX, math::vec3 impactPoint = math::vec3(-69.0f,0.0f,0.0f), bool hasCollider = true); void OnSplit(physics_split_test* action); void meshSplittingTest(rendering::model_handle planeH, rendering::model_handle cubeH , rendering::model_handle cylinderH, rendering::model_handle complexH, rendering::material_handle TextureH); void collisionResolutionTest(rendering::model_handle cubeH, rendering::material_handle wireframeH); void fractureVideoScene(); void prematureExplosion(explosion* action); void numericalRobustnessTest(); void extendedContinuePhysics(extendedPhysicsContinue * action); void OneTimeContinuePhysics(nextPhysicsTimeStepContinue * action); void spawnCubeStack(math::vec3 start); void compositeColliderTest(); void explosionTest(); void spawnEntityOnCameraForward(spawnEntity * action); void simpleMinecraftHouse(math::vec3 start); void createFloor(int xCount, int yCount, math::vec3 start, math::vec3 offset, rendering::model_handle cubeH, std::vector< rendering::material_handle> materials , std::vector ignoreJ, std::vector shouldFracture , float fractureTime = FLT_MAX, math::vec3 impactPoint = math::vec3(), bool hasRigidbodies = false,float strength =0.0f,bool hasCollider = true); void smallExplosionTest(smallExplosion*action); void mediumExplosionTest(mediumExplosion*action); void largeExplosionTest(largeExplosion*action); void explodeAThing(time::span); enum explosionType : int { NO_BOOM = 0, SMALL_BOOM = 1, MEDIUM_BOOM = 2, BIG_BOOM = 4, }; explosionType m_boom = explosionType::NO_BOOM; void fractureTest(); rendering::material_handle textureH; rendering::material_handle woodTextureH; rendering::material_handle rockTextureH; rendering::material_handle concreteH; rendering::material_handle tileH; rendering::material_handle directionalLightMH; rendering::material_handle brickH; rendering::model_handle cubeH; rendering::model_handle concaveTestObject; rendering::model_handle planeH; rendering::model_handle cylinderH; rendering::model_handle complexH; rendering::model_handle directionalLightH; ecs::entity_handle smallExplosionEnt; ecs::entity_handle mediumExplosionEnt; ecs::entity_handle largeExplosionEnt; ecs::entity_handle staticToAABBEntLinear, staticToAABBEntRotation, staticToOBBEnt, staticToEdgeEnt; }; }