private VIS.WorkSpace.Geometry GetDestinationGeometry( VLUnityCameraHelper.FlipCoordinateSystemHandedness fcsHandedness) { VLGeometry creator = this.destinationGeometry.GetComponent <VLGeometry>(); // check if object has a geometry component if (creator != null) { return(CreateVLGeometry(creator, fcsHandedness)); } else { // if target object has no geometry component -> use center point which is stored in // destinationPoints[0] VIS.WorkSpace.Transform trans = VLUnityCameraHelper.CreateLocalVLTransform( this.destinationGeometry, fcsHandedness); Vector3[] destination = GetDestinationVertices(); trans.t = new float[3] { destination[0].x, destination[0].y, destination[0].z }; return(new VIS.WorkSpace.Plane( 0, 0, 1, trans)); } }
/// <summary> /// Creates a corresponding VLWorkSpace.Geometry, which can be used in the vlSDK. /// </summary> /// <param name="trans">Transform, which will be applied to the Geometry</param> /// <returns></returns> public VIS.WorkSpace.Geometry CreateVLGeometry(VIS.WorkSpace.Transform trans) { switch (this.shape) { case VLGeometryShape.Sphere: return(new VIS.WorkSpace.Sphere( this, trans)); case VLGeometryShape.Plane: return(new VIS.WorkSpace.Plane( this.planeLength, this.planeWidth, this.planeStep, trans)); case VLGeometryShape.Line: return(new VIS.WorkSpace.Plane( this.lineLength, 0, this.lineStep, trans)); case VLGeometryShape.Point: default: return(new VIS.WorkSpace.Plane( 0, 0, 1, trans)); } }