|
Sarg Bjornson
Theme Park Designer
Join date: 14 Sep 2005
Posts: 244
|
01-15-2007 03:47
Hi everyone Several clients have asked me to create river rapids, but I have found a little problem when creating the vehicles themselves: How can you make a vehicle spin without changing its forward direction? I have tried fiddling with VEHICLE_LINEAR_MOTOR_OFFSET and dinamically changing the vehicle's reference frame over time, but the movement I obtained was... well, quite funny, but not river-rapidy at all. I also tried llSetTargetOmega, because, being a client-side function, I thought it wouldn't influence the vehicle's forward axis, but it does, too  Any ideas would be greatly appreciated.
_____________________
Read The METAVERSE MESSENGER A Real Newspaper For A Virtual World
|
|
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
|
01-15-2007 16:16
Head to Phobos region on the mainland (north of Europa), and look for the giant pool. There is a toob rack there from which you can grab a toob. Those toobs were once used for river rapids several years ago and worked very well without need for scripting the rotations. Basically, the toobs hit a rock and started spinning. Yuo could probably make a rock in the pool and see for yourself how well they spin.
For your vehicle, you might want to decrease the linear or angular friction on the Z axis of the friction vector. On those, the higher the number, the lower the friction and the lower the number, the higher the friction. It might work to decrease the friction on all axis, since you're in water... make them all like 1000 or 10000.
|
|
Sarg Bjornson
Theme Park Designer
Join date: 14 Sep 2005
Posts: 244
|
01-15-2007 23:25
Thanks DoteDote. Are those Lee Linden's freebie tubes? Or were they modified a bit?
_____________________
Read The METAVERSE MESSENGER A Real Newspaper For A Virtual World
|
|
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
|
01-16-2007 11:26
The problem, as I think you've found, is that the vehicle API's linear motors are continuously relative to the local reference frame of the vehicle itself. That makes them perfect for a person who's in the car and turning with the car, but pretty much useless for controlling an object that needs to move relative to the world (down the river, for example), ignoring the local axes.
I also ran into a problem like this trying to make an automated car using the vehicle system. Since I could only give the car a continuously relative direction to move in, not an absolute direction, it was impossible to update the car frequently enough to get it to move toward a checkpoint in its path. I ended up doing everything with impulses and llRotLookAt(), and probably reimplemented a fair amount of the vehicle system myself.
That said, I think maybe you should ditch the vehicle system and just occasionally give the tube nudges down the river with llApplyImpulse. Spinning won't affect the impulses.
|
|
Sarg Bjornson
Theme Park Designer
Join date: 14 Sep 2005
Posts: 244
|
01-16-2007 14:24
Lex, I said it before and I'll say it again: you are the best!
That idea really nailed the problem. River rapids, here we go! ^_^
_____________________
Read The METAVERSE MESSENGER A Real Newspaper For A Virtual World
|