@kognifai/cogsengine
    Preparing search index...

    Class AxisCubeComponent

    A cube with grids on the side faces. Coordinate systems Local coordinate system is the coordinate system used by the rendering system, and minCorner and maxCorner are specified using this system. The unit coordinate system is the coordinate system used for grid lines and annotations. Local and unit coords are linked through zScale and unitScales, unit.x = local.xunitScales.x, unit.y = local.yunitScales.y, and unit.z = (local.z/zScale)*unitScales.z. Thus, zScale is the amount of exaggeration that has been applied to the underlying data before rendering (a zScale of 10 means that local coord z is 10 times larger than an un-exaggerated local coord z would have been). Further, unitScales specifies the number of unit-units there is in a local scale unit. That is, if local coords are in meters, and we want to the grid to use feet, we set unitScales to 1.0/0.3048=3.2808.

    Tick sizes First, the distance between min and max in unit coordinates is divided by maxAxisValues. We allow this distance to grow until we get a distance that is a nice round number (i.e., a power of 10), by rounding the 10-logarithm of up of the distance and raising 10 to this number, that is, distance = 10^( ceil( log10( (max-min)/maxAxisValues ) ) ). This expression yields the smallest distance that is a power of 10 and results in no more than maxAxisValues grid-lines along that axis.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    autoAdjustMargin: vec3

    A margin applied to the bounding box of the encased Entity, this property only works alongside autoNodes.

    autoAdjustToLargestDimension: boolean

    If the auto adjustment should make the box equal in size along all axes.

    autoNodes: Entity[]

    Entities(Nodes) that are to be encased by this AxisCube.

    axisTitles: string[]

    Titles for the x,y,z-axises.

    backQuadMaterial: Entity
    bottomQuadMaterial: Entity
    frontQuadMaterial: Entity
    isTyped: boolean

    Internal flag set if component is a Cogs Core component.

    leftQuadMaterial: Entity
    maxAxisValues: number

    The maximum number of axis annotation values to use.

    maxCorner: vec3

    Maximum corner of the cube.

    minCorner: vec3

    Minimum corner of the cube.

    rightQuadMaterial: Entity
    textColor: vec4

    Color of text, to be forwarded to children.

    tickSizeOffset: number
    topQuadMaterial: Entity
    unitNames: string[]

    Name of the x,y,z-axis units.

    unitScales: vec3

    Size of unit coordinate axis in unitname-units.

    useAxisAnnotations: boolean

    If the axis cube should create axis annotation text.

    zScale: number

    Amount to scale the z-axis.

    Accessors

    • get entity(): Entity

      Gets the optional owning entity

      Returns Entity

    • set entity(entity: Entity): void

      Internal: set owning entity.

      Parameters

      Returns void

    • get name(): string

      Component name == type. For compatibility

      Returns string

    • get type(): string

      Gets the type of the component. Ex. "TransformComponent", "SceneComponent" etc.

      Returns string

    Methods

    • Internal: Creates a new component of the given type (name). Component is wrapped when adding to an entity.

      Parameters

      • type: string

        Type of the component. Ex. "TransformComponent"

      Returns Component

      Created Cogs.js component.

    • Internal: Creates a new component being wrapped as an existing member of the entity

      Parameters

      • type: string

        Type of the component. Ex. "TransformComponent"

      • entity: Entity

        The owning entity

      Returns Component

      Created Cogs.js component.