Page 1 of 1
Whirlpool
Posted: Wed Jun 06, 2007 7:37 pm
by jftsang
I'm trying to make a whirlpool map where the player spins around on a disk and there is a death physics driver in the middle, and the player is spun arounds and sucked inwards. How would I program that using physics drivers? Like this?
Code: Select all
physics
name centre
death You were sucked into the whirlpool
end
physics
name whirlpool_spin
angular 10.0 [whereever the centre is]
end
physics
name whirlpool_drag
[WHAT DO I DO HERE?!?!??!]
end
thank you
Posted: Wed Jun 06, 2007 8:03 pm
by Spazzy McGee
I think you may have hit a dead end.
As far as I know, you can't have a radial drag towards a central point using one driver, however, you may be able to achieve it by using several segments with different drivers pointing towards the centre, for example in this arrangement:
You use the 'linear' property to do this - see
http://my.bzflag.org/w/Physics - you'll have to calculate the directional speed for each of the segments though.
The thing is... I'm not sure how you would achieve both motions at once, using the segments method. You may be able to add the same angular motion to
all of the drivers for each segment - you can have to properties per driver.
Code: Select all
physics
name whirlpool_1
angular 10.0 [point of rotation[
linear 10 0 0
end
Posted: Fri Jun 08, 2007 6:50 pm
by anomaly
Code: Select all
physics
name whirlpool
angular 10
linear 10 0 0
end
problem is the X value of 10 in the linear option points in the positive X direction. the other side of the disk would need to point in the negative X direction. some other positions on the disk require both X and Y in both the positive and negative directions.
it would be nice to be able to do that, but at this time is might be quite a feat to accomplish.
good luck and please post if you succeed
Posted: Fri Jun 08, 2007 8:33 pm
by Tedius
Spazzy and anomaly are both correct as usual. I have a square version of what they have suggested running at:
tedius.dyndns.org:5171
my code looks something like this:
Code: Select all
physics
name spin
angular 0.05000 0.0 0.0
linear -50 -50 0
end
physics
name spin2
angular 0.05000 0.0 0.0
linear 50 -50 0
end
physics
name spin3
angular 0.05000 0.0 0.0
linear 50 50 0
end
physics
name spin4
angular 0.05000 0.0 0.0
linear -50 50 0
end
and the 4 quadrants have the phydrv's applied to them as would be expected..
Code: Select all
define NEQuadrant
mesh
vertex 200.0 200.0 3.0000000 #0
vertex -200.0 200.0 3.0000000 #1
vertex -200.0 -200.0 3.0000000 #2
vertex 200.0 -200.0 3.0000000 #3
face
vertices 0 1 2 3
phydrv spin
matref ocean
endface
end #mesh
enddef
define NWQuadrant
mesh
vertex 200.0 200.0 3.0000000 #0
vertex -200.0 200.0 3.0000000 #1
vertex -200.0 -200.0 3.0000000 #2
vertex 200.0 -200.0 3.0000000 #3
face
vertices 0 1 2 3
phydrv spin2
matref ocean
endface
end #mesh
enddef
#etc. etc...
An unexpected problem I ran into involves the angular physics driver and frame rate. If my frame rate is very high (>60 or so) I end up spinning uncontrollably as if I hit a patch of black ice. If I turn on Energy saver (capping frame rate at 30fps), my tank acts as normal.
Maelstrom
Posted: Mon Jun 11, 2007 7:20 pm
by Enterprise
Im trying to make the ships for the server, and am drawing on google sketchup, before sending to jftsang to finish off before sending to Tedius. If i draw them on google sketchup is that Ok to be put on the server, or do i need to draw them in another programme?
P.S.
jftsang may not have mentioned this but I was the one that had the idea, I just lack the knowledge and time to make the server and host it.
Re: Maelstrom
Posted: Mon Jun 11, 2007 7:42 pm
by TD-Linux
Enterprise wrote:Im trying to make the ships for the server, and am drawing on google sketchup, before sending to jftsang to finish off before sending to Tedius. If i draw them on google sketchup is that Ok to be put on the server, or do i need to draw them in another programme?
P.S.
jftsang may not have mentioned this but I was the one that had the idea, I just lack the knowledge and time to make the server and host it.
Sure, sketchup will work to make meshes. You will then have to run the mesh file through a converter (possibly several) to be able to put it into a map.
Posted: Mon Jun 11, 2007 7:53 pm
by Peter
No need to go off topic with the sketch up thing there is a topic on it in "map editors".
Posted: Wed Jun 13, 2007 1:53 pm
by big_daddy2
why dont u use a texture matrix with a spin value?
Posted: Wed Jun 13, 2007 2:08 pm
by CannonBallGuy
A texture matrix involves a moving texture. It will not affect any tanks.
This is a topic about physics.
Posted: Wed Jun 13, 2007 2:43 pm
by big_daddy2
i know that but what i was saying was why move a tank and kill it when u can make it look like its spinning and kills it, i mean since u have a death object ur not going to spin, and it wont even look like its spinning
just add a phydrv with a death to the texture matrix
Posted: Wed Jun 13, 2007 10:59 pm
by A Meteorite
big_daddy2 wrote:i know that but what i was saying was why move a tank and kill it when u can make it look like its spinning and kills it, i mean since u have a death object ur not going to spin, and it wont even look like its spinning
jftsang does not want the whole disk to have death - he just wants the center to have it and for tanks to be sucked towards the center.
jftsang wrote:I'm trying to make a whirlpool map where the player spins around on a disk and there is a death physics driver in the middle, and the player is spun arounds and sucked inwards.