Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add accessor functions for PointerDragBehavior._options #7211

Merged
merged 1 commit into from Nov 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions dist/preview release/what's new.md
Expand Up @@ -35,6 +35,7 @@
- Display Oculus Quest controller when using a Quest in WebVR ([TrevorDev](https://github.com/TrevorDev))
- Added startAndReleaseDragOnPointerEvents property to pointerDragBehavior which can be set to false for custom drag triggering ([TrevorDev](https://github.com/TrevorDev))
- Added optional picking predicate to pointerDragBehavior for filtering affected meshes ([Exolun](https://github.com/Exolun))
- Added accessor functions for `PointerDragBehavior._options` ([Popov72](https://github.com/Popov72))
- Effect renderer to render one or multiple shader effects to a texture ([TrevorDev](https://github.com/TrevorDev))
- Added url parameters to web request modifiers ([PierreLeBlond](https://github.com/PierreLeBlond))
- Added `VRExperienceHelper.exitVROnDoubleTap` ([Deltakosh](https://github.com/deltakosh/))
Expand Down
15 changes: 15 additions & 0 deletions src/Behaviors/Meshes/pointerDragBehavior.ts
Expand Up @@ -98,6 +98,21 @@ export class PointerDragBehavior implements Behavior<AbstractMesh> {
public useObjectOrienationForDragging = true;

private _options: { dragAxis?: Vector3, dragPlaneNormal?: Vector3 };

/**
* Gets the options used by the behavior
*/
public get options(): { dragAxis?: Vector3, dragPlaneNormal?: Vector3 } {
return this._options;
}

/**
* Sets the options used by the behavior
*/
public set options(options: { dragAxis?: Vector3, dragPlaneNormal?: Vector3 }) {
this._options = options;
}

/**
* Creates a pointer drag behavior that can be attached to a mesh
* @param options The drag axis or normal of the plane that will be dragged across. If no options are specified the drag plane will always face the ray's origin (eg. camera)
Expand Down