Thyme applyForce function

Suggest changes and improvements to Algodoo.

Thyme applyForce function

Postby macunixgeek » Tue Jul 06, 2010 8:34 pm

I think that there should be functions added to the objects that can apply forces and impulses to objects.
EX:
Code: Select all
[object].applyForce(force vector)
[object].applyForceLoc(force vector, position relative to object center)
[object].applyAngForce(force in radians)
[object].applyAngForceLoc(force in radians, position relative to object center)
[object].applyImpulse(impulse vector)
[object].applyImpulseLoc(impulse vector, position relative to object center)
[object].applyAngImpulse(impulse in rpms)
[object].applyAngImpulse(impulse in rpms, position relative to object center)


I think this could be used for simulating physical effects that Algodoo doesn't simulate on its own, such as suction, aerodynamics, linear motors, etc...
Thymer
macunixgeek
 
Posts: 49
Joined: Wed Sep 02, 2009 11:55 pm

Re: Thyme applyForce function

Postby Rideg » Tue Jul 06, 2010 9:34 pm

This could be very fun to experiment with and teaching at the same time. Support + 1 :thumbup:
Image
make sure to check out my work.
User avatar
Rideg
 
Posts: 948
Joined: Tue Dec 15, 2009 5:17 pm
Location: Östersund, Sweden

Re: Thyme applyForce function

Postby Rrobba » Tue Jul 06, 2010 9:44 pm

Yup, could come in handy!

Here we go...Support +2
Image
I don't suffer from insanity. I enjoy every minute of it.
User avatar
Rrobba
[Best Sig 2010]
 
Posts: 1480
Joined: Mon Aug 31, 2009 6:01 pm
Location: Gibraltar

Re: Thyme applyForce function

Postby Versieon » Tue Jul 06, 2010 10:56 pm

+3

thats 6 already
User avatar
Versieon
 
Posts: 375
Joined: Tue Sep 01, 2009 4:45 pm

Re: Thyme applyForce function

Postby tatt61880 » Wed Jul 07, 2010 2:47 am

[object].applyForce(force vector)
[object].applyForceLoc(force vector, position relative to object center)


Same function name might be better for 1 argument and 2 argument.
i.e. object.applyForce(force_vector [, position_relative_to_object_center])
//which "position_relative_to_object_center" is optional argument.

+4
NOTE: I'm not an Algoryx member.
Hi, Algodoo lovers. Have you read next topic? Featured scenes suggestions
To translators: English.cfg changelog will be useful (even for me).
User avatar
tatt61880
[Most Helpful Person 2010]
 
Posts: 1150
Joined: Mon Aug 31, 2009 5:45 pm
Location: Tokyo, Japan

Re: Thyme applyForce function

Postby macunixgeek » Wed Jul 07, 2010 8:29 am

tatt61880 wrote:
Same function name might be better for 1 argument and 2 argument.
i.e. object.applyForce(force_vector [, position_relative_to_object_center])
//which "position_relative_to_object_center" is optional argument.


That was my initial thought, but I didn't know if function overloading was possible in Thyme.
Thymer
macunixgeek
 
Posts: 49
Joined: Wed Sep 02, 2009 11:55 pm

Re: Thyme applyForce function

Postby tatt61880 » Wed Jul 07, 2010 4:37 pm

macunixgeek wrote:
tatt61880 wrote:
Same function name might be better for 1 argument and 2 argument.
i.e. object.applyForce(force_vector [, position_relative_to_object_center])
//which "position_relative_to_object_center" is optional argument.


That was my initial thought, but I didn't know if function overloading was possible in Thyme.

As far as I know, function overloading is currently impossible.
Emil will add it if he think it is useful and appropriate, though.
NOTE: I'm not an Algoryx member.
Hi, Algodoo lovers. Have you read next topic? Featured scenes suggestions
To translators: English.cfg changelog will be useful (even for me).
User avatar
tatt61880
[Most Helpful Person 2010]
 
Posts: 1150
Joined: Mon Aug 31, 2009 5:45 pm
Location: Tokyo, Japan

Re: Thyme applyForce function

Postby Rideg » Wed Jul 07, 2010 5:18 pm

It's educational. That's a big reason to implement it as Algodoo is a educational program that's intended to be used by teachers, schools or any other educational use. With this, the techer could Explain what should happen if we apply a certain amount of force, and with this you can simply type in the force as a vector and use it somwere on a object. Then the students could calculate how much velocity the object should gain, how fast it should twist if you apply the force on the edge of the object, and so much more.

So yeah, this suggestion does have a reason to be implemented. :thumbup:
Image
make sure to check out my work.
User avatar
Rideg
 
Posts: 948
Joined: Tue Dec 15, 2009 5:17 pm
Location: Östersund, Sweden

Re: Thyme applyForce function

Postby tatt61880 » Wed Jul 07, 2010 6:10 pm

I suggest drag-able vector for forces and velocities.
Image
NOTE: I'm not an Algoryx member.
Hi, Algodoo lovers. Have you read next topic? Featured scenes suggestions
To translators: English.cfg changelog will be useful (even for me).
User avatar
tatt61880
[Most Helpful Person 2010]
 
Posts: 1150
Joined: Mon Aug 31, 2009 5:45 pm
Location: Tokyo, Japan

Re: Thyme applyForce function

Postby Rideg » Wed Jul 07, 2010 6:56 pm

what do you mean? Ain't this possible allreadey :O
Image
make sure to check out my work.
User avatar
Rideg
 
