Away3D 4.0 Beta ::: PrimitiveBase.as ::: Update geometry and UV?

Software: Away3D 4.x

redefy, Newbie
Posted: 23 March 2012 02:06 AM   Total Posts: 8

In the class PrimitiveBase.as is not automatically updated geometry and UV.

No OK:

mesh = new Mesh(new PlaneGeometry(40040011true), material);
conteiner.addChild(mesh);

private function 
onMouseDown(event:MouseEvent):void {
    PlaneGeometry
(mesh.geometry).width -= 30;

OK:

mesh = new Mesh(new PlaneGeometry(40040011true), material);
conteiner.addChild(mesh);

private function 
onMouseDown(event:MouseEvent):void {
    PlaneGeometry
(mesh.geometry).width -= 30;
    
PlaneGeometry(mesh.geometry).subGeometries;

Because it

override public function get subGeometries():Vector.<SubGeometry> {
    if (_geomDirty) updateGeometry();
    if (_uvDirty) updateUVs();

  return super.subGeometries;
}

Recommend how to solve this problem more elegant ...

   

Karim Beyrouti, Administrator
Posted: 23 March 2012 09:57 AM   Total Posts: 30   [ # 1 ]

There might be a better way, but how about something like this:

var PlaneGeometry = new PlaneGeometry(40040011true);
var 
mesh = new Meshmaterial);

// and to update it 

p.width -= 30;
mesh.geometry p

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X