Skip to content

marble3 / raycastFromCamera

Function: raycastFromCamera() ​

raycastFromCamera(camera, world, range?): object

Defined in: src/physics.ts:117

Casts a ray range units long from the camera through the centre of the screen. Returns what it hit first, or null, and the point where the ray ends.

Parameters ​

camera ​

Camera

world ​

btDiscreteDynamicsWorld

range? ​

number = 1000

Returns ​

object

collision ​

collision: RayHit | null

end ​

end: Vector3