Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SemiTorus

Hierarchy

Index

Properties

Private _typeTag3

_typeTag3: "SemiTorus"

active

active: boolean

Defines this item's active state.

If false, this item

  • Ignores (physics-) collisions
  • Ignores tracing, e.g. from RayCast and Input
  • Does not use physics

animated

animated: boolean

Returns true if this item has animation tracks.

arc

arc: number

Visible torus sector in radians.

param

sector angle in radians

center

center: Vector3

Returns the center point of this item.

returns

center of this item in world space.

children

children: ItemCollection

Returns all first-level hierarchy children of this item.

Note: This does not return a complete children Transform hierarchy.

See BaseItem.parent

color

color: Color

Defines color of this item.

To change opacity, use BaseItem.opacity.

id

id: string

The unique id of this item.

If several items share the same name, this item can still be found by its id.

See Scene.getItem

See BaseItem.name

input

input: object

Type declaration

  • onButtonDown: function
    • onButtonDown(handler: function): void
    • Triggers whenever the main input is pressed down inside of this item.

      Calling this function on an existing handler overwrites the handler.

      Parameters

      • handler: function

        function to call on press down. Pass null to remove the handler.

          • (): void
          • Returns void

      Returns void

  • onButtonUp: function
    • onButtonUp(handler: function): void
    • Triggers whenever the main input is released inside of this item.

      Calling this function on an existing handler overwrites the handler.

      Parameters

      • handler: function

        function to call on release. Pass null to remove the handler.

          • (): void
          • Returns void

      Returns void

  • onClick: function
    • onClick(handler: function): void
    • Triggers whenever the main input is pressed and released inside of this item.

      Calling this function on an existing click handler overwrites the handler.

      Parameters

      • handler: function

        function to call after click. Pass null to remove the handler.

          • (): void
          • Returns void

      Returns void

  • onHover: function
    • onHover(handler: function): void
    • Triggers whenever the item is hovered.

      Calling this function on existing hover handler overwrites the handler.

      Parameters

      • handler: function

        method to call on hover event. Uses boolean property to determine start and end of hover event. Pass null to remove the handler.

          • (t: boolean): void
          • Parameters

            • t: boolean

            Returns void

      Returns void

  • setCollisionDrag: function
    • setCollisionDrag(): void
    • setCollisionDrag(callback: function): void
    • Creates a drag interaction on this item to another item, allowing this item to be moved on the surface of other items.

      Returns void

    • Creates a drag interaction on this item to another item, allowing this item to be moved on the surface of other items.

      Parameters

      • callback: function

        function to call when the drag interaction ends

          • (): void
          • Returns void

      Returns void

  • setItemDrag: function
    • setItemDrag(target: BaseItem): void
    • setItemDrag(target: BaseItem, callback: function): void
    • Creates a drag interaction which causes this item to be draggable on the target.

      Parameters

      • target: BaseItem

        item to use as drag surface.

      Returns void

    • Creates a drag interaction which causes this item to be draggable on the target.

      Parameters

      • target: BaseItem

        item to use as drag surface.

      • callback: function

        function to call when the drag interaction ends.

          • (): void
          • Returns void

      Returns void

masking

masking: boolean

name

name: string

Name of this item displayed in their name tag and in the item hierarchy.

See Scene.getItem

See BaseItem.id

nameVisible

nameVisible: boolean

Toggles visibility of the item name tag.

See BaseItem.name

opacity

opacity: number

Normalized opacity of this item.

Note: Items with opacity below 0.3 ignore inputs, e.g. from BaseItem.input.

parent

parent: BaseItem

Returns the parent of this item.

See BaseItem.add

See BaseItem.removeFromParent

physics

physics: object

