Faerell Stern
Retired nomad knight
Join date: 15 Oct 2004
Posts: 4
|
01-17-2005 18:35
ive been looking at some physic disruptor today, and i tought... god why does it only make stuff go up, while it could use the same technique, but to make stuff come to the object, like a black hole? so i tried to make it do that, but i found out really fast that it would need alot more of complex scripting than what i tought, so i tought id ask ppl in this forum for help...
anybody knows how to have it calculate the force to apply with llPushObject according to the "distance" in vector(like, if the object is at 100,100,30 and the target at 120,140,30 then the force needs to be sth like -20,-40,0 ) ?
thx in advance
-Fae
|
Moleculor Satyr
Fireflies!
Join date: 5 Jan 2004
Posts: 2,650
|
01-17-2005 19:03
llVecDist()
_____________________
</sarcasm>
|
Lance LeFay
is a Thug
Join date: 1 May 2003
Posts: 1,488
|
01-17-2005 22:17
The goggles! They do nothing!
_____________________
"Hoochie Hair is high on my list" - Andrew Linden "Adorable is 'they pay me to say you are cute'" -Barnesworth Anubis
|
Tcoz Bach
Tyrell Victim
Join date: 10 Dec 2002
Posts: 973
|
01-17-2005 22:32
I did this once a long time ago in Morris. Animated a texture on a torus so it looked like it was collapsing into the center, grabbed anything in the area and pushed them on a vector to the object.
People were not happy once they caught on. Careful with that one.
_____________________
** ...you want to do WHAT with that cube? **
|
Adam Zaius
Deus
Join date: 9 Jan 2004
Posts: 1,483
|
01-17-2005 22:35
From: Faerell Stern ive been looking at some physic disruptor today, and i tought... god why does it only make stuff go up, while it could use the same technique, but to make stuff come to the object, like a black hole? so i tried to make it do that, but i found out really fast that it would need alot more of complex scripting than what i tought, so i tought id ask ppl in this forum for help...
anybody knows how to have it calculate the force to apply with llPushObject according to the "distance" in vector(like, if the object is at 100,100,30 and the target at 120,140,30 then the force needs to be sth like -20,-40,0 ) ?
thx in advance
-Fae vector x,y; (x = object pos, y = target pos) vector force = (x - y) * llPow(llVecDist(llGetPos(),x),3);
|
Moleculor Satyr
Fireflies!
Join date: 5 Jan 2004
Posts: 2,650
|
01-18-2005 07:35
From: Adam Zaius vector x,y; (x = object pos, y = target pos)
vector force = (x - y) * llPow(llVecDist(llGetPos(),x),3); POW! Pow pow pow pow POW! I KNEW there had to be an easier way than multiplying it three times manually, but I never thought it was another function.
_____________________
</sarcasm>
|
Faerell Stern
Retired nomad knight
Join date: 15 Oct 2004
Posts: 4
|
01-18-2005 13:04
thx alot adam, will need some power multiplying (i had to stand still so that i could see if it actually works) now ill make it more powerful and work on ACTIVE objects, but theres one thing thats wrong with the lines of code you wrote, even tough its easily fixed... it pushes the objects away  so now ill mod it to work negativly (mmmm... 0 - force = newforce? if theres another way, tell me  ), and it should work fine, thx again... but now ive got another question... is it possible to find out the targets mass? *edit* ah... actually the negative thing doesnt work, first type dismatch, then even with <0,0,0> - force, it doesnt work...
|