
Groups
363
Groups
Groups have many of the same properties and methods as models, except that you need to
substitute the word
group
for the word
model
when writing scripts. A group is a node that can
have a parent and/or children. These can be models, lights, cameras, or other groups.
Group properties
The properties of the group determine its particular appearance and relationship to the rest of
the 3D world.
Use these properties to work with groups:
Property
Access
Description
Value
name
Get
Unique string name.
Any string.
parent
Get and set
This group’s parent; either another object or
the 3D cast member itself.
An object or
cast member.
child.count
Get
Number of children (but not grandchildren) of
a given group.
An integer.
transform
Get and set
Script transform object representing this
group’s position and orientation relative to its
parent’s position and orientation.
transform.position
gives the relative
position.
transform.rotation
gives the relative
rotation.
Set: a transform
object.
Get: reference
to a transform
object.
userData
Get and set
A property list containing all
properties assigned to the group. Users can
add, remove, get, and set properties on this
list.
The default list
includes the
properties
assigned in the
3D modeling
tool. User
properties are
then added.
bounding
Sphere
Get
A list containing a vector and a floating-point
value. The vector represents the position of
the group in world space. The floating-point
value represents the radius of the bounding
sphere that contains the group and its
children.
A list, with the
default value of
[vector
(0,0,0), 0.0]
.
world
Position
Get
Position of the group in world coordinates. A
quick shortcut for
group.getWorldTransform()
.
position
A vector object.
pointAt
Orientation
Get and set
A list of two orthogonal vectors,
[objectRelativeDirection,
objectRelativeUp]
, that control how the
groups
pointAt()
method works.
A vector list.
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...