Class: Group3D

Group3D

new Group3D()

The Group3D class acts as a container for 3D based elements. Any 3D elements inside a Group3D will move and rotate as the Group3D does in a forward kinematic fashion. Group3D instances can also contain other Group3D instances and create infinitely deep forward kinematics.

However, they still will z-sort against all other 3D elements in the Stage3D instance. In that respect the Group3D acts as a mathematical container only. However, it is still used like any other container with addChild, removeChild, etc. However, due to the fact that this is a 3D scene where the z-sorting is handled by an element's actual z coordinate there is no need for dealing with indexes. This means that even though this class acts like a normal createjs.Container in many ways methods such as addChildAt, removeChildAt, getChildAt, etc. which have to do with a child's index are invalid and will throw errors.

The above and the fact that z-sorting is still world-based and not just local to the container is the reason for the semantic difference in using the term "group" instead of "container".

For advanced understanding: in the CreateJS display list children of Group3D objects are actually contained by the root Stage3D container. That is how world z-sorting is accomplished. This also means that the bubbling of events, etc. will come frome there, not from the Group3D. It is a poor idea to add events directly to the Group3D instance.
Source:

Extends

Members

rotX :Number

The rotX property sets the x-axis rotation value for the DisplayObject3D instance in degrees.
Type:
  • Number
Inherited From:
Default Value:
  • 0
Source:

rotY :Number

The rotY property sets the y-axis rotation value for the DisplayObject3D instance in degrees.
Type:
  • Number
Inherited From:
Default Value:
  • 0
Source:

rotZ :Number

The rotY property sets the y-axis rotation value for the DisplayObject3D instance in degrees.
Type:
  • Number
Inherited From:
Default Value:
  • 0
Source:

stage3D :Stage3D

Each DisplayObject3D has a stage3D property that allows it to tell which stage it is currently in the display list of. Is null when not in a display list.
Type:
Inherited From:
Default Value:
  • null
Source:

transform3D :Transform3D

Contains the DipslayObject3D's local and global transform data.
Type:
Inherited From:
Source:

x :Number

The x property sets the x coordinate value for the DisplayObject3D instance.
Type:
  • Number
Inherited From:
Default Value:
  • 0
Source:

y :Number

The y property sets the y coordinate value for the DisplayObject3D instance.
Type:
  • Number
Inherited From:
Default Value:
  • 0
Source:

z :Number

The z property sets the z coordinate value for the DisplayObject3D instance.
Type:
  • Number
Inherited From:
Default Value:
  • 0
Source:

Methods

addChild() → {DisplayObject3D}

addChild allows objects to be added to this Group3D. Note: likewise, a Group3D instance is added to another Group3D or to the Stage3D via those instances' addChild methods as well. addChild may take a singular value to add or may be given many such as instance.addChild(one, two, three, four);
Parameters:
Type Description
DisplayObject3D Any object that inherits from DisplayObject3D may be added.
Source:
Returns:
Returns the DisplayObject3D that was added, or the last that was added if multiple were added at once.
Type
DisplayObject3D

contains() → {Boolean}

contains allows you to check if a DisplayObject3D is contained (has been added via addChild) by the Group3D
Parameters:
Type Description
DisplayObject3D The object to test for.
Source:
Returns:
Returns a Boolean value for whether the Group3D contains the object or not.
Type
Boolean

getChildByName() → {DisplayObject3D}

getChildByName allows you to get a child of the Group3D by its name property.
Parameters:
Type Description
String The String name to look for.
Source:
Returns:
Returns a the DisplayObject3D found if it is found. Returns null of none found.
Type
DisplayObject3D

removeChild() → {Boolean}

removeChild allows objects that were added via addChild to be removed. removeChild may take a singular value to remove or may be given many such as instance.removeChild(one, two, three, four);
Parameters:
Type Description
DisplayObject3D Any object that inherits from DisplayObject3D and has been added may be removed.
Source:
Returns:
Returns a Boolean value for if the object was removed (false if it was not in the display list to be removed), or the result for the last that was removed if multiple were removed at once.
Type
Boolean