Trep Cosmo
Registered User
Join date: 3 Mar 2005
Posts: 101
|
05-05-2005 19:59
Hi everyone. I'm experimenting with the physics calls here, and I've run across a problem. If I do: llApplyRotationalImpulse(<0,0,0.025> * llGetMass(), FALSE);
How do I figure out that I need to do: llApplyRotationalImpulse(<0,0,-0.025> * llGetMass(), FALSE);
Later in my script? I thought llGetTorque() would tell me, but it doesn't (even when I use llSetTorque()). And llGetOmega() returns some crazy numbers that I don't know how to manipulate to find out what I need. I really don't want to manually keep track of the forces I'm applying. Can someone help me out?
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
05-05-2005 23:47
I don't do much with physics so far, but I'd have thought if you define the vector somewhere as a variable e.g. vector torque = <0, 0, 0.25> then you apply it with torque in the equation, you cancel it with -1 * torque.
|
Trep Cosmo
Registered User
Join date: 3 Mar 2005
Posts: 101
|
05-06-2005 00:55
Yes, keeping track of your impulses in a vector does work. However I'm trying to avoid that because there's no way to tell what the current omega/torque is when you set it through llSetTorque. That's why I'd like to know either why llGetTorque doesn't work, or how to do the math on llGetOmega to figure out how to stop the rotation.
Also, I forgot to mention that if anyone knows the answer and doesn't want to post, or doesn't like to post, feel free to get ahold of me in-game. I'd love to have help with this type of thing in-game.
|
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
|
05-06-2005 07:37
You might also try to base calculations on the return of llGetEnergy.As for me, I usually just use llRotLookAt to fine-tune my rotations. But then, that's because I'm too lazy to deal with real physics most of the time. 
_____________________
---
|
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
|
05-06-2005 08:16
The problem with trying to do something like this is that we're not told what units llGetOmega() and llApplyRotationalImpulse() are in, so it makes it hard to know what to do with the numbers you get. Blah.
I think if you want to stop all movement dead, you can set an object non-physical and then physical. Not sure, though.
|
Alphazero Sugar
Noob Tube
Join date: 24 Mar 2005
Posts: 60
|
05-06-2005 12:00
From: Lex Neva I think if you want to stop all movement dead, you can set an object non-physical and then physical. Not sure, though.
Yep. This works great. You come to a screeching halt immediately.
|
Trep Cosmo
Registered User
Join date: 3 Mar 2005
Posts: 101
|
05-06-2005 12:16
Somehow I missed seeing the llGetEnegry() function. I'll be sure to check that out as soon as I get in-game. I was really hoping to do what I wanted to do, but I guess it's just not going to happen. Anyway, thanks for the help everyone! This was just for an experiment, so it's not too big of a deal.
|