author Yannick Deubel (https://github.com/yandeu)
 *  copyright license https import { AmmoPhysics } from '../physics' ; import { ExtendedObject3D } from '@enable3d/common/dist/types' ; export default class ClosestRayResultCallback { protected _btRayCallback ! : Ammo . ClosestRayResultCallback ; constructor ( protected physics ) { } getHitPointWorld ( ) { const h = this . _btRayCallback . get_m_hitPointWorld ( ) as Ammo . btVector3 ; const point = { x : h . x ( ) , y : h . y ( ) , z : h . z ( ) } ; return point ; } getHitNormalWorld ( ) { const h = this . _btRayCallback . get_m_hitNormalWorld ( ) ; const normal = { x : h . x ( ) , y : h . y ( ) , z : h . z ( ) } ; return normal ; } getCollisionObject ( ) { const rb = Ammo . castObject ( this . _btRayCallback . get_m_collisionObject ( ) , Ammo . btRigidBody ) ; return rb . threeObject ; } }