Type declaration

  • angularVelocity: Vector3

    Returns world space angularVelocity of this item.

    returns

    angular velocity in world space.

  • angularVelocityLocal: Vector3

    Returns local space angularVelocity of this item.

    returns

    angular velocity in world space.

    See BaseItem.parent

  • enabled: boolean

    Toggles this item to be simulated with physics.

    returns

    physics simulation state.

  • force: Vector3

    Defines directional force that is applied on this item each frame.

    returns

    item force in world space.

  • friction: number

    Defines the friction of this item during movement

    • Value of 0 resembles ice
    • Value of 1 resembles a surface with high friction, e.g. car tyre.
    returns

    item friction.

  • group: object
    • velocityLocal: Vector3

      Returns the world space velocity of the group's center of mass.

      returns

      velocity in world space.

  • mass: number

    Defines the mass of this item. Items with higher mass more easily push away items with lower mass.

    returns

    item mass.

  • position: Vector3

    Returns the world space position of the center of mass for this item.

    returns

    center of mass.

  • restitution: number

    Defines this item's restitution (bounciness).

    • Restitution of 0 does not cause item to bounce
    • Restitution of 1 causes item to bounce at no loss of energy
    returns

    item restitution.

  • softness: number

    Defines the velocity threshold at which this item is allowed to be repulsed by collisions.

    High values make this item feel soft, low values make it feel solid.

    returns

    item softness.

  • static: boolean

    Defines static state of this item. Static items have indefinite mass and can not be moved by physics forces.

    returns

    static state.

  • velocity: Vector3

    Returns the world space velocity of the item's center of mass.

    returns

    velocity in world space.

  • velocityLocal: Vector3

    Returns the local space velocity of the item's center of mass.

    returns

    velocity in local space.

    See BaseItem.parent

  • addToCollisionFilter: function
    • addToCollisionFilter(item: BaseItem): void
    • Adds collision filter to target item to ignore collisions, even when this item shares the same collision layer.

      Parameters

      • item: BaseItem

        item to add to collision filter

      Returns void

  • applyForce: function
    • Applies constant directional force to this item each frame.

      Parameters

      • force: Vector3

        world space force to apply.

      Returns void

  • applyImpulse: function
    • Pushes this item with the defined impulse for this frame.

      Parameters

      • origin: Vector3

        origin of the impulse in world space.

      • impulse: Vector3

        direction & force of the impulse.

      Returns void

  • applyImpulseLocal: function
    • Pushes this item with the defined impulse relative to its forward direction for this frame.

      Parameters

      • localOrigin: Vector3

        origin of the impulse relative to item forward direction.

      • impulse: Vector3

        direction & force of the impulse.

      Returns void

  • onCollisionEnter: function
    • onCollisionEnter(handler: function): void
    • Handles the start of a physics collision between this item and another item.

      To remove the handler, pass null for handler.

      Parameters

      • handler: function

        passes BaseItem which this item collides against.

      Returns void

  • onCollisionExit: function
    • onCollisionExit(handler: function): void
    • Handles the end of a physics collision between this item and another item.

      To remove the handler, pass null for handler.

      Parameters

      • handler: function

        passes item which this item collided against.

      Returns void

  • removeFromCollisionFilter: function
    • removeFromCollisionFilter(item: BaseItem): void
    • Removes collision filter from the target item.

      Parameters

      • item: BaseItem

        item to remove from collision filter

      Returns void

  • restrictMovementAxis: function
    • restrictMovementAxis(axes: object): void
    • Restricts this item's movement on the defined axes.

      Parameters

      • axes: object

        axes to restrict movement on.

        • Optional x?: boolean
        • Optional y?: boolean
        • Optional z?: boolean

      Returns void

  • restrictRotationAxis: function
    • restrictRotationAxis(axes: object): void
    • Restricts this item's rotation to the defined rotation axes

      Parameters

      • axes: object

        axes to restrict movement one.

        • Optional x?: boolean
        • Optional y?: boolean
        • Optional z?: boolean

      Returns void

  • shiftPosition: function
    • shiftPosition(shift: Vector3): void
    • Moves this item by an offset from its current position.

      Parameters

      • shift: Vector3

        offset from current position in world space.

      Returns void

  • shiftPositionLocal: function
    • shiftPositionLocal(offset: Vector3): void
    • Moves this item by an offset relative to its forward direction.

      Parameters

      • offset: Vector3

        offset relative to forward direction.

      Returns void

radius

radius: number

relativeTransform

relativeTransform: Transform

The relative Transform of this item in local space.

The local space is determined by this item's BaseItem.parent.

See BaseItem.transform

speech

speech: string | number

Defines the text in the speech-bubble of this item.

thought

thought: string | number

Defines the text in the thought-bubble of this item.

transform

transform: Transform

The Transform of this item in world space.

See BaseItem.relativeTransform

transition

transition: object

