Packageaway3d.tools.utils
Classpublic class Drag3D

Class Drag3D allows free dragging of an ObjectContainer3D onto a given plane. locks on world planes locks on ObjectContainer3D planes locks on ObjectContainer3D rotations planes

Public Properties
 PropertyDefined by
  debug : Boolean
Drag3D
  object3d : ObjectContainer3D
Drag3D
  offsetCenter : Boolean
Drag3D
  offsetMouseCenter : Vector3D
[read-only] getIntersect method returns the 3d point in space (Vector3D) where mouse hits the given plane.
Drag3D
  plane : String
[write-only] Changes the plane the object will be considered on.
Drag3D
  planeObject3d : ObjectContainer3D
[write-only] Defines planes as the position of a given ObjectContainer3D
Drag3D
  planePosition : Vector3D
[write-only] Defines planes position by a postion Vector3D
Drag3D
  useRotations : Boolean
Drag3D
Public Methods
 MethodDefined by
  
Drag3D
(view:View3D, object3d:ObjectContainer3D = null, plane:String)
Class Drag3D allows to drag 3d objects with the mouse.Drag3D
Drag3D
  
getIntersect():Vector3D
Returns the Vector3D where mouse to scene ray hits the plane set for the class.
Drag3D
  
updateDrag():void
if an ObjectContainer3D is set this handler will calculate the mouse intersection on given plane and will update position and rotations of the ObjectContainer3D set accordingly
Drag3D
Public Constants
 ConstantDefined by
  PLANE_XY : String = "xy"
[static]
Drag3D
  PLANE_XZ : String = "xz"
[static]
Drag3D
  PLANE_ZY : String = "zy"
[static]
Drag3D
Property detail
debugproperty
debug:Boolean  [read-write]Implementation
    public function get debug():Boolean
    public function set debug(value:Boolean):void
object3dproperty 
object3d:ObjectContainer3D  [read-write]Implementation
    public function get object3d():ObjectContainer3D
    public function set object3d(value:ObjectContainer3D):void
offsetCenterproperty 
offsetCenter:Boolean  [read-write]Implementation
    public function get offsetCenter():Boolean
    public function set offsetCenter(value:Boolean):void
offsetMouseCenterproperty 
offsetMouseCenter:Vector3D  [read-only]

getIntersect method returns the 3d point in space (Vector3D) where mouse hits the given plane. return Vector3D the difference mouse mouse hit to object center

Implementation
    public function get offsetMouseCenter():Vector3D
planeproperty 
plane:String  [write-only]

Changes the plane the object will be considered on. If class debug is set to true. It display the selected plane for debug/visual aid purposes with a brighter color.

Implementation
    public function set plane(value:String):void
planeObject3dproperty 
planeObject3d:ObjectContainer3D  [write-only]

Defines planes as the position of a given ObjectContainer3D

Implementation
    public function set planeObject3d(value:ObjectContainer3D):void
planePositionproperty 
planePosition:Vector3D  [write-only]

Defines planes position by a postion Vector3D

Implementation
    public function set planePosition(value:Vector3D):void
useRotationsproperty 
useRotations:Boolean  [read-write]Implementation
    public function get useRotations():Boolean
    public function set useRotations(value:Boolean):void
Constructor detail
Drag3D()constructor
public function Drag3D(view:View3D, object3d:ObjectContainer3D = null, plane:String)Parameters
view:View3D — View3D. The view3d where the object to drag is or will be addChilded.
 
object3d:ObjectContainer3D (default = null) — [optional] ObjectContainer3D. The object3D to drag.
 
plane:String — [optional] String. The plane to drag on.
Init Parameters
Method detail
getIntersect()method
public function getIntersect():Vector3D

Returns the Vector3D where mouse to scene ray hits the plane set for the class. return Vector3D The intersection Vector3D

Returns
Vector3D
updateDrag()method 
public function updateDrag():void

if an ObjectContainer3D is set this handler will calculate the mouse intersection on given plane and will update position and rotations of the ObjectContainer3D set accordingly

Constant detail
PLANE_XYconstant
public static const PLANE_XY:String = "xy"
PLANE_XZconstant 
public static const PLANE_XZ:String = "xz"
PLANE_ZYconstant 
public static const PLANE_ZY:String = "zy"
Wiki link
Click to go to the wiki page for 'away3d.tools.utils.Drag3D'

Code examples

Comments