engine
engine copied to clipboard
Raycast hitResult return collidershape
Is your feature request related to a problem? Please describe.
raycast HitResult returns collider shape useful when the entity have multiple collider shapes
const { inputManager } = this.engine;
const ray = new Ray();
const hit = new HitResult();
this.camera.screenPointToRay(inputManager.pointerPosition, ray);
const result = engine.physicsManager.raycast(
ray,
Number.MAX_VALUE,
Layer.Everything,
hit
);
if (result) {
console.log(hit);
}
}
HitResult2 {entity: Entity2, distance: 16.806891631390485, point: Vector32, normal: Vector32, shape:colliderShape}