Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Dev/bounding box accessors #60

Merged
merged 15 commits into from
Aug 9, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,8 @@ public Vector2 NudgeConstraints

private bool isRotationPossible = false;

private Vector3 offsetPosition = Vector3.zero;

private Vector3 prevPosition = Vector3.zero;

private Vector3 prevScale = Vector3.one;
Expand All @@ -346,7 +348,7 @@ private void Update()
{
if (isBeingHeld)
{
manipulationTarget.position = primaryPointer.Result.Details.Point;
manipulationTarget.position = offsetPosition + primaryPointer.Result.Details.Point;
}

if (isPressed && isNudgePossible && primaryPointer != null)
Expand Down Expand Up @@ -656,6 +658,7 @@ public virtual void BeginHold(MixedRealityPointerEventData eventData)
MixedRealityToolkit.SpatialAwarenessSystem.SetMeshVisibility(SpatialMeshDisplayOptions.Collision);

prevPosition = manipulationTarget.position;
offsetPosition = prevPosition - eventData.Pointer.Result.Details.Point;
prevScale = manipulationTarget.localScale;
prevRotation = manipulationTarget.rotation;

Expand Down
Loading