User Guide

384
#detailed returns a list of property lists, each representing an intersected model. Each property
list will have the following properties:
#model is a reference to the intersected model object.
#distance is the distance from the camera to the point of intersection with the model.
#isectPosition is a vector representing the world space position of the point of intersection.
#isectNormal is the world space normal vector to the mesh at the point of intersection.
#meshID is the meshID of the intersected mesh, which can be used as in index into the mesh
list of the
meshDeform modifier.
#faceID is the face ID of the intersected face, which can be used as an index into the face list
of the
meshDeform modifier.
#vertices is a three-element list of vectors that represent the world space positions of the
vertices of the intersected face.
#uvCoord is a property list with properties #u and #v that represent the u and v barycentric
coordinates of the face.
Within the returned list, the first model listed is the one closest to the viewer and the last model
listed is the furthest from the viewer.
Only one intersection (the closest intersection) is returned per model.
The command returns an empty list if there are no models found under the specified point.
Example
The first line in this handler translates the location of the cursor from a point on the Stage to a
point within sprite 5. The second line uses the
modelsUnderLoc command to obtain the first
three models found under that point. The third line displays the returned detailed information
about the models in the message window.
on mouseUp
pt = the mouseLoc - point(sprite(5).left, sprite(5).top)
m = sprite(5).camera.modelsUnderLoc(pt, 3, #detailed)
put m
end
See also
modelsUnderRay, modelUnderLoc
modelsUnderRay
Syntax
member(whichCastmember).modelsUnderRay(locationVector, directionVector {,
maxNumberOfModels, levelOfDetail})
Description
3D command; returns a list of models found under a ray drawn from the position specified by
locationVector and pointing in the direction of directionVector, with both vectors being
specified in world-relative coordinates.
The optional
maxNumberOfModels parameter allows you to limit the length of the returned list. If
this parameter isnt specified, the command returns a list containing references for all of the
models found under the specified ray.