@kognifai/cogsengine
    Preparing search index...

    Class VariableExtrusionComponent

    class defining a Cogs component. Defines basic properties of the component - readonly for clients 'type' and 'entity'. All component shares same class definition. The properties for accessing the fields of the component type will be filled in at runtime, e.g. for TransformComponent: getter+setter for: coordinates, position, rotation etc.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    angle: number

    Angle to rotate the shape around the trajectory by.

    closed: boolean

    If the shape should be displayed closed.

    creaseAngle: number

    Crease angle to use when smoothing normals. Any angle above the given will create a crease.

    crossSection: Float32Array

    (Contents: vec3[]) Cross section shape.

    depthOffset: number

    Offset amount applied to the given profile depths before calculating the trajectory.

    depths: Float32Array

    Depth values for the profile.

    enableRotation: boolean

    If rotation should be enabled.

    isTyped: boolean

    Internal flag set if component is a Cogs Core component.

    morph: Float32Array

    Morph factors applied per segment controlling the amount of regular/morph cross section to use.

    morphCrossSection: Float32Array

    (Contents: vec3[]) Morph target cross section.

    profile: Float32Array

    (Contents: vec2[]) Extrusion profile in two component (radial, length).

    radiusScale: number

    Radius scale applied to the entire shape perpendicular to the direction of the trajectory.

    segmentCount: number

    Number of segments per cross section.

    textureOffset: vec2

    Offset in units to apply to generated texture coordinates.

    textureScale: vec2

    Scale factor to multiply generated texture coordinates by.

    trajectory: Entity

    The trajectory this component is connected to.

    twist: Float32Array

    Twist factors given by segment.

    useMorph: boolean

    If morphing factors should be applied.

    useOffset: boolean

    If offsets are applied.

    useSimpleRotation: boolean

    If rotation should be applied uniformly to the entire shape (instead of per segment).

    useTwist: boolean

    If twist factors should be applied.

    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.