Jump to content

Condition from RBD packed position


bobbybob

Recommended Posts

@3dome, Is the "*" a way to reference all points? Because it's a RBD Packed, there could be more then one object?

 

In a pop wrangle it would look like this

Quote

if (@P.y < -5)
    i@activationState = 1;
else
    i@activationState = 0;

Because it iterates over all the object, we could just reference the object we need to look at. But in the pop drags parameter, there is no way to know what object we are referring to... Is there a way to use something like the "point" vex function, to tell it to look at the position of "object 1"?

Maybe I just don't understand the "*= @P.y" expression, can you elaborate?

Edited by bobbybob
Link to comment
Share on other sites

sorry for the confusion caused by my lazy coding style

airresist *= @P.y < some-value;  is actually the same as

if(@P.y < some-value)
{
	airresist = airresist * 1; //keeping airresist at whatever level it's set
}
else
{
  	airresist = airresist * 0; //turning it off as (something * 0) = 0
}

x *= y is just short for x = x * y, it has nothing to do with objects. Pop drag will act on all objects unless you set a group or play with the VEXpression

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...