Image:
 Author: AverageCoder Group: Default Filesize: 7.79 kB Date added: 2024-10-22 Rating: 5 Downloads: 1208 Views: 285 Comments: 4 Ratings: 1 Times favored: 0 Made with: Algodoo v2.2.0b Tags:
|
Me and ChatGPT made a function named applyForce that takes an object, force, and relative position to calculate and apply a force at a given relative position on the object.
The reason why I named the scene Chronic lag is because I need help optimizing it.
The function works just fine (I think, tell me if its correct or not) but it lags if its called too many times in a postStep.
A way to replicate this lag is to duplicate the red cube a couple times until your computer begins to lag.
I'm confused because the script is relatively simple for a computer and that Algodoo has thrusters that do the same thing but with much better performance.
If anyone knows a solution to this lag, please tell me. And if you want to use the function as it is, you can take it. The function was also intended to be a Scene.my function and thats why it takes a object as an argument.
I intend to make a scene where almost every physical interaction is calculated with thyme. I want to do that so I self-teach myself about physics and to have people learn from the scene.
Also, what does Scene.addContact do? |
Last edited at 2024/10/22 01:55:02 by AverageCoder
Please log in to rate this scene
|