Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Relative Velocity Calculations Scripts???

Greg Hauptmann
Registered User
Join date: 30 Oct 2005
Posts: 283
12-02-2005 16:33
Hi,

Does anyone have a set of functions to help perform relative angular velocity calculations. In this case what I really want is the relative velocity (i.e. an integer, not a 3D velocity) of the object passing through a flattened cylinder (i.e. looks like a circle), relative to the main axis of the cylinder? From this I could tell from which side the object was coming.

For background see: /54/12/74722/1.html

Tks
Cid Jacobs
Theoretical Meteorologist
Join date: 18 Jul 2004
Posts: 4,304
12-02-2005 17:47
I think you are looking for llVecMag ?
_____________________
Greg Hauptmann
Registered User
Join date: 30 Oct 2005
Posts: 283
12-02-2005 19:53
actually I think the answer is:

OoC

where
o - represents the DOT product http://em-ntserver.unl.edu/Math/mathweb/vectors/vectors.html#vec7
O - is the velocity vector of the objects passing through
C - a vector (normalised - i.e. magnitude 1) representing the orientation of the cylinders (torus) axis.

I now have to work out how to calculate C. I'm guessing it will be using (a) the IIGetRot() for the cylinder object + (b) knowledge of the normal orientation of the cylinder's central axis in world co-ordiniates (i.e. when IIGetRot() is calculated does it assume a cylinder normally points up, or horizontal [to north or east etc]).

If you happen to know anything about this last point (i.e. calculating C) I'd be interested (otherwise I'll use the suck it and see approach)
Seifert Surface
Mathematician
Join date: 14 Jun 2005
Posts: 912
12-03-2005 01:13
Sounds like you want to look at llVecNorm, llGetRot and llRot2Up.
_____________________
-Seifert Surface
2G!tGLf 2nLt9cG
Greg Hauptmann
Registered User
Join date: 30 Oct 2005
Posts: 283
12-05-2005 11:36
thanks BTW - this put me on track - I did still to write my on Dot Production function [ok - its only one line of code :) ]