AlexGaida / activatorNode

a C++ vector distance plug-in with min/ max values.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

activatorNode

a vector distance node with a max distance range attribute for the target vector.


Information

This C++ node is useful in rigging for Maya to determine how close the controller object is to the specified targetVector.

Math

// create a new vector between the origin and target

MVector outputResultVector = inOriginVector - inVector;

// compute distance between the origin and target vector

double array[3] = {

pow(outputResultVector.x, 2);

pow(outputResultVector.y, 2);

pow(outputResultVector.z, 2);

}

double distance = pow(sum(array), 0.5);

double outputUnit = 1 - (distance / maxDistance);

Demo

Node Demo

About

a C++ vector distance plug-in with min/ max values.


Languages

Language:C++ 64.0%Language:CMake 32.4%Language:Batchfile 3.6%