Jump to content
ejr32123

implicit cast vector to float? [solved]

Recommended Posts

Posted (edited)

Hey!

I am trying to delete geometry by comparing two vectors. For some reason  (also it only seems to compare the first dimension in the vector rather then each value) I keep getting a implicit cast (vector to float) error even though I am comparing two vectors. How does that make any sense?  Do I have to compare the individual values rather a the vector as a whole? Thanks in advance :)

 

edit: Also v@test I set to {2,2,2}, but some areas have {2,2,0.5}.  If thres is {2,2,1} shouldn't areas with {2,2,0.5} get deleted? because {2,2,0.5} < {2,2,1}?

Evan

vtof.PNG

Edited by ejr32123

Share this post


Link to post
Share on other sites

AFAIK there's no vector comparison in vex. What you are doing is just comparing the first element of the vector. Depending on your needs you can use length to get the magnitude of the vector and compare them instead. Either that or you can write your own function to compare the vectors in a way that suits your needs.

  • Thanks 1

Share this post


Link to post
Share on other sites
46 minutes ago, vtrvtr said:

AFAIK there's no vector comparison in vex. What you are doing is just comparing the first element of the vector. Depending on your needs you can use length to get the magnitude of the vector and compare them instead. Either that or you can write your own function to compare the vectors in a way that suits your needs.

Thanks so much! That would make sense. 

Share this post


Link to post
Share on other sites
Posted (edited)

I just saw this in the manual:

The comparison operators (==, !=, <, <=, >, >=) are defined when the left hand of the operator is the same type as the right hand side, for string, float and integer types only. The operations result in integer types.

 

@vtrvtr you are 100% right

Edited by ejr32123

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×