| Package | away3d.tools.utils |
| Class | public class Drag3D |
| Inheritance | Drag3D Object |
| Property | Defined By | ||
|---|---|---|---|
| debug : Boolean
Displays the planes for debug/visual aid purposes
| Drag3D | ||
| object3d : ObjectContainer3D
Sets the target ObjectContainer3D to the class. | Drag3D | ||
| offsetCenter : Boolean
Defines an offset for the drag from center mesh to mouse position. | 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
Defines if the target object3d plane will be aligned to object rotations or not
| Drag3D | ||
| Method | Defined By | ||
|---|---|---|---|
Class Drag3D allows to drag 3d objects with the mouse.Drag3D
| Drag3D | ||
getIntersect(x:Number, y:Number):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 | ||
| Constant | Defined By | ||
|---|---|---|---|
| PLANE_XY : String = xy [static] | Drag3D | ||
| PLANE_XZ : String = xz [static] | Drag3D | ||
| PLANE_ZY : String = zy [static] | Drag3D | ||
| debug | property |
debug:BooleanDisplays the planes for debug/visual aid purposes
public function get debug():Boolean public function set debug(value:Boolean):void| object3d | property |
object3d:ObjectContainer3DSets the target ObjectContainer3D to the class. The ObjectContainer3D that will be dragged
public function get object3d():ObjectContainer3D public function set object3d(value:ObjectContainer3D):void| offsetCenter | property |
offsetCenter:BooleanDefines 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.
public function get offsetCenter():Boolean public function set offsetCenter(value:Boolean):void| offsetMouseCenter | property |
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
public function get offsetMouseCenter():Vector3D| plane | property |
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.
public function set plane(value:String):void| planeObject3d | property |
planeObject3d:ObjectContainer3D [write-only] Defines planes as the position of a given ObjectContainer3D
public function set planeObject3d(value:ObjectContainer3D):void| planePosition | property |
planePosition:Vector3D [write-only] Defines planes position by a postion Vector3D
public function set planePosition(value:Vector3D):void| useRotations | property |
useRotations:BooleanDefines if the target object3d plane will be aligned to object rotations or not
public function get useRotations():Boolean public function set useRotations(value:Boolean):void| Drag3D | () | Constructor |
public function Drag3D(view:View3D, object3d:ObjectContainer3D = null, plane:String)
Class Drag3D allows to drag 3d objects with the mouse.Drag3D
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 (default = NaN) — [optional] String. The plane to drag on.
|
| getIntersect | () | method |
public function getIntersect(x:Number, y:Number):Vector3DReturns the Vector3D where mouse to scene ray hits the plane set for the class.
Parameters
x:Number (default = NaN) — [optional] Number. x coordinate.
| |
y:Number (default = NaN) — [optional] Number. y coordinate.
|
Vector3D — Vector3D The intersection Vector3D
If both x and y params are NaN, the class will return the hit from mouse coordinates
|
| updateDrag | () | method |
public function updateDrag():voidif 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
| PLANE_XY | Constant |
public static const PLANE_XY:String = xy| PLANE_XZ | Constant |
public static const PLANE_XZ:String = xz| PLANE_ZY | Constant |
public static const PLANE_ZY:String = zy