PinToMeshComponent
ClassAttaches the SceneObject to the mesh surface of a specific RenderMeshVisual.
- Available on all platforms
Index
Properties
Methods
Extends
Properties
enabled
enabled:
boolean
If disabled, the Component will stop enacting its behavior.
Default Value
true
Inherited from
isBeingDestroyed
readonlyisBeingDestroyed:boolean
Returns true if this Component is currently being destroyed. Becomes true as soon as
destruction begins via Component#destroy or destruction of its owning SceneObject,
before any OnDestroyEvent callbacks fire.
Since
Lens Scripting Version 364
Example
if (!script.isBeingDestroyed) {
// Component is still fully alive
}
Inherited from
isEnabledInHierarchy
readonlyisEnabledInHierarchy:boolean
Returns true if this Component, its SceneObject, and all of that SceneObjects parents are enabled.
Inherited from
Component.isEnabledInHierarchy
offsetPosition
offsetPosition:
vec3
The position offset to apply.
Default Value
(0, 0, 0)
offsetRotation
offsetRotation:
vec3
The euler angle offset to apply. Only has an effect when orientation is set to PositionAndDirection.
Default Value
(0, 0, 0)
orientation
orientation:
Orientation
The orientation type to use.
Default Value
PinToMeshComponent.Orientation.OnlyPosition
pinUV
pinUV:
vec2
The UV coordinates on the target mesh to attach to.
Default Value
(0, 0)
preferredTriangle
preferredTriangle:
number
The preferred triangle index to attach to when multiple triangles contain the desired UV coordinate.
Default Value
-1
preferredUVLayerIndex
preferredUVLayerIndex:
number
Index of the UV coordinate set to use for pinning.
Default Value
-1
sceneObject
readonlysceneObject:SceneObject
The SceneObject this component is on.
Inherited from
target
target:
BaseMeshVisual
The target mesh to attach to.
Default Value
null
uniqueIdentifier
readonlyuniqueIdentifier:string
Since
Lens Scripting Version 176
Inherited from
useInterpolatedVertexNormal
useInterpolatedVertexNormal:
boolean
If enabled, interpolated vertex normals will be used when calculating the attachment position.
Default Value
false
Methods
destroy()
destroy():
void
Destroys the component.
Returns
void
Inherited from
getSceneObject()
getSceneObject():
SceneObject
Returns the SceneObject the component is attached to.
Returns
Inherited from
getTransform()
getTransform():
Transform
Returns the Transform this component is attached to.
Returns
Inherited from
getTypeName()
staticgetTypeName():TypeName<PinToMeshComponent>
Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().
Returns
TypeName<PinToMeshComponent>
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object matches or derives from the passed in type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object is the same as other. Useful for checking if two references point to the same thing.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean
Inherited from
See also
Pin To Mesh guide.
Nested types
Enumerations
| Enumeration | Description |
|---|---|
| Orientation | Used with PinToMeshComponent.orientation. |