Skip to main content

<sphere>

Renders a sphere. When placed inside of a <rigidbody> it gains physical properties.

Props

PropTypeDescriptionDefault
radiusNumberRadius of the sphere.0.5
widthSegmentsNumberNumber of width segments.32
heightSegmentsNumberNumber of height segments.16
colorStringColor of the sphere.0xededed
opacityNumberOpacity of the sphere.1
positionArrayPosition of the sphere.[0,0,0]
rotationArrayRotation of the sphere.[0,0,0]
scaleNumber|ArrayScale of the sphere. A single value will be scaled scalar.1
onHoverEnterFunctionCalled when an avatar hovers over the sphere. Provides an Event
onHoverLeaveFunctionCalled when an avatar hovers out of the sphere. Provides an Event
onPointerDownFunctionCalled when avatar presses the pointer down over this object.
onPointerDownHintStringText displayed when hovering over this object when onPointerDown is defined.
onPointerUpFunctionCalled when avatar releases the pointer over this object.
onPointerUpHintStringText displayed when hovering over this object with the pointer down and onPointerUp is defined.
hitDistanceNumberMaximum distance to interact with this node.3
hiddenBooleanWhether to hide this box. Use this for invisible physics.false
climbableBooleanWhether avatars can climb the sphere when placed inside a <rigidbody>

Ref

FieldDescription
setPosition(vec3)Update position
setRotation(eul)Update rotation

Notes

None.