Closed AideenMonike closed 1 year ago
Bezier curve equation has been implemented in a test scene, using a chain of gameobjects. More information is available within the commits in the branch "FoilPhysics". Conditions now need to be set, then this script applied to the VR model.
Issue found with the logic involving the conditions to bend. In the attached video file it shows a slo-mo flick and quick slash with the foil, demonstrating how the foil flick is more of an effect of inertia, causing the tip to travel. Conditions involving sudden changes in acceleration will be explored.
https://github.com/AideenMonike/f3nce/assets/117270483/0706198e-a2cf-4f0d-90df-1a53d6991e64
Foil progress is closer to completion now. Originally, the plan was to contract the tip closer to the base as the foil bent, but that took lots of math to be effective for very diminishing returns i.e. lack of realism in physics. Additionally, it didn't have a way to create a bend based on motion. Another strategy that was tried was using joint and other physics-based components inbuilt to the unity engine. This did not work as intended, and gave the same returns as when it was tested previously (reference commit from abt. February of the Foil physics branch). The separate bones wouldn't tether together properly and rotation was achieved at all. However, it did reintroduce the idea of using bending joints that had springs. From this Unity Answers thread (forum.unity.com/threads/best-method-to-make-rigidbody-spring-to-upright-rotation.1126985/), I derived that making the spring rotate towards the upwards position of the base would cause the tip to rotate upwards. This was a major success and the spring worked properly. Now all that's left is to create a method that will allow the object to bend based on motion.
A script has been created to make the foil bend, and has a variable that accurately reduces/increases how springy or far the foil will go. Will need to be implemented, then the feature will be complete.
Script has been completed and tested, some feedback from the alpha test indicate the foil as slightly too malleable. Values will be adjusted, however the logic is sound and this feature is complete.
Make the foil bend and flick properly.