예제 #1
0
    bool ValidateCloud(Shape shape, GameObject obj)
    {
        PointsComponent points = obj.GetComponent <PointsComponent>();

        if (points == null)
        {
            Debug.LogError("Missing mesh data object.");
            return(false);
        }

        bool ok = true;

        Tes.Handlers.MeshCache meshCache = (Tes.Handlers.MeshCache)tes.GetHandler((ushort)RoutingID.Mesh);

        // Find the resource.
        var meshDetails = meshCache.GetEntry(points.MeshID);

        if (meshDetails == null)
        {
            Debug.LogError(string.Format("Missing mesh {0}", points.MeshID));
            return(false);
        }


        ok = ValidateVectors("Point", meshDetails.Builder.Vertices, _sampleMesh.Vertices()) && ok;

        return(ok);
    }
예제 #2
0
 void Start()
 {
     if (PointsComponent == null)
     {
         PointsComponent = this.GetComponent <PointsComponent>();
     }
 }
    bool ValidateCloud(Shape shape, Shape referenceShape, MessageHandler handler)
    {
        PointCloudHandler cloudHandler   = (PointCloudHandler)handler;
        PointsComponent   pointsData     = cloudHandler.ShapeCache.GetShapeData <PointsComponent>(shape.ID);
        PointCloudShape   cloudReference = (PointCloudShape)referenceShape;

        if (pointsData == null)
        {
            Debug.LogError("Unable to resolve point cloud data.");
            return(false);
        }

        bool ok = true;

        // Only validate vertices.
        ok = ValidateVectors("Point", pointsData.Mesh.Mesh.Vertices, cloudReference.PointCloud.Vertices()) && ok;

        return(ok);
    }
예제 #4
0
 void Start()
 {
     baseColor       = this.renderer.material.color;
     PointsComponent = this.GetComponent <PointsComponent>();
 }
예제 #5
0
 void Start()
 {
     baseColor = this.renderer.material.color;
     PointsComponent = this.GetComponent<PointsComponent>();
 }
 void Start()
 {
     if (PointsComponent == null)
         PointsComponent = this.GetComponent<PointsComponent>();
 }