Skip to main content

Relative Rotation (Bi-Entity Condition Type)

Compares how closely the direction the actor faces lines up with the direction the target faces. The value compared is the cosine of the angle between the two directions: 1 when they point the same way, 0 when they are at right angles and -1 when they point in opposite directions.

Type ID: apoli:relative_rotation

Fields

FieldTypeDefaultDescription
axesArray of Strings["x", "y", "z"]The axes of the two directions to use. Leaving an axis out flattens both directions onto the others, so ["x", "z"] ignores pitch.
actor_rotationString"head"Which of the actor's rotations to use: "head" or "body".
target_rotationString"body"Which of the target's rotations to use: "head" or "body".
comparisonComparisonrequiredHow the value is compared with compare_to.
compare_toFloatrequiredThe number the value is compared with, from -1 to 1.

Examples

"bientity_condition": {
    "type": "apoli:relative_rotation",
    "actor_rotation": "head",
    "target_rotation": "body",
    "comparison": ">=",
    "compare_to": -0.8
}

This passes unless the actor's head and the target's body point in nearly opposite directions, a value of -0.8 or less.

"bientity_condition": {
    "type": "apoli:relative_rotation",
    "actor_rotation": "head",
    "target_rotation": "body",
    "comparison": ">=",
    "compare_to": 0.4
}

This passes when the actor's head faces roughly the same way as the target's body, within about 66 degrees.