Options
All
  • Public
  • Public/Protected
  • All
Menu

A behavior that allows a transform node to stick to a surface position/orientation

since

5.0.0

Hierarchy

  • SurfaceMagnetismBehavior

Implements

Index

Constructors

Properties

enabled: boolean

Is this behavior reacting to pointer events

hitNormalOffset: number

Distance offset from the hit point to place the target at, along the hit normal.

interpolatePose: boolean

Set to false if the node should strictly follow the camera without any interpolation time

keepOrientationVertical: boolean

If true, pitch and roll are omitted.

lerpTime: number

Rate of interpolation of position and rotation of the attached node. Higher values will give a slower interpolation.

maxStickingDistance: number

Maximum distance for the node to stick to the surface

meshes: AbstractMesh[]

Spatial mapping meshes to collide with

Accessors

  • get name(): string
  • Name of the behavior

    Returns string

Methods

  • Attaches the behavior to a transform node

    Parameters

    • target: Mesh

      defines the target where the behavior is attached to

    • Optional scene: Scene

      the scene

    Returns void

  • detach(): void
  • Detaches the behavior

    Returns void

  • Finds the intersection point of the given ray onto the meshes and updates the target. Transformation will be interpolated according to interpolatePose and lerpTime properties. If no mesh of meshes are hit, this does nothing.

    Parameters

    • pickInfo: PickingInfo

      The input pickingInfo that will be used to intersect the meshes

    Returns boolean

    a boolean indicating if we found a hit to stick to

  • init(): void
  • Function called when the behavior needs to be initialized (after attaching it to a target)

    Returns void

  • updateAttachPoint(): void
  • Updates the attach point with the current geometry extents of the attached mesh

    Returns void

Legend

  • Constructor
  • Property
  • Method
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Property
  • Method
  • Static method

Settings

Theme