User Guide
modelsUnderLoc 401
modelsUnderLoc
Usage
member(whichCastmember).camera(whichCamera).modelsUnderLoc\
(pointWithinSprite, optionsList)
Description
3D command; returns a list of models found under a specified point within the rect of a sprite
using the referenced camera. The list of models can also be compared to a set of optional
parameters before being returned.
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.
Parameters
pointWithinSprite
Required. A point under which a list of models is found. This point is
relative to the upper left corner of the sprite, in pixels.
optionsList Optional. A list that specifies the maximum number of models to return, the level
of information detail, a list of models among which to cast, and the maximum distance to draw
the ray. All of these properties are optional.
maxNumberOfModels Optional. An integer that specifies the maximum length of the returned list.
If omitted, the command returns a list containing references for all of the models found under the
specified point.
levelOfDetail Optional. A symbol that specifies the level of detail of the information returned.
Valid values include the following:
• #simple returns a list containing references to the models found under the point. This is the
default setting.
• #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.