Posts: 948
Joined: Tue Dec 15, 2009 5:17 pm
Location: Östersund, Sweden

Re: Thyme applyForce function

Postby Versieon » Wed Jul 07, 2010 7:55 pm

no, all we can do is adjust sliders to creat a vector, draging a vector would be usefull for students and visualisation.
User avatar
Versieon
 
Posts: 375
Joined: Tue Sep 01, 2009 4:45 pm

Re: Thyme applyForce function

Postby Antotabo » Wed Jul 07, 2010 11:40 pm

And how long does the force act?? Forever or thre could be another argument for how much time the force act??

Also, those are useless:

[object].applyAngForceLoc(force in radians, position relative to object center)
[object].applyAngImpulse(impulse in rpms, position relative to object center)

Since torque is equivalent no matter how far you are from the center.
Antotabo
 
Posts: 54
Joined: Tue Sep 01, 2009 6:27 am

Re: Thyme applyForce function

Postby macunixgeek » Thu Jul 08, 2010 8:12 am

Antotabo wrote:Also, those are useless:

[object].applyAngForceLoc(force in radians, position relative to object center)
[object].applyAngImpulse(impulse in rpms, position relative to object center)

Since torque is equivalent no matter how far you are from the center.


I meant that the force would rotate the object around the specified point. Also, the force would be instantaneous.
Thymer
macunixgeek
 
Posts: 49
Joined: Wed Sep 02, 2009 11:55 pm

Re: Thyme applyForce function

Postby Antotabo » Thu Jul 08, 2010 6:41 pm

I meant that the force would rotate the object around the specified point. Also, the force would be instantaneous.


Did you take the time to try to understand what I meant?? I know what you meant.

But, A force applied during 0 time equal no work at all. So this doesn't work. A force have to be apllied for a certain amount of time for it to have an effect.

And you can't rotate an object around a specific point other than its center of gravity by applying a rotationnal force. You need another external force to displace the mass centerpoint in the space. Unless you are NOT in a physic simulator, those two unreal forces doesn't fit Algodoo. It become more of an animation thing and this is not. Also I don't think it would be useful. If you really want to make this behaviour use a hinge, and then we would be ok with the physics.

Hope you understand my point.

I just want to help you with this because I think it would be great addition to Thyme.
Antotabo
 
Posts: 54
Joined: Tue Sep 01, 2009 6:27 am

Re: Thyme applyForce function

Postby macunixgeek » Fri Jul 09, 2010 9:09 am

I think I see what you're saying. I guess the force would be applied over one timestep if it can't be applied instantaneously.
Thymer
macunixgeek
 
Posts: 49
Joined: Wed Sep 02, 2009 11:55 pm

Re: Thyme applyForce function

Postby Kilinich » Fri Jul 09, 2010 9:37 am

Suggested before so many times...
It's the most wanted feature of all time since Phun got scripts :D

But I think your implementation is a bit complicated.
object.externalForce ([x,y], M) is enough.
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Re: Thyme applyForce function

Postby Nxdt » Fri Jul 09, 2010 10:39 am

Support + what number are we on?
Bit complicated though, i suggest trying to simplify it like kilinch said.
User avatar
Nxdt
 
Posts: 1019
Joined: Mon Aug 31, 2009 6:32 pm
Location: Scotland!

Re: Thyme applyForce function

Postby Sonic » Fri Jul 16, 2010 7:56 pm

I support. Then I could make an unstoppable force vs an immovable object
I do stuff and break things. You know how it is.
Image
User avatar
Sonic
 
Posts: 1467
Joined: Tue Sep 01, 2009 6:18 pm
Location: America!!!

Re: Thyme applyForce function

Postby macunixgeek » Fri Jul 23, 2010 7:11 am

Sonic wrote:I support. Then I could make an unstoppable force vs an immovable object


heh. applyForce([+inf,0]). I think the object would just disappear then...
Thymer
macunixgeek
 
Posts: 49
Joined: Wed Sep 02, 2009 11:55 pm

Re: Thyme applyForce function

Postby Sonic » Fri Jul 23, 2010 7:47 am

Or the game would just crash. Either way...it'll be fun.
I do stuff and break things. You know how it is.
Image
User avatar
Sonic
 
Posts: 1467
Joined: Tue Sep 01, 2009 6:18 pm
Location: America!!!

Re: Thyme applyForce function

Postby Chronos » Fri Jul 23, 2010 7:51 am

The force would just go through the object.
TheWinkits wrote:They both looks of cuking amazing
User avatar
Chronos
[Most Active Member 2010]
 
Posts: 4457
Joined: Mon Aug 31, 2009 6:00 pm
Location: Californania

Re: Thyme applyForce function

Postby Sonic » Fri Jul 23, 2010 7:59 am

With Algodoo's glitchy physics, you're probably right.
I do stuff and break things. You know how it is.
Image
User avatar
Sonic
 
Posts: 1467
Joined: Tue Sep 01, 2009 6:18 pm
Location: America!!!

Re: Thyme applyForce function

Postby Versieon » Mon Jul 26, 2010 3:43 pm

Yes, you can already sort of try this with an inertia mult set to inf and then add angular velocity in the velocity menu. Then put it between two unmoveable blocks and watch what happens.
User avatar
Versieon
 
Posts: 375
Joined: Tue Sep 01, 2009 4:45 pm


Return to Suggestions

Who is online

Users browsing this forum: No registered users and 3 guests