
390
Chapter 16: Working with Models and Model Resources
Camera methods
Use these methods to work with cameras:
boundingSphere
Get
A list containing a vector and a
floating-point value, with the vector
representing the position and the
value the radius of a bounding sphere
surrounding the camera and all its
children.
[vector (0,0,0),
0.0]
worldPosition
Get and set
Position of the camera in world
coordinates. Shortcut for the method
node.getWorldTransform
().position
.
Vector object
Method
Description
Returns
addChild(
aNode
,
preserveWorld
)
Adds
aNode
to this camera’s list of children. An
equivalent operation is to set
aNode.parent
to equal
thisCamera
.
The
preserveWorld
argument is optional.I t can have two
values:
#preserveWorld
or
#preserveParent
. If the value
is
#preserveWorld
, the world transform of the child being
added remains intact. If
#preserveParent
, the child’s
transform is interpreted as remaining parent-relative.
Nothing
child[
index
]
Returns the child at the specified position in the index.
Camera object
child(
name
)
Returns the child named
name
.
Camera object
clone(
name
)
Clones a camera named
name
, adds it to the cameras’s
parent’s child list, and adds it to the world.
All children of the camera are automatically cloned.This
can be avoided by removing the children, performing
the cloning operation, and then adding the children
back.
If the name is omitted or is
""
, the clone isn’t added to
the camera palette, has no parent, and has no children.
This option lets you quickly create temporary camera
instances.
Camera object
cloneDeep(
name
)
Clones both the camera and all resources used by the
camera’s children.
Camera object
addtoWorld()
Adds a camera to the currently active 3D world, setting
its parent as
"world"
Equivalent to setting the camera's parent to the world
group.
All newly created cameras are added to the world by
default, without it being necessary to use this method.
Nothing
removeFrom
World()
For cameras whose parent hierarchy terminates in the
world, this sets their parent to
void
and removes them
from the world. Otherwise it does nothing.
Nothing
Property Name
Access
Description
Default
Summary of Contents for DIRECTOR MX 2004-USING DIRECTOR
Page 1: ...DIRECTOR MX 2004 Using Director...
Page 16: ...16 Chapter 1 Introduction...
Page 82: ...82 Chapter 3 Sprites...
Page 98: ...98 Chapter 4 Animation...
Page 134: ...134 Chapter 5 Bitmaps...
Page 242: ...242 Chapter 10 Sound and Synchronization...
Page 274: ...274 Chapter 11 Using Digital Video...
Page 290: ...290 Chapter 12 Behaviors...
Page 302: ...302 Chapter 13 Navigation and User Interaction...
Page 334: ...334 Chapter 15 The 3D Cast Member 3D Text and 3D Behaviors...
Page 392: ...392 Chapter 16 Working with Models and Model Resources...
Page 418: ...418 Chapter 18 Movies in a Window...
Page 446: ...446 Chapter 22 Managing and Testing Director Projects...