Exemple #1
0
        PortableVertex MakeVertex(Mesh mesh, MeshFace face, int i)
        {
            PortableVertex vertex = new PortableVertex();

            vertex.position = CoordinateSystems.Unity(mesh.Positions[face.Indices[i]]);
            vertex.normal   = CoordinateSystems.Unity(mesh.Normals[face.Indices[i]]);
            vertex.uv.x     = face.TexCoords[i].X / 255f;
            vertex.uv.y     = 1f - (face.TexCoords[i].Y / 255f);

            return(vertex);
        }
Exemple #2
0
        public void Add(Car car)
        {
            ResetMaterials();

            foreach (var texture in car.Material.Textures)
            {
                Add(texture, "diffuse");
            }

            Add(car.Geometry.Good);
            Add(car.Geometry.Wheels);

            carProperties             = new AssetsInfo.CarInfo();
            carProperties.WheelRearL  = CoordinateSystems.UnityWheelPosition(car.Data.DataObjects[3].Position);
            carProperties.WheelFrontL = CoordinateSystems.UnityWheelPosition(car.Data.DataObjects[2].Position);
            carProperties.WheelRearR  = CoordinateSystems.UnityWheelPosition(car.Data.DataObjects[1].Position);
            carProperties.WheelFrontR = CoordinateSystems.UnityWheelPosition(car.Data.DataObjects[0].Position);
            carProperties.Chassis     = CoordinateSystems.Unity(car.Data.DataObjects[4].Position);
        }
Exemple #3
0
        public void Add(Circuit circuit)
        {
            ResetMaterials();

            foreach (var texture in circuit.Textures)
            {
                Add(texture, "diffuse");
            }

            foreach (var sector in circuit.Sectors)
            {
                Add(sector);
            }

            foreach (var background in circuit.Background.Textures)
            {
                Add(background, "background");
            }

            try
            {
                foreach (var sky in circuit.Sky.Textures)
                {
                    Add(sky, "sky");
                }
            }
            catch
            {
            }

            circuitProperties = new AssetsInfo.CircuitInfo();

            // get the start positions

            circuitProperties.grid.pole    = CoordinateSystems.Unity(circuit.DesignationForward.Starts[0].Data);
            circuitProperties.grid.second  = CoordinateSystems.Unity(circuit.DesignationForward.Starts[3].Data);
            circuitProperties.grid.third   = CoordinateSystems.Unity(circuit.DesignationForward.Starts[6].Data);
            circuitProperties.grid.forward = CoordinateSystems.Unity(circuit.DesignationForward.Starts[1].Data);
        }