Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

If's and Vectors

Jade Bard
Registered User
Join date: 7 Jul 2004
Posts: 106
11-11-2004 15:10
I need to check to see if my vector is higher or lower then a certain number.
As in is <-, this number only, - > greater then zero.

How do i ONLY check that number?

-thanks
Neo Rebus
Registered User
Join date: 10 Apr 2004
Posts: 59
11-11-2004 15:12
From: Jade Bard
I need to check to see if my vector is higher or lower then a certain number.
As in is <-, this number only, - > greater then zero.

How do i ONLY check that number?

-thanks


If the vector is in a variable, say "myVec", try
CODE

if (myVec.y > 0) {
...
}
Jade Bard
Registered User
Join date: 7 Jul 2004
Posts: 106
11-11-2004 15:41
thank you very much!
Samhain Broom
Registered User
Join date: 1 Aug 2004
Posts: 298
11-12-2004 12:32
By the way, if you mean higher or lower as in elevation you might want to look at the "Z" axis of the vector, that is the direction that determines the "height".

so:

CODE

if (myVec.z > 0) {
...
}


(I could be wrong though)
_____________________
rm -rf /bin/ladden #beware of geeks bearing grifts