Type declaration

  • moveBy: function
    • Moves this item from its current position by local offset vector.

      Parameters

      • target: Vector3

        relative offset to apply.

      • duration: number

        time in seconds.

      Returns Tweener

      created Tweener.

    • Moves this item from its current position by local offset vector.

      Parameters

      • target: Vector3

        relative offset to apply.

      • duration: number

        time in seconds.

      • callback: function

        function to call when the target is reached.

          • (): void
          • Returns void

      Returns Tweener

      created Tweener.

  • moveOnPath: function
    • moveOnPath(options: object): Tweener
    • Moves this item on a PathItem.

      Example

      //moves an item indefinitely on a PathItem
      const myItem = Scene.getItem("myItem")
      const myPath = Scene.getItem("myPath") as PathItem
      
      myItem.transition.moveOnPath({
          path: myPath,
          speed: 1.5,
          turnWithPath: true,
          repeat: true
      })

      Parameters

      • options: object

        path movement options.

        • Optional callback?: function
            • (): void
            • Returns void

        • Optional endPoint?: number
        • path: PathItem
        • Optional repeat?: boolean
        • Optional reverse?: boolean
        • Optional speed?: number
        • Optional startPoint?: number
        • Optional time?: number
        • Optional turnWithPath?: boolean

          For closed paths

      Returns Tweener

      created Tweener.

  • moveTo: function
    • Moves this item to the target point over duration.

      Parameters

      • target: Vector3

        point in world space.

      • duration: number

        time in seconds.

      Returns Tweener

      created Tweener.

    • Moves this item to the target point over duration.

      Parameters

      • target: Vector3

        point in world space.

      • duration: number

        time in seconds.

      • callback: function

        function to call when the target is reached.

          • (): void
          • Returns void

      Returns Tweener

      created Tweener.

  • rotateLocal: function
    • rotateLocal(axis: Vector3, angleInRadians: number, duration: number): Tweener
    • rotateLocal(axis: Vector3, angleInRadians: number, duration: number, callback: function): Tweener
    • rotateLocal(offset: Vector3, axis: Vector3, angleInRadians: number, duration: number): Tweener
    • rotateLocal(offset: Vector3, axis: Vector3, angleInRadians: number, duration: number, callback: function): Tweener
    • Rotates this item by angleInRadians towards axis direction over duration.

      Parameters

      • axis: Vector3

        vector defining the local rotation axis.

      • angleInRadians: number

        rotation in radians.

      • duration: number

        time in seconds.

      Returns Tweener

      created Tweener

    • Rotates this item by angleInRadians towards axis direction over duration.

      Parameters

      • axis: Vector3

        vector defining the local rotation axis.

      • angleInRadians: number

        rotation in radians.

      • duration: number

        time in seconds.

      • callback: function

        function to call when the Tweener ends.

          • (): void
          • Returns void

      Returns Tweener

      created Tweener

    • Rotates this item by angleInRadians around an offset towards axis direction over duration.

      Parameters

      • offset: Vector3

        offset relative to current position.

      • axis: Vector3

        vector defining the local rotation axis.

      • angleInRadians: number

        rotation in radians.

      • duration: number

        time in seconds.

      Returns Tweener

      created Tweener

    • Rotates this item by angleInRadians around an offset towards axis direction over duration.

      Parameters

      • offset: Vector3

        offset relative to current position.

      • axis: Vector3

        vector defining the local rotation axis.

      • angleInRadians: number

        rotation in radians.

      • duration: number

        time in seconds.

      • callback: function

        function to call when the Tweener ends.

          • (): void
          • Returns void

      Returns Tweener

      created Tweener

  • stop: function
    • stop(): void
    • Stops all Tweener on this item.

      See Tweener

      Returns void

tubeRadiusX

tubeRadiusX: number

tubeRadiusZ

tubeRadiusZ: number

visible

visible: boolean

Toggles this item's visibility. If false, items retains its opacity value, but is not displayed.

See BaseItem.opacity

Methods

add

copy

delete

  • delete(): void
  • Irreversibly removes this item from the Scene.

    Note: This method does not update previously existing item references.

    Returns void

deleteChildren

  • deleteChildren(): void

getProperty

  • getProperty(key: string): string
  • Gets a custom property from this object. Returns null if the property can not be found.

    Parameters

    • key: string

      name of property to search.

    Returns string

getSlot

  • getSlot(name: string): Slot
  • Returns Slot by name.

    Parameters

    • name: string

      name of slot to find.

    Returns Slot

onCollisionEnter

  • onCollisionEnter(handler: function): void
  • Handles the start of a collision between this item and another item.

    To remove the handler, pass null for handler.

    Parameters

    • handler: function

      passes BaseItem which this item collides against.

    Returns void

onCollisionExit

  • onCollisionExit(handler: function): void
  • Handles the end of a collision between this item and another item.

    Calling this function on an existing collision handler overwrites the handler.

    Parameters

    • handler: function

      passes item which this item collided against.

    Returns void

onPropertyChanged

  • onPropertyChanged(id: string, handler: function): void
  • Handles property value changes in this object.

    Parameters

    • id: string

      property to listen to.

    • handler: function

      function that's called when property value is changed.

        • (t: string): void
        • Parameters

          • t: string

          Returns void

    Returns void

removeFromParent

  • removeFromParent(): void

setProperty

  • setProperty(key: string, value: any): void
  • Sets a custom property to this object.

    Properties are saved as strings.

    Parameters

    • key: string

      property name.

    • value: any

      property value.

    Returns void

Generated using TypeDoc