UNPKG

@animech-public/playcanvas

Version:
2 lines (1 loc) 708 B
import{SphereGeometry as e}from"../../../scene/geometry/sphere-geometry.js";import{TriData as t}from"../tri-data.js";import{Shape as s}from"./shape.js";class r extends s{constructor(s,r={}){super(s,r),this._size=.12,this._tolerance=.05,this.triData=[new t(new e,2)],this._createCenter()}_createCenter(){this._createRoot("sphereCenter"),this._updateTransform(),this._addRenderMesh(this.entity,"sphere",this._shading)}set size(e){this._size=null!=e?e:1,this._updateTransform()}get size(){return this._size}set tolerance(e){this._tolerance=e,this._updateTransform()}get tolerance(){return this._tolerance}_updateTransform(){this.entity.setLocalScale(this._size,this._size,this._size)}}export{r as SphereShape};