Returns true
if this item has animation tracks.
Visible torus sector in radians.
Returns the center point of this item.
Returns all first-level hierarchy children of this item.
Note: This does not return a complete children Transform
hierarchy.
See BaseItem.parent
Defines color of this item.
To change opacity, use BaseItem.opacity.
Toggles the highlight effect on this item. If true
, displays item highlight.
Defines the highlight type of this item.
default
: item uses highlight and outlinelight
: item uses light onlyoutline
: item uses outline onlyinherited
: item uses highlight options from parent-itemThe 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
Triggers whenever the main input is pressed down inside of this item.
Calling this function on an existing handler overwrites the handler.
function to call on press down. Pass null
to remove the handler.
Triggers whenever the main input is released inside of this item.
Calling this function on an existing handler overwrites the handler.
function to call on release. Pass null
to remove the handler.
Triggers whenever the main input is pressed and released inside of this item.
Calling this function on an existing click handler overwrites the handler.
function to call after click. Pass null
to remove the handler.
Triggers whenever the item is hovered.
Calling this function on existing hover handler overwrites the handler.
method to call on hover event. Uses boolean
property to determine start and end of hover event. Pass null
to remove the handler.
Creates a drag interaction on this item to another item
, allowing this item to be moved on the surface
of other items.
Creates a drag interaction on this item to another item
, allowing this item to be moved on the surface
of other items.
function to call when the drag interaction ends
Creates a drag interaction which causes this item
to be draggable on the target
.
item to use as drag surface.
Creates a drag interaction which causes this item
to be draggable on the target
.
item to use as drag surface.
function to call when the drag interaction ends.
Name of this item displayed in their name tag and in the item hierarchy.
See Scene.getItem
See BaseItem.id
Toggles visibility of the item name tag.
See BaseItem.name
Normalized opacity of this item.
Note: Items with opacity below 0.3
ignore inputs, e.g. from BaseItem.input.
Returns the parent of this item.
Returns world space angularVelocity
of this item.
Returns local space angularVelocity
of this item.
Toggles this item to be simulated with physics.
Defines directional force
that is applied on this item each frame.
Defines the friction of this item during movement
0
resembles ice1
resembles a surface with high friction, e.g. car tyre.Returns the world space velocity
of the group's center of mass.
Defines the mass of this item. Items with higher mass more easily push away items with lower mass.
Returns the world space position
of the center of mass for this item.
Toggles precise model collisions.
If true
, this item attempts to use pre-defined collision volumes if available.
If false
, this item uses simplified boundary box collision.
Defines this item's restitution (bounciness).
0
does not cause item to bounce1
causes item to bounce at no loss of energyDefines 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.
Defines static
state of this item. Static items have indefinite mass and can not be moved by physics forces.
Returns the world space velocity
of the item's center of mass.
Returns the local space velocity
of the item's center of mass.
Adds collision filter to target item
to ignore collisions, even when this item shares the same collision layer.
item to add to collision filter
Applies constant directional force
to this item each frame.
world space force to apply.
Removes collision filter from the target item
.
item to remove from collision filter
Restricts this item's movement on the defined axes
.
axes to restrict movement on.
Restricts this item's rotation to the defined rotation axes
axes to restrict movement one.
Moves this item by an offset from its current position.
offset from current position in world space.
Moves this item by an offset
relative to its forward direction.
offset relative to forward direction.
The relative Transform of this item in local space.
The local space is determined by this item's BaseItem.parent.
Returns all slots found in this item.
Defines the text in the speech-bubble of this item.
Defines the text in the thought-bubble of this item.
The Transform of this item in world space.
Rotates this item to face towards a target
point over duration
.
point in world space.
time in seconds.
created Tweener
.
Rotates this item to face towards a target
point over duration
.
point in world space.
time in seconds.
function to call when this item faces the target
point.
created Tweener
.
Rotates this item over duration
so that
Y
-axis points towards the target
point.Z
-axis points towards the worldUp
direction.Note: The local Z
-axis always attempts to be perpendicular to Y
, which may lead to
worldUp
not always accurately being pointed at.
point in world space.
time in seconds.
defines the upward direction.
created Tweener
.
Rotates this item over duration
so that
Y
-axis points towards the target
point.Z
-axis points towards the worldUp
direction.Note: The local Z
-axis always attempts to be perpendicular to Y
, which may lead to
worldUp
not always accurately being pointed at.
point in world space.
time in seconds.
defines the upward direction.
function to call when this item looks at target
.
created Tweener
.
Moves this item from its current position by local offset
vector.
relative offset to apply.
time in seconds.
created Tweener
.
Moves this item from its current position by local offset
vector.
relative offset to apply.
time in seconds.
function to call when the target is reached.
created 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
})
path movement options.
For closed paths
created Tweener
.
Moves this item to the target
point over duration
.
point in world space.
time in seconds.
created Tweener
.
Moves this item to the target
point over duration
.
point in world space.
time in seconds.
function to call when the target is reached.
created Tweener
.
Fades this item's to the target
opacity over duration
.
opacity to fade to.
time in seconds.
created Tweener
.
Fades this item's to the target
opacity over duration
.
opacity to fade to.
time in seconds.
function to call when the target is reached.
created Tweener
.
Fades this item's to the target
opacity over duration
.
starting opacity.
opacity to fade to.
time in seconds.
created Tweener
.
Fades this item's to the target
opacity over duration
.
starting opacity.
opacity to fade to.
time in seconds.
function to call when the target is reached.
created Tweener
.
Rotates this item by angleInRadians
towards axis
direction over duration
.
vector defining the local rotation axis.
rotation in radians.
time in seconds.
created Tweener
Rotates this item by angleInRadians
towards axis
direction over duration
.
vector defining the local rotation axis.
rotation in radians.
time in seconds.
function to call when the Tweener
ends.
created Tweener
Rotates this item by angleInRadians
around an offset
towards axis
direction over duration
.
offset relative to current position.
vector defining the local rotation axis.
rotation in radians.
time in seconds.
created Tweener
Rotates this item by angleInRadians
around an offset
towards axis
direction over duration
.
offset relative to current position.
vector defining the local rotation axis.
rotation in radians.
time in seconds.
function to call when the Tweener
ends.
created Tweener
Scales this item from startValue
to endValue
over duration
.
starting size.
target size.
time in seconds.
created Tweener
.
Stops all Tweener
on this item.
See Tweener
Adds a child to this item.
Children inherit BaseItem.transform and BaseItem.highlight settings from their parent.
Adds a tag to the item. Tags are used to help categorize items independent of BaseItem.name or BaseItem.id.
Items can hold several tags.
adds a new tag to this item.
Creates a copy of this item.
All properties except those made with BaseItem.setProperty are copied.
Irreversibly removes this item from the Scene.
Note: This method does not update previously existing item references.
Deletes all children of this item.
Gets a custom property from this object. Returns null
if the property can not be found.
name of property to search.
Returns true
if the defined tag
can be find in this item.
tag to check.
See BaseItem.addTag
Handles property value changes in this object.
property to listen to.
function that's called when property value is changed.
Removes this item from its parent-item, disconnecting all inherited Transform
and highlight
settings.
Removes a tag from this item.
tag to remove.
See BaseItem.addTag
Sets a custom property to this object.
Properties are saved as strings
.
property name.
property value.
Defines this item's
active
state.If
false
, this item