/* * Copyright (c) Meta Platforms, Inc. and affiliates. * All rights reserved. * * Licensed under the Oculus SDK License Agreement (the "License"); * you may not use the Oculus SDK except in compliance with the License, * which is provided at the time of installation or download, or which * otherwise accompanies this software in either electronic or hard copy form. * * You may obtain a copy of the License at * * https://developer.oculus.com/licenses/oculussdk/ * * Unless required by applicable law or agreed to in writing, the Oculus SDK * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using UnityEngine; namespace Oculus.Interaction.Grab.GrabSurfaces { /// /// This interface defines the method needed to use grab surfaces. They allow finding the /// nearest poses at the surface to a given set of parameters as well as duplicating and /// mirroring the surface. /// public interface IGrabSurface { /// /// Finds the Pose at the surface that is the closest to the given pose. /// /// The pose to find the nearest to. /// The best found pose at the surface.< /// Weight used to decide which target pose to select /// Reference transform to measure the poses against /// The score indicating how good the found pose was, -1 for invalid result. GrabPoseScore CalculateBestPoseAtSurface(in Pose targetPose, out Pose bestPose, in PoseMeasureParameters scoringModifier, Transform relativeTo); /// /// Finds the Pose at the surface that is the closest to the given ray. /// /// Ray searching for the nearest snap pose /// The best found pose at the surface. /// Reference transform to measure the poses against /// True if the pose was found bool CalculateBestPoseAtSurface(Ray targetRay, out Pose bestPose, Transform relativeTo); /// /// Method for mirroring a Pose around the surface. /// Different surfaces will prefer mirroring along different axis. /// /// The Pose to be mirrored. /// Reference transform to mirror the pose around /// A new pose mirrored at this surface. Pose MirrorPose(in Pose gripPose, Transform relativeTo); /// /// Creates a new IGrabSurface under the selected gameobject /// that is a mirror version of the current. /// /// The gameobject in which to place the new IGrabSurface. /// A mirror of this IGrabSurface. IGrabSurface CreateMirroredSurface(GameObject gameObject); /// /// Creates a new IGrabSurface under the selected gameobject /// with the same data as this one. /// /// The gameobject in which to place the new IGrabSurface. /// A clone of this IGrabSurface. IGrabSurface CreateDuplicatedSurface(GameObject gameObject); } }