Thyme applyForce function
23 posts • Page 1 of 1
Thyme applyForce function
I think that there should be functions added to the objects that can apply forces and impulses to objects.
EX:
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...
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
This could be very fun to experiment with and teaching at the same time. Support + 1 
-

Rideg - Posts: 948
- Joined: Tue Dec 15, 2009 5:17 pm
- Location: Östersund, Sweden
Re: Thyme applyForce function
Yup, could come in handy!
Here we go...Support +2
Here we go...Support +2

I don't suffer from insanity. I enjoy every minute of it.
-

Rrobba - [Best Sig 2010]
- Posts: 1480
- Joined: Mon Aug 31, 2009 6:01 pm
- Location: Gibraltar
Re: Thyme applyForce function
[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).
Hi, Algodoo lovers. Have you read next topic? Featured scenes suggestions
To translators: English.cfg changelog will be useful (even for me).
-

tatt61880 - [Most Helpful Person 2010]
- Posts: 1150
- Joined: Mon Aug 31, 2009 5:45 pm
- Location: Tokyo, Japan
Re: Thyme applyForce function
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
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).
Hi, Algodoo lovers. Have you read next topic? Featured scenes suggestions
To translators: English.cfg changelog will be useful (even for me).
-

tatt61880 - [Most Helpful Person 2010]
- Posts: 1150
- Joined: Mon Aug 31, 2009 5:45 pm
- Location: Tokyo, Japan
Re: Thyme applyForce function
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.
So yeah, this suggestion does have a reason to be implemented.
-

Rideg - Posts: 948
- Joined: Tue Dec 15, 2009 5:17 pm
- Location: Östersund, Sweden
Re: Thyme applyForce function
I suggest drag-able vector for forces and velocities.


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).
Hi, Algodoo lovers. Have you read next topic? Featured scenes suggestions
To translators: English.cfg changelog will be useful (even for me).
-

tatt61880 - [Most Helpful Person 2010]
- Posts: 1150
- Joined: Mon Aug 31, 2009 5:45 pm
- Location: Tokyo, Japan
Re: Thyme applyForce function
what do you mean? Ain't this possible allreadey :O
-

Rideg - Posts: 948
- Joined: Tue Dec 15, 2009 5:17 pm
- Location: Östersund, Sweden
Re: Thyme applyForce function
no, all we can do is adjust sliders to creat a vector, draging a vector would be usefull for students and visualisation.
-

Versieon - Posts: 375
- Joined: Tue Sep 01, 2009 4:45 pm
Re: Thyme applyForce function
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.
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
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
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
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
Suggested before so many times...
It's the most wanted feature of all time since Phun got scripts
But I think your implementation is a bit complicated.
object.externalForce ([x,y], M) is enough.
It's the most wanted feature of all time since Phun got scripts
But I think your implementation is a bit complicated.
object.externalForce ([x,y], M) is enough.
Dream of Algodoo as game development engine...
-

Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: Thyme applyForce function
Support + what number are we on?
Bit complicated though, i suggest trying to simplify it like kilinch said.
Bit complicated though, i suggest trying to simplify it like kilinch said.
-

Nxdt - Posts: 1019
- Joined: Mon Aug 31, 2009 6:32 pm
- Location: Scotland!
Re: Thyme applyForce function
I support. Then I could make an unstoppable force vs an immovable object
-

Sonic - Posts: 1467
- Joined: Tue Sep 01, 2009 6:18 pm
- Location: America!!!
Re: Thyme applyForce function
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
Or the game would just crash. Either way...it'll be fun.
-

Sonic - Posts: 1467
- Joined: Tue Sep 01, 2009 6:18 pm
- Location: America!!!
Re: Thyme applyForce function
The force would just go through the object.
TheWinkits wrote:They both looks of cuking amazing
-

Chronos - [Most Active Member 2010]
- Posts: 4457
- Joined: Mon Aug 31, 2009 6:00 pm
- Location: Californania
Re: Thyme applyForce function
With Algodoo's glitchy physics, you're probably right.
-

Sonic - Posts: 1467
- Joined: Tue Sep 01, 2009 6:18 pm
- Location: America!!!
Re: Thyme applyForce function
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.
-

Versieon - Posts: 375
- Joined: Tue Sep 01, 2009 4:45 pm
23 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 3 guests





