From 0f4911a96ed13ab073e543a615fa1fced71f4e38 Mon Sep 17 00:00:00 2001 From: Felix Klenner Date: Thu, 30 Nov 2023 11:50:57 +0100 Subject: [PATCH] Readme --- README.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..77b0f1a --- /dev/null +++ b/README.md @@ -0,0 +1,34 @@ +# Cable Joints implementation in Unity + +### Running: + + - Load project in Unity + - Select a scene from the file explorer in "Assets > Scenes" + - Enable Gizmos using the button in the top right of the game preview + - Press the play button + +### Code Structure +| File | Description| +|------------------------------------------------------------| -| + | [CableJointsAlgorithm.cs](Assets/CableJointsAlgorithm.cs) | Main Algorithm Implementation| + | [Controller.cs](Assets/Controller.cs) | Sets up the scene, creates Unity Game Objects| + | [RollerProperties.cs](Assets/RollerProperties.cs) | Contains properties for each part of the Cable| + | [Extensions.cs](Assets/Extensions.cs) | Useful extension methods| + +### Creating a scene: +An effort was made to simplify creation of new scenes as much as possible and create most required objects in code instead. + + - Create a new scene in unity + - Add the controller component to any object (e.g. the Main Camera) + - Add rollers using Right click > 2D Object > Sprites > Circle + - Other shapes can be added using the same menu + - Add the RollerProperties Component to all objects which should be connected by the cable and adjust the settings: + - Start: set for one of the ends of the cable + - Clockwise: determines the side the cable is running around the object + - Link To: Select the next game object the cable should be connected to + - Movement: Rotatable and Powered should only be used for circles and represent rollers. Fixed and Free can be used for any shape + - Use fixed attachment point: If set to true the object is not viewed as a roller, but a point attachment instead (e.g. weights) + - Objects not connected by cable (e.g. Floor) can be created by adding an sprite with a collider. + - Mass is calculated based on area + - Press 'T', to toggle powered wheels on and off. +