402
Chapter 12: Methods
modelList
Optional. A list of model references that are included if they are found under the
specified ray. Model references not included in this list are ignored, even if they are under the
specified ray. Use the model references, not the string names of the models. Specify each model
you want to include. Adding a parent model reference does not automatically include its child
model references.
Example
This statement creates a list of ten models:
tModelList = [member("3D").model("foo"),member("3D").model[10]]
This statement builds a list of options that would return a maximum of ten models, include
simple detail, and draw results from
tModelList
:
tOptionsList = [#maxNumberOfModels: 10, #levelOfDetail: #simple, #modelList:
tModelList]
After the options list is built, 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 information about the models in the message window.
-- Lingo syntax
on mouseUp
pt = the mouseLoc - point(sprite(5).left, sprite(5).top)
m = sprite(5).camera.modelsUnderLoc(pt, tOptionsList)
put m
end
// JavaScript syntax
function mouseUp() {
pt = _mouse.mouseLoc - point(sprite(5).left, sprite(5).top);
m = sprite(5).camera.modelsUnderLoc(pt, tOptionsList);
put(m);
}
See also
modelsUnderRay
,
modelUnderLoc
modelsUnderRay
Usage
member(
whichCastmember
).modelsUnderRay(
locationVector
,
directionVector
,
optionsList)
Description
3D command; returns a list of models found under a ray drawn from a specified position and
pointing in a specified direction, with both vectors being specified in world-relative coordinates.
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 position specified by
locationVector
and the last model listed is the furthest from that position.
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 ray.
Summary of Contents for DIRECTOR MX 2004-DIRECTOR SCRIPTING
Page 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Page 48: ...48 Chapter 2 Director Scripting Essentials...
Page 100: ...100 Chapter 4 Debugging Scripts in Director...
Page 118: ...118 Chapter 5 Director Core Objects...
Page 594: ...594 Chapter 12 Methods...
Page 684: ...684 Chapter 14 Properties See also DVD...
Page 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Page 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Page 1102: ...1102 Chapter 14 Properties...