Пример #1
0
    // Update is called once per frame
    void Update()
    {
        // Set Oorbit speed
        Operiod = TimeM.timeMult;

        // Set our Ellipse orbit
        setEllipseOrigin();

        // Handle pause of ellipse movement (since a mult of 0 doesnt stop it completely)
        if (TimeM.pause == false)
        {
            // Move along planets orbit
            MovingOrbit();
        }



        // Rotate around planets axis (Day/Night Cycle) based on current speed
        roll += TimeM.timeMult;
        // Render object
        MeshFilter MF = GetComponent <MeshFilter>(); // Tells QCombine routine the object its moving and all its data

        CurrentPosition         = (Quarts.QCombine(new Vectors(Vx, Vy, Vz), CurrentPosition, new Vectors(scalex, scaley, scalez), new Vectors(roll, pitch, yaw), ModelSpaceVertices, MF));
        transform.localPosition = new Vector3(CurrentPosition.x, CurrentPosition.y, CurrentPosition.z);


        // Debug - shows xyz position on screen since mesh rendered doesnt move the actual transform
        x = CurrentPosition.x;
        y = CurrentPosition.y;
        z = CurrentPosition.z;
    }
Пример #2
0
    // Update is called once per frame
    void Update()
    {
        // Rotate
        timeOfDay = (Time.deltaTime / 3600) * timeBoost;
        yaw      += ((timeOfDay / 24) * 360.0f);

        // Render object
        MeshFilter MF = GetComponent <MeshFilter>(); // Tells QCombine routine the object its moving and all its data

        Quarts.QCombine(new Vectors(0, 0, 0), new Vectors(0, 0, 0), new Vectors(scalex, scaley, scalez), new Vectors(roll, pitch, yaw), ModelSpaceVertices, MF);
    }