public FirstPersonControls(Object3D object, RenderingContext context) { super(object, context); this.viewHalfX = context.getWidth() / 2; this.viewHalfY = context.getHeight() / 2; this.target = new Vector3(); context.getInput().addInputHandler( this ); }
public FlyControls(Object3D object, RenderingContext context) { super(object, context); this.viewHalfX = context.getWidth() / 2.0; this.viewHalfY = context.getHeight() / 2.0; // disable default target object behavior this.tmpQuaternion = new Quaternion(); this.mouseStatus = 0; this.moveState = new MoveState(); this.moveVector = new Vector3( 0, 0, 0 ); this.rotationVector = new Vector3( 0, 0, 0 ); context.getInput().addInputHandler( this ); }
public TransformControls(Camera camera, RenderingContext context) { super(); if(context == null) throw new NullPointerException("TransformControl - context could not be null "); this.camera=camera; this.context=context; this.gizmoTranslate = new TransformGizmoTranslate(); this.gizmoRotate = new TransformGizmoRotate(); this.gizmoScale = new TransformGizmoScale(); this.add(this.gizmoTranslate); this.add(this.gizmoRotate); this.add(this.gizmoScale); this.gizmoTranslate.hide(); this.gizmoRotate.hide(); this.gizmoScale.hide(); _dragging = false; _mode = TransformControls.Mode.TRANSLATE; _plane = "XY"; changeEvent = new LocalEvent("change",null); mouseDownEvent = new LocalEvent("mouseDown",null); mouseUpEvent = new LocalEvent("mouseUp",_mode); objectChangeEvent = new LocalEvent("objectChange",null); context.getInput().addInputHandler( this ); }
public TrackballControls(Object3D object, RenderingContext context) { super(object, context); this.radius = ( context.getWidth() + context.getHeight() ) / 4.0; this.target = new Vector3(); this.lastPosition = new Vector3(); this.eye = new Vector3(); this.rotateStart = new Vector3(); this.rotateEnd = new Vector3(); this.zoomStart = new Vector2(); this.zoomEnd = new Vector2(); this.panStart = new Vector2(); this.panEnd = new Vector2(); context.getInput().addInputHandler( this ); }