public GVRSceneObject startDrag(GVRSceneObject dragMe, float relX, float relY, float relZ) {
        synchronized (mLock) {
            if (mCursorController == null) {
                Log.w(TAG, "Physics drag failed: Cursor controller not found!");
                return null;
            }

            if (mDragMe != null) {
                Log.w(TAG, "Physics drag failed: Previous drag wasn't finished!");
                return null;
            }

            if (mPivotObject == null) {
                mPivotObject = onCreatePivotObject(mContext);
            }

            mDragMe = dragMe;

            GVRTransform t = dragMe.getTransform();

            /* It is not possible to drag a rigid body directly, we need a pivot object.
            We are using the pivot object's position as pivot of the dragging's physics constraint.
             */
            mPivotObject.getTransform().setPosition(t.getPositionX() + relX,
                    t.getPositionY() + relY, t.getPositionZ() + relZ);

            mCursorController.startDrag(mPivotObject);
        }

        return mPivotObject;
    }
public GVRSceneObject startDrag ( GVRSceneObject dragMe , float relX , float relY , float relZ ) { synchronized ( mLock ) { if ( mCursorController == null ) { Log . w ( TAG , "Physics drag failed: Cursor controller not found!" ) ; return null ; } if ( mDragMe != null ) { Log . w ( TAG , "Physics drag failed: Previous drag wasn't finished!" ) ; return null ; } if ( mPivotObject == null ) { mPivotObject = onCreatePivotObject ( mContext ) ; } mDragMe = dragMe ; GVRTransform t = dragMe . getTransform ( ) ; mPivotObject . getTransform ( ) . setPosition ( t . getPositionX ( ) + relX , t . getPositionY ( ) + relY , t . getPositionZ ( ) + relZ ) ; mCursorController . startDrag ( mPivotObject ) ; } return mPivotObject ; }
Start the drag of the pivot object.

@param dragMe Scene object with a rigid body.
@param relX rel position in x-axis.
@param relY rel position in y-axis.
@param relZ rel position in z-axis.

@return Pivot instance if success, otherwise returns null.