Skip to content

YoComposite

SylvainBertrand edited this page Nov 17, 2019 · 18 revisions

What is a YoComposite?

A YoComposite is an abstract data structure composed of several YoVariables, for more information on YoVariables YoVariable wiki, which can represent a more complex type of data such as a 2D or 3D point.

A YoComposite is attributed a name and a pattern, following the example of a 3D point composite, the name would be Point3D and the pattern would be: x, y, and z. Using the pattern, SCS 2 can then search throughout all the control variables to retrieve any set of YoVariables that represents a Point3D, allowing then direct interaction with a point rather than its coordinates.

By default, SCS 2 defines a small set of predefined YoComposites that are:

  • YoTuple2D representing any 2D points and vectors. It uses the following pattern: x, and y.
  • YoTuple3D representing any 3D points and vectors. It uses the following pattern: x, y, z.
  • YoQuaternion representing any unit-length quaternion. It uses the following pattern: qx, qy, qz, and qs.
  • YoYawPitchRoll representing any orientation described as the yaw, pitch- and roll angles. It uses the following pattern: yaw, pitch, and roll.

The use of YoComposites instead of YoVariables when searching control variables greatly reduces the size of the search result.

Search example when searching for YoVariables:

YoVariable search example

Same keywords but searching for YoTuple3Ds:

YoTuple3D search example

How to create a new YoComposite?

SCS 2 comes an editor for creating new YoComposites accessible from the menu:

YoCompositePattern menu item
This open the following dialog:
YoCompositePattern editor

Let's create a new YoComposite for the spine joints of Atlas. Start by clicking Add...:

Add button
Enter the name of composite, we will call it _Spine_ in this example:
Set name
The names for the joints are: _back_bkz_, _back_bky_, and _back_bkx_ which is what we will use for the component identifiers, i.e. the pattern of the composite. Add the identifiers using the "plus" button:
Add identifier button
and name them after each joint to obtain the result:
Spine joint identifiers
# Features available with YoComposite? Now save:
Save button
The new composite is now available in the search panel:
Spine target
Search spine

Clone this wiki locally