Is there something wrong with the Drag3D?

Software: Away3D 4.x

KobeJames, Newbie
Posted: 08 June 2012 02:32 PM   Total Posts: 21

1.I put an ObjectContainer3D object in scene, the container includes some children.
2.drag the container from original postion to somewhere,then children follow.there is no problem
3.drag the a child object of the container,then some offset is appear.
——————————————————————————————————-

drag3D = new Drag3D(view,container,Drag3D.PLANE_XY);//onMouseDown 
drag3D.updateDrag();//onEnterFrame 
   

KobeJames, Newbie
Posted: 08 June 2012 04:01 PM   Total Posts: 21   [ # 1 ]

I know the reason.
the offset is affected by parent container.
I think we should improve the Drag3D’s ability.

   

KobeJames, Newbie
Posted: 08 June 2012 11:50 PM   Total Posts: 21   [ # 2 ]

I Changed the Drag3D class updateDrag() method:
I add some code in there:

public function updateDrag():void
{
 
if(_object3d == null)
  throw new 
Error ("Drag3D error: no ObjectContainer3D or world planes specified");
 if(
_debug) updateDebug();
 
intersect();
   
 if(
_offsetCenter == null){
  _object3d
.x = _intersect.x;
  
_object3d.y = _intersect.y;
  
_object3d.z = _intersect.z;
 
} else{
  _object3d
.x = _intersect.x + _offsetCenter.x;
  
_object3d.y = _intersect.y + _offsetCenter.y;
  
_object3d.z = _intersect.z + _offsetCenter.z;

  
//this is my code please help me check it whether right
  
_object3d.x -= _object3d.scenePosition.x - _object3d.x;
  
_object3d.y -= _object3d.scenePosition.y - _object3d.y;
  
_object3d.z -= _object3d.scenePosition.z - _object3d.z;
 
}
} 
   

Richard Olsson, Administrator
Posted: 16 June 2012 11:59 AM   Total Posts: 1192   [ # 3 ]

Please file a bug report over at http://github.com/away3d/away3d-core-fp11/issues explaining the issue and please include your suggested fix. We’ll try to get it in for the Away3D 4.0 stable release.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X