├── .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