ManipulateComponent
ClassHandles input information from user touch input via the InteractionComponent to control the Scale, Rotation, and Translation of objects.
- Available on all platforms
Index
Properties
Methods
Example
// Disables the scale functionality on a manipulate component when a user taps
//@input Component.ManipulateComponent manip
function onTap(eventData)
{
script.manip.enableManipulateType(ManipulateType.Scale, false);
}
var tapEvent = script.createEvent("TapEvent");
tapEvent.bind(onTap);
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
isContextualSwivel
isContextualSwivel:
boolean
Changes swivel behavior based on the object's height relative to the camera.
Default Value
false
isEnabledInHierarchy
readonlyisEnabledInHierarchy:boolean
Returns true if this Component, its SceneObject, and all of that SceneObjects parents are enabled.
Inherited from
Component.isEnabledInHierarchy
isManipulating
readonlyisManipulating:boolean
Returns whether the object that the Manipulate Component is on is currently being manipulated
maxDistance
maxDistance:
number
The maximum distance the object can travel from the user.
Default Value
0
maxHeight
maxHeight:
number
The maximum height of the object.
Default Value
0
maxScale
maxScale:
number
The maximum size the object can scale to.
Default Value
0
minDistance
minDistance:
number
The minimum distance the object can be from the user.
Default Value
0
minHeight
minHeight:
number
The minimum height of the object.
Default Value
0
minScale
minScale:
number
The minimum size the object can shrink to.
Default Value
0
onManipulateEnd
readonlyonManipulateEnd:event1<ManipulateEndEventArgs,void>
Event fired when manipulation ends.
Since
Lens Scripting Version 148
onManipulateStart
readonlyonManipulateStart:event1<ManipulateStartEventArgs,void>
Event fired when manipulation starts.
Since
Lens Scripting Version 148
rotationScale
rotationScale:
number
Multiplier for swivel rotation speed. For example, a value of 0.5 will cut rotation speed in half, and a value of 2.0 will double rotation speed.
Default Value
0
sceneObject
readonlysceneObject:SceneObject
The SceneObject this component is on.
Inherited from
uniqueIdentifier
readonlyuniqueIdentifier:string
Since
Lens Scripting Version 176
Inherited from
Methods
clampWorldPosition()
clampWorldPosition():
void
Repositions the object to be within the bounds of minDistance, maxDistance.
Returns
void
destroy()
destroy():
void
Destroys the component.
Returns
void
Inherited from
enableManipulateType()
enableManipulateType(
type,enable):void
Enables or disables the specified ManipulateType for this ManipulateComponent.
Parameters
| Parameter | Type |
|---|---|
type | ManipulateType |
enable | boolean |
Returns
void
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<ManipulateComponent>
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<ManipulateComponent>
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
intersectManipulateFrame()
intersectManipulateFrame(
screenSpacePoint):ManipulateFrameIntersectResult
Checks for an intersection point between the manipulation plane and a line extending from the camera through the specified screen space point. The screen point is passed in as (x, y) with both values ranging from ([0-1], [0-1]), (0,0) being left-top and (1,1) being right-bottom. The result is returned as a ManipulateFrameIntersectResult object.
Parameters
| Parameter | Type |
|---|---|
screenSpacePoint | vec2 |
Returns
ManipulateFrameIntersectResult
isManipulateTypeEnabled()
isManipulateTypeEnabled(
type):boolean
Returns whether the specified ManipulateType is enabled for this ManipulateComponent.
Parameters
| Parameter | Type |
|---|---|
type | ManipulateType |
Returns
boolean
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