Packageaway3d.tools.utils
Classpublic class Drag3D
InheritanceDrag3D Inheritance Object

Class Drag3D allows free dragging of an object3D locked to planes XY, XZ and YZ. locks on world planes locks on Object3D planes locks on Object3D planes with object rotations



Public Properties
 PropertyDefined By
  debug : Boolean
Displays the planes for debug/visual aid purposes
Drag3D
  object3d : Object3D
Sets the target object3d to the class.
Drag3D
  offsetCenter : Vector3D
[read-only]
Drag3D
  plane : String
[write-only] Changes the plane the object will be considered on.
Drag3D
  planeObject3d : Object3D
[write-only] Defines planes as the position of a given Object3D
Drag3D
  planePosition : Vector3D
[write-only] Defines planes position by a postion Vector3D
Drag3D
  useRotations : Boolean
Defines if the target object3d plane will be aligned to object rotations or not
Drag3D
Public Methods
 MethodDefined By
  
Drag3D
  
getIntersect():Vector3D
getIntersect method returns the 3d point in space (Vector3D) where mouse hits the given plane.
Drag3D
  
Defines an offset for the drag from center mesh to mouse position.
Drag3D
  
updateDrag():void
if an object3D is set this handler will calculate the mouse intersection on given plane and will update position and rotations of the object3d set accordingly
Drag3D
Property Detail
debugproperty
debug:Boolean

Displays the planes for debug/visual aid purposes


Implementation
    public function get debug():Boolean
    public function set debug(value:Boolean):void
object3dproperty 
object3d:Object3D

Sets the target object3d to the class. The object3d that will be dragged


Implementation
    public function get object3d():Object3D
    public function set object3d(value:Object3D):void
offsetCenterproperty 
offsetCenter:Vector3D  [read-only]


Implementation
    public function get offsetCenter():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:Object3D  [write-only]

Defines planes as the position of a given Object3D


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

Defines planes position by a postion Vector3D


Implementation
    public function set planePosition(value:Vector3D):void
useRotationsproperty 
useRotations:Boolean

Defines if the target object3d plane will be aligned to object rotations or not


Implementation
    public function get useRotations():Boolean
    public function set useRotations(value:Boolean):void
Constructor Detail
Drag3D()Constructor
public function Drag3D(view:View3D)



Parameters
view:View3D
####INIT####
Method Detail
getIntersect()method
public function getIntersect():Vector3D

getIntersect method returns the 3d point in space (Vector3D) where mouse hits the given plane.

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

Defines an offset for the drag from center mesh to mouse position. object3d must have been set previously for this setter. if not an error is triggered Since the offset is set from center to mouse projection, its usually a good practice to set it during firt mouse down prior to drag.

updateDrag()method 
public function updateDrag():void

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