@@ -1780,7 +1780,7 @@ Scene3D.prototype.setLookAt=function(eye, center, up){
17801780/**
17811781* Adds a 3D shape to this scene. Its reference, not a copy,
17821782* will be stored in the 3D scene's list of shapes.
1783- * @param {Shape|glutil.ShapeGroup } shape A 3D shape.
1783+ * @param {glutil. Shape|glutil.ShapeGroup } shape A 3D shape.
17841784* @return {glutil.Scene3D } This object.
17851785*/
17861786Scene3D . prototype . addShape = function ( shape ) {
@@ -1802,7 +1802,7 @@ Scene3D.prototype.makeShape=function(mesh){
18021802
18031803/**
18041804* Removes all instances of a 3D shape from this scene.
1805- * @param {Shape|glutil.ShapeGroup } shape The 3D shape to remove.
1805+ * @param {glutil. Shape|glutil.ShapeGroup } shape The 3D shape to remove.
18061806* @return {glutil.Scene3D } This object.
18071807*/
18081808Scene3D . prototype . removeShape = function ( shape ) {
@@ -2062,7 +2062,7 @@ function ShapeGroup(){
20622062/**
20632063* Adds a 3D shape to this shape group. Its reference, not a copy,
20642064* will be stored in the list of shapes.
2065- * @param {Shape|glutil.ShapeGroup } shape A 3D shape.
2065+ * @param {glutil. Shape|glutil.ShapeGroup } shape A 3D shape.
20662066* @return {glutil.ShapeGroup } This object.
20672067*/
20682068ShapeGroup . prototype . addShape = function ( shape ) {
@@ -2100,16 +2100,30 @@ ShapeGroup.prototype.getMatrix=function(){
21002100 return mat ;
21012101}
21022102/**
2103- * Not documented yet.
2103+ * Sets the transform used by this shape group. Child
2104+ * shapes can set their own transforms, in which case, the
2105+ * rendering process will multiply this shape group's transform
2106+ * with the child shape's transform as it renders the child shape.
21042107 * @param {glutil.Transform } transform
21052108 */
21062109ShapeGroup . prototype . setTransform = function ( transform ) {
21072110 this . transform = transform . copy ( ) ;
21082111 return this ;
21092112}
2113+
2114+ /**
2115+ * Sets the material used by all shapes in this shape group.
2116+ * @param {glutil.Material } material
2117+ */
2118+ ShapeGroup . prototype . setMaterial = function ( material ) {
2119+ for ( var i = 0 ; i < this . shapes . length ; i ++ ) {
2120+ this . shapes [ i ] . setMaterial ( material ) ;
2121+ }
2122+ return this ;
2123+ }
21102124/**
21112125* Removes all instances of a 3D shape from this shape group
2112- * @param {Shape|glutil.ShapeGroup } shape The 3D shape to remove.
2126+ * @param {glutil. Shape|glutil.ShapeGroup } shape The 3D shape to remove.
21132127* @return {glutil.ShapeGroup } This object.
21142128*/
21152129ShapeGroup . prototype . removeShape = function ( shape ) {
0 commit comments