Specifications
30
The joint connects several segments, and it needs to know which point on each segment to attach to. For
this purpose, we have lines like
AnyRefNode &GroundNode = ..GlobalRef.Shoulder;
AnyRefNode &UpperArmNode = ..Segs.UpperArm.ShoulderNode;
The simple explanation is that these lines define nodes on the GlobalRef and UpperArm to which the joint
attaches. Notice the two dots in front of the names. They signify that the GlobalRef and Segs folders are
defined two levels up compared to where we are now in the model. If you neglected the two dots, then
AnyBody would be searching for the two objects in the Shoulder folder, and would not be able to find them.
This "dot" system is quite similar to the system you may know from directory structures in Dos, Windows,
Unix, or just about any other computer operating system.
But there is more to it than that. You can see that the Shoulder point on GlobalRef has been given the local
name of "GroundNode". This means that, within the context of this joint, we can hereafter refer to the point
as "GroundNode". This is practical because it allows us to assign shorter names to long external references.
Another specialty is the '&' in front of the local name. If you have C++ experience, you should be familiar
with this. It means that GroundNode is a reference (a pointer) to GlobalRef.Shoulder rather than a copy of
it. So if GlobalRef.Shoulder moves around, Shoulder.GroundNode follows with it. Hit F7 to load the model
again to make sure that the definition is correct.
We need an elbow joint before we are finished: the elbow. The definition is completely parallel to what you
have just seen, but we shall use one of the handy tools to define the references. The skeleton of the elbow
joint is as follows:
AnyFolder Jnts = {
//---------------------------------
AnyRevoluteJoint Shoulder = {
Axis = z;
AnyRefNode &GroundNode = ..GlobalRef.Shoulder;
AnyRefNode &UpperArmNode = ..Segs.UpperArm.ShoulderNode;
}; // Shoulder joint
AnyRevoluteJoint Elbow = {
Axis = z;
AnyRefNode &UpperArmNode = ;
AnyRefNode &ForeArmNode = ;
}; // Elbow joint
}; // Jnts folder
As you can clearly see, the nodes in the Elbow joint are not pointing at anything yet. In this simple model it
is easy to find the relative path of the pertinent nodes on the upper arm and the forearm, but in a complex
model it can be very difficult to sort these references out. So the system offers a tool to help you. If you
click the model tab in the tree view on the left hand side of the editor window, then the tree of objects in the
loaded model appears. Anything that was defined in the model when it was recently successfully loaded can
be found in this tree including the two nodes we are going to connect in the elbow. Click to place the cursor
just before the semicolon in the &UpperArmNode definition in the Elbow joint. Then expand the tree as
shown below.










