IdaJS
    Preparing search index...

    Interface ObjectHelper

    Helper object containing useful enums and functions for operating with scene objects and zones.

    Available globally as object.

    interface ObjectHelper {
        Bonuses: BonusFlags;
        ControlModes: ControlModes;
        Down: [0, -1, 0];
        East: [1, 0, 0];
        Flags: StaticFlags;
        North: [0, 0, -1];
        South: [0, 0, 1];
        TwinsenStances: TwinsenStances;
        Up: [0, 1, 0];
        West: [-1, 0, 0];
        ZoneDirections: ZoneDirections;
        ZoneTypes: ZoneTypes;
        angleToDegrees(angle: number): number;
        angleToRadians(angle: number): number;
        degreesToAngle(degrees: number): number;
        directionToAngle(direction: number[] | ZoneDirection): number;
        radiansToAngle(radians: number): number;
    }
    Index

    Properties

    Bonuses: BonusFlags

    All bonuses the Game Object can give.

    ControlModes: ControlModes

    The movement control modes for the Game Object.

    Down: [0, -1, 0]

    Down direction vector (negative Y axis)

    East: [1, 0, 0]

    East direction vector (positive X axis)

    All static flags of the Game Object, that are allowed by Ida to read or modify.

    North: [0, 0, -1]

    North direction vector (negative Z axis)

    South: [0, 0, 1]

    South direction vector (positive Z axis)

    TwinsenStances: TwinsenStances

    The string => number "enum", containing Twinsen's stance modes.

    Up: [0, 1, 0]

    Up direction vector (positive Y axis)

    West: [-1, 0, 0]

    West direction vector (negative X axis)

    ZoneDirections: ZoneDirections

    The string => number "enum", containing scene directions.

    If used with custom created zones, then the zone direction can be put into Info2 register of the zone.

    ZoneTypes: ZoneTypes

    The string => number "enum", containing Zone types.

    Methods

    • Converts the LBA angle to degrees.

      Parameters

      • angle: number

        The angle value to convert (0-4096)

      Returns number

      The corresponding degrees value (0-360)

    • Converts the LBA angle system to radians.

      Parameters

      • angle: number

        The angle value to convert (0-4096)

      Returns number

      The corresponding radians value (0-2π)

    • Converts Euler degrees (0-360) to the game's angle system (0-4096)

      Parameters

      • degrees: number

        The degrees value to convert.

      Returns number

      The corresponding angle value (0-4096)

    • Converts a zone direction or 3D vector to the game angle value (0..4096 system)

      Parameters

      • direction: number[] | ZoneDirection

        The zone direction enum value or a 3D vector [x, y, z]

      Returns number

      The corresponding angle value

      For zone directions: SENW (0, 1024, 2048, or 3072).

      For vectors: Calculated angle of the vector (Z+ is 0°, X+ is 90°, Z- is 180°, X- is 270°).

      The Y component of vectors is ignored in the calculation.

    • Converts radians to the LBA angle system (0..4096)

      Parameters

      • radians: number

        The radians value to convert.

      Returns number

      The corresponding angle value (0-4096)