new Ray3D(origin, direction)math3d.js:651Create a ray
const ray = render3D.screenToRay(mousePosScreen);
const distance = raycastPlane(ray, vec3(), vec3(0, 1, 0));
if (distance !== undefined)
ball.pos3D = ray.getPosition(distance);Ray3D - A start point and a direction, what screenToRay returns and the raycast helpers take
new Ray3D(origin, direction)math3d.js:651Create a ray
const ray = render3D.screenToRay(mousePosScreen);
const distance = raycastPlane(ray, vec3(), vec3(0, 1, 0));
if (distance !== undefined)
ball.pos3D = ray.getPosition(distance);direction : Vector3math3d.js:663Which way it goes
origin : Vector3math3d.js:661Where the ray starts
copy() → Ray3Dmath3d.js:673Returns a new ray that is a copy of this
getPosition(distance) → Vector3math3d.js:669Returns the point a distance along the ray
distance numberWhat the raycast helpers return