ObjectContainer3D can’t addChild Object3D anymore?

Software: Away3D 4.x

mprzybylski, Newbie
Posted: 21 June 2011 03:38 AM   Total Posts: 6

Man, I’m having a hell of a time porting my stuff over to Broomstick.  Just now I realized that ObjectContainer3D.addChild expects another ObjectContainer3D but I’ve got five Object3Ds that I just want to put into that container.  How do I do this in Broomstick?

   

mprzybylski, Newbie
Posted: 21 June 2011 03:45 AM   Total Posts: 6   [ # 1 ]

actually, i should probably clarify something.  I’m adding a couple of meshes to ObjectContainer3D which seems to work fine.  Then, i’m trying to clone that ObjectContainer3D into five others but I can’t clone it as it gives me an error saying I can’t assign Object3D to ObjectContainer3D.  So basically the issue may be that clone() isn’t working on ObjectContainer3D properly?  Here is my code:

public function createChairs($num:int):void
  {
   clearChairs
();
   
   var 
len:int $num;
   var 
arcLength:Number = ((Math.PI) / len);
   var 
angle:int int(360 len);
   var 
radius:int 100;
   var 
chairClone:ObjectContainer3D;
   var 
pt:Point;
   
   for (var 
i:int 0leni++)
   
{
    pt 
Point.polar(radius, (arcLength));
    
    
chairClone chairSingleContainer.clone();
    
chairClone.pt.x;
    
chairClone.pt.y;
    
chairClone.rotationY = (-* (angle));
    
    
chairContainer.addChild(chairClone);
   
}
  } 

 

   

afuzzyllama, Newbie
Posted: 21 June 2011 11:57 AM   Total Posts: 3   [ # 2 ]

What is the object type of charSingleContainer?  If it is Object3D, why not append that to its own ObjectContainer3D and then clone it?

   

mprzybylski, Newbie
Posted: 21 June 2011 03:17 PM   Total Posts: 6   [ # 3 ]

It’s an ObjectContainer3D (chairSingleContainer that is) and not allowing me to clone.

   

mprzybylski, Newbie
Posted: 21 June 2011 04:53 PM   Total Posts: 6   [ # 4 ]

I just saw a note in the code for the clone() method in Object3D that says the following:

// todo: implement for all subtypes

Does that mean it’s just not in yet?  From looking at the Object3D.clone() method it doesn’t even look like it creates clones properly either though I have not tried it out…

   

afuzzyllama, Newbie
Posted: 21 June 2011 05:46 PM   Total Posts: 3   [ # 5 ]

I’m having the same problem with pivotPoint.  On the ObjectContainer3D it say ‘TODO: pivot stuff’.  Broomstick is still in alpha.  If there is a TODO you might just need to end up doing it wink

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X