/* * Gets a secific proximity collider list */ public List <GameObject> GetCollisionList(ProximityType proximityType, SixenseHands hand) { List <GameObject> targetList = null; switch (proximityType) { case ProximityType.INSTRUMENT_INTERIOR: if (hand == SixenseHands.LEFT) { targetList = m_leftInstrumentInterior; } else if (hand == SixenseHands.RIGHT) { targetList = m_rightInstrumentInterior; } break; case ProximityType.INSTRUMENT_PROXIMITY: if (hand == SixenseHands.LEFT) { targetList = m_leftInstrumentProximity; } else if (hand == SixenseHands.RIGHT) { targetList = m_rightInstrumentProximity; } break; case ProximityType.GENERATOR: break; } return(targetList); }
/* * Adds a proximity target to a list of active colliders with a hand */ public void AddCollision(GameObject proximityTarget, SixenseHands hand, ProximityType proximityType) { List <GameObject> targetList = GetCollisionList(proximityType, hand); if (!targetList.Contains(proximityTarget)) { targetList.Add(proximityTarget); } }
private bool VerifyProximity(ProximityType aProximityType, Proximity aProximity) { try { switch (aProximityType) { case ProximityType.Similarity: if (aProximity is Similarity) { return(true); } break; case ProximityType.Dissimilarity: if (aProximity is Dissimilarity) { return(true); } break; case ProximityType.None: return(true); break; default: return(false); } return(false); } catch (Exception _ex) { GeneralTools.Tools.WriteToLog(_ex); return(false); } }
/** * Construct a SessionOpts with specific parameters. * * @param trafficType Type of traffic. * @param isMultipoint true iff session supports multipoint (greater than two endpoints). * @param proximity Proximity constraint bitmask. * @param transports Allowed transport types bitmask. */ public SessionOpts(TrafficType trafficType, bool isMultipoint, ProximityType proximity, TransportMask transports) { _sessionOpts = alljoyn_sessionopts_create((byte)trafficType, isMultipoint ? 1 : 0, (byte)proximity, (ushort)transports); }
public void Init(ProximityType type) { proximityTarget = type; }
/* * Removes a proximity target from a list of active colliders with a hand */ public void RemoveCollision(GameObject proximityTarget, SixenseHands hand, ProximityType proximityType) { List <GameObject> targetList = GetCollisionList(proximityType, hand); targetList.Remove(proximityTarget); }
/* * Returns the the closest object to the hand in a specific proximity list */ public GameObject HandTarget(BaseTool.ToolHand hand, ProximityType proximityTarget, BaseTool.ToolMode mode) { return(GetClosestObjectInList(GetCollisionList(proximityTarget, BaseTool.ToolHandToSixenseHand(hand)), GetHand(hand), mode)); }
private bool VerifyProximity(ProximityType aProximityType, Proximity aProximity) { try { switch (aProximityType) { case ProximityType.Similarity: if (aProximity is Similarity) return true; break; case ProximityType.Dissimilarity: if (aProximity is Dissimilarity) return true; break; case ProximityType.None: return true; break; default: return false; } return false; } catch (Exception _ex) { GeneralTools.Tools.WriteToLog(_ex); return false; } }