Search found 59 matches

by NotARaptor
Thu Mar 15, 2018 4:20 pm
Forum: Support and Development
Topic: Rope Physics Help
Replies: 19
Views: 14669

Re: Rope Physics Help

I'm quite acquainted with the precision issues of floating point calculations, and I have to disagree with the part I've highlighted in boldface. No matter the magnitude of each number, to multiply two floating-point numbers, you multiply the mantissas and add the exponents, and assuming no overflo...
by NotARaptor
Thu Mar 15, 2018 3:56 pm
Forum: Support and Development
Topic: Rope Physics Help
Replies: 19
Views: 14669

Re: Rope Physics Help

Nice one @Ref - that's another example of Verlet integration with constraint relaxation, but obviously written to specifically handle the rope and nothing else. It looks nice :) Personally I'd tweak the variables a bit as it feels "floaty", but it doesn't feel "stretchy" which it...
by NotARaptor
Thu Mar 15, 2018 3:05 pm
Forum: Support and Development
Topic: Rope Physics Help
Replies: 19
Views: 14669

Re: Rope Physics Help

I'll make some code examples of the various steps at some point!
by NotARaptor
Thu Mar 15, 2018 12:31 pm
Forum: Support and Development
Topic: Rope Physics Help
Replies: 19
Views: 14669

Re: Rope Physics Help

Ok... <cracks knuckles> let's do this. Boiling the problem down to the basics, we have a system of N objects - we know their positions and velocities, and their masses, at a specific point in time. We want to simulate the system over dt time from that point, and see where they end up. We use Newton'...
by NotARaptor
Tue Mar 13, 2018 5:05 pm
Forum: Support and Development
Topic: Rope Physics Help
Replies: 19
Views: 14669

Re: Rope Physics Help

(And it's also called lua, not LUA; it's not an acronym, it's portuguese for moon. :P) :oops: Noted :) Thanks. @pgimeno - I did start composing a reply about different integrators, timesteps, precision issues, spring stiffness and why the relaxation technique used with Verlet is so popular... but i...
by NotARaptor
Tue Mar 13, 2018 4:32 pm
Forum: Support and Development
Topic: Rope Physics Help
Replies: 19
Views: 14669

Re: Rope Physics Help

ZIP files are case sensitive. You told it to require "Rope". But the file is named "rope". Heads up to anyone downloading this to unzip it and change that code to make it run. Sorry about that! Very new to LUA, should have thought about that. I keep indexing arrays from zero too!
by NotARaptor
Sat Mar 10, 2018 9:26 am
Forum: Support and Development
Topic: Rope Physics Help
Replies: 19
Views: 14669

Re: Rope Physics Help

You can adjust the number of passes to suit. Decreasing it a lot will give the rope a more springy feel. But with 50 segments and 50 passes, I could still simulate 100 ropes at 60fps, so it's not slow, and the maths could be optimised, but as a beginner in LUA I'm not sure how best to do it - in C I...
by NotARaptor
Fri Mar 09, 2018 2:03 pm
Forum: Support and Development
Topic: Rope Physics Help
Replies: 19
Views: 14669

Re: Rope Physics Help

I just threw this together quickly - looks to be pretty rope-ish to me, doesn't rely on love.physics. screenshot.png It doesn't do collisions or anything, but that could be added easily enough. I added two ropes - one has zero drag, the other does have drag, so you can see the difference. The first ...
by NotARaptor
Thu Mar 01, 2018 2:50 pm
Forum: Support and Development
Topic: line with ellipse/circle collision
Replies: 15
Views: 10465

Re: line with ellipse/circle collision

Hello! Sorry, new here - first post and all that. I saw this thread and thought I'd give it a go. Treating the ellipses as polylines, this code calculates the intersections of line segments and ellipses - it seems pretty efficient for most use-cases, but I'm sure it could be improved. Screenshot: el...