~openracing/openracing/trunk

« back to all changes in this revision

Viewing changes to src/core/UTI.cs

  • Committer: Jean-Christophe Hoelt
  • Date: 2009-07-20 16:23:02 UTC
  • Revision ID: jeko@immunity-20090720162302-xwk0ov2qttlljmvb
UTI

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
namespace OpenRacing.Core.Track
5
5
{
6
 
        public struct StartingPosition
7
 
        {
8
 
                public Math3D.Vector3 Position;
9
 
                public Math3D.Quaternion Orientation;
10
 
        }
11
 
        
12
6
#region physics
13
7
        public interface PhysicalSurface
14
8
        {
36
30
        public interface PhysicalScene
37
31
        {
38
32
                // Returns the number of surfaces in the physical scene
39
 
                int NumPhysicalSurfaces();
 
33
                int NumSurfaces();
40
34
                // Returns the surface at index i
41
 
                PhysicalSurface GetPhysicalSurface(int i);
 
35
                PhysicalSurface GetSurface(int i);
42
36
        }
43
37
#endregion
44
38
        
 
39
#region logical
 
40
        public struct StartingPosition
 
41
        {
 
42
                public Math3D.Vector3 Position;
 
43
                public Math3D.Quaternion Orientation;
 
44
        }
 
45
        
 
46
 
 
47
        
45
48
        public interface LogicalScene
46
49
        {
47
50
                int NumStartingPositions();
48
51
                StartingPosition GetStartingPosition(int i);
49
52
        }
 
53
#endregion
 
54
        
 
55
#region visual
 
56
        public interface VisualMesh
 
57
        {
 
58
                // Returns the list of vertices
 
59
        Vector3[] GetVertices();
 
60
                // Returns the number of vertices
 
61
        int NumVertices();
 
62
                
 
63
                // Returns the list of normals
 
64
        Vector3[] GetNormals();
 
65
                // Returns the number of normals
 
66
        int NumNormals();
 
67
                
 
68
                // Returns the list of tangents
 
69
        Vector2[] GetTangents();
 
70
                // Returns the number of tangents
 
71
        int NumTangents();
 
72
                
 
73
                // Returns the list of texture coordinates
 
74
        Vector2[] GetTexcoords();
 
75
                // Returns the number of texture coordinates
 
76
        int NumTexcoords();
 
77
                
 
78
                // Returns the list of indices, each 3 indices gives a triangle
 
79
                int[] GetIndices();
 
80
                // Returns the number of indices
 
81
        int NumIndices();
 
82
                
 
83
                // Material associated with this mesh
 
84
                string GetMaterialName();
 
85
        }
 
86
        
 
87
        // A material with its attributes
 
88
        public struct VisualMaterial
 
89
        {
 
90
                public string Name; // Name of the material
 
91
                public string Type; // Type of material: shader to apply
 
92
                // Shader's parameters
 
93
                public System.Collections.Generic.Dictionary<string, string> StringProperties;
 
94
                public System.Collections.Generic.Dictionary<string, int> IntProperties;
 
95
                public System.Collections.Generic.Dictionary<string, double> FloatProperties;
 
96
        }
50
97
        
51
98
        public interface VisualScene
52
99
        {
 
100
                // Returns the number of meshes composing the track
 
101
                int NumMeshes();
 
102
                // Returns mesh at index i
 
103
                VisualMesh GetMesh(int i);
 
104
 
 
105
                // Returns the number of materials
 
106
                int NumMaterials();
 
107
                // Returns material at index i
 
108
                VisualMaterial GetMaterial(int i);
53
109
        }
 
110
#endregion
54
111
        
55
112
        public interface UTI
56
113
        {
58
115
        void Shutdown();
59
116
 
60
117
                PhysicalScene PhysicalScene { get; }
61
 
                VisualScene VisualScene { get; }
62
 
                LogicalScene LogicalScene { get; }
 
118
                VisualScene   VisualScene   { get; }
 
119
                LogicalScene  LogicalScene  { get; }
63
120
                
64
121
        string GetFullPath(string fileName);
65
122
        }