├── .github └── workflows │ ├── build-push-unity.yml │ ├── build_documentation.yml │ ├── build_pr_documentation.yml │ ├── delete_doc_comment.yml │ ├── pip.yml │ ├── quality.yml │ ├── tests-no-deps.yml │ ├── tests.yml │ ├── unused │ ├── activation.yml │ └── test-unity.yml │ └── wheels.yml ├── .gitignore ├── CMakeLists.txt ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── MANIFEST.in ├── Makefile ├── README.md ├── SECURITY.md ├── docs ├── README.md └── source │ ├── _toctree.yml │ ├── api │ ├── actors.mdx │ ├── actuators.mdx │ ├── joints.mdx │ ├── lights.mdx │ ├── objects.mdx │ ├── physics.mdx │ ├── reward_functions.mdx │ ├── rl_env.mdx │ ├── scenes.mdx │ └── sensors.mdx │ ├── assets │ ├── api.png │ ├── rl.png │ ├── simulate_library.png │ ├── simulate_reward_function_predicates.png │ ├── simulate_sb3_basic_maze.png │ ├── simulate_sb3_collectables.png │ ├── simulate_sb3_move_boxes.png │ ├── simulate_sb3_procgen.png │ └── simulate_sb3_see_reward.png │ ├── conceptual │ ├── backends.mdx │ ├── gltf.mdx │ └── philosophy.mdx │ ├── howto │ ├── map_pools.mdx │ ├── plugins.mdx │ ├── rl.mdx │ ├── run_on_gcp.mdx │ └── sample_factory.mdx │ ├── index.mdx │ ├── installation.mdx │ ├── quicktour.mdx │ └── tutorials │ ├── creating_a_scene.mdx │ ├── interaction.mdx │ └── running_the_simulation.mdx ├── examples ├── README.md ├── __init__.py ├── advanced │ ├── __init__.py │ ├── cartpole.py │ ├── doors_plugin.py │ ├── lunar_lander.py │ └── mountaincar.py ├── basic │ ├── __init__.py │ ├── create_and_save.py │ ├── objects.py │ ├── simple_physics.py │ └── structured_grid_test.py ├── intermediate │ ├── __init__.py │ ├── multi_agent_playground.py │ ├── playground.py │ ├── procgen_grid.py │ ├── reward_functions.py │ └── tmaze.py ├── notebooks │ ├── __init__.py │ └── quick_tour.ipynb ├── rl │ ├── __init__.py │ ├── sb3_basic_maze.py │ ├── sb3_collectables.py │ ├── sb3_move_boxes.py │ ├── sb3_multiprocess.py │ ├── sb3_procgen.py │ └── sb3_visual_reward.py ├── robot.py ├── shapenet.py ├── under_construction │ ├── __init__.py │ ├── advanced_physics.py │ ├── maze2d.py │ ├── maze2denvs.py │ └── pendulum.py └── under_the_hood │ ├── __init__.py │ ├── blender_example.py │ ├── echo_gltf.py │ ├── gltf_loading_test.py │ └── godot_example.py ├── integrations ├── Blender │ ├── README.md │ └── simulate_blender │ │ ├── __init__.py │ │ ├── client.py │ │ ├── simenv_op.py │ │ ├── simenv_pnl.py │ │ └── simulator.py ├── Godot │ ├── README.md │ └── simulate_godot │ │ ├── .gitattributes │ │ ├── .gitignore │ │ ├── Scenes │ │ └── scene.tscn │ │ ├── Simulate │ │ ├── Bridge │ │ │ ├── client.gd │ │ │ └── command.gd │ │ ├── Commands │ │ │ ├── close.gd │ │ │ ├── initialize.gd │ │ │ ├── reset.gd │ │ │ └── step.gd │ │ ├── GLTF │ │ │ ├── gltf_enums.gd │ │ │ ├── hf_actuator.gd │ │ │ ├── hf_articulation_body.gd │ │ │ ├── hf_collider.gd │ │ │ ├── hf_extensions.gd │ │ │ ├── hf_physic_material.gd │ │ │ ├── hf_raycast_sensor.gd │ │ │ ├── hf_reward_function.gd │ │ │ ├── hf_rigid_body.gd │ │ │ └── hf_state_sensor.gd │ │ ├── RLAgents │ │ │ ├── agent.gd │ │ │ ├── agent_manager.gd │ │ │ ├── reward_function.gd │ │ │ └── rl_action.gd │ │ ├── debug_camera.gd │ │ ├── render_camera.gd │ │ ├── simulation_node.gd │ │ └── simulator.gd │ │ ├── icon.png │ │ ├── icon.png.import │ │ └── project.godot └── Unity │ ├── README.md │ ├── simulate-unity │ ├── .gitignore │ ├── Assets │ │ ├── GLTF.meta │ │ ├── MountainCar.meta │ │ ├── MountainCar │ │ │ ├── Cart.cs │ │ │ ├── Cart.cs.meta │ │ │ ├── MountainCar.asmdef │ │ │ ├── MountainCar.asmdef.meta │ │ │ ├── MountainCarPlugin.cs │ │ │ └── MountainCarPlugin.cs.meta │ │ ├── Plugins.meta │ │ ├── Plugins │ │ │ ├── Doors.meta │ │ │ └── Doors │ │ │ │ ├── src.zip │ │ │ │ └── src.zip.meta │ │ ├── Resources.meta │ │ ├── Resources │ │ │ ├── DefaultEmissive.mat │ │ │ ├── DefaultEmissive.mat.meta │ │ │ ├── DefaultLit.mat │ │ │ ├── DefaultLit.mat.meta │ │ │ ├── Plugins.meta │ │ │ ├── Singletons.meta │ │ │ └── Singletons │ │ │ │ ├── Client.asset │ │ │ │ └── Client.asset.meta │ │ ├── Scenes.meta │ │ ├── Scenes │ │ │ ├── SampleScene.meta │ │ │ ├── SampleScene.unity │ │ │ ├── SampleScene.unity.meta │ │ │ ├── SampleScene │ │ │ │ ├── PostProcessing Profile.asset │ │ │ │ └── PostProcessing Profile.asset.meta │ │ │ ├── URPAsset.asset │ │ │ ├── URPAsset.asset.meta │ │ │ ├── URPAsset_Renderer.asset │ │ │ ├── URPAsset_Renderer.asset.meta │ │ │ ├── URPGlobalSettings.asset │ │ │ └── URPGlobalSettings.asset.meta │ │ ├── Simulate.meta │ │ ├── Simulate │ │ │ ├── Editor.meta │ │ │ ├── Editor │ │ │ │ ├── GLBImporterEditor.cs │ │ │ │ ├── GLBImporterEditor.cs.meta │ │ │ │ ├── GLTFAssetUtility.cs │ │ │ │ ├── GLTFAssetUtility.cs.meta │ │ │ │ ├── GLTFImporterEditor.cs │ │ │ │ ├── GLTFImporterEditor.cs.meta │ │ │ │ ├── SimEnvEditor.asmdef │ │ │ │ └── SimEnvEditor.asmdef.meta │ │ │ ├── README.md │ │ │ ├── README.md.meta │ │ │ ├── Runtime.meta │ │ │ └── Runtime │ │ │ │ ├── Bridge.meta │ │ │ │ ├── Bridge │ │ │ │ ├── Client.cs │ │ │ │ ├── Client.cs.meta │ │ │ │ ├── Close.cs │ │ │ │ ├── Close.cs.meta │ │ │ │ ├── Initialize.cs │ │ │ │ ├── Initialize.cs.meta │ │ │ │ ├── Reset.cs │ │ │ │ ├── Reset.cs.meta │ │ │ │ ├── Step.cs │ │ │ │ ├── Step.cs.meta │ │ │ │ ├── TestEchoGLTF.cs │ │ │ │ └── TestEchoGLTF.cs.meta │ │ │ │ ├── GLTF.meta │ │ │ │ ├── GLTF │ │ │ │ ├── AnimationSettings.cs │ │ │ │ ├── AnimationSettings.cs.meta │ │ │ │ ├── BufferedBinaryReader.cs │ │ │ │ ├── BufferedBinaryReader.cs.meta │ │ │ │ ├── Converters.meta │ │ │ │ ├── Converters │ │ │ │ │ ├── ColorConverter.cs │ │ │ │ │ ├── ColorConverter.cs.meta │ │ │ │ │ ├── EnumConverter.cs │ │ │ │ │ ├── EnumConverter.cs.meta │ │ │ │ │ ├── Matrix4x4Converter.cs │ │ │ │ │ ├── Matrix4x4Converter.cs.meta │ │ │ │ │ ├── QuaternionConverter.cs │ │ │ │ │ ├── QuaternionConverter.cs.meta │ │ │ │ │ ├── TranslationConverter.cs │ │ │ │ │ ├── TranslationConverter.cs.meta │ │ │ │ │ ├── Vector2Converter.cs │ │ │ │ │ ├── Vector2Converter.cs.meta │ │ │ │ │ ├── Vector3Converter.cs │ │ │ │ │ └── Vector3Converter.cs.meta │ │ │ │ ├── Enums.cs │ │ │ │ ├── Enums.cs.meta │ │ │ │ ├── Exporter.cs │ │ │ │ ├── Exporter.cs.meta │ │ │ │ ├── GLTFAccessor.cs │ │ │ │ ├── GLTFAccessor.cs.meta │ │ │ │ ├── GLTFAnimation.cs │ │ │ │ ├── GLTFAnimation.cs.meta │ │ │ │ ├── GLTFAsset.cs │ │ │ │ ├── GLTFAsset.cs.meta │ │ │ │ ├── GLTFBuffer.cs │ │ │ │ ├── GLTFBuffer.cs.meta │ │ │ │ ├── GLTFBufferView.cs │ │ │ │ ├── GLTFBufferView.cs.meta │ │ │ │ ├── GLTFCamera.cs │ │ │ │ ├── GLTFCamera.cs.meta │ │ │ │ ├── GLTFExtensions.cs │ │ │ │ ├── GLTFExtensions.cs.meta │ │ │ │ ├── GLTFImage.cs │ │ │ │ ├── GLTFImage.cs.meta │ │ │ │ ├── GLTFMaterial.cs │ │ │ │ ├── GLTFMaterial.cs.meta │ │ │ │ ├── GLTFMesh.cs │ │ │ │ ├── GLTFMesh.cs.meta │ │ │ │ ├── GLTFNode.cs │ │ │ │ ├── GLTFNode.cs.meta │ │ │ │ ├── GLTFObject.cs │ │ │ │ ├── GLTFObject.cs.meta │ │ │ │ ├── GLTFPrimitive.cs │ │ │ │ ├── GLTFPrimitive.cs.meta │ │ │ │ ├── GLTFScene.cs │ │ │ │ ├── GLTFScene.cs.meta │ │ │ │ ├── GLTFSkin.cs │ │ │ │ ├── GLTFSkin.cs.meta │ │ │ │ ├── GLTFTexture.cs │ │ │ │ ├── GLTFTexture.cs.meta │ │ │ │ ├── HF_actuators.cs │ │ │ │ ├── HF_actuators.cs.meta │ │ │ │ ├── HF_articulation_bodies.cs │ │ │ │ ├── HF_articulation_bodies.cs.meta │ │ │ │ ├── HF_colliders.cs │ │ │ │ ├── HF_colliders.cs.meta │ │ │ │ ├── HF_physic_materials.cs │ │ │ │ ├── HF_physic_materials.cs.meta │ │ │ │ ├── HF_raycast_sensors.cs │ │ │ │ ├── HF_raycast_sensors.cs.meta │ │ │ │ ├── HF_reward_functions.cs │ │ │ │ ├── HF_reward_functions.cs.meta │ │ │ │ ├── HF_rigid_bodies.cs │ │ │ │ ├── HF_rigid_bodies.cs.meta │ │ │ │ ├── HF_state_sensors.cs │ │ │ │ ├── HF_state_sensors.cs.meta │ │ │ │ ├── ImportSettings.cs │ │ │ │ ├── ImportSettings.cs.meta │ │ │ │ ├── Importer.cs │ │ │ │ ├── Importer.cs.meta │ │ │ │ ├── KHR_lights_punctual.cs │ │ │ │ ├── KHR_lights_punctual.cs.meta │ │ │ │ ├── KHR_texture_transform.cs │ │ │ │ └── KHR_texture_transform.cs.meta │ │ │ │ ├── Helpers.meta │ │ │ │ ├── Helpers │ │ │ │ ├── Extensions.cs │ │ │ │ ├── Extensions.cs.meta │ │ │ │ ├── Singleton.cs │ │ │ │ └── Singleton.cs.meta │ │ │ │ ├── Node.cs │ │ │ │ ├── Node.cs.meta │ │ │ │ ├── Plugins.meta │ │ │ │ ├── Plugins │ │ │ │ ├── ICommand.cs │ │ │ │ ├── ICommand.cs.meta │ │ │ │ ├── IGLTFExtension.cs │ │ │ │ ├── IGLTFExtension.cs.meta │ │ │ │ ├── IPlugin.cs │ │ │ │ ├── IPlugin.cs.meta │ │ │ │ ├── PluginBase.cs │ │ │ │ └── PluginBase.cs.meta │ │ │ │ ├── RLActors.meta │ │ │ │ ├── RLActors │ │ │ │ ├── Actions.cs │ │ │ │ ├── Actions.cs.meta │ │ │ │ ├── Actor.cs │ │ │ │ ├── Actor.cs.meta │ │ │ │ ├── Map.cs │ │ │ │ ├── Map.cs.meta │ │ │ │ ├── MapPool.cs │ │ │ │ ├── MapPool.cs.meta │ │ │ │ ├── RLPlugin.cs │ │ │ │ ├── RLPlugin.cs.meta │ │ │ │ ├── RewardFunction.cs │ │ │ │ ├── RewardFunction.cs.meta │ │ │ │ ├── Sensors.meta │ │ │ │ ├── Sensors │ │ │ │ │ ├── CameraSensor.cs │ │ │ │ │ ├── CameraSensor.cs.meta │ │ │ │ │ ├── ISensors.cs │ │ │ │ │ ├── ISensors.cs.meta │ │ │ │ │ ├── JsonHelper.cs │ │ │ │ │ ├── JsonHelper.cs.meta │ │ │ │ │ ├── RaycastSensor.cs │ │ │ │ │ ├── RaycastSensor.cs.meta │ │ │ │ │ ├── StateSensor.cs │ │ │ │ │ └── StateSensor.cs.meta │ │ │ │ ├── SimEnv.RLAgents.asmdef │ │ │ │ └── SimEnv.RLAgents.asmdef.meta │ │ │ │ ├── RenderCamera.cs │ │ │ │ ├── RenderCamera.cs.meta │ │ │ │ ├── Simulate.asmdef │ │ │ │ ├── Simulate.asmdef.meta │ │ │ │ ├── Simulation.meta │ │ │ │ ├── Simulation │ │ │ │ ├── Config.cs │ │ │ │ ├── Config.cs.meta │ │ │ │ ├── EventData.cs │ │ │ │ └── EventData.cs.meta │ │ │ │ ├── Simulator.cs │ │ │ │ ├── Simulator.cs.meta │ │ │ │ ├── Tests.meta │ │ │ │ ├── Tests │ │ │ │ ├── EditMode.meta │ │ │ │ ├── EditMode │ │ │ │ │ ├── EditMode.asmdef │ │ │ │ │ ├── EditMode.asmdef.meta │ │ │ │ │ ├── TestRewardFunctions.cs │ │ │ │ │ └── TestRewardFunctions.cs.meta │ │ │ │ ├── PlayMode.meta │ │ │ │ └── PlayMode │ │ │ │ │ ├── PlayMode.asmdef │ │ │ │ │ ├── PlayMode.asmdef.meta │ │ │ │ │ ├── TestRewardFunctions.cs │ │ │ │ │ └── TestRewardFunctions.cs.meta │ │ │ │ ├── Utils.meta │ │ │ │ └── Utils │ │ │ │ ├── DebugCam.cs │ │ │ │ └── DebugCam.cs.meta │ │ ├── StreamingAssets.meta │ │ ├── Tests.meta │ │ └── Tests │ │ │ ├── Tests.asmdef │ │ │ └── Tests.asmdef.meta │ ├── Packages │ │ ├── manifest.json │ │ └── packages-lock.json │ └── ProjectSettings │ │ ├── AudioManager.asset │ │ ├── BurstAotSettings_StandaloneLinux64.json │ │ ├── BurstAotSettings_StandaloneOSX.json │ │ ├── BurstAotSettings_StandaloneWindows.json │ │ ├── BurstAotSettings_WebGL 2.json │ │ ├── BurstAotSettings_WebGL.json │ │ ├── ClusterInputManager.asset │ │ ├── CommonBurstAotSettings.json │ │ ├── DynamicsManager.asset │ │ ├── EditorBuildSettings.asset │ │ ├── EditorSettings.asset │ │ ├── GraphicsSettings.asset │ │ ├── InputManager.asset │ │ ├── MemorySettings.asset │ │ ├── NavMeshAreas.asset │ │ ├── PackageManagerSettings.asset │ │ ├── Packages │ │ └── com.unity.testtools.codecoverage │ │ │ └── Settings.json │ │ ├── Physics2DSettings.asset │ │ ├── PresetManager.asset │ │ ├── ProjectSettings.asset │ │ ├── ProjectVersion.txt │ │ ├── QualitySettings.asset │ │ ├── SceneTemplateSettings.json │ │ ├── ShaderGraphSettings 2.asset │ │ ├── ShaderGraphSettings 3.asset │ │ ├── ShaderGraphSettings 4.asset │ │ ├── ShaderGraphSettings.asset │ │ ├── TagManager.asset │ │ ├── TimeManager.asset │ │ ├── URPProjectSettings.asset │ │ ├── UnityConnectSettings.asset │ │ ├── VFXManager.asset │ │ ├── VersionControlSettings.asset │ │ ├── XRSettings.asset │ │ └── boot.config │ └── tests │ ├── __init__.py │ ├── conftest.py │ ├── test_action_add_force.py │ ├── test_action_add_torque.py │ ├── test_action_change_position.py │ └── test_action_metadata.py ├── pyproject.toml ├── setup.cfg ├── setup.py ├── src └── simulate │ ├── __init__.py │ ├── assets │ ├── __init__.py │ ├── action_mapping.py │ ├── actors.py │ ├── actuator.py │ ├── anytree │ │ ├── __init__.py │ │ ├── abstractiter.py │ │ ├── exceptions.py │ │ ├── nodemixin.py │ │ ├── preorderiter.py │ │ └── render.py │ ├── articulation_body.py │ ├── asset.py │ ├── camera.py │ ├── collider.py │ ├── gltf_export.py │ ├── gltf_extension.py │ ├── gltf_import.py │ ├── gltflib │ │ ├── __init__.py │ │ ├── __version__.py │ │ ├── enums │ │ │ ├── __init__.py │ │ │ ├── accessor_type.py │ │ │ ├── alpha_mode.py │ │ │ ├── animation_target_path.py │ │ │ ├── buffer_target.py │ │ │ ├── camera_type.py │ │ │ ├── component_type.py │ │ │ ├── interpolation.py │ │ │ ├── primitive_mode.py │ │ │ └── rigidbody_constraints.py │ │ ├── gltf.py │ │ ├── gltf_resource.py │ │ ├── models │ │ │ ├── __init__.py │ │ │ ├── accessor.py │ │ │ ├── animation.py │ │ │ ├── animation_sampler.py │ │ │ ├── asset.py │ │ │ ├── attributes.py │ │ │ ├── base_model.py │ │ │ ├── buffer.py │ │ │ ├── buffer_view.py │ │ │ ├── camera.py │ │ │ ├── channel.py │ │ │ ├── extensions │ │ │ │ ├── __init__.py │ │ │ │ └── khr_lights_ponctual.py │ │ │ ├── gltf_model.py │ │ │ ├── image.py │ │ │ ├── material.py │ │ │ ├── mesh.py │ │ │ ├── named_base_model.py │ │ │ ├── node.py │ │ │ ├── normal_texture_info.py │ │ │ ├── occlusion_texture_info.py │ │ │ ├── orthographic_camera_info.py │ │ │ ├── pbr_metallic_roughness.py │ │ │ ├── perspective_camera_info.py │ │ │ ├── primitive.py │ │ │ ├── sampler.py │ │ │ ├── scene.py │ │ │ ├── skin.py │ │ │ ├── sparse.py │ │ │ ├── sparse_indices.py │ │ │ ├── sparse_values.py │ │ │ ├── target.py │ │ │ ├── texture.py │ │ │ └── texture_info.py │ │ └── utils │ │ │ ├── __init__.py │ │ │ ├── data_utils.py │ │ │ ├── file_utils.py │ │ │ └── json_utils.py │ ├── light.py │ ├── material.py │ ├── object.py │ ├── physic_material.py │ ├── procgen │ │ ├── __init__.py │ │ ├── constants.py │ │ ├── prims │ │ │ ├── __init__.py │ │ │ └── build_map.py │ │ └── wfc │ │ │ ├── __init__.py │ │ │ ├── build_map.py │ │ │ ├── wfc_utils.py │ │ │ └── wfc_wrapping.py │ ├── reward_functions.py │ ├── rigid_body.py │ ├── sensors.py │ ├── spaces │ │ ├── __init__.py │ │ ├── box.py │ │ ├── dict.py │ │ ├── discrete.py │ │ ├── multi_binary.py │ │ ├── multi_discrete.py │ │ ├── seeding.py │ │ ├── space.py │ │ ├── tuple.py │ │ └── utils.py │ └── utils.py │ ├── config.py │ ├── engine │ ├── __init__.py │ ├── blender_engine.py │ ├── engine.py │ ├── godot_engine.py │ ├── notebook_engine.py │ ├── notebook_viewer.zip │ ├── pyvista_engine.py │ └── unity_engine.py │ ├── rl │ ├── __init__.py │ ├── multi_proc_rl_env.py │ ├── parallel_rl_env.py │ └── rl_env.py │ ├── scene.py │ └── utils │ ├── __init__.py │ ├── imports.py │ └── logging.py ├── tests ├── __init__.py ├── conftest.py ├── test_assets │ ├── fixtures │ │ └── Box.gltf │ ├── test_actor.py │ ├── test_asset.py │ ├── test_camera.py │ ├── test_collider.py │ ├── test_controller.py │ ├── test_gltf.py │ ├── test_light.py │ ├── test_material.py │ ├── test_object.py │ ├── test_reward.py │ ├── test_rigidbody_component.py │ ├── test_sensor.py │ ├── test_utils.py │ └── test_wfc_wrapping.py ├── test_engine │ ├── __init__.py │ └── test_pyvista.py ├── test_gltflib │ ├── README.md │ ├── __init__.py │ ├── e2e │ │ ├── __init__.py │ │ └── test_roundtrip.py │ ├── samples │ │ └── custom │ │ │ ├── BadEncoding │ │ │ ├── glb │ │ │ │ ├── utf-16-be.glb │ │ │ │ ├── utf-16-le.glb │ │ │ │ ├── utf-8-bom.glb │ │ │ │ └── windows-1252.glb │ │ │ └── gltf │ │ │ │ ├── utf-16-be.gltf │ │ │ │ ├── utf-16-le.gltf │ │ │ │ ├── utf-8-bom.gltf │ │ │ │ └── windows-1252.gltf │ │ │ ├── Corrupt │ │ │ ├── BinaryChunkEOF.glb │ │ │ └── JsonChunkEOF.glb │ │ │ ├── EmptyChunk │ │ │ └── EmptyBinaryChunk.glb │ │ │ ├── External │ │ │ ├── external.glb │ │ │ └── external.gltf │ │ │ ├── Minimal │ │ │ └── minimal.gltf │ │ │ └── MultipleChunks │ │ │ └── MultipleChunks.glb │ ├── unit │ │ ├── __init__.py │ │ ├── test_gltf.py │ │ └── test_gltf_model.py │ └── util.py ├── test_rl │ ├── __init__.py │ └── test_wrappers │ │ ├── __init__.py │ │ ├── create_env.py │ │ └── test_parallel_simenv.py └── test_scene.py └── third-party ├── CMakeLists.txt ├── fastwfc ├── CMakeLists.txt ├── Makefile ├── cmake │ └── fastwfcTargets.cmake.in ├── fastwfc_py.cpp ├── include │ └── fastwfc │ │ ├── direction.hpp │ │ ├── overlapping_wfc.hpp │ │ ├── propagator.hpp │ │ ├── run_wfc.hpp │ │ ├── tiling_wfc.hpp │ │ ├── utils │ │ ├── array2D.hpp │ │ └── array3D.hpp │ │ ├── wave.hpp │ │ └── wfc.hpp └── src │ ├── propagator.cpp │ ├── run_wfc.cpp │ ├── wave.cpp │ └── wfc.cpp └── vhacd ├── CMakeLists.txt ├── Makefile ├── cmake ├── vhacdConfig.cmake.in └── vhacdTargets.cmake.in ├── include └── vhacd │ └── VHACD.h └── vhacd_py.cpp /.github/workflows/build_documentation.yml: -------------------------------------------------------------------------------- 1 | name: Build documentation 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | - doc-builder* 8 | - v*-release 9 | 10 | jobs: 11 | build: 12 | uses: huggingface/doc-builder/.github/workflows/build_main_documentation.yml@main 13 | with: 14 | commit_sha: ${{ github.sha }} 15 | package: simulate 16 | install_libgl1: true 17 | -------------------------------------------------------------------------------- /.github/workflows/build_pr_documentation.yml: -------------------------------------------------------------------------------- 1 | name: Build PR Documentation 2 | 3 | on: 4 | pull_request: 5 | 6 | concurrency: 7 | group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} 8 | cancel-in-progress: true 9 | 10 | jobs: 11 | build: 12 | uses: huggingface/doc-builder/.github/workflows/build_pr_documentation.yml@main 13 | with: 14 | commit_sha: ${{ github.event.pull_request.head.sha }} 15 | pr_number: ${{ github.event.number }} 16 | package: simulate 17 | install_libgl1: true -------------------------------------------------------------------------------- /.github/workflows/delete_doc_comment.yml: -------------------------------------------------------------------------------- 1 | name: Delete dev documentation 2 | 3 | on: 4 | pull_request: 5 | types: [ closed ] 6 | 7 | 8 | jobs: 9 | delete: 10 | uses: huggingface/doc-builder/.github/workflows/delete_doc_comment.yml@main 11 | with: 12 | pr_number: ${{ github.event.number }} 13 | package: simulate -------------------------------------------------------------------------------- /.github/workflows/pip.yml: -------------------------------------------------------------------------------- 1 | name: Pip 2 | 3 | on: 4 | workflow_dispatch: 5 | pull_request: 6 | push: 7 | branches: 8 | - master 9 | 10 | concurrency: 11 | group: ${{ github.workflow }}-${{ github.ref }} 12 | cancel-in-progress: true 13 | 14 | jobs: 15 | build: 16 | strategy: 17 | fail-fast: false 18 | matrix: 19 | platform: [windows-latest, macos-latest, ubuntu-latest] 20 | python-version: ["3.8", "3.10"] 21 | 22 | runs-on: ${{ matrix.platform }} 23 | 24 | steps: 25 | - uses: actions/checkout@v3 26 | 27 | - uses: actions/setup-python@v4 28 | with: 29 | python-version: ${{ matrix.python-version }} 30 | 31 | - name: Add requirements 32 | run: python -m pip install --upgrade wheel setuptools 33 | 34 | - name: Build and install 35 | run: pip install --verbose . 36 | 37 | - name: Test 38 | run: python -c "import simulate as sm; scene = sm.Scene() + sm.Box()" 39 | -------------------------------------------------------------------------------- /.github/workflows/quality.yml: -------------------------------------------------------------------------------- 1 | name: Quality Check 2 | 3 | on: [pull_request] 4 | 5 | jobs: 6 | quality: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v2 10 | - name: Set up Python 3.8 11 | uses: actions/setup-python@v3 12 | with: 13 | python-version: 3.8 14 | - name: Install Python dependencies 15 | run: pip install -e .[quality] 16 | - name: Run Quality check 17 | run: make quality 18 | -------------------------------------------------------------------------------- /.github/workflows/tests-no-deps.yml: -------------------------------------------------------------------------------- 1 | name: Run simple loading test 2 | 3 | on: [pull_request] 4 | 5 | env: 6 | HF_HOME: ~/hf_cache 7 | 8 | jobs: 9 | run-tests: 10 | runs-on: ubuntu-latest 11 | 12 | strategy: 13 | # see discussion at https://github.com/pyvista/pyvista/issues/2867 14 | matrix: 15 | include: 16 | - python-version: '3.8' 17 | vtk-version: '9.0.3' 18 | 19 | steps: 20 | - uses: actions/checkout@v3 21 | 22 | - name: Set up Python ${{ matrix.python-version }} 23 | uses: actions/setup-python@v4 24 | with: 25 | python-version: ${{ matrix.python-version }} 26 | 27 | - uses: actions/cache@v3 28 | with: 29 | path: ~/.cache/pip 30 | key: Python-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.vtk-version }}-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements_test.txt') }} 31 | restore-keys: | 32 | Python-${{ runner.os }}-${{ matrix.python-version }} 33 | 34 | - name: Install the library 35 | run: | 36 | pip install --upgrade pip 37 | pip install . 38 | 39 | - name: Set up vtk 40 | if: ${{ matrix.vtk-version != 'latest' }} 41 | run: pip install vtk==${{ matrix.vtk-version }} 42 | 43 | - name: Run Simple loading test 44 | run: | 45 | python -c "import simulate as sm; scene = sm.Scene() + sm.Box()" 46 | -------------------------------------------------------------------------------- /.github/workflows/unused/activation.yml: -------------------------------------------------------------------------------- 1 | name: Acquire activation file 2 | on: 3 | workflow_dispatch: {} 4 | jobs: 5 | activation: 6 | name: Request manual activation file 🔑 7 | runs-on: ubuntu-latest 8 | steps: 9 | # Request manual activation file 10 | - name: Request manual activation file 11 | id: getManualLicenseFile 12 | uses: game-ci/unity-request-activation-file@v2 13 | # Upload artifact (Unity_v20XX.X.XXXX.alf) 14 | - name: Expose as artifact 15 | uses: actions/upload-artifact@v2 16 | with: 17 | name: ${{ steps.getManualLicenseFile.outputs.filePath }} 18 | path: ${{ steps.getManualLicenseFile.outputs.filePath }} 19 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include LICENSE 2 | include README.md 3 | include src/simulate/engine/viewer.zip 4 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 15 | 16 | Each major version is currently being supported with security updates. 17 | 18 | | Version | Supported | 19 | | ------- | ------------------ | 20 | | 1.x.x | :white_check_mark: | 21 | 22 | 23 | ## Reporting a Vulnerability 24 | 31 | 32 | To report a security vulnerability, please contact: feedback@huggingface.co 33 | -------------------------------------------------------------------------------- /docs/source/api/actors.mdx: -------------------------------------------------------------------------------- 1 | 12 | 13 | # Actors 14 | 15 | [[autodoc]] SimpleActor 16 | 17 | [[autodoc]] EgocentricCameraActor 18 | 19 | 20 | Under construction 🚧. -------------------------------------------------------------------------------- /docs/source/api/actuators.mdx: -------------------------------------------------------------------------------- 1 | 12 | 13 | # Actuators 14 | 15 | [[autodoc]] Actuator 16 | 17 | 18 | Under construction 🚧. -------------------------------------------------------------------------------- /docs/source/api/joints.mdx: -------------------------------------------------------------------------------- 1 | 12 | 13 | # Articulation Bodies 14 | 15 | There are two primary types of articulation supported by Simulate: 16 | 1. `Prismatic` joints: slide along a specified axis, 17 | 2. `Revolute` joints: rotate about a specified axis. 18 | 19 | *Note* that these are currently only implemented in **Unity**. 20 | 21 | [[autodoc]] ArticulationBodyComponent -------------------------------------------------------------------------------- /docs/source/api/lights.mdx: -------------------------------------------------------------------------------- 1 | 12 | 13 | # Lights 14 | 15 | [[autodoc]] Light 16 | 17 | 18 | Under construction 🚧. -------------------------------------------------------------------------------- /docs/source/api/objects.mdx: -------------------------------------------------------------------------------- 1 | 12 | 13 | # Objects 14 | 15 | The base object class is `Object3D`. 16 | 17 | [[autodoc]] Object3D 18 | 19 | ## Other included objects 20 | 21 | [[autodoc]] Plane 22 | 23 | [[autodoc]] Sphere 24 | 25 | [[autodoc]] Capsule 26 | 27 | [[autodoc]] Cylinder 28 | 29 | [[autodoc]] Box 30 | 31 | [[autodoc]] Cone 32 | 33 | [[autodoc]] Line 34 | 35 | [[autodoc]] MultipleLines 36 | 37 | [[autodoc]] Tube 38 | 39 | [[autodoc]] Polygon 40 | 41 | [[autodoc]] RegularPolygon 42 | 43 | [[autodoc]] Ring 44 | 45 | [[autodoc]] Text3D 46 | 47 | [[autodoc]] Triangle 48 | 49 | [[autodoc]] Rectangle 50 | 51 | [[autodoc]] Circle 52 | 53 | [[autodoc]] StructuredGrid 54 | 55 | [[autodoc]] ProcGenGrid 56 | 57 | [[autodoc]] ProcGenPrimsMaze3D 58 | -------------------------------------------------------------------------------- /docs/source/api/physics.mdx: -------------------------------------------------------------------------------- 1 | 12 | 13 | # Rigid Bodies 14 | 15 | [[autodoc]] RigidBodyComponent -------------------------------------------------------------------------------- /docs/source/api/rl_env.mdx: -------------------------------------------------------------------------------- 1 | 12 | 13 | # RL Environment Wrappers 14 | 15 | [[autodoc]] RLEnv 16 | 17 | [[autodoc]] ParallelRLEnv 18 | 19 | [[autodoc]] MultiProcessRLEnv 20 | -------------------------------------------------------------------------------- /docs/source/api/scenes.mdx: -------------------------------------------------------------------------------- 1 | 12 | 13 | # Scenes 14 | 15 | Under construction 🚧. -------------------------------------------------------------------------------- /docs/source/api/sensors.mdx: -------------------------------------------------------------------------------- 1 | 12 | 13 | # Sensors 14 | 15 | Three types of Sensor are provided in Simulate: 16 | - Camera sensors - for RGB observations 17 | - State sensors - For measurements of positions & rotations 18 | - Raycast sensors - for depth measurements. 19 | 20 | 21 | 22 | [[autodoc]] Camera 23 | 24 | [[autodoc]] StateSensor 25 | 26 | [[autodoc]] RaycastSensor -------------------------------------------------------------------------------- /docs/source/assets/api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huggingface/simulate/1a7832e46bd4702490e223612a528b586fb36eb1/docs/source/assets/api.png -------------------------------------------------------------------------------- /docs/source/assets/rl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huggingface/simulate/1a7832e46bd4702490e223612a528b586fb36eb1/docs/source/assets/rl.png -------------------------------------------------------------------------------- /docs/source/assets/simulate_library.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huggingface/simulate/1a7832e46bd4702490e223612a528b586fb36eb1/docs/source/assets/simulate_library.png -------------------------------------------------------------------------------- /docs/source/assets/simulate_reward_function_predicates.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huggingface/simulate/1a7832e46bd4702490e223612a528b586fb36eb1/docs/source/assets/simulate_reward_function_predicates.png -------------------------------------------------------------------------------- /docs/source/assets/simulate_sb3_basic_maze.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huggingface/simulate/1a7832e46bd4702490e223612a528b586fb36eb1/docs/source/assets/simulate_sb3_basic_maze.png -------------------------------------------------------------------------------- /docs/source/assets/simulate_sb3_collectables.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huggingface/simulate/1a7832e46bd4702490e223612a528b586fb36eb1/docs/source/assets/simulate_sb3_collectables.png -------------------------------------------------------------------------------- /docs/source/assets/simulate_sb3_move_boxes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huggingface/simulate/1a7832e46bd4702490e223612a528b586fb36eb1/docs/source/assets/simulate_sb3_move_boxes.png -------------------------------------------------------------------------------- /docs/source/assets/simulate_sb3_procgen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huggingface/simulate/1a7832e46bd4702490e223612a528b586fb36eb1/docs/source/assets/simulate_sb3_procgen.png -------------------------------------------------------------------------------- /docs/source/assets/simulate_sb3_see_reward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huggingface/simulate/1a7832e46bd4702490e223612a528b586fb36eb1/docs/source/assets/simulate_sb3_see_reward.png -------------------------------------------------------------------------------- /docs/source/conceptual/backends.mdx: -------------------------------------------------------------------------------- 1 | 12 | 13 | # Backends 14 | 15 | 16 | Simulate is designed to work with multiple backends to give users flexibility over the usage of their environment. 17 | 18 |

19 |
20 | 21 |
22 |

23 | 24 | Under construction 🚧. -------------------------------------------------------------------------------- /docs/source/conceptual/gltf.mdx: -------------------------------------------------------------------------------- 1 | 12 | 13 | # GLTF 14 | 15 | Environments in the Simulate library are saved in an extension of the [GLTF 2.0 format](https://registry.khronos.org/glTF/) 16 | 17 | We provide tools to define assets that are GLTF extensions, by inheriting from GltfExtensionMixin. -------------------------------------------------------------------------------- /docs/source/howto/plugins.mdx: -------------------------------------------------------------------------------- 1 | 12 | 13 | # Under construction -------------------------------------------------------------------------------- /docs/source/howto/sample_factory.mdx: -------------------------------------------------------------------------------- 1 | 12 | 13 | # Using Sample Factory for high throughput training 14 | 15 | Under construction 🚧. -------------------------------------------------------------------------------- /docs/source/installation.mdx: -------------------------------------------------------------------------------- 1 | 12 | 13 | # 💻 Installation 14 | 15 | 🤗 Simulate can be installed in python using pip: 16 | ``` 17 | pip install simulate 18 | ``` 19 | 20 | 🤗 Simulate comes with additional support for reinforcement learning libraries, including gym: 21 | ``` 22 | pip install simulate[gym] 23 | ``` 24 | 25 | stable baselines 3: 26 | ``` 27 | pip install simulate[sb3] 28 | ``` 29 | 30 | and sample-factory (experimental): 31 | ``` 32 | pip install simulate[sf] 33 | ``` 34 | 35 | Verify that 🤗 Simulate is working correctly by showing a simple scene: 36 | ``` 37 | import simulate as sm 38 | scene = sm.Scene(engine="Unity") 39 | scene += sm.LightSun() + sm.Box() 40 | scene.show() 41 | ``` 42 | -------------------------------------------------------------------------------- /docs/source/tutorials/interaction.mdx: -------------------------------------------------------------------------------- 1 | 12 | 13 | # Under construction -------------------------------------------------------------------------------- /examples/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huggingface/simulate/1a7832e46bd4702490e223612a528b586fb36eb1/examples/__init__.py -------------------------------------------------------------------------------- /examples/advanced/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huggingface/simulate/1a7832e46bd4702490e223612a528b586fb36eb1/examples/advanced/__init__.py -------------------------------------------------------------------------------- /examples/basic/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huggingface/simulate/1a7832e46bd4702490e223612a528b586fb36eb1/examples/basic/__init__.py -------------------------------------------------------------------------------- /examples/basic/create_and_save.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The HuggingFace Authors. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Lint as: python3 16 | 17 | import simulate as sm 18 | 19 | 20 | # This example showcases basic scene assembly and saving as a gltf 21 | if __name__ == "__main__": 22 | 23 | # creates a basic scene and saves as gltf 24 | scene = sm.Scene(engine="pyvista") 25 | 26 | # add light source 27 | scene += sm.LightSun() 28 | 29 | # add objects to scene 30 | scene += [sm.Sphere(position=[1, 0, 0], with_collider=True), sm.Box(name="target", position=[0, 2.5, 0])] 31 | 32 | # the print function returns a tree for scene 33 | print(scene) 34 | # This should return the following 35 | # Scene(engine='PyVistaEngine') 36 | # ├── light_sun_00(LightSun) 37 | # ├── sphere_00(Sphere) 38 | # │ └── sphere_00_collider(Collider) 39 | # └── target(Box) 40 | # └── target_collider(Collider) 41 | 42 | # save the scene 43 | scene.save("output/test.gltf") 44 | 45 | scene.show() 46 | 47 | input("Press enter to end this example.") 48 | -------------------------------------------------------------------------------- /examples/basic/structured_grid_test.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The HuggingFace Authors. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Lint as: python3 16 | 17 | import numpy as np 18 | 19 | import simulate as sm 20 | 21 | 22 | # This example tests the StructuredGrid object in Simulate 23 | if __name__ == "__main__": 24 | scene = sm.Scene(engine="unity") 25 | 26 | # Create mesh data 27 | x = np.arange(-5, 5, 0.25) 28 | z = np.arange(-5, 5, 0.25) 29 | x, z = np.meshgrid(x, z) 30 | r = np.sqrt(x**2 + z**2) 31 | y = np.sin(r) 32 | 33 | # convert the array to a 3d object 34 | scene += sm.StructuredGrid(x, y, z) 35 | 36 | # add a lightsun for rendering 37 | scene += sm.LightSun() 38 | scene += sm.Camera(position=[0, 5, -15], rotation=[0, 1, 0, 0]) 39 | scene.show() 40 | 41 | input("Press enter to end this example.") 42 | scene.close() 43 | -------------------------------------------------------------------------------- /examples/intermediate/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huggingface/simulate/1a7832e46bd4702490e223612a528b586fb36eb1/examples/intermediate/__init__.py -------------------------------------------------------------------------------- /examples/notebooks/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huggingface/simulate/1a7832e46bd4702490e223612a528b586fb36eb1/examples/notebooks/__init__.py -------------------------------------------------------------------------------- /examples/rl/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huggingface/simulate/1a7832e46bd4702490e223612a528b586fb36eb1/examples/rl/__init__.py -------------------------------------------------------------------------------- /examples/under_construction/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huggingface/simulate/1a7832e46bd4702490e223612a528b586fb36eb1/examples/under_construction/__init__.py -------------------------------------------------------------------------------- /examples/under_construction/pendulum.py: -------------------------------------------------------------------------------- 1 | from cmath import pi 2 | 3 | import matplotlib.pyplot as plt 4 | import numpy as np 5 | from matplotlib import use 6 | 7 | import simulate as sm 8 | from simulate.assets import material 9 | from simulate.assets.reward_functions import RewardFunction 10 | 11 | 12 | scene = sm.Scene(engine="unity", config=sm.Config(time_step=1 / 30.0, frame_skip=4)) 13 | 14 | scene += sm.LightSun() 15 | scene += sm.Camera( 16 | name="cam", 17 | camera_type="orthographic", 18 | xmag=1, 19 | ymag=1, 20 | zfar=100, 21 | znear=0.001, 22 | position=[0, 1, -10], 23 | width=256, 24 | height=144, 25 | ) 26 | 27 | # Define a immovable base as the root of the scene (could also just be the scene itself but here we see it) 28 | root = sm.Sphere(name="root", radius=0.01, position=[0, 0, 0], material=sm.Material.BLUE) 29 | root.physics_component = sm.ArticulationBodyComponent("fixed", immovable=True, use_gravity=False) 30 | scene += root 31 | 32 | # Pendulum is child of the root 33 | pendulum = sm.Cylinder( 34 | name="pendulum", position=[0, -0.5, -0.025], height=1, radius=0.01, material=material.Material.RED, is_actor=True 35 | ) 36 | pendulum.physics_component = sm.ArticulationBodyComponent("revolute", immovable=False, use_gravity=True) 37 | pendulum.actuator = sm.Actuator( 38 | low=-2.0, 39 | high=2.0, 40 | shape=(1,), 41 | mapping=sm.ActionMapping("add_torque", axis=[1, 0, 0], amplitude=3, max_velocity_threshold=8.0), 42 | ) 43 | root += pendulum 44 | 45 | pendulum += sm.StateSensor(root, pendulum, "rotation") 46 | 47 | scene.save("test.gltf") 48 | 49 | scene2 = sm.Scene.create_from("test.gltf") 50 | 51 | env = sm.RLEnv(scene) 52 | 53 | for i in range(10): 54 | event = env.step(action=1.0) 55 | -------------------------------------------------------------------------------- /examples/under_the_hood/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huggingface/simulate/1a7832e46bd4702490e223612a528b586fb36eb1/examples/under_the_hood/__init__.py -------------------------------------------------------------------------------- /examples/under_the_hood/blender_example.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The HuggingFace Authors. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import simulate as sm 16 | 17 | 18 | # This example shows how a scene can be rendered with the Blender animation tool. 19 | 20 | 21 | def create_scene(): 22 | # create a scene with the blender engine 23 | scene = sm.Scene(engine="blender") 24 | 25 | # load an asset from the hub 26 | scene += sm.Asset.create_from("simulate-tests/Chair/glTF-Binary/SheenChair.glb", name="chair") 27 | 28 | # add light and a camera 29 | scene += sm.Light(name="sun", position=[0, 20, 0], intensity=0.9) 30 | scene += sm.Camera(name="cam1", position=[2, 3, 2], rotation=[-45, 45, 0], width=1024, height=1024) 31 | scene.show() 32 | 33 | # optional scene saving as image: uncomment to render the scene to an image in the desired folder 34 | # scene.render(path="") 35 | scene.close() 36 | 37 | 38 | if __name__ == "__main__": 39 | create_scene() 40 | -------------------------------------------------------------------------------- /integrations/Blender/README.md: -------------------------------------------------------------------------------- 1 | ## Blender Integration 2 | 3 | ### Install addon in Blender 4 | This integration has been developed for Blender 3.2. You can install Blender from [this page](https://www.blender.org/download/) 5 | 6 | - Launch Blender 7 | - Go to `Edit > Preferences > Add-ons > Install...` 8 | - Select the `simulate_blender.zip` file next to this README.md file 9 | 10 | ### Run in Blender 11 | - You might need to run Blender with admin rights 12 | - You can find an example script using the `simulate` API in `simulate/examples/blender_example.py` to create a scene 13 | - Run the python script. It should print "Waiting for connection...", meaning that it has spawned a websocket server, and is waiting for a connection from the Blender client 14 | - In Blender, open the submenus (little arrow in the top right) 15 | - Go in the `Simulation` category and click on `Import Scene`. It should connect to the Python client, then display the scene. The python script should finish execution 16 | - If you call `scene.render(path)`, Blender might freeze for a bit while rendering the scene to an image 17 | 18 | -------------------------------------------------------------------------------- /integrations/Blender/simulate_blender/__init__.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa 2 | # This program is free software; you can redistribute it and/or modify 3 | # it under the terms of the GNU General Public License as published by 4 | # the Free Software Foundation; either version 3 of the License, or 5 | # (at your option) any later version. 6 | # 7 | # This program is distributed in the hope that it will be useful, but 8 | # WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTIBILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | # General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program. If not, see . 14 | 15 | bl_info = { 16 | "name": "simulate", 17 | "author": "Hugging Face", 18 | "description": "", 19 | "blender": (3, 2, 0), 20 | "version": (0, 0, 1), 21 | "location": "View3D", 22 | "warning": "", 23 | "category": "Simulation", 24 | } 25 | 26 | import bpy 27 | 28 | from .simulate_op import SIMULATE_OT_ImportScene 29 | from .simulate_pnl import SIMULATE_PT_Panel 30 | 31 | 32 | classes = (SIMULATE_OT_ImportScene, SIMULATE_PT_Panel) 33 | 34 | 35 | def register(): 36 | for c in classes: 37 | bpy.utils.register_class(c) 38 | 39 | 40 | def unregister(): 41 | for c in classes: 42 | bpy.utils.unregister_class(c) 43 | -------------------------------------------------------------------------------- /integrations/Blender/simulate_blender/client.py: -------------------------------------------------------------------------------- 1 | import socket 2 | 3 | 4 | class Client: 5 | def __init__(self): 6 | self.host = "127.0.0.1" 7 | self.port = 55001 8 | self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 9 | self._connect() 10 | 11 | def _connect(self): 12 | self.socket.connect((self.host, self.port)) 13 | 14 | def listen(self, callback): 15 | chunk_size = 1024 16 | while True: 17 | msg_length = int.from_bytes(self.socket.recv(4), "little") 18 | if msg_length: 19 | data = "" 20 | while len(data) < msg_length: 21 | data += self.socket.recv(min(chunk_size, msg_length - len(data))).decode() 22 | callback(data) 23 | break 24 | 25 | def send_bytes(self, data): 26 | self.socket.sendall(data) 27 | 28 | def close(self): 29 | self.socket.close() 30 | -------------------------------------------------------------------------------- /integrations/Blender/simulate_blender/simenv_op.py: -------------------------------------------------------------------------------- 1 | from bpy.types import Operator 2 | 3 | from .simulator import Simulator 4 | 5 | 6 | class SIMULATE_OT_ImportScene(Operator): 7 | bl_idname = "simulate.import_scene" 8 | bl_label = "Import Scene" 9 | bl_description = "Import a scene from the Simulate library through TCP" 10 | 11 | @classmethod 12 | def poll(cls, context) -> bool: 13 | return True 14 | 15 | def execute(self, context): 16 | _ = Simulator() 17 | return {"FINISHED"} 18 | -------------------------------------------------------------------------------- /integrations/Blender/simulate_blender/simenv_pnl.py: -------------------------------------------------------------------------------- 1 | from bpy.types import Panel 2 | 3 | 4 | class SIMULATE_PT_Panel(Panel): 5 | bl_space_type = "VIEW_3D" 6 | bl_region_type = "UI" 7 | bl_label = "Simulation Environment" 8 | bl_category = "Simulation" 9 | 10 | def draw(self, context): 11 | layout = self.layout 12 | layout.label(text="Simulation Environment") 13 | row = layout.row() 14 | row.operator("simulate.import_scene", text="Import Scene") 15 | -------------------------------------------------------------------------------- /integrations/Godot/README.md: -------------------------------------------------------------------------------- 1 | ## Simulate with Godot 2 | 3 | ### Install in Godot 4 4 | This integration has been developed for Godot 4.x. You can install Godot from [this page](https://godotengine.org/article/dev-snapshot-godot-4-0-alpha-11). 5 | Currently Godot4 is still in early alpha stage, therefore you will be able to find updates pretty often. Another solution is to build the engine from source using [this guide](https://docs.godotengine.org/en/latest/development/compiling/). 6 | 7 | The integration provided is a simple Godot scene containing a default setup (with a directional light and free camera) to connect to the TCP server and load commands sent from the Simulate API. 8 | To load it: 9 | - Launch your Godot 4 installation 10 | - On the Project Manager, select `Import > Browse` 11 | - Navigate to the path of this repository and select the `integrations/Godot/simulate-godot/project.godot` file 12 | - Finally click `Import & Edit` 13 | 14 | You can also copy the simulate-godot folder to a different place and load it from there. 15 | 16 | ### Use the scene 17 | - Create the `simulate` scene with a `'Godot'` engine, for example: 18 | ``` 19 | import simulate as sm 20 | 21 | scene = sm.Scene(engine="godot") 22 | scene += sm.Sphere() 23 | scene.render() 24 | ``` 25 | - Run the python script. It should print "Waiting for connection...", meaning that it has spawned a websocket server, and is waiting for a connection from the Godot client. 26 | - Press Play (F5) in Godot. It should connect to the Python client, then display a basic Sphere. The python script should finish execution. 27 | 28 | -------------------------------------------------------------------------------- /integrations/Godot/simulate_godot/.gitattributes: -------------------------------------------------------------------------------- 1 | # Normalize EOL for all files that Git considers text files. 2 | * text=auto eol=lf 3 | -------------------------------------------------------------------------------- /integrations/Godot/simulate_godot/.gitignore: -------------------------------------------------------------------------------- 1 | # Godot 4+ specific ignores 2 | .godot/ 3 | -------------------------------------------------------------------------------- /integrations/Godot/simulate_godot/Scenes/scene.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=3 uid="uid://b0j8qghrwvoyr"] 2 | 3 | [ext_resource type="Script" path="res://Simulate/debug_camera.gd" id="2_cqhjv"] 4 | 5 | [node name="Root" type="Node"] 6 | 7 | [node name="BaseWorld" type="Node3D" parent="."] 8 | 9 | [node name="Camera" type="Camera3D" parent="BaseWorld"] 10 | transform = Transform3D(0.707107, -0.5, 0.5, 0, 0.707107, 0.707107, -0.707107, -0.5, 0.5, 8, 8, 8) 11 | script = ExtResource("2_cqhjv") 12 | -------------------------------------------------------------------------------- /integrations/Godot/simulate_godot/Simulate/Bridge/command.gd: -------------------------------------------------------------------------------- 1 | class_name Command 2 | extends Node 3 | 4 | 5 | signal callback 6 | 7 | var content : Variant 8 | var _commands : Dictionary 9 | 10 | 11 | func load_commands() -> void: 12 | 13 | var com_path : String = "res://Simulate/Commands" 14 | var directory = DirAccess.open(com_path) 15 | 16 | if directory: 17 | directory.list_dir_begin() 18 | 19 | while true: 20 | var file = directory.get_next() 21 | if file == "": 22 | break 23 | var command_name = file.split(".")[0] 24 | var command_script = load(com_path + "/" + file) 25 | _commands[command_name] = command_script.new() 26 | _commands[command_name].connect("callback", _handle_callback) 27 | add_child(_commands[command_name]) 28 | 29 | directory.list_dir_end() 30 | 31 | func execute(type: String) -> void: 32 | if type in _commands: 33 | _commands[type].execute(content) 34 | else: 35 | print("Unknown command.") 36 | emit_signal("callback", PackedByteArray([97, 99, 107])) 37 | 38 | 39 | func _handle_callback(callback_data: PackedByteArray) -> void: 40 | emit_signal("callback", callback_data) 41 | -------------------------------------------------------------------------------- /integrations/Godot/simulate_godot/Simulate/Commands/close.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | # Close the simulation 3 | 4 | 5 | signal callback 6 | 7 | 8 | func execute(_content: Variant) -> void: 9 | get_tree().paused = false 10 | get_tree().quit() 11 | print("Close called!") 12 | emit_signal("callback", PackedByteArray([97, 99, 107])) 13 | -------------------------------------------------------------------------------- /integrations/Godot/simulate_godot/Simulate/Commands/initialize.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | # Build the scene and sets global simulation metadata 3 | 4 | 5 | signal callback 6 | 7 | 8 | func execute(content: Variant) -> void: 9 | var content_bytes : PackedByteArray = Marshalls.base64_to_raw(content["b64bytes"]) 10 | 11 | var gltf_state : GLTFState = GLTFState.new() 12 | var gltf_doc : GLTFDocument = GLTFDocument.new() 13 | 14 | gltf_doc.register_gltf_document_extension(HFExtensions.new(), false) 15 | 16 | gltf_doc.append_from_buffer(content_bytes, "", gltf_state) 17 | var gltf_scene = gltf_doc.generate_scene(gltf_state) 18 | get_tree().current_scene.add_child(gltf_scene) 19 | 20 | emit_signal("callback", PackedByteArray([97, 99, 107])) 21 | -------------------------------------------------------------------------------- /integrations/Godot/simulate_godot/Simulate/Commands/reset.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | # Reset the simulation 3 | 4 | 5 | signal callback 6 | 7 | 8 | func execute(_content:Variant) -> void: 9 | get_tree().paused = false 10 | emit_signal("callback", PackedByteArray([97, 99, 107])) 11 | -------------------------------------------------------------------------------- /integrations/Godot/simulate_godot/Simulate/Commands/step.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | # Step through the simulation (also steps the physics!) 3 | 4 | 5 | signal callback 6 | 7 | 8 | func execute(_content: Variant) -> void: 9 | get_tree().paused = false 10 | emit_signal("callback", PackedByteArray([97, 99, 107])) 11 | -------------------------------------------------------------------------------- /integrations/Godot/simulate_godot/Simulate/GLTF/gltf_enums.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | class_name GLTFEnums 3 | 4 | 5 | enum AlphaMode { OPAQUE, MASK, BLEND } 6 | enum AccessorType { SCALAR, VEC2, VEC3, VEC4, MAT2, MAT3, MAT4 } 7 | enum RenderingMode { POINTS, LINES, LINE_LOOP, LINE_STRIP, TRIANGLES, TRIANGLE_STRIP, TRIANGLE_FAN } 8 | enum GLType { UNSET = -1, BYTE = 5120, UNSIGNED_BYTE = 5121, SHORT = 5122, UNSIGNED_SHORT = 5123, UNSIGNED_INT = 5125, FLOAT = 5126 } 9 | enum Format { AUTO, GLTF, GLB } 10 | enum CameraType { perspective, orthographic } 11 | enum LightType { directional, point, spot } 12 | enum ColliderType { box, sphere, capsule, mesh } 13 | enum InterpolationMode { ImportFromFile = -1, LINEAR = 0, STEP = 1, CUBICSPLINE = 2 } 14 | enum BufferViewTarget { ARRAY_BUFFER = 34962, ELEMENT_ARRAY_BUFFER = 34963 } 15 | enum PhysicMaterialCombine { average, minimum, multiply, maximum } 16 | -------------------------------------------------------------------------------- /integrations/Godot/simulate_godot/Simulate/GLTF/hf_extensions.gd: -------------------------------------------------------------------------------- 1 | extends GLTFDocumentExtension 2 | class_name HFExtensions 3 | 4 | 5 | func _import_node(state: GLTFState, _gltf_node: GLTFNode, json: Dictionary, node: Node): 6 | var extensions = json.get("extensions") 7 | if not json.has("extensions"): 8 | return OK 9 | 10 | if extensions.has("HF_actuators"): 11 | var actuator = HFActuator.new() 12 | actuator.import(state, json, extensions) 13 | node.replace_by(actuator) 14 | if extensions.has("HF_articulation_bodies"): 15 | var articulation_body = HFArticulationBody.new() 16 | articulation_body.import(state, json, extensions) 17 | node.replace_by(articulation_body) 18 | if extensions.has("HF_colliders"): 19 | var collider = HFCollider.new() 20 | collider.import(state, json, extensions) 21 | node.replace_by(collider) 22 | if extensions.has("HF_raycast_sensors"): 23 | var raycast_sensor = HFRaycastSensor.new() 24 | raycast_sensor.import(state, json, extensions) 25 | node.replace_by(raycast_sensor) 26 | if extensions.has("HF_reward_functions"): 27 | var reward_function = HFRewardFunction.new() 28 | reward_function.import(state, json, extensions) 29 | node.replace_by(reward_function) 30 | if extensions.has("HF_rigid_bodies"): 31 | var rigid_body = HFRigidBody.new() 32 | rigid_body.import(state, json, extensions) 33 | node.replace_by(rigid_body) 34 | if extensions.has("HF_state_sensors"): 35 | var state_sensor = HFStateSensor.new() 36 | state_sensor.import(state, json, extensions) 37 | node.replace_by(state_sensor) 38 | 39 | return OK 40 | -------------------------------------------------------------------------------- /integrations/Godot/simulate_godot/Simulate/GLTF/hf_physic_material.gd: -------------------------------------------------------------------------------- 1 | extends PhysicsMaterial 2 | class_name HFPhysicMaterial 3 | 4 | 5 | var material_name: String = "" 6 | var dynamic_friction: float = 0.6 7 | var friction_combine: GLTFEnums.PhysicMaterialCombine 8 | var bounce_combine: GLTFEnums.PhysicMaterialCombine 9 | 10 | 11 | func import(state: GLTFState, extensions: Dictionary, id: int): 12 | print("Importing a physic material.") 13 | var physic_material: Dictionary = state.json["extensions"]["HF_physic_materials"]["objects"][id] 14 | material_name = extensions["HF_physic_materials"]["name"] 15 | friction = 0.6 16 | 17 | for key in physic_material.keys(): 18 | match key: 19 | "name": 20 | material_name = physic_material["name"] 21 | "dynamic_friction": 22 | dynamic_friction = physic_material["dynamic_friction"] 23 | "static_friction": 24 | friction = physic_material["static_friction"] 25 | "bounciness": 26 | bounce = physic_material["bounciness"] 27 | "friction_combine": 28 | friction_combine = GLTFEnums.PhysicMaterialCombine.get(physic_material["friction_combine"]) 29 | "bounce_combine": 30 | bounce_combine = GLTFEnums.PhysicMaterialCombine.get(physic_material["bounce_combine"]) 31 | _: 32 | print("Field not implemented: ", key) 33 | -------------------------------------------------------------------------------- /integrations/Godot/simulate_godot/Simulate/GLTF/hf_raycast_sensor.gd: -------------------------------------------------------------------------------- 1 | extends Node3D 2 | class_name HFRaycastSensor 3 | 4 | 5 | var n_horizontal_rays: int 6 | var n_vertical_rays: int 7 | var horizontal_fov: float 8 | var vertical_fov: float 9 | var ray_length: float 10 | var sensor_tag: String 11 | 12 | 13 | func import(state: GLTFState, json: Dictionary, extensions: Dictionary): 14 | print("Importing a raycast sensor.") 15 | var raycast_sensor: Dictionary = state.json["extensions"]["HF_raycast_sensors"]["objects"][extensions["HF_raycast_sensors"]["object_id"]] 16 | name = extensions["HF_raycast_sensors"]["name"] 17 | 18 | position = Vector3( 19 | json["translation"][0], 20 | json["translation"][1], 21 | json["translation"][2], 22 | ) 23 | rotation = Quaternion( 24 | json["rotation"][0], 25 | json["rotation"][1], 26 | json["rotation"][2], 27 | json["rotation"][3], 28 | ).get_euler() 29 | scale = Vector3( 30 | json["scale"][0], 31 | json["scale"][1], 32 | json["scale"][2], 33 | ) 34 | 35 | for key in raycast_sensor.keys(): 36 | match key: 37 | "n_horizontal_rays": 38 | n_horizontal_rays = raycast_sensor["n_horizontal_rays"] 39 | "n_vertical_rays": 40 | n_vertical_rays = raycast_sensor["n_vertical_rays"] 41 | "horizontal_fov": 42 | horizontal_fov = raycast_sensor["horizontal_fov"] 43 | "vertical_fov": 44 | vertical_fov = raycast_sensor["vertical_fov"] 45 | "ray_length": 46 | ray_length = raycast_sensor["ray_length"] 47 | "sensor_tag": 48 | sensor_tag = raycast_sensor["sensor_tag"] 49 | _: 50 | print("Field not implemented: ", key) 51 | -------------------------------------------------------------------------------- /integrations/Godot/simulate_godot/Simulate/GLTF/hf_state_sensor.gd: -------------------------------------------------------------------------------- 1 | extends Node3D 2 | class_name HFStateSensor 3 | 4 | 5 | var reference_entity: String 6 | var target_entity:String 7 | var properties: Array 8 | var sensor_tag: String 9 | 10 | 11 | func import(state: GLTFState, json: Dictionary, extensions: Dictionary): 12 | print("Importing a state sensor.") 13 | var state_sensor: Dictionary = state.json["extensions"]["HF_state_sensors"]["objects"][extensions["HF_state_sensors"]["object_id"]] 14 | name = extensions["HF_state_sensors"]["name"] 15 | 16 | position = Vector3( 17 | json["translation"][0], 18 | json["translation"][1], 19 | json["translation"][2], 20 | ) 21 | rotation = Quaternion( 22 | json["rotation"][0], 23 | json["rotation"][1], 24 | json["rotation"][2], 25 | json["rotation"][3], 26 | ).get_euler() 27 | scale = Vector3( 28 | json["scale"][0], 29 | json["scale"][1], 30 | json["scale"][2], 31 | ) 32 | 33 | for key in state_sensor.keys(): 34 | match key: 35 | "target_entity": 36 | target_entity = state_sensor["target_entity"] 37 | "reference_entity": 38 | reference_entity = state_sensor["reference_entity"] 39 | "properties": 40 | properties = state_sensor["properties"] 41 | "sensor_tag": 42 | sensor_tag = state_sensor["sensor_tag"] 43 | _: 44 | print("Field not implemented: ", key) 45 | -------------------------------------------------------------------------------- /integrations/Godot/simulate_godot/Simulate/RLAgents/agent.gd: -------------------------------------------------------------------------------- 1 | class_name Agent 2 | extends Node 3 | 4 | 5 | var node: SimulationNode 6 | var action_space 7 | var observations 8 | var reward_functions 9 | var accum_reward: float 10 | var current_action 11 | 12 | 13 | func _init(node: SimulationNode): 14 | self.node = node 15 | 16 | func initialize() -> void: 17 | pass 18 | 19 | func handle_intermediate_frame() -> void: 20 | pass 21 | 22 | func step(action) -> void: 23 | pass 24 | 25 | func get_event_data() -> Data: 26 | return Data.new() 27 | 28 | func agent_update() -> void: 29 | pass 30 | 31 | func get_camera_observations() -> Dictionary: 32 | return {} 33 | 34 | func update_reward() -> void: 35 | pass 36 | 37 | func reset() -> void: 38 | pass 39 | 40 | func calculate_reward() -> float: 41 | return 0.0 42 | 43 | func get_reward() -> float: 44 | return 0.0 45 | 46 | func zero_reward() -> float: 47 | return 0.0 48 | 49 | func is_done() -> bool: 50 | return false 51 | 52 | func try_get_reward_function(reward, reward_function) -> bool: 53 | return true 54 | 55 | 56 | class Data: 57 | var done: bool 58 | var reward: float 59 | var frames: Dictionary 60 | -------------------------------------------------------------------------------- /integrations/Godot/simulate_godot/Simulate/RLAgents/agent_manager.gd: -------------------------------------------------------------------------------- 1 | class_name AgentManager 2 | extends Node 3 | 4 | 5 | var instance: AgentManager 6 | var agents: Dictionary 7 | 8 | 9 | func _init(): 10 | pass 11 | 12 | func on_scene_initialized(kwargs: Dictionary) -> void: 13 | pass 14 | 15 | func on_before_step(event_data) -> void: 16 | pass 17 | 18 | func on_step(event_data) -> void: 19 | pass 20 | 21 | func on_reset() -> void: 22 | pass 23 | 24 | func on_before_scene_unloaded() -> void: 25 | pass 26 | -------------------------------------------------------------------------------- /integrations/Godot/simulate_godot/Simulate/RLAgents/rl_action.gd: -------------------------------------------------------------------------------- 1 | class_name RLAction 2 | extends Node 3 | 4 | 5 | func execute_action(agent, action) -> void: 6 | pass 7 | 8 | func add_force(agent, value, mapping) -> void: 9 | pass 10 | 11 | func add_relative_force(agent, value, mapping) -> void: 12 | pass 13 | 14 | func add_torque(agent, value, mapping) -> void: 15 | pass 16 | 17 | func add_relative_torque(agent, value, mapping) -> void: 18 | pass 19 | 20 | func add_force_at_position(agent, value, mapping) -> void: 21 | pass 22 | 23 | func move_position(agent, value, mapping) -> void: 24 | pass 25 | 26 | func move_relative_position(agent, value, mapping) -> void: 27 | pass 28 | 29 | func move_rotation(agent, value, mapping) -> void: 30 | pass 31 | 32 | func move_relative_rotation(agent, value, mapping) -> void: 33 | pass 34 | -------------------------------------------------------------------------------- /integrations/Godot/simulate_godot/Simulate/debug_camera.gd: -------------------------------------------------------------------------------- 1 | extends Camera3D 2 | # Simple debug camera 3 | 4 | 5 | @export_range(0, 10, 0.01) var sensitivity : float = 3 6 | @export_range(0, 1000, 0.1) var default_velocity : float = 5 7 | @export_range(0, 10, 0.01) var speed_scale : float = 1.17 8 | @export var max_speed : float = 1000 9 | @export var min_speed : float = 0.2 10 | 11 | @onready var _velocity = default_velocity 12 | 13 | 14 | func _input(event): 15 | # Mouse input handling 16 | if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED: 17 | if event is InputEventMouseMotion: 18 | rotation.y -= event.relative.x / 1000 * sensitivity 19 | rotation.x -= event.relative.y / 1000 * sensitivity 20 | rotation.x = clamp(rotation.x, PI/-2, PI/2) 21 | 22 | if event is InputEventMouseButton: 23 | match event.button_index: 24 | MOUSE_BUTTON_RIGHT: 25 | Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED if event.pressed else Input.MOUSE_MODE_VISIBLE) 26 | MOUSE_BUTTON_WHEEL_UP: # increase fly velocity 27 | _velocity = clamp(_velocity * speed_scale, min_speed, max_speed) 28 | MOUSE_BUTTON_WHEEL_DOWN: # decrease fly velocity 29 | _velocity = clamp(_velocity / speed_scale, min_speed, max_speed) 30 | 31 | func _process(delta): 32 | # Keyboard input handling (change for different keyboard configs) 33 | var direction = Vector3( 34 | float(Input.is_key_pressed(KEY_D)) - float(Input.is_key_pressed(KEY_Q)), 35 | float(Input.is_key_pressed(KEY_E)) - float(Input.is_key_pressed(KEY_A)), 36 | float(Input.is_key_pressed(KEY_S)) - float(Input.is_key_pressed(KEY_Z)) 37 | ).normalized() 38 | 39 | translate(direction * _velocity * delta) 40 | -------------------------------------------------------------------------------- /integrations/Godot/simulate_godot/Simulate/render_camera.gd: -------------------------------------------------------------------------------- 1 | class_name RenderCamera 2 | extends Node 3 | 4 | 5 | var node: SimulationNode 6 | var camera 7 | var readable: bool 8 | var tex: Texture2D 9 | 10 | 11 | func _init(node, data): 12 | pass 13 | 14 | func copy_render_result_to_buffer(buffer): 15 | pass 16 | -------------------------------------------------------------------------------- /integrations/Godot/simulate_godot/Simulate/simulation_node.gd: -------------------------------------------------------------------------------- 1 | class_name SimulationNode 2 | extends Node3D 3 | 4 | 5 | var camera_data 6 | var light_data 7 | var collider_data 8 | var rigidbody_data 9 | var joint_data 10 | var agent_data 11 | 12 | var camera 13 | var light 14 | var collider 15 | var rigidbody 16 | var joint 17 | var data 18 | 19 | 20 | func initialize() -> void: 21 | pass 22 | 23 | func reset_state() -> void: 24 | pass 25 | 26 | func initialize_camera() -> void: 27 | pass 28 | 29 | func initiliaze_light() -> void: 30 | pass 31 | 32 | func initialize_collider() -> void: 33 | pass 34 | 35 | func initialize_rigidbody() -> void: 36 | pass 37 | 38 | func initialize_joint() -> void: 39 | pass 40 | 41 | func get_data(): 42 | pass 43 | 44 | 45 | class Data: 46 | var name: String 47 | var position: Vector3 48 | var rotation: Quaternion 49 | -------------------------------------------------------------------------------- /integrations/Godot/simulate_godot/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huggingface/simulate/1a7832e46bd4702490e223612a528b586fb36eb1/integrations/Godot/simulate_godot/icon.png -------------------------------------------------------------------------------- /integrations/Godot/simulate_godot/icon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://2cwdrvpxvvv7" 6 | path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://icon.png" 14 | dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/lossy_quality=0.7 20 | compress/hdr_compression=1 21 | compress/bptc_ldr=0 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/GLTF.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3d78f6e1c9a683f48918841028e97c6b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/MountainCar.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 51d8c771f1b4af84694d51cfc75fe693 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/MountainCar/Cart.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | [RequireComponent(typeof(Rigidbody))] 4 | public class Cart : MonoBehaviour { 5 | public float moveForce = 300f; 6 | public float rotationDampening = 200f; 7 | 8 | Rigidbody rigidBody; 9 | Vector3 prevPos; 10 | float push; 11 | 12 | void Awake() { 13 | rigidBody = GetComponent(); 14 | prevPos = transform.position; 15 | } 16 | 17 | void Update() { 18 | push = 0; 19 | if (Input.GetKey(KeyCode.LeftArrow)) 20 | push -= 1; 21 | if (Input.GetKey(KeyCode.RightArrow)) 22 | push += 1; 23 | 24 | Ray ray = new Ray(transform.position, Vector3.down); 25 | float deltaPosition = (transform.position - prevPos).magnitude; 26 | if (Physics.Raycast(ray, out RaycastHit hit, 1f, LayerMask.GetMask("Ground"))) { 27 | transform.up = Vector3.Lerp(transform.up, hit.normal, Time.deltaTime * deltaPosition * rotationDampening); 28 | } 29 | 30 | prevPos = transform.position; 31 | } 32 | 33 | void FixedUpdate() { 34 | rigidBody.AddForce(Vector3.right * push * moveForce * Time.fixedDeltaTime, ForceMode.Acceleration); 35 | } 36 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/MountainCar/Cart.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7e7fa553fade3324788aa27d5d0ad522 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/MountainCar/MountainCar.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "MountainCar", 3 | "rootNamespace": "", 4 | "references": [ 5 | "GUID:20acf4accf2cab340945bbf78cc82cf7" 6 | ], 7 | "includePlatforms": [], 8 | "excludePlatforms": [], 9 | "allowUnsafeCode": false, 10 | "overrideReferences": false, 11 | "precompiledReferences": [], 12 | "autoReferenced": true, 13 | "defineConstraints": [], 14 | "versionDefines": [], 15 | "noEngineReferences": false 16 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/MountainCar/MountainCar.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4e26a5e2ace0ddf4daf2eb51245cde36 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/MountainCar/MountainCarPlugin.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Simulate; 3 | using UnityEngine; 4 | 5 | public class MountainCarPlugin : PluginBase { 6 | public override void OnSceneInitialized(Dictionary kwargs) { 7 | GameObject cart = GameObject.Find("Cart"); 8 | GameObject rail = GameObject.Find("RailCollider"); 9 | if (cart != null && rail != null) { 10 | Debug.Log("Found cart and rail objects, setting up mountain car plugin"); 11 | cart.AddComponent(); 12 | rail.layer = LayerMask.NameToLayer("Ground"); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/MountainCar/MountainCarPlugin.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4f63e219ff112904da4f3d28af88a2a1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0dddf312f7c9ecd41a9e0d90d1c7642c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Plugins/Doors.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 79ddb31bfd0152a4da9dfa351c662d71 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Plugins/Doors/src.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huggingface/simulate/1a7832e46bd4702490e223612a528b586fb36eb1/integrations/Unity/simulate-unity/Assets/Plugins/Doors/src.zip -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Plugins/Doors/src.zip.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d667d3dc7504f2741acf0e3505c357f2 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 09b693027ad046149bd8730467fa0a53 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Resources/DefaultEmissive.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d21619287321de84a96407b2f8eac607 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Resources/DefaultLit.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c41064657a6a8b37c9ee5cfcddc8864f 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Resources/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 62b1e17193c76444686e6ce48119a2fc 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Resources/Singletons.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8dfa20936b223c94ea81374db3928599 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Resources/Singletons/Client.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: d96904f8d22e93540ab9a0aea7d3b5fa, type: 3} 13 | m_Name: Client 14 | m_EditorClassIdentifier: 15 | host: localhost 16 | port: 55001 17 | physicsUpdateRate: 30 18 | frameSkip: 15 19 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Resources/Singletons/Client.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4598dc31433dba84d878f1955685f217 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6ea315d0fd7389c41b19996891e99ae3 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Scenes/SampleScene.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8b45d796c7216074a909e0e96c63e3bf 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Scenes/SampleScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9fc0d4010bbf28b4594072e72b8655ab 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Scenes/SampleScene/PostProcessing Profile.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dd9a783c9c36ab444ba1088f8b7aa298 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Scenes/URPAsset.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d4f60a8d81b125d4c91f21e9c69cb326 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Scenes/URPAsset_Renderer.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9fb6b182a902d8f498f2b559a8107175 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Scenes/URPGlobalSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 2ec995e51a6e251468d2a3fd8a686257, type: 3} 13 | m_Name: URPGlobalSettings 14 | m_EditorClassIdentifier: 15 | k_AssetVersion: 2 16 | lightLayerName0: Light Layer default 17 | lightLayerName1: Light Layer 1 18 | lightLayerName2: Light Layer 2 19 | lightLayerName3: Light Layer 3 20 | lightLayerName4: Light Layer 4 21 | lightLayerName5: Light Layer 5 22 | lightLayerName6: Light Layer 6 23 | lightLayerName7: Light Layer 7 24 | m_StripDebugVariants: 1 25 | m_StripUnusedPostProcessingVariants: 0 26 | m_StripUnusedVariants: 1 27 | supportRuntimeDebugDisplay: 0 28 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Scenes/URPGlobalSettings.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cf8114c54e6e97544b8a91a687fb24a9 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f1e1ed5c9e4270a47bb8a37d673050b5 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1554e4633573aa74281d62f3aa93a6fa 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Editor/GLBImporterEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor.AssetImporters; 2 | using UnityEngine; 3 | 4 | namespace Simulate.GLTF { 5 | [ScriptedImporter(1, "glb", importQueueOffset: 3000)] 6 | public class GLBImporterEditor : GLTFImporterEditor { 7 | public override void OnImportAsset(AssetImportContext ctx) { 8 | AnimationClip[] animations; 9 | if(importSettings == null) 10 | importSettings = new ImportSettings(); 11 | GameObject root =Importer.LoadFromFile(ctx.assetPath, importSettings, out animations, Format.GLB); 12 | GLTFAssetUtility.SaveToAsset(root, animations, ctx, importSettings); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Editor/GLBImporterEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dc314da6b137a564fa2b6ad38833e65e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Editor/GLTFAssetUtility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7c825474a3f07c74da66d6b5cf5d410f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Editor/GLTFImporterEditor.cs: -------------------------------------------------------------------------------- 1 | // adapted from https://github.com/Siccity/GLTFUtility/blob/master/Scripts/Editor/GLTFImporter.cs 2 | using UnityEngine; 3 | using UnityEditor.AssetImporters; 4 | 5 | namespace Simulate.GLTF { 6 | [ScriptedImporter(1, "gltf", importQueueOffset: 3000)] 7 | public class GLTFImporterEditor : ScriptedImporter { 8 | public ImportSettings importSettings; 9 | 10 | public override void OnImportAsset(AssetImportContext ctx) { 11 | AnimationClip[] animations; 12 | GameObject root = Importer.LoadFromFile(ctx.assetPath, importSettings, out animations); 13 | GLTFAssetUtility.SaveToAsset(root, animations, ctx, importSettings); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Editor/GLTFImporterEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ae6bde3691c07b64da9194c7cdd3e016 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Editor/SimEnvEditor.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Editor", 3 | "rootNamespace": "", 4 | "references": [ 5 | "GUID:20acf4accf2cab340945bbf78cc82cf7" 6 | ], 7 | "includePlatforms": [ 8 | "Editor" 9 | ], 10 | "excludePlatforms": [], 11 | "allowUnsafeCode": false, 12 | "overrideReferences": false, 13 | "precompiledReferences": [], 14 | "autoReferenced": true, 15 | "defineConstraints": [], 16 | "versionDefines": [], 17 | "noEngineReferences": false 18 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Editor/SimEnvEditor.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0939dd59a5ba2814ba10f249727b8974 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/README.md: -------------------------------------------------------------------------------- 1 | This package provides core backend functionality for the Hugging Face Simulate project: (https://github.com/huggingface/simulate). 2 | 3 | To use this package, add a GameObject to the scene, then add a `Simulator` component to it. 4 | 5 | Core Classes: 6 | - `Simulator`: Master controller singleton that tracks objects, loads and unloads plugins, etc. 7 | - `Node`: Component attached to every tracked object. 8 | - `RenderCamera`: Component attached to every tracked camera. Call `Render()` to asynchronously request a color buffer. 9 | - `Client`: Manages communication with the backend. Don't modify directly; instead, use plugins. 10 | 11 | Plugins: 12 | - `IPlugin`: For adding custom behaviour to the backend. 13 | - `ICommand`: For defining custom commands from the Python frontend. 14 | - `IGLTFExtension`: For defining custom GLTF extensions. 15 | 16 | To add functionality to the backend: 17 | - Create a separate folder. For example, `RLAgents`. 18 | - Add an assembly definition to this folder (Right Click > Create > Assembly Definition). 19 | - In the assembly definition, add a reference to `Simulate`. 20 | - In the folder, create a script that implements `IPlugin`. For a simple example, look at `IPlugin.cs`, or for a more complex example, see `AgentsPlugin.cs`. 21 | 22 | If this folder is in the Unity project, it will automatically be included in the build. 23 | 24 | To add functionality post-build, a plugin can be compiled externally, then the DLL can be placed in the build's `Resources/Plugins/` folder. 25 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 85dd1f23a24f707468002a6dd8587e2c 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 03463e50df20749458048a790c141742 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Bridge.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2284a1814546f4d4886aa8f383083977 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Bridge/Client.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d96904f8d22e93540ab9a0aea7d3b5fa 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Bridge/Close.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine.Events; 3 | 4 | namespace Simulate { 5 | public class Close : ICommand { 6 | public void Execute(Dictionary kwargs, UnityAction callback) { 7 | Simulator.Close(); 8 | callback("{}"); 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Bridge/Close.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 86e878980260489e28d509974a70cc89 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Bridge/Initialize.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | using UnityEngine.Events; 4 | 5 | namespace Simulate { 6 | public class Initialize : ICommand { 7 | public string b64bytes; 8 | 9 | public void Execute(Dictionary kwargs, UnityAction callback) { 10 | ExecuteAsync(kwargs, callback); 11 | } 12 | 13 | async void ExecuteAsync(Dictionary kwargs, UnityAction callback) { 14 | try { 15 | await Simulator.Initialize(b64bytes, kwargs); 16 | } catch (System.Exception e) { 17 | string error = "Failed to build scene from GLTF: " + e.ToString(); 18 | Debug.LogError(error); 19 | callback(error); 20 | return; 21 | } 22 | callback("{}"); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Bridge/Initialize.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dcd66e98bd8471b4e8a7078d0748c170 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Bridge/Reset.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine.Events; 3 | 4 | namespace Simulate.RlAgents { 5 | public class Reset : ICommand { 6 | public void Execute(Dictionary kwargs, UnityAction callback) { 7 | Simulator.Reset(); 8 | callback("{}"); 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Bridge/Reset.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 695f12516f62eef4d855a5b11df510bd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Bridge/Step.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using UnityEngine.Events; 3 | using Newtonsoft.Json; 4 | using System.Collections.Generic; 5 | 6 | namespace Simulate { 7 | public class Step : ICommand { 8 | public void Execute(Dictionary kwargs, UnityAction callback) { 9 | ExecuteCoroutine(kwargs, callback).RunCoroutine(); 10 | } 11 | 12 | IEnumerator ExecuteCoroutine(Dictionary kwargs, UnityAction callback) { 13 | yield return Simulator.StepCoroutine(kwargs); 14 | string json = JsonConvert.SerializeObject(Simulator.currentEvent, new EventDataConverter()); 15 | callback(json); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Bridge/Step.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3d39b4fe6d6a33a4e8cc62d43f2ffb90 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Bridge/TestEchoGLTF.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Newtonsoft.Json; 4 | using Simulate.GLTF; 5 | using UnityEngine; 6 | using UnityEngine.Events; 7 | 8 | namespace Simulate { 9 | public class TestEchoGLTF : ICommand { 10 | public string b64bytes; 11 | 12 | public void Execute(Dictionary kwargs, UnityAction callback) { 13 | ExecuteAsync(kwargs, callback); 14 | } 15 | 16 | async void ExecuteAsync(Dictionary kwargs, UnityAction callback) { 17 | // Import GLTF 18 | byte[] bytes = Convert.FromBase64String(b64bytes); 19 | GameObject root = await Importer.LoadFromBytesAsync(bytes); 20 | 21 | // Export GLTF 22 | GLTFObject gltfObject = Exporter.CreateGLTFObject(root.transform, null, true); 23 | JsonSerializerSettings settings = new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }; 24 | string json = JsonConvert.SerializeObject(gltfObject, settings); 25 | callback(json); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Bridge/TestEchoGLTF.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: afd4250c3ae53cb4b842d352fb5ba0f0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e509983a1affb95448d185c96084ca3f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/AnimationSettings.cs: -------------------------------------------------------------------------------- 1 | // adapted from https://github.com/Siccity/GLTFUtility/blob/master/Scripts/Settings/AnimationSettings.cs 2 | using System; 3 | 4 | namespace Simulate.GLTF { 5 | [Serializable] 6 | public class AnimationSettings { 7 | public bool looping; 8 | public float frameRate = 24; 9 | public InterpolationMode interpolationMode = InterpolationMode.ImportFromFile; 10 | public bool compressBlendShapeKeyFrames = true; 11 | } 12 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/AnimationSettings.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 126d62a1640b8854bb225a4091555920 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/BufferedBinaryReader.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ad9c9a22c410c7f4996e80a67dbae368 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/Converters.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a2876ef75905204fa430e372253c03a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/Converters/ColorConverter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 125e989c8cd9ded46900a0d2bcfa8b8d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/Converters/EnumConverter.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | // adapted from https://github.com/Siccity/GLTFUtility/tree/master/Scripts/Converters/EnumConverter.cs 3 | using Newtonsoft.Json; 4 | using System; 5 | 6 | public class EnumConverter : JsonConverter { 7 | public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { 8 | writer.WriteValue(value.ToString()); 9 | } 10 | 11 | public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { 12 | string value = serializer.Deserialize(reader); 13 | if (Enum.IsDefined(objectType, value)) 14 | return Enum.Parse(objectType, value); 15 | else 16 | return existingValue; 17 | } 18 | 19 | public override bool CanConvert(Type objectType) { 20 | return typeof(Enum).IsAssignableFrom(objectType); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/Converters/EnumConverter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 333dae604c588664986e2e5a7f189e7a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/Converters/Matrix4x4Converter.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | // adapted from https://github.com/Siccity/GLTFUtility/tree/master/Scripts/Converters/Matrix4x4Converter.cs 3 | using Newtonsoft.Json; 4 | using System; 5 | 6 | public class Matrix4x4Converter : JsonConverter { 7 | public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { 8 | Matrix4x4 matrix = (Matrix4x4)value; 9 | writer.WriteStartArray(); 10 | for (int i = 0; i < 16; i++) 11 | writer.WriteValue(matrix[i]); 12 | writer.WriteEndArray(); 13 | } 14 | 15 | public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { 16 | float[] floatArray = serializer.Deserialize(reader); 17 | return new Matrix4x4( 18 | new Vector4(floatArray[0], floatArray[1], floatArray[2], floatArray[3]), 19 | new Vector4(floatArray[4], floatArray[5], floatArray[6], floatArray[7]), 20 | new Vector4(floatArray[8], floatArray[9], floatArray[10], floatArray[11]), 21 | new Vector4(floatArray[12], floatArray[13], floatArray[14], floatArray[15]) 22 | ); 23 | } 24 | 25 | public override bool CanConvert(Type objectType) { 26 | return objectType == typeof(Matrix4x4); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/Converters/Matrix4x4Converter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4aae75c17b8902346bcbcf6cc2c41a31 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/Converters/QuaternionConverter.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | // adapted from https://github.com/Siccity/GLTFUtility/tree/master/Scripts/Converters/QuaternionConverter.cs 3 | using Newtonsoft.Json; 4 | using System; 5 | 6 | public class QuaternionConverter : JsonConverter { 7 | public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { 8 | Quaternion rot = (Quaternion)value; 9 | writer.WriteStartArray(); 10 | writer.WriteValue(rot.x); 11 | writer.WriteValue(-rot.y); 12 | writer.WriteValue(-rot.z); 13 | writer.WriteValue(rot.w); 14 | writer.WriteEndArray(); 15 | } 16 | 17 | public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { 18 | float[] floatArray = serializer.Deserialize(reader); 19 | return new Quaternion(floatArray[0], -floatArray[1], -floatArray[2], floatArray[3]); 20 | } 21 | 22 | public override bool CanConvert(Type objectType) { 23 | return objectType == typeof(Quaternion); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/Converters/QuaternionConverter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0e0209378e1443146a37842cd3f83060 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/Converters/TranslationConverter.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | // adapted from https://github.com/Siccity/GLTFUtility/tree/master/Scripts/Converters/TranslationConverter.cs 3 | using Newtonsoft.Json; 4 | using System; 5 | 6 | public class TranslationConverter : JsonConverter { 7 | /// 8 | /// Converts from float array to Vector3 during deserialization, and back. 9 | /// Compensates for differing coordinate systems as well. 10 | /// 11 | public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { 12 | Vector3 pos = (Vector3)value; 13 | writer.WriteStartArray(); 14 | writer.WriteValue(-pos.x); 15 | writer.WriteValue(pos.y); 16 | writer.WriteValue(pos.z); 17 | writer.WriteEndArray(); 18 | } 19 | 20 | public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { 21 | float[] floatArray = serializer.Deserialize(reader); 22 | return new Vector3(-floatArray[0], floatArray[1], floatArray[2]); 23 | } 24 | 25 | public override bool CanConvert(Type objectType) { 26 | return objectType == typeof(Vector3); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/Converters/TranslationConverter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8a91cf804266a92478c365a802052c47 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/Converters/Vector2Converter.cs: -------------------------------------------------------------------------------- 1 | // adapted from https://github.com/Siccity/GLTFUtility/tree/master/Scripts/Converters/Vector2Converter.cs 2 | using UnityEngine; 3 | using Newtonsoft.Json; 4 | using System; 5 | 6 | public class Vector2Converter : JsonConverter { 7 | public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { 8 | Vector2 pos = (Vector2)value; 9 | writer.WriteStartArray(); 10 | writer.WriteValue(pos.x); 11 | writer.WriteValue(pos.y); 12 | writer.WriteEndArray(); 13 | } 14 | 15 | public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { 16 | float[] floatArray = null; 17 | try { 18 | floatArray = serializer.Deserialize(reader); 19 | } catch (System.Exception) { 20 | floatArray = new float[] { serializer.Deserialize(reader) }; 21 | } 22 | 23 | switch (floatArray.Length) { 24 | case 1: 25 | return new Vector2(floatArray[0], floatArray[0]); 26 | case 2: 27 | return new Vector2(floatArray[0], floatArray[1]); 28 | case 3: 29 | return new Vector2(floatArray[0], floatArray[1]); 30 | default: 31 | return Vector2.one; 32 | } 33 | } 34 | 35 | public override bool CanConvert(Type objectType) { 36 | return objectType == typeof(Vector2); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/Converters/Vector2Converter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aacf967ad8b6bb943a46824e66294cc3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/Converters/Vector3Converter.cs: -------------------------------------------------------------------------------- 1 | // adapted from https://github.com/Siccity/GLTFUtility/tree/master/Scripts/Converters/Vector3Converter.cs 2 | using UnityEngine; 3 | using Newtonsoft.Json; 4 | using System; 5 | 6 | public class Vector3Converter : JsonConverter { 7 | public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { 8 | Vector3 pos = (Vector3)value; 9 | writer.WriteStartArray(); 10 | writer.WriteValue(pos.x); 11 | writer.WriteValue(pos.y); 12 | writer.WriteValue(pos.z); 13 | writer.WriteEndArray(); 14 | } 15 | 16 | public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { 17 | float[] floatArray = serializer.Deserialize(reader); 18 | return new Vector3(floatArray[0], floatArray[1], floatArray[2]); 19 | } 20 | 21 | public override bool CanConvert(Type objectType) { 22 | return objectType == typeof(Vector3); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/Converters/Vector3Converter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ae804884f7e96564aab4c63502173e8c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/Enums.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9b8524f2bd2723d4892611f69ef6c8ef 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/Exporter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c9e60c1b11777c845abb67fd57923ba7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/GLTFAccessor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f50e3508dd1f3c7469cafb4148d555b1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/GLTFAnimation.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f0de3fcaf800df749816ceb1f6520e9e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/GLTFAsset.cs: -------------------------------------------------------------------------------- 1 | // adapted from https://github.com/Siccity/GLTFUtility/blob/master/Scripts/Spec/GLTFAsset.cs 2 | using Newtonsoft.Json; 3 | 4 | namespace Simulate.GLTF { 5 | public class GLTFAsset { 6 | public string copyright; 7 | public string generator; 8 | [JsonProperty(Required = Required.Always)] public string version; 9 | public string minVersion; 10 | } 11 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/GLTFAsset.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6e7ce75f723f4f84796c8a5a4bc659ef 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/GLTFBuffer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9b6e5e38d1a97324d8f005bf69e92528 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/GLTFBufferView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1f5882249a8cbc44ab6ea0bdf12e5bae 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/GLTFCamera.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d643b9487f34ba842ac61b6fd1b1ba83 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/GLTFExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace Simulate.GLTF { 2 | public class GLTFExtensions { 3 | public KHRLightsPunctual KHR_lights_punctual; 4 | public HFColliders HF_colliders; 5 | public HFPhysicMaterials HF_physic_materials; 6 | public HFArticulationBodies HF_articulation_bodies; 7 | public HFRigidBodies HF_rigid_bodies; 8 | public HFActuators HF_actuators; 9 | public HFStateSensors HF_state_sensors; 10 | public HFRaycastSensors HF_raycast_sensors; 11 | public HFRewardFunctions HF_reward_functions; 12 | public Config HF_config; 13 | } 14 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/GLTFExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3ccdae7f973d7aa419c6444c33662284 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/GLTFImage.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 344946fabf5fa384287c1d44e96b6ac5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/GLTFMaterial.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3562a2fd5457ba746bc078d1a5760703 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/GLTFMesh.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 53a8a06cc9dee7645bbacc5baaabd400 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/GLTFNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eb55bd2509e760e468d25d15ab71136f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/GLTFObject.cs: -------------------------------------------------------------------------------- 1 | // adapted from https://github.com/Siccity/GLTFUtility/blob/master/Scripts/Spec/GLTFObject.cs 2 | using System.Collections.Generic; 3 | using Newtonsoft.Json; 4 | 5 | namespace Simulate.GLTF { 6 | public class GLTFObject { 7 | public int? scene; 8 | [JsonProperty(Required = Required.Always)] public GLTFAsset asset; 9 | public List scenes; 10 | public List nodes; 11 | public List meshes; 12 | public List animations; 13 | public List buffers; 14 | public List bufferViews; 15 | public List accessors; 16 | public List skins; 17 | public List textures; 18 | public List images; 19 | public List materials; 20 | public List cameras; 21 | public List extensionsUsed; 22 | public List extensionsRequired; 23 | public GLTFExtensions extensions; 24 | } 25 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/GLTFObject.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 33bf0aa0608e8644099f8ff14a7e30f1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/GLTFPrimitive.cs: -------------------------------------------------------------------------------- 1 | // adapted from https://github.com/Siccity/GLTFUtility/blob/master/Scripts/Spec/GLTFPrimitive.cs 2 | using System.Collections.Generic; 3 | using Newtonsoft.Json; 4 | 5 | namespace Simulate.GLTF { 6 | public class GLTFPrimitive { 7 | [JsonProperty(Required = Required.Always)] public GLTFAttributes attributes; 8 | public RenderingMode mode = RenderingMode.TRIANGLES; 9 | public int? indices; 10 | public int? material; 11 | public List targets; 12 | public Extensions extensions; 13 | 14 | public class GLTFAttributes { 15 | public int? POSITION; 16 | public int? NORMAL; 17 | public int? TANGENT; 18 | public int? COLOR_0; 19 | public int? TEXCOORD_0; 20 | public int? TEXCOORD_1; 21 | public int? TEXCOORD_2; 22 | public int? TEXCOORD_3; 23 | public int? TEXCOORD_4; 24 | public int? TEXCOORD_5; 25 | public int? TEXCOORD_6; 26 | public int? TEXCOORD_7; 27 | public int? JOINTS_0; 28 | public int? JOINTS_1; 29 | public int? JOINTS_2; 30 | public int? JOINTS_3; 31 | public int? WEIGHTS_0; 32 | public int? WEIGHTS_1; 33 | public int? WEIGHTS_2; 34 | public int? WEIGHTS_3; 35 | } 36 | 37 | public class Extensions { 38 | public DracoMeshCompression KHR_draco_mesh_compression; 39 | } 40 | 41 | public class DracoMeshCompression { 42 | public int bufferView = 0; 43 | public GLTFAttributes attributes; 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/GLTFPrimitive.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 838c9615748283f4cb3bb849d8be8c71 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/GLTFScene.cs: -------------------------------------------------------------------------------- 1 | // adapted from https://github.com/Siccity/GLTFUtility/blob/master/Scripts/Spec/GLTFScene.cs 2 | using System.Collections.Generic; 3 | 4 | namespace Simulate.GLTF { 5 | public class GLTFScene { 6 | public string name; 7 | public List nodes; 8 | 9 | public static GLTFScene Export(GLTFObject gltfObject, List nodes) { 10 | GLTFScene scene = new GLTFScene(); 11 | scene.nodes = new List(); 12 | for (int i = 0; i < nodes.Count; i++) { 13 | if (nodes[i].transform.parent == null) 14 | scene.nodes.Add(i); 15 | } 16 | gltfObject.scenes = new List() { scene }; 17 | return scene; 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/GLTFScene.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aaa6d909782d70942be49fffe5e96103 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/GLTFSkin.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aae72b6aa8032fa45a148fc1f2520af0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/GLTFTexture.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f6854fbad25802c4484772b0735617b7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/HF_actuators.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2553dfb4a013aed08ac52f6a8895c695 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/HF_articulation_bodies.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: de0d576cc941f7ccb9fdd1ad942012a2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/HF_colliders.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2c5c1619af96f442a95dd058f8784c84 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/HF_physic_materials.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 74699234108b3704185f85e85f485d56 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/HF_raycast_sensors.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using Newtonsoft.Json; 3 | using System.Collections.Generic; 4 | 5 | namespace Simulate.GLTF { 6 | public class HFRaycastSensors { 7 | public List objects; 8 | 9 | public HFRaycastSensors() { 10 | objects = new List(); 11 | } 12 | public class HFRaycastSensor { 13 | public int n_horizontal_rays; 14 | public int n_vertical_rays; 15 | public float horizontal_fov; 16 | public float vertical_fov; 17 | public float ray_length; 18 | public string sensor_tag; 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/HF_raycast_sensors.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7034f93dfa5b3430989426417b7a6a4d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/HF_reward_functions.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Newtonsoft.Json; 3 | using UnityEngine; 4 | 5 | namespace Simulate.GLTF { 6 | public class HFRewardFunctions { 7 | public List objects; 8 | 9 | // A serialization of a reward function 10 | public class HFRewardFunction { 11 | [JsonProperty(Required = Required.Always)] public string type; 12 | public string entity_a; 13 | public string entity_b; 14 | [JsonProperty(Required = Required.Always), JsonConverter(typeof(Vector3Converter))] public Vector3 direction; 15 | public string distance_metric; 16 | public float scalar = 1f; 17 | public float threshold = 1f; 18 | public bool is_terminal = false; 19 | public bool is_collectable = false; 20 | public bool trigger_once = true; 21 | } 22 | } 23 | } 24 | 25 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/HF_reward_functions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0f61beb0513f18c85a97dee3e0d820d4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/HF_rigid_bodies.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 428942c928ef5469ebbb10ff6ac85704 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/HF_state_sensors.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Simulate.GLTF { 4 | public class HFStateSensors { 5 | public List objects; 6 | 7 | public HFStateSensors() { 8 | objects = new List(); 9 | } 10 | public class HFStateSensor { 11 | public string reference_entity; 12 | public string target_entity; 13 | public List properties; 14 | public string sensor_tag; 15 | } 16 | } 17 | 18 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/HF_state_sensors.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f21dd7dff20402130900bc2b4bf966da 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/ImportSettings.cs: -------------------------------------------------------------------------------- 1 | // adapted from https://github.com/Siccity/GLTFUtility/blob/master/Scripts/Settings/ImportSettings.cs 2 | using UnityEngine; 3 | using System; 4 | 5 | namespace Simulate.GLTF { 6 | [Serializable] 7 | public class ImportSettings { 8 | public bool materials = true; 9 | public AnimationSettings animationSettings = new AnimationSettings(); 10 | public bool generateLightmapUVs; 11 | [Range(0, 180)] public float hardAngle = 88; 12 | [Range(1, 75)] public float angleError = 8; 13 | [Range(1, 75)] public float areaError = 15; 14 | [Range(1, 64)] public float packMargin = 4; 15 | } 16 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/ImportSettings.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 94b1f48a153af5140bacb6dccc24f7f3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/Importer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0ca2fe12c72102a469ecbcd9bd8bb851 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/KHR_lights_punctual.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 13aa51a21b01c794aa02ea53d0c80c13 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/KHR_texture_transform.cs: -------------------------------------------------------------------------------- 1 | // adapted from https://github.com/Siccity/GLTFUtility/blob/master/Scripts/Extensions/KHR_texture_transform.cs 2 | using UnityEngine; 3 | using Newtonsoft.Json; 4 | 5 | namespace Simulate.GLTF { 6 | public class KHR_texture_transform { 7 | [JsonConverter(typeof(Vector2Converter))] public Vector2 offset = Vector2.zero; 8 | public float rotation; 9 | [JsonConverter(typeof(Vector2Converter))] public Vector2 scale = Vector2.one; 10 | public int texCoord = 0; 11 | 12 | public void Apply(GLTFMaterial.TextureInfo texInfo, Material material, string textureSamplerName) { 13 | material.SetTextureOffset(textureSamplerName, offset); 14 | material.SetTextureScale(textureSamplerName, scale); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/GLTF/KHR_texture_transform.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b344cac771cee464983825f003e3bd0b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Helpers.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c994e518355fd1a45af98f6e718c43e9 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Helpers/Extensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bd9c0fe1b50c7d34abcfb9c8a5526070 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Helpers/Singleton.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace Simulate { 4 | public abstract class Singleton : ScriptableObject where T : Singleton { 5 | static T _instance; 6 | public static T instance { 7 | get { 8 | if (_instance == null) { 9 | T[] assets = Resources.LoadAll("Singletons"); 10 | if (assets == null || assets.Length < 1) 11 | throw new System.Exception("Couldn't find Singleton of type " + typeof(T)); 12 | else if (assets.Length > 1) 13 | throw new System.Exception("Found multiple Singletons of type " + typeof(T)); 14 | _instance = assets[0]; 15 | } 16 | return _instance; 17 | } 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Helpers/Singleton.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c7cd79f096233d6418838e5de884cb05 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Node.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9114f17ac5a7877469223eecf3c4f97d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7c06972202a6eaf49b24e64735a513ca 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Plugins/ICommand.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine.Events; 3 | 4 | namespace Simulate { 5 | /// 6 | /// Interface for defining custom API commands. 7 | /// Serializable fields in custom commands can be passed through the python API. 8 | /// 9 | /// For example, on the Unity side: 10 | /// 11 | /// public class MyCustomLoggingCommand : ICommand { 12 | /// public string message; 13 | /// 14 | /// public void Execute(UnityAction{string} callback) { 15 | /// Debug.Log("Received message: " + message); 16 | /// callback("{}"); 17 | /// } 18 | /// } 19 | /// 20 | /// Then, on the python side, given a scene using the Unity engine: 21 | /// 22 | /// command = { 23 | /// "type": "MyCustomLoggingCommand", 24 | /// "contents": json.dumps({ 25 | /// "message": "hello from python api"} 26 | /// )} 27 | /// } 28 | /// scene.engine.run_command(command) 29 | /// 30 | /// 31 | /// 32 | public interface ICommand { 33 | /// 34 | /// Executes the custom command. 35 | /// Don't forget to call the callback, i.e. callback("{}");. 36 | /// 37 | /// Required callback for the client to continue execution. 38 | void Execute(Dictionary kwargs, UnityAction callback); 39 | } 40 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Plugins/ICommand.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b6ee8cb57c4ad3b4c85637e48b63a37e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Plugins/IGLTFExtension.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Simulate { 4 | /// 5 | /// Interface for custom GLTF extensions. 6 | /// Extensions defined should be serializable, so they can be passed as json strings. 7 | /// 8 | /// For example, a GLTF extension that adds a RigidBody with a given mass: 9 | /// 10 | /// [Serializable] 11 | /// public class MyCustomRigidBodyExtension : IGLTFExtension { 12 | /// public float mass; 13 | /// 14 | /// public void Initialize(Node node, Dictionary kwargs) { 15 | /// Rigidbody rigidBody = node.gameObject.AddComponent{Rigidbody}(); 16 | /// rigidBody.mass = mass; 17 | /// } 18 | /// } 19 | /// 20 | /// 21 | /// 22 | public interface IGLTFExtension { 23 | /// 24 | /// Initialize extension on the given node. 25 | /// 26 | /// 27 | void Initialize(Node node, Dictionary kwargs); 28 | } 29 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Plugins/IGLTFExtension.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dea827206192cc248bf3f6c3439a9485 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Plugins/IPlugin.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5a8889dda95639c49abf3f1e26a6daa8 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Plugins/PluginBase.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | 4 | namespace Simulate { 5 | /// 6 | /// Helper class if you only want to override some methods. 7 | /// 8 | public abstract class PluginBase : IPlugin { 9 | public virtual void OnCreated() { } 10 | public virtual void OnReleased() { } 11 | public virtual void OnSceneInitialized(Dictionary kwargs) { } 12 | public virtual void OnBeforeStep(EventData eventData) { } 13 | public virtual void OnStep(EventData eventData) { } 14 | public virtual void OnAfterStep(EventData eventData) { } 15 | public virtual void OnReset() { } 16 | public virtual void OnBeforeSceneUnloaded() { } 17 | public virtual IEnumerator OnStepCoroutine(EventData eventData) { yield break; } 18 | } 19 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Plugins/PluginBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: be5ab7a2e16ebae40b05836acc2b1f04 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/RLActors.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5aa917eb27b404e11a69e263efd403df 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/RLActors/Actions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 199bfb14e71f74697a59145960ffa20b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/RLActors/Actor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a883693ed1067e32a90d57db76839fc 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/RLActors/Map.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 89d8a1b431cfa92428144a7753080211 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/RLActors/MapPool.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace Simulate.RlAgents { 6 | public class MapPool : IEnumerable { 7 | Queue pool; 8 | 9 | public MapPool() { 10 | pool = new Queue(); 11 | } 12 | 13 | public void Push(Map map) { 14 | Debug.Assert(!pool.Contains(map)); 15 | map.SetActive(false); 16 | pool.Enqueue(map); 17 | } 18 | 19 | public Map Request() { 20 | if (pool.Count == 0) { 21 | Debug.LogWarning("Pool empty"); 22 | return null; 23 | } 24 | Map map = pool.Dequeue(); 25 | map.SetActive(true); 26 | return map; 27 | } 28 | 29 | public void Clear() { 30 | pool.Clear(); 31 | } 32 | 33 | public IEnumerator GetEnumerator() { 34 | return pool.GetEnumerator(); 35 | } 36 | 37 | IEnumerator IEnumerable.GetEnumerator() { 38 | return GetEnumerator(); 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/RLActors/MapPool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 314769c7ec80df142bd21bfd9d2ca5cb 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/RLActors/RLPlugin.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d9344ee1421e1e488de5cc0996a5610 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/RLActors/RewardFunction.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0ef67e38d2b534ea085f0f675c2f5489 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/RLActors/Sensors.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7ba2bcd41d8046d3a994db59f181dced 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/RLActors/Sensors/CameraSensor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3ef074acaf4b877d690c0f8a7383b4e1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/RLActors/Sensors/ISensors.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using UnityEngine; 3 | 4 | namespace Simulate { 5 | public class Buffer { 6 | public float[] floatBuffer; 7 | public uint[] uintBuffer; 8 | public string type; 9 | public int[] shape; 10 | 11 | public int size; 12 | 13 | public Buffer(int size, int[] shape, string type) { 14 | this.type = type; 15 | this.shape = shape; 16 | this.size = size; 17 | if (type == "float") { 18 | floatBuffer = new float[size]; 19 | } else if (type == "uint8") { 20 | uintBuffer = new uint[size]; 21 | } else { 22 | Debug.Log("trying to create SensorBuffer with unknown type " + type); 23 | } 24 | } 25 | 26 | public string ToJson(int[] shape, string name) { 27 | if (type == "float") { 28 | return JsonHelper.ToJson(floatBuffer, shape, name); 29 | } else if (type == "uint8") { 30 | return JsonHelper.ToJson(uintBuffer, shape, name); 31 | } else { 32 | Debug.Log("trying to parse SensorBuffer with unknown type " + type); 33 | return ""; 34 | } 35 | } 36 | } 37 | 38 | public interface ISensor { 39 | string GetName(); 40 | string GetSensorBufferType(); 41 | int GetSize(); 42 | int[] GetShape(); 43 | void Enable(); 44 | void Disable(); 45 | void AddObsToBuffer(Buffer buffer, int bufferIndex); 46 | } 47 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/RLActors/Sensors/ISensors.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a04118ce402bc4efbab2490decb39579 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/RLActors/Sensors/JsonHelper.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | 4 | namespace Simulate { 5 | public static class JsonHelper { 6 | public static T[] FromJson(string json) { 7 | Wrapper wrapper = JsonUtility.FromJson>(json); 8 | return wrapper.items; 9 | } 10 | 11 | public static string ToJson(T[] array) { 12 | Wrapper wrapper = new Wrapper(); 13 | wrapper.items = array; 14 | return JsonUtility.ToJson(wrapper); 15 | } 16 | 17 | public static string ToJson(T[] array, int[] shape) { 18 | Wrapper wrapper = new Wrapper(); 19 | wrapper.items = array; 20 | wrapper.shape = shape; 21 | return JsonUtility.ToJson(wrapper); 22 | } 23 | 24 | public static string ToJson(T[] array, int[] shape, string name) { 25 | Wrapper wrapper = new Wrapper(); 26 | wrapper.items = array; 27 | wrapper.shape = shape; 28 | wrapper.name = name; 29 | return JsonUtility.ToJson(wrapper); 30 | } 31 | 32 | public static string ToJson(T[] array, bool prettyPrint) { 33 | Wrapper wrapper = new Wrapper(); 34 | wrapper.items = array; 35 | return JsonUtility.ToJson(wrapper, prettyPrint); 36 | } 37 | 38 | [Serializable] 39 | private class Wrapper { 40 | public T[] items; 41 | public int[] shape; 42 | public string name; 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/RLActors/Sensors/JsonHelper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f73b59c6b060af10cb11e15ed352a871 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/RLActors/Sensors/RaycastSensor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f51480dfc9d78f3ebaa44d5e9f2dea40 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/RLActors/Sensors/StateSensor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b6c4c937e8c0bd8ed8da56994227cb7c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/RLActors/SimEnv.RLAgents.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Simulate.RLAgents", 3 | "rootNamespace": "", 4 | "references": [ 5 | "GUID:20acf4accf2cab340945bbf78cc82cf7" 6 | ], 7 | "includePlatforms": [], 8 | "excludePlatforms": [], 9 | "allowUnsafeCode": false, 10 | "overrideReferences": false, 11 | "precompiledReferences": [], 12 | "autoReferenced": true, 13 | "defineConstraints": [], 14 | "versionDefines": [], 15 | "noEngineReferences": false 16 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/RLActors/SimEnv.RLAgents.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0c9ce8845e1d4b74a8ec83a8cd83b5ed 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/RenderCamera.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 62f080d0cb2baa7479c1f4ec82358223 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Simulate.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Runtime", 3 | "rootNamespace": "", 4 | "references": [ 5 | "GUID:15fc0a57446b3144c949da3e2b9737a9" 6 | ], 7 | "includePlatforms": [], 8 | "excludePlatforms": [], 9 | "allowUnsafeCode": false, 10 | "overrideReferences": false, 11 | "precompiledReferences": [], 12 | "autoReferenced": false, 13 | "defineConstraints": [], 14 | "versionDefines": [], 15 | "noEngineReferences": false 16 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Simulate.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 20acf4accf2cab340945bbf78cc82cf7 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Simulation.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9aac8836facfdaa428103e62768d03fc 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Simulation/Config.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cbb9b9d7cc5eff449b35011fb1327993 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Simulation/EventData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Newtonsoft.Json; 4 | using Newtonsoft.Json.Linq; 5 | using UnityEngine; 6 | 7 | namespace Simulate { 8 | public class EventData { 9 | [JsonIgnore] public Dictionary inputKwargs; 10 | [JsonIgnore] public Dictionary outputKwargs; 11 | public Dictionary nodes; 12 | public Dictionary frames; 13 | 14 | public EventData() { 15 | nodes = new Dictionary(); 16 | frames = new Dictionary(); 17 | inputKwargs = new Dictionary(); 18 | outputKwargs = new Dictionary(); 19 | } 20 | } 21 | 22 | public class EventDataConverter : JsonConverter { 23 | public override bool CanRead => false; 24 | 25 | public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { 26 | throw new NotImplementedException(); 27 | } 28 | 29 | public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { 30 | EventData eventData = value as EventData; 31 | JObject jo = JObject.FromObject(eventData); 32 | foreach (string key in eventData.outputKwargs.Keys) { 33 | jo.Add(key, JObject.FromObject(eventData.outputKwargs[key])); 34 | 35 | } 36 | jo.WriteTo(writer); 37 | } 38 | 39 | public override bool CanConvert(Type objectType) { 40 | return objectType == typeof(EventData); 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Simulation/EventData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 894e14b88d875a340bf0bf37c04df0a2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Simulator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: edce4d304493ed6419d4714cb9c74c89 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Tests.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 30957bb0020fa2e81a12081751a65996 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Tests/EditMode.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 08f1c09553d475cb58b890a5fa4a4691 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Tests/EditMode/EditMode.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "EditMode", 3 | "rootNamespace": "", 4 | "references": [ 5 | "UnityEngine.TestRunner", 6 | "UnityEditor.TestRunner", 7 | "Runtime", 8 | "Simulate.RLAgents" 9 | ], 10 | "includePlatforms": [ 11 | "Editor" 12 | ], 13 | "excludePlatforms": [], 14 | "allowUnsafeCode": false, 15 | "overrideReferences": true, 16 | "precompiledReferences": [ 17 | "nunit.framework.dll" 18 | ], 19 | "autoReferenced": false, 20 | "defineConstraints": [ 21 | "UNITY_INCLUDE_TESTS" 22 | ], 23 | "versionDefines": [], 24 | "noEngineReferences": false 25 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Tests/EditMode/EditMode.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a76dcdf6b2b3adb97a6c4efd805396a3 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Tests/EditMode/TestRewardFunctions.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using NUnit.Framework; 4 | using UnityEngine; 5 | using UnityEngine.TestTools; 6 | using Simulate; 7 | using Simulate.RlAgents; 8 | 9 | 10 | public class TestRewardFunctions { 11 | // A Test behaves as an ordinary method 12 | } 13 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Tests/EditMode/TestRewardFunctions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 828bb5d90d36d4d83aef120bf746a543 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Tests/PlayMode.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: de783993b11dd5a22b88648749a29b7e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Tests/PlayMode/PlayMode.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "PlayMode", 3 | "rootNamespace": "", 4 | "references": [ 5 | "UnityEngine.TestRunner", 6 | "UnityEditor.TestRunner", 7 | "Runtime", 8 | "Simulate.RLAgents" 9 | ], 10 | "includePlatforms": [], 11 | "excludePlatforms": [], 12 | "allowUnsafeCode": false, 13 | "overrideReferences": true, 14 | "precompiledReferences": [ 15 | "nunit.framework.dll" 16 | ], 17 | "autoReferenced": false, 18 | "defineConstraints": [ 19 | "UNITY_INCLUDE_TESTS" 20 | ], 21 | "versionDefines": [], 22 | "noEngineReferences": false 23 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Tests/PlayMode/PlayMode.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6b52d908b636755258a43e16f9c9ee61 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Tests/PlayMode/TestRewardFunctions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3d5c79de77d86fc9097792bcf3bc36fd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Utils.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d69d14b478b02746a360c48b06d6d7b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Simulate/Runtime/Utils/DebugCam.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 757b6a32579269a42acdd1f92032b14f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/StreamingAssets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fe5cfccc2070ad14182a1073b10f317d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Tests.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a9383c25aa9ea4e16bca00837e4d9491 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Tests/Tests.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Tests", 3 | "optionalUnityReferences": [ 4 | "TestAssemblies" 5 | ], 6 | "includePlatforms": [ 7 | "Editor" 8 | ] 9 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/Assets/Tests/Tests.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 991e82c4836894f40a586154d3853947 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 1024 20 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/ProjectSettings/BurstAotSettings_StandaloneLinux64.json: -------------------------------------------------------------------------------- 1 | { 2 | "MonoBehaviour": { 3 | "Version": 4, 4 | "EnableBurstCompilation": true, 5 | "EnableOptimisations": true, 6 | "EnableSafetyChecks": false, 7 | "EnableDebugInAllBuilds": false, 8 | "UsePlatformSDKLinker": false, 9 | "CpuMinTargetX32": 0, 10 | "CpuMaxTargetX32": 0, 11 | "CpuMinTargetX64": 0, 12 | "CpuMaxTargetX64": 0, 13 | "CpuTargetsX64": 72, 14 | "OptimizeFor": 0 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/ProjectSettings/BurstAotSettings_StandaloneOSX.json: -------------------------------------------------------------------------------- 1 | { 2 | "MonoBehaviour": { 3 | "Version": 4, 4 | "EnableBurstCompilation": true, 5 | "EnableOptimisations": true, 6 | "EnableSafetyChecks": false, 7 | "EnableDebugInAllBuilds": false, 8 | "UsePlatformSDKLinker": false, 9 | "CpuMinTargetX32": 0, 10 | "CpuMaxTargetX32": 0, 11 | "CpuMinTargetX64": 0, 12 | "CpuMaxTargetX64": 0, 13 | "CpuTargetsX64": 72, 14 | "OptimizeFor": 0 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/ProjectSettings/BurstAotSettings_StandaloneWindows.json: -------------------------------------------------------------------------------- 1 | { 2 | "MonoBehaviour": { 3 | "Version": 4, 4 | "EnableBurstCompilation": true, 5 | "EnableOptimisations": true, 6 | "EnableSafetyChecks": false, 7 | "EnableDebugInAllBuilds": false, 8 | "UsePlatformSDKLinker": false, 9 | "CpuMinTargetX32": 0, 10 | "CpuMaxTargetX32": 0, 11 | "CpuMinTargetX64": 0, 12 | "CpuMaxTargetX64": 0, 13 | "CpuTargetsX32": 6, 14 | "CpuTargetsX64": 72, 15 | "OptimizeFor": 0 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/ProjectSettings/BurstAotSettings_WebGL 2.json: -------------------------------------------------------------------------------- 1 | { 2 | "MonoBehaviour": { 3 | "Version": 4, 4 | "EnableBurstCompilation": true, 5 | "EnableOptimisations": true, 6 | "EnableSafetyChecks": false, 7 | "EnableDebugInAllBuilds": false, 8 | "CpuMinTargetX32": 0, 9 | "CpuMaxTargetX32": 0, 10 | "CpuMinTargetX64": 0, 11 | "CpuMaxTargetX64": 0, 12 | "OptimizeFor": 0 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/ProjectSettings/BurstAotSettings_WebGL.json: -------------------------------------------------------------------------------- 1 | { 2 | "MonoBehaviour": { 3 | "Version": 4, 4 | "EnableBurstCompilation": true, 5 | "EnableOptimisations": true, 6 | "EnableSafetyChecks": false, 7 | "EnableDebugInAllBuilds": false, 8 | "CpuMinTargetX32": 0, 9 | "CpuMaxTargetX32": 0, 10 | "CpuMinTargetX64": 0, 11 | "CpuMaxTargetX64": 0, 12 | "OptimizeFor": 0 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/ProjectSettings/CommonBurstAotSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "MonoBehaviour": { 3 | "Version": 4, 4 | "DisabledWarnings": "" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Gravity: {x: 0, y: -29.43, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_DefaultMaxDepenetrationVelocity: 10 11 | m_SleepThreshold: 0.005 12 | m_DefaultContactOffset: 0.01 13 | m_DefaultSolverIterations: 6 14 | m_DefaultSolverVelocityIterations: 1 15 | m_QueriesHitBackfaces: 0 16 | m_QueriesHitTriggers: 1 17 | m_EnableAdaptiveForce: 0 18 | m_ClothInterCollisionDistance: 0 19 | m_ClothInterCollisionStiffness: 0 20 | m_ContactsGeneration: 1 21 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 22 | m_AutoSimulation: 1 23 | m_AutoSyncTransforms: 0 24 | m_ReuseCollisionCallbacks: 1 25 | m_ClothInterCollisionSettingsToggle: 0 26 | m_ClothGravity: {x: 0, y: -9.81, z: 0} 27 | m_ContactPairsMode: 0 28 | m_BroadphaseType: 0 29 | m_WorldBounds: 30 | m_Center: {x: 0, y: 0, z: 0} 31 | m_Extent: {x: 250, y: 250, z: 250} 32 | m_WorldSubdivisions: 8 33 | m_FrictionType: 0 34 | m_EnableEnhancedDeterminism: 0 35 | m_EnableUnifiedHeightmaps: 1 36 | m_ImprovedPatchFriction: 0 37 | m_SolverType: 0 38 | m_DefaultMaxAngularSpeed: 7 39 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/Scenes/SampleScene.unity 10 | guid: 9fc0d4010bbf28b4594072e72b8655ab 11 | m_configObjects: 12 | com.unity.addressableassets: {fileID: 11400000, guid: 0d3464c755331d547813943f22ef1dbe, type: 2} 13 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 0 10 | m_DefaultBehaviorMode: 0 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 0 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 1 16 | m_EtcTextureFastCompressor: 1 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 4 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInEditMode: 1 24 | m_EnableTextureStreamingInPlayMode: 1 25 | m_AsyncShaderCompilation: 1 26 | m_EnterPlayModeOptionsEnabled: 0 27 | m_EnterPlayModeOptions: 3 28 | m_ShowLightmapResolutionOverlay: 1 29 | m_UseLegacyProbeSampleCount: 0 30 | m_SerializeInlineMappingsOnOneLine: 1 31 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/ProjectSettings/MemorySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!387306366 &1 4 | MemorySettings: 5 | m_ObjectHideFlags: 0 6 | m_EditorMemorySettings: 7 | m_MainAllocatorBlockSize: -1 8 | m_ThreadAllocatorBlockSize: -1 9 | m_MainGfxBlockSize: -1 10 | m_ThreadGfxBlockSize: -1 11 | m_CacheBlockSize: -1 12 | m_TypetreeBlockSize: -1 13 | m_ProfilerBlockSize: -1 14 | m_ProfilerEditorBlockSize: -1 15 | m_BucketAllocatorGranularity: -1 16 | m_BucketAllocatorBucketsCount: -1 17 | m_BucketAllocatorBlockSize: -1 18 | m_BucketAllocatorBlockCount: -1 19 | m_ProfilerBucketAllocatorGranularity: -1 20 | m_ProfilerBucketAllocatorBucketsCount: -1 21 | m_ProfilerBucketAllocatorBlockSize: -1 22 | m_ProfilerBucketAllocatorBlockCount: -1 23 | m_TempAllocatorSizeMain: -1 24 | m_JobTempAllocatorBlockSize: -1 25 | m_BackgroundJobTempAllocatorBlockSize: -1 26 | m_JobTempAllocatorReducedBlockSize: -1 27 | m_TempAllocatorSizeGIBakingWorker: -1 28 | m_TempAllocatorSizeNavMeshWorker: -1 29 | m_TempAllocatorSizeAudioWorker: -1 30 | m_TempAllocatorSizeCloudWorker: -1 31 | m_TempAllocatorSizeGfx: -1 32 | m_TempAllocatorSizeJobWorker: -1 33 | m_TempAllocatorSizeBackgroundWorker: -1 34 | m_TempAllocatorSizePreloadManager: -1 35 | m_PlatformMemorySettings: {} 36 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreReleasePackages: 0 16 | m_EnablePackageDependencies: 0 17 | m_AdvancedSettingsExpanded: 1 18 | m_ScopedRegistriesSettingsExpanded: 1 19 | m_SeeAllPackageVersions: 0 20 | oneTimeWarningShown: 0 21 | m_Registries: 22 | - m_Id: main 23 | m_Name: 24 | m_Url: https://packages.unity.com 25 | m_Scopes: [] 26 | m_IsDefault: 1 27 | m_Capabilities: 7 28 | m_UserSelectedRegistryName: 29 | m_UserAddingNewScopedRegistry: 0 30 | m_RegistryInfoDraft: 31 | m_Modified: 0 32 | m_ErrorMessage: 33 | m_UserModificationsInstanceId: -830 34 | m_OriginalInstanceId: -832 35 | m_LoadAssets: 0 36 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "m_Name": "Settings", 3 | "m_Path": "ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json", 4 | "m_Dictionary": { 5 | "m_DictionaryValues": [] 6 | } 7 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_DefaultPresets: {} 8 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2021.3.2f1 2 | m_EditorVersionWithRevision: 2021.3.2f1 (d6360bedb9a0) 3 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/ProjectSettings/ShaderGraphSettings 2.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: de02f9e1d18f588468e474319d09a723, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | customInterpolatorErrorThreshold: 32 16 | customInterpolatorWarningThreshold: 16 17 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/ProjectSettings/ShaderGraphSettings 3.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: de02f9e1d18f588468e474319d09a723, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | customInterpolatorErrorThreshold: 32 16 | customInterpolatorWarningThreshold: 16 17 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/ProjectSettings/ShaderGraphSettings 4.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: de02f9e1d18f588468e474319d09a723, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | customInterpolatorErrorThreshold: 32 16 | customInterpolatorWarningThreshold: 16 17 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/ProjectSettings/ShaderGraphSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: de02f9e1d18f588468e474319d09a723, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | customInterpolatorErrorThreshold: 32 16 | customInterpolatorWarningThreshold: 16 17 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: 7 | - Actor 8 | layers: 9 | - Default 10 | - TransparentFX 11 | - Ignore Raycast 12 | - 13 | - Water 14 | - UI 15 | - Ground 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | - 41 | m_SortingLayers: 42 | - name: Default 43 | uniqueID: 0 44 | locked: 0 45 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/ProjectSettings/URPProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 247994e1f5a72c2419c26a37e9334c01, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_LastMaterialVersion: 5 16 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_DashboardUrl: https://dashboard.unity3d.com 13 | m_TestInitMode: 0 14 | CrashReportingSettings: 15 | m_EventUrl: https://perf-events.cloud.unity3d.com 16 | m_Enabled: 0 17 | m_LogBufferSize: 10 18 | m_CaptureEditorExceptions: 1 19 | UnityPurchasingSettings: 20 | m_Enabled: 0 21 | m_TestMode: 0 22 | UnityAnalyticsSettings: 23 | m_Enabled: 0 24 | m_TestMode: 0 25 | m_InitializeOnStartup: 1 26 | UnityAdsSettings: 27 | m_Enabled: 0 28 | m_InitializeOnStartup: 1 29 | m_TestMode: 0 30 | m_IosGameId: 31 | m_AndroidGameId: 32 | m_GameIds: {} 33 | m_GameId: 34 | PerformanceReportingSettings: 35 | m_Enabled: 0 36 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_StripUpdateShader: {fileID: 0} 10 | m_RenderPipeSettingsPath: 11 | m_FixedTimeStep: 0.016666668 12 | m_MaxDeltaTime: 0.05 13 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /integrations/Unity/simulate-unity/ProjectSettings/boot.config: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huggingface/simulate/1a7832e46bd4702490e223612a528b586fb36eb1/integrations/Unity/simulate-unity/ProjectSettings/boot.config -------------------------------------------------------------------------------- /integrations/Unity/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huggingface/simulate/1a7832e46bd4702490e223612a528b586fb36eb1/integrations/Unity/tests/__init__.py -------------------------------------------------------------------------------- /integrations/Unity/tests/conftest.py: -------------------------------------------------------------------------------- 1 | import socket 2 | 3 | import pytest 4 | 5 | 6 | def pytest_addoption(parser): 7 | parser.addoption("--build_exe", action="store", help="path to Unity build") 8 | 9 | 10 | @pytest.fixture(scope="session") 11 | def port_number(worker_id): 12 | """use a different port in each xdist worker""" 13 | port = 56000 + hash(worker_id) % 1024 14 | with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: 15 | if s.connect_ex(("localhost", port)) == 0: 16 | port = 58000 + hash(worker_id) % 1024 # test another port 17 | with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: 18 | if s.connect_ex(("localhost", port)) == 0: 19 | raise Exception("No available port found") 20 | return port 21 | 22 | 23 | @pytest.fixture(scope="session") 24 | def build_exe(pytestconfig): 25 | value = pytestconfig.getoption("build_exe") 26 | if value is None: 27 | raise ValueError("Please provide a path to the Unity build executable") 28 | return value 29 | 30 | 31 | @pytest.fixture(scope="session") 32 | def set_mpl(): 33 | """Avoid matplotlib windows popping up.""" 34 | try: 35 | import matplotlib 36 | except Exception: 37 | pass 38 | else: 39 | matplotlib.use("agg", force=True) 40 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = [ 3 | "setuptools>=42", 4 | "scikit-build", 5 | "cmake>=3.22", 6 | "pybind11>=2.10.0", 7 | "numpy>=1.17", 8 | "ninja; platform_system!='Windows'" 9 | ] 10 | build-backend = "setuptools.build_meta" 11 | 12 | [tool.cibuildwheel] 13 | test-command = "python {project}/tests/test_scene.py" 14 | test-skip = "*universal2:arm64" -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | license_files = LICENSE 3 | 4 | [isort] 5 | ensure_newline_before_comments = True 6 | force_grid_wrap = 0 7 | include_trailing_comma = True 8 | line_length = 119 9 | lines_after_imports = 2 10 | multi_line_output = 3 11 | use_parentheses = True 12 | 13 | [flake8] 14 | ignore = E203, E501, W503 15 | max-line-length = 119 16 | per-file-ignores = __init__.py:F401, F403 17 | -------------------------------------------------------------------------------- /src/simulate/__init__.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa 2 | # Copyright 2020 The HuggingFace Simulate Authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # Lint as: python3 17 | # pylint: enable=line-too-long 18 | # pylint: disable=g-import-not-at-top,g-bad-import-order,wrong-import-position 19 | 20 | __version__ = "0.1.3.dev0" 21 | 22 | from .assets import * 23 | from .assets.utils import * 24 | from .config import Config 25 | from .engine import * 26 | from .rl import MultiProcessRLEnv, ParallelRLEnv, RLEnv 27 | from .scene import Scene 28 | from .utils import logging 29 | 30 | 31 | logger = logging.get_logger(__name__) 32 | 33 | # Set Hugging Face hub debug verbosity (TODO remove) 34 | logging.set_verbosity_debug() 35 | -------------------------------------------------------------------------------- /src/simulate/assets/__init__.py: -------------------------------------------------------------------------------- 1 | from .action_mapping import * 2 | from .actors import * 3 | from .actuator import * 4 | from .articulation_body import * 5 | from .asset import Asset 6 | from .camera import * 7 | from .collider import * 8 | from .light import * 9 | from .material import * 10 | from .object import * 11 | from .reward_functions import * 12 | from .rigid_body import * 13 | from .sensors import * 14 | from .utils import * 15 | -------------------------------------------------------------------------------- /src/simulate/assets/anytree/__init__.py: -------------------------------------------------------------------------------- 1 | from .exceptions import TreeError 2 | from .nodemixin import NodeMixin 3 | from .render import RenderTree 4 | -------------------------------------------------------------------------------- /src/simulate/assets/anytree/exceptions.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); 2 | # you may not use this file except in compliance with the License. 3 | # You may obtain a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | 13 | # Lint as: python3 14 | 15 | 16 | class TreeError(RuntimeError): 17 | """Tree Error.""" 18 | 19 | pass 20 | 21 | 22 | class LoopError(TreeError): 23 | """Tree contains infinite loop.""" 24 | 25 | pass 26 | -------------------------------------------------------------------------------- /src/simulate/assets/gltflib/__init__.py: -------------------------------------------------------------------------------- 1 | from .enums import * 2 | from .gltf import GLTF 3 | from .gltf_resource import ( 4 | GLB_BINARY_CHUNK_TYPE, 5 | GLB_JSON_CHUNK_TYPE, 6 | Base64Resource, 7 | ExternalResource, 8 | FileResource, 9 | GLBResource, 10 | GLTFResource, 11 | ) 12 | from .models import * 13 | from .utils import * 14 | -------------------------------------------------------------------------------- /src/simulate/assets/gltflib/__version__.py: -------------------------------------------------------------------------------- 1 | VERSION = (1, 0, 12) 2 | 3 | __version__ = ".".join(map(str, VERSION)) 4 | -------------------------------------------------------------------------------- /src/simulate/assets/gltflib/enums/__init__.py: -------------------------------------------------------------------------------- 1 | from .accessor_type import AccessorType 2 | from .alpha_mode import AlphaMode 3 | from .animation_target_path import AnimationTargetPath 4 | from .buffer_target import BufferTarget 5 | from .camera_type import CameraType 6 | from .component_type import ComponentType 7 | from .interpolation import Interpolation 8 | from .primitive_mode import PrimitiveMode 9 | from .rigidbody_constraints import RigidbodyConstraints 10 | -------------------------------------------------------------------------------- /src/simulate/assets/gltflib/enums/accessor_type.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The HuggingFace Authors. 2 | # Copyright (c) 2019 Sergey Krilov 3 | # Copyright (c) 2018 Luke Miller 4 | # 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 all 13 | # 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 THE 21 | # SOFTWARE. 22 | 23 | # Lint as: python3 24 | from enum import Enum 25 | 26 | 27 | class AccessorType( 28 | str, Enum 29 | ): # This is an equivalent StrEnum class (see https://docs.python.org/3/library/enum.html#others0) 30 | SCALAR = "SCALAR" 31 | VEC2 = "VEC2" 32 | VEC3 = "VEC3" 33 | VEC4 = "VEC4" 34 | MAT2 = "MAT2" 35 | MAT3 = "MAT3" 36 | MAT4 = "MAT4" 37 | -------------------------------------------------------------------------------- /src/simulate/assets/gltflib/enums/alpha_mode.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The HuggingFace Authors. 2 | # Copyright (c) 2019 Sergey Krilov 3 | # Copyright (c) 2018 Luke Miller 4 | # 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 all 13 | # 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 THE 21 | # SOFTWARE. 22 | 23 | # Lint as: python3 24 | from enum import Enum 25 | 26 | 27 | class AlphaMode(Enum): 28 | OPAQUE = "OPAQUE" 29 | MASK = "MASK" 30 | BLEND = "BLEND" 31 | -------------------------------------------------------------------------------- /src/simulate/assets/gltflib/enums/animation_target_path.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The HuggingFace Authors. 2 | # Copyright (c) 2019 Sergey Krilov 3 | # Copyright (c) 2018 Luke Miller 4 | # 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 all 13 | # 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 THE 21 | # SOFTWARE. 22 | 23 | # Lint as: python3 24 | from enum import Enum 25 | 26 | 27 | class AnimationTargetPath(Enum): 28 | TRANSLATION = "translation" 29 | ROTATION = "rotation" 30 | SCALE = "scale" 31 | WEIGHTS = "weights" 32 | -------------------------------------------------------------------------------- /src/simulate/assets/gltflib/enums/buffer_target.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The HuggingFace Authors. 2 | # Copyright (c) 2019 Sergey Krilov 3 | # Copyright (c) 2018 Luke Miller 4 | # 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 all 13 | # 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 THE 21 | # SOFTWARE. 22 | 23 | # Lint as: python3 24 | from enum import IntEnum 25 | 26 | 27 | class BufferTarget(IntEnum): 28 | ARRAY_BUFFER = 34962 29 | ELEMENT_ARRAY_BUFFER = 34963 30 | -------------------------------------------------------------------------------- /src/simulate/assets/gltflib/enums/camera_type.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The HuggingFace Authors. 2 | # Copyright (c) 2019 Sergey Krilov 3 | # Copyright (c) 2018 Luke Miller 4 | # 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 all 13 | # 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 THE 21 | # SOFTWARE. 22 | 23 | # Lint as: python3 24 | from enum import Enum 25 | 26 | 27 | class CameraType(Enum): 28 | PERSPECTIVE = "perspective" 29 | ORTHOGRAPHIC = "orthographic" 30 | -------------------------------------------------------------------------------- /src/simulate/assets/gltflib/enums/component_type.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The HuggingFace Authors. 2 | # Copyright (c) 2019 Sergey Krilov 3 | # Copyright (c) 2018 Luke Miller 4 | # 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 all 13 | # 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 THE 21 | # SOFTWARE. 22 | 23 | # Lint as: python3 24 | from enum import IntEnum 25 | 26 | 27 | class ComponentType(IntEnum): 28 | BYTE = 5120 29 | UNSIGNED_BYTE = 5121 30 | SHORT = 5122 31 | UNSIGNED_SHORT = 5123 32 | UNSIGNED_INT = 5125 33 | FLOAT = 5126 34 | -------------------------------------------------------------------------------- /src/simulate/assets/gltflib/enums/interpolation.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The HuggingFace Authors. 2 | # Copyright (c) 2019 Sergey Krilov 3 | # Copyright (c) 2018 Luke Miller 4 | # 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 all 13 | # 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 THE 21 | # SOFTWARE. 22 | 23 | # Lint as: python3 24 | from enum import Enum 25 | 26 | 27 | class Interpolation(Enum): 28 | LINEAR = "LINEAR" 29 | STEP = "STEP" 30 | CUBICSPLINE = "CUBICSPLINE" 31 | -------------------------------------------------------------------------------- /src/simulate/assets/gltflib/enums/primitive_mode.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The HuggingFace Authors. 2 | # Copyright (c) 2019 Sergey Krilov 3 | # Copyright (c) 2018 Luke Miller 4 | # 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 all 13 | # 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 THE 21 | # SOFTWARE. 22 | 23 | # Lint as: python3 24 | from enum import IntEnum 25 | 26 | 27 | class PrimitiveMode(IntEnum): 28 | POINTS = 0 29 | LINES = 1 30 | LINE_LOOP = 2 31 | LINE_STRIP = 3 32 | TRIANGLES = 4 33 | TRIANGLE_STRIP = 5 34 | -------------------------------------------------------------------------------- /src/simulate/assets/gltflib/enums/rigidbody_constraints.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The HuggingFace Authors. 2 | # Copyright (c) 2019 Sergey Krilov 3 | # Copyright (c) 2018 Luke Miller 4 | # 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 all 13 | # 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 THE 21 | # SOFTWARE. 22 | 23 | # Lint as: python3 24 | from enum import Enum 25 | 26 | 27 | class RigidbodyConstraints(str, Enum): 28 | FREEZE_POSITION_X = "freeze_position_x" 29 | FREEZE_POSITION_Y = "freeze_position_y" 30 | FREEZE_POSITION_Z = "freeze_position_z" 31 | FREEZE_ROTATION_X = "freeze_rotation_x" 32 | FREEZE_ROTATION_Y = "freeze_rotation_y" 33 | FREEZE_ROTATION_Z = "freeze_rotation_z" 34 | -------------------------------------------------------------------------------- /src/simulate/assets/gltflib/models/__init__.py: -------------------------------------------------------------------------------- 1 | from .accessor import Accessor 2 | from .animation import Animation 3 | from .animation_sampler import AnimationSampler 4 | from .asset import Asset 5 | from .attributes import Attributes 6 | from .base_model import Extensions 7 | from .buffer import Buffer 8 | from .buffer_view import BufferView 9 | from .camera import Camera 10 | from .channel import Channel 11 | from .extensions import * 12 | from .gltf_model import GLTFModel 13 | from .image import Image 14 | from .material import Material 15 | from .mesh import Mesh 16 | from .node import Node 17 | from .normal_texture_info import NormalTextureInfo 18 | from .occlusion_texture_info import OcclusionTextureInfo 19 | from .orthographic_camera_info import OrthographicCameraInfo 20 | from .pbr_metallic_roughness import PBRMetallicRoughness 21 | from .perspective_camera_info import PerspectiveCameraInfo 22 | from .primitive import Primitive 23 | from .sampler import Sampler 24 | from .scene import Scene 25 | from .skin import Skin 26 | from .sparse import Sparse 27 | from .sparse_indices import SparseIndices 28 | from .sparse_values import SparseValues 29 | from .target import Target 30 | from .texture import Texture 31 | from .texture_info import TextureInfo 32 | -------------------------------------------------------------------------------- /src/simulate/assets/gltflib/models/extensions/__init__.py: -------------------------------------------------------------------------------- 1 | from .khr_lights_ponctual import * 2 | -------------------------------------------------------------------------------- /src/simulate/assets/gltflib/utils/__init__.py: -------------------------------------------------------------------------------- 1 | from .data_utils import padbytes 2 | from .file_utils import create_parent_dirs 3 | from .json_utils import del_none, replace_unique_id_and_remove_none 4 | -------------------------------------------------------------------------------- /src/simulate/assets/gltflib/utils/data_utils.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The HuggingFace Authors. 2 | # Copyright (c) 2019 Sergey Krilov 3 | # Copyright (c) 2018 Luke Miller 4 | # 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 all 13 | # 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 THE 21 | # SOFTWARE. 22 | 23 | # Lint as: python3 24 | 25 | 26 | def padbytes(arr: bytearray, alignment: int, fillchar: bytes = b"\x00", offset: int = 0) -> int: 27 | arrlen = len(arr) 28 | padlen = (alignment - ((arrlen + offset) % alignment)) % alignment 29 | if padlen > 0: 30 | arr.extend(padlen * fillchar) 31 | return arrlen + padlen 32 | return arrlen 33 | -------------------------------------------------------------------------------- /src/simulate/assets/procgen/__init__.py: -------------------------------------------------------------------------------- 1 | from .constants import TILE_SIZE 2 | from .wfc import generate_seed 3 | -------------------------------------------------------------------------------- /src/simulate/assets/procgen/constants.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The HuggingFace Authors. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Lint as: python3 16 | """Constants of procgen module.""" 17 | 18 | # Size of the tile 19 | TILE_SIZE = 1.0 20 | -------------------------------------------------------------------------------- /src/simulate/assets/procgen/prims/__init__.py: -------------------------------------------------------------------------------- 1 | from .build_map import generate_prims_maze 2 | -------------------------------------------------------------------------------- /src/simulate/assets/procgen/wfc/__init__.py: -------------------------------------------------------------------------------- 1 | from .build_map import generate_2d_map, generate_map 2 | from .wfc_utils import generate_seed 3 | from .wfc_wrapping import build_wfc_neighbor, build_wfc_tile 4 | -------------------------------------------------------------------------------- /src/simulate/assets/procgen/wfc/wfc_utils.py: -------------------------------------------------------------------------------- 1 | """ 2 | Utils function for Wave function collapse. 3 | """ 4 | 5 | import numpy as np 6 | 7 | 8 | def generate_seed() -> int: 9 | """ 10 | Generate seeds to pass to the C++ side. 11 | """ 12 | return np.random.randint(0, 2**32, dtype=np.uint32) 13 | -------------------------------------------------------------------------------- /src/simulate/assets/spaces/__init__.py: -------------------------------------------------------------------------------- 1 | from .box import Box 2 | from .dict import Dict 3 | from .discrete import Discrete 4 | from .multi_binary import MultiBinary 5 | from .multi_discrete import MultiDiscrete 6 | from .space import Space 7 | from .tuple import Tuple 8 | from .utils import flatdim, flatten, flatten_space, unflatten 9 | -------------------------------------------------------------------------------- /src/simulate/engine/__init__.py: -------------------------------------------------------------------------------- 1 | from .blender_engine import BlenderEngine 2 | from .engine import Engine 3 | from .godot_engine import GodotEngine 4 | from .notebook_engine import NotebookEngine, in_notebook 5 | from .pyvista_engine import PyVistaEngine 6 | from .unity_engine import UnityEngine 7 | -------------------------------------------------------------------------------- /src/simulate/engine/notebook_viewer.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huggingface/simulate/1a7832e46bd4702490e223612a528b586fb36eb1/src/simulate/engine/notebook_viewer.zip -------------------------------------------------------------------------------- /src/simulate/rl/__init__.py: -------------------------------------------------------------------------------- 1 | from .multi_proc_rl_env import MultiProcessRLEnv 2 | from .parallel_rl_env import ParallelRLEnv 3 | from .rl_env import RLEnv 4 | -------------------------------------------------------------------------------- /src/simulate/utils/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Optuna, Hugging Face 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from .imports import is_fastwfc_available, is_vhacd_available 16 | -------------------------------------------------------------------------------- /src/simulate/utils/imports.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Optuna, Hugging Face 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | """ Import utilities.""" 15 | 16 | import importlib.util 17 | 18 | 19 | _vhacd_available = importlib.util.find_spec("simulate._vhacd") is not None 20 | _fastwfc_available = importlib.util.find_spec("simulate._fastwfc") is not None 21 | 22 | 23 | def is_vhacd_available(): 24 | return _vhacd_available 25 | 26 | 27 | def is_fastwfc_available(): 28 | return _fastwfc_available 29 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huggingface/simulate/1a7832e46bd4702490e223612a528b586fb36eb1/tests/__init__.py -------------------------------------------------------------------------------- /tests/conftest.py: -------------------------------------------------------------------------------- 1 | import pyvista 2 | from pytest import fixture 3 | 4 | 5 | pyvista.OFF_SCREEN = True 6 | 7 | 8 | @fixture(scope="session") 9 | def set_mpl(): 10 | """Avoid matplotlib windows popping up.""" 11 | try: 12 | import matplotlib 13 | except Exception: 14 | pass 15 | else: 16 | matplotlib.use("agg", force=True) 17 | -------------------------------------------------------------------------------- /tests/test_assets/test_camera.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The HuggingFace Authors. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Lint as: python3 16 | import unittest 17 | 18 | import simulate as sm 19 | 20 | 21 | # TODO add more tests on saving/exporting/loading gltf cameras in gltf files 22 | class CameraTest(unittest.TestCase): 23 | def test_create_camera(self): 24 | camera = sm.Camera() 25 | self.assertIsInstance(camera, sm.Camera) 26 | 27 | def test_create_distant_camera(self): 28 | camera = sm.CameraDistant() 29 | self.assertIsInstance(camera, sm.CameraDistant) 30 | -------------------------------------------------------------------------------- /tests/test_assets/test_light.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The HuggingFace Authors. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Lint as: python3 16 | import unittest 17 | 18 | import simulate as sm 19 | 20 | 21 | # TODO add more tests on saving/exporting/loading in gltf files 22 | class LightsTest(unittest.TestCase): 23 | def test_create_light(self): 24 | light = sm.Light() 25 | self.assertIsInstance(light, sm.Light) 26 | 27 | def test_create_light_sun(self): 28 | light = sm.LightSun() 29 | self.assertIsInstance(light, sm.LightSun) 30 | -------------------------------------------------------------------------------- /tests/test_assets/test_rigidbody_component.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The HuggingFace Authors. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Lint as: python3 16 | import unittest 17 | 18 | import simulate as sm 19 | 20 | 21 | # TODO add more tests on saving/exporting/loading in gltf files 22 | class RigidBodyTest(unittest.TestCase): 23 | def test_create_rigidbody(self): 24 | rb = sm.RigidBodyComponent() 25 | self.assertIsInstance(rb, sm.RigidBodyComponent) 26 | -------------------------------------------------------------------------------- /tests/test_engine/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huggingface/simulate/1a7832e46bd4702490e223612a528b586fb36eb1/tests/test_engine/__init__.py -------------------------------------------------------------------------------- /tests/test_gltflib/README.md: -------------------------------------------------------------------------------- 1 | # Tests examples taken from the original great gltflib 2 | 3 | Find the great gltflib by Lukas Shawford here: https://github.com/lukas-shawford/gltflib 4 | -------------------------------------------------------------------------------- /tests/test_gltflib/__init__.py: -------------------------------------------------------------------------------- 1 | from .e2e import * 2 | from .unit import * 3 | -------------------------------------------------------------------------------- /tests/test_gltflib/e2e/__init__.py: -------------------------------------------------------------------------------- 1 | from .test_roundtrip import TestRoundtrip 2 | -------------------------------------------------------------------------------- /tests/test_gltflib/samples/custom/BadEncoding/glb/utf-16-be.glb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huggingface/simulate/1a7832e46bd4702490e223612a528b586fb36eb1/tests/test_gltflib/samples/custom/BadEncoding/glb/utf-16-be.glb -------------------------------------------------------------------------------- /tests/test_gltflib/samples/custom/BadEncoding/glb/utf-16-le.glb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huggingface/simulate/1a7832e46bd4702490e223612a528b586fb36eb1/tests/test_gltflib/samples/custom/BadEncoding/glb/utf-16-le.glb -------------------------------------------------------------------------------- /tests/test_gltflib/samples/custom/BadEncoding/glb/utf-8-bom.glb: -------------------------------------------------------------------------------- 1 | glTFP JSON{"asset":{"version":"2.0"}} BINsample binary data -------------------------------------------------------------------------------- /tests/test_gltflib/samples/custom/BadEncoding/glb/windows-1252.glb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huggingface/simulate/1a7832e46bd4702490e223612a528b586fb36eb1/tests/test_gltflib/samples/custom/BadEncoding/glb/windows-1252.glb -------------------------------------------------------------------------------- /tests/test_gltflib/samples/custom/BadEncoding/gltf/utf-16-be.gltf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huggingface/simulate/1a7832e46bd4702490e223612a528b586fb36eb1/tests/test_gltflib/samples/custom/BadEncoding/gltf/utf-16-be.gltf -------------------------------------------------------------------------------- /tests/test_gltflib/samples/custom/BadEncoding/gltf/utf-16-le.gltf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huggingface/simulate/1a7832e46bd4702490e223612a528b586fb36eb1/tests/test_gltflib/samples/custom/BadEncoding/gltf/utf-16-le.gltf -------------------------------------------------------------------------------- /tests/test_gltflib/samples/custom/BadEncoding/gltf/utf-8-bom.gltf: -------------------------------------------------------------------------------- 1 | { 2 | "asset": { 3 | "version": "2.0" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/test_gltflib/samples/custom/BadEncoding/gltf/windows-1252.gltf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huggingface/simulate/1a7832e46bd4702490e223612a528b586fb36eb1/tests/test_gltflib/samples/custom/BadEncoding/gltf/windows-1252.gltf -------------------------------------------------------------------------------- /tests/test_gltflib/samples/custom/Corrupt/BinaryChunkEOF.glb: -------------------------------------------------------------------------------- 1 | glTF@JSON{"asset":{"version":"2.0"}} 2 | BIN -------------------------------------------------------------------------------- /tests/test_gltflib/samples/custom/Corrupt/JsonChunkEOF.glb: -------------------------------------------------------------------------------- 1 | glTF/ JSON{"asset":{"version":"2.0"}} -------------------------------------------------------------------------------- /tests/test_gltflib/samples/custom/EmptyChunk/EmptyBinaryChunk.glb: -------------------------------------------------------------------------------- 1 | glTF8JSON{"asset":{"version":"2.0"}} BIN -------------------------------------------------------------------------------- /tests/test_gltflib/samples/custom/External/external.glb: -------------------------------------------------------------------------------- 1 | glTFxdJSON{"asset":{"version":"2.0"},"buffers":[{"uri":"http://www.example.com/data.bin","byteLength":18}]} -------------------------------------------------------------------------------- /tests/test_gltflib/samples/custom/External/external.gltf: -------------------------------------------------------------------------------- 1 | { 2 | "asset": { 3 | "version": "2.0" 4 | }, 5 | "images": [ 6 | { 7 | "uri": "http://www.example.com/image.jpg", 8 | "mimeType": "image/jpeg" 9 | } 10 | ], 11 | "buffers": [ 12 | { 13 | "byteLength": 840, 14 | "uri": "http://www.example.com/data.bin" 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /tests/test_gltflib/samples/custom/Minimal/minimal.gltf: -------------------------------------------------------------------------------- 1 | { 2 | "asset": { 3 | "version": "2.0" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/test_gltflib/samples/custom/MultipleChunks/MultipleChunks.glb: -------------------------------------------------------------------------------- 1 | glTFl8JSON{"asset":{"version":"2.0"},"buffers":[{"byteLength":4}]}BINdata {more data -------------------------------------------------------------------------------- /tests/test_gltflib/unit/__init__.py: -------------------------------------------------------------------------------- 1 | from .test_gltf import TestGLTF 2 | from .test_gltf_model import TestGLTFModel 3 | -------------------------------------------------------------------------------- /tests/test_rl/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huggingface/simulate/1a7832e46bd4702490e223612a528b586fb36eb1/tests/test_rl/__init__.py -------------------------------------------------------------------------------- /tests/test_rl/test_wrappers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huggingface/simulate/1a7832e46bd4702490e223612a528b586fb36eb1/tests/test_rl/test_wrappers/__init__.py -------------------------------------------------------------------------------- /tests/test_scene.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The HuggingFace Authors. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Lint as: python3 16 | import unittest 17 | 18 | import simulate as sm 19 | 20 | 21 | class SceneTest(unittest.TestCase): 22 | def test_create_scene_pyvista(self): 23 | scene = sm.Scene(engine=None) 24 | self.assertIsInstance(scene, sm.Asset) 25 | self.assertIsInstance(scene.engine, sm.PyVistaEngine) 26 | -------------------------------------------------------------------------------- /third-party/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory("fastwfc") 2 | add_subdirectory("vhacd") -------------------------------------------------------------------------------- /third-party/fastwfc/cmake/fastwfcTargets.cmake.in: -------------------------------------------------------------------------------- 1 | @PACKAGE_INIT@ 2 | 3 | include("${CMAKE_CURRENT_LIST_DIR}/fastwfcTargets.cmake") 4 | -------------------------------------------------------------------------------- /third-party/fastwfc/include/fastwfc/direction.hpp: -------------------------------------------------------------------------------- 1 | #ifndef FAST_WFC_DIRECTION_HPP_ 2 | #define FAST_WFC_DIRECTION_HPP_ 3 | 4 | /** 5 | * A direction is represented by an unsigned integer in the range [0; 3]. 6 | * The x and y values of the direction can be retrieved in these tables. 7 | */ 8 | constexpr int directions_x[4] = {0, -1, 1, 0}; 9 | constexpr int directions_y[4] = {-1, 0, 0, 1}; 10 | 11 | /** 12 | * Return the opposite direction of direction. 13 | */ 14 | constexpr unsigned get_opposite_direction(unsigned direction) noexcept { 15 | return 3 - direction; 16 | } 17 | 18 | #endif // FAST_WFC_DIRECTION_HPP_ 19 | -------------------------------------------------------------------------------- /third-party/vhacd/cmake/vhacdConfig.cmake.in: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huggingface/simulate/1a7832e46bd4702490e223612a528b586fb36eb1/third-party/vhacd/cmake/vhacdConfig.cmake.in -------------------------------------------------------------------------------- /third-party/vhacd/cmake/vhacdTargets.cmake.in: -------------------------------------------------------------------------------- 1 | @PACKAGE_INIT@ 2 | 3 | include("${CMAKE_CURRENT_LIST_DIR}/vhacdTargets.cmake") 4 | --------------------------------------------------------------------------------