import { PhysXPhysics } from "../PhysXPhysics" ; import { ISphereColliderShape } from "@oasis-engine/design" ; import { PhysXColliderShape } from "./PhysXColliderShape" ; import { PhysXPhysicsMaterial } from "../PhysXPhysicsMaterial" ; import { Vector3 } from "oasis-engine" ; /**
 * Sphere collider shape in PhysX.
 */ export class PhysXSphereColliderShape extends PhysXColliderShape implements ISphereColliderShape { private _radius : number ; private _maxScale : number = 1 ; param uniqueID param radius param material constructor ( uniqueID , radius , material ) { super ( ) ; this . _radius = radius ; this . _pxGeometry = new PhysXPhysics . _physX . PxSphereGeometry ( this . _radius * this . _maxScale ) ; this . _allocShape ( material ) ; this . _setLocalPose ( ) ; this . setUniqueID ( uniqueID ) ; } /**
     * {@inheritDoc ISphereColliderShape.setRadius }
     */ setRadius ( value ) { this . _radius = value ; this . _pxGeometry . radius = value * this . _maxScale ; this . _pxShape . setGeometry ( this . _pxGeometry ) ; } /**
     * {@inheritDoc IColliderShape.setWorldScale }
     */ setWorldScale ( scale ) { this . _maxScale = Math . max ( scale . x , Math . max ( scale . x , scale . y ) ) ; this . _pxGeometry . radius = this . _radius * this . _maxScale ; this . _pxShape . setGeometry ( this . _pxGeometry ) ; } }