Cesium for Unity
1.15.4
Loading...
Searching...
No Matches
CesiumMetadataValueType.cs
Go to the documentation of this file.
1
using
UnityEngine;
2
using
Unity.Mathematics;
3
using
System;
4
5
namespace
CesiumForUnity
6
{
10
public
enum
CesiumMetadataType
11
{
12
Invalid
= 0,
13
Scalar
,
14
Vec2
,
15
Vec3
,
16
Vec4
,
17
Mat2
,
18
Mat3
,
19
Mat4
,
20
String
,
21
Boolean
,
22
Enum
23
}
24
29
public
enum
CesiumMetadataComponentType
30
{
31
None
= 0,
32
Int8
,
33
Uint8
,
34
Int16
,
35
Uint16
,
36
Int32
,
37
Uint32
,
38
Int64
,
39
Uint64
,
40
Float32
,
41
Float64
42
}
43
48
public
struct
CesiumMetadataValueType
49
{
50
#region Fields
54
public
CesiumMetadataType
type
;
55
60
public
CesiumMetadataComponentType
componentType
;
61
66
public
bool
isArray
;
67
#endregion
68
69
#region Constructor
76
public
CesiumMetadataValueType
(
77
CesiumMetadataType
type
,
CesiumMetadataComponentType
componentType
,
bool
isArray
)
78
{
79
this.type =
type
;
80
this.componentType =
componentType
;
81
this.isArray =
isArray
;
82
}
83
#endregion
84
85
#region Static methods
86
public
static
CesiumMetadataValueType
GetValueType
(System.Object inObject)
87
{
88
if
(inObject ==
null
)
89
{
90
return
new
CesiumMetadataValueType
();
91
}
92
93
if
(inObject.GetType() == typeof(
CesiumPropertyArray
))
94
{
95
CesiumPropertyArray
array = inObject as
CesiumPropertyArray
;
96
return
new
CesiumMetadataValueType
(array.
elementValueType
.
type
, array.
elementValueType
.
componentType
,
true
);
97
}
98
99
switch
(inObject)
100
{
101
case
System.Boolean:
102
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Boolean,
CesiumMetadataComponentType
.None,
false
);
103
case
System.SByte:
104
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Scalar,
CesiumMetadataComponentType
.Int8,
false
);
105
case
Byte:
106
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Scalar,
CesiumMetadataComponentType
.Uint8,
false
);
107
case
Int16
:
108
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Scalar,
CesiumMetadataComponentType
.Int16,
false
);
109
case
UInt16
:
110
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Scalar,
CesiumMetadataComponentType
.Uint16,
false
);
111
case
Int32
:
112
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Scalar,
CesiumMetadataComponentType
.Int32,
false
);
113
case
UInt32
:
114
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Scalar,
CesiumMetadataComponentType
.Uint32,
false
);
115
case
Int64
:
116
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Scalar,
CesiumMetadataComponentType
.Int64,
false
);
117
case
UInt64
:
118
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Scalar,
CesiumMetadataComponentType
.Uint64,
false
);
119
case
float:
120
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Scalar,
CesiumMetadataComponentType
.Float32,
false
);
121
case
double:
122
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Scalar,
CesiumMetadataComponentType
.Float64,
false
);
123
case
int2:
124
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Vec2,
CesiumMetadataComponentType
.Int32,
false
);
125
case
int3:
126
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Vec3,
CesiumMetadataComponentType
.Int32,
false
);
127
case
int4:
128
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Vec4,
CesiumMetadataComponentType
.Int32,
false
);
129
case
uint2:
130
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Vec2,
CesiumMetadataComponentType
.Uint32,
false
);
131
case
uint3:
132
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Vec3,
CesiumMetadataComponentType
.Uint32,
false
);
133
case
uint4:
134
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Vec4,
CesiumMetadataComponentType
.Uint32,
false
);
135
case
float2:
136
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Vec2,
CesiumMetadataComponentType
.Float32,
false
);
137
case
float3:
138
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Vec3,
CesiumMetadataComponentType
.Float32,
false
);
139
case
float4:
140
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Vec4,
CesiumMetadataComponentType
.Float32,
false
);
141
case
double2:
142
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Vec2,
CesiumMetadataComponentType
.Float64,
false
);
143
case
double3:
144
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Vec3,
CesiumMetadataComponentType
.Float64,
false
);
145
case
double4:
146
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Vec4,
CesiumMetadataComponentType
.Float64,
false
);
147
case
int2x2:
148
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Mat2,
CesiumMetadataComponentType
.Int32,
false
);
149
case
int3x3:
150
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Mat3,
CesiumMetadataComponentType
.Int32,
false
);
151
case
int4x4:
152
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Mat4,
CesiumMetadataComponentType
.Int32,
false
);
153
case
CesiumIntVec2:
154
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Vec2, (inObject as CesiumIntVec2?).Value.componentType,
false
);
155
case
CesiumIntVec3:
156
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Vec3, (inObject as CesiumIntVec3?).Value.componentType,
false
);
157
case
CesiumIntVec4:
158
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Vec4, (inObject as CesiumIntVec4?).Value.componentType,
false
);
159
case
CesiumUintVec2:
160
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Vec2, (inObject as CesiumUintVec2?).Value.componentType,
false
);
161
case
CesiumUintVec3:
162
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Vec3, (inObject as CesiumUintVec3?).Value.componentType,
false
);
163
case
CesiumUintVec4:
164
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Vec4, (inObject as CesiumUintVec4?).Value.componentType,
false
);
165
case
uint2x2:
166
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Mat2,
CesiumMetadataComponentType
.Uint32,
false
);
167
case
uint3x3:
168
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Mat3,
CesiumMetadataComponentType
.Uint32,
false
);
169
case
uint4x4:
170
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Mat4,
CesiumMetadataComponentType
.Uint32,
false
);
171
case
float2x2:
172
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Mat2,
CesiumMetadataComponentType
.Float32,
false
);
173
case
float3x3:
174
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Mat3,
CesiumMetadataComponentType
.Float32,
false
);
175
case
float4x4:
176
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Mat4,
CesiumMetadataComponentType
.Float32,
false
);
177
case
double2x2:
178
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Mat2,
CesiumMetadataComponentType
.Float64,
false
);
179
case
double3x3:
180
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Mat3,
CesiumMetadataComponentType
.Float64,
false
);
181
case
double4x4:
182
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Mat4,
CesiumMetadataComponentType
.Float64,
false
);
183
case
CesiumIntMat2x2:
184
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Mat2, (inObject as CesiumIntMat2x2?).Value.componentType,
false
);
185
case
CesiumIntMat3x3:
186
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Mat3, (inObject as CesiumIntMat3x3?).Value.componentType,
false
);
187
case
CesiumIntMat4x4:
188
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Mat4, (inObject as CesiumIntMat4x4?).Value.componentType,
false
);
189
case
CesiumUintMat2x2:
190
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Mat2, (inObject as CesiumUintMat2x2?).Value.componentType,
false
);
191
case
CesiumUintMat3x3:
192
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Mat3, (inObject as CesiumUintMat3x3?).Value.componentType,
false
);
193
case
CesiumUintMat4x4:
194
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.Mat4, (inObject as CesiumUintMat4x4?).Value.componentType,
false
);
195
case
System.String:
196
return
new
CesiumMetadataValueType
(
CesiumMetadataType
.String,
CesiumMetadataComponentType
.None,
false
);
197
default
:
198
return
new
CesiumMetadataValueType
();
199
}
200
}
201
#endregion
202
}
203
}
CesiumForUnity.CesiumPropertyArray
Represents an array value from a property in glTF metadata.
Definition
CesiumPropertyArray.cs:10
CesiumForUnity.CesiumPropertyArray.elementValueType
CesiumMetadataValueType elementValueType
The value type of the elements in the array.
Definition
CesiumPropertyArray.cs:28
CesiumForUnity
Definition
Cesium3DTile.cs:8
CesiumForUnity.MetadataType.String
@ String
CesiumForUnity.MetadataType.Boolean
@ Boolean
CesiumForUnity.MetadataType.Int16
@ Int16
CesiumForUnity.MetadataType.None
@ None
CesiumForUnity.MetadataType.Int8
@ Int8
CesiumForUnity.MetadataType.UInt16
@ UInt16
CesiumForUnity.MetadataType.UInt64
@ UInt64
CesiumForUnity.MetadataType.Int32
@ Int32
CesiumForUnity.MetadataType.UInt32
@ UInt32
CesiumForUnity.MetadataType.Int64
@ Int64
CesiumForUnity.CesiumMetadataType
CesiumMetadataType
Identifies the type of a property in EXT_structural_metadata.
Definition
CesiumMetadataValueType.cs:11
CesiumForUnity.CesiumMetadataType.Vec3
@ Vec3
CesiumForUnity.CesiumMetadataType.Mat2
@ Mat2
CesiumForUnity.CesiumMetadataType.Mat3
@ Mat3
CesiumForUnity.CesiumMetadataType.Invalid
@ Invalid
CesiumForUnity.CesiumMetadataType.Mat4
@ Mat4
CesiumForUnity.CesiumMetadataType.Enum
@ Enum
CesiumForUnity.CesiumMetadataType.Scalar
@ Scalar
CesiumForUnity.CesiumMetadataType.Vec4
@ Vec4
CesiumForUnity.CesiumMetadataType.Vec2
@ Vec2
CesiumForUnity.CesiumMetadataComponentType
CesiumMetadataComponentType
Identifies the component type of a property in EXT_structural_metadata.
Definition
CesiumMetadataValueType.cs:30
CesiumForUnity.CesiumMetadataComponentType.Float32
@ Float32
CesiumForUnity.CesiumMetadataComponentType.Uint32
@ Uint32
CesiumForUnity.CesiumMetadataComponentType.Uint16
@ Uint16
CesiumForUnity.CesiumMetadataComponentType.Uint8
@ Uint8
CesiumForUnity.CesiumMetadataComponentType.Uint64
@ Uint64
CesiumForUnity.CesiumMetadataComponentType.Float64
@ Float64
CesiumForUnity.CesiumMetadataValueType
Represents the value type of a metadata value or property, akin to the property types in EXT_structur...
Definition
CesiumMetadataValueType.cs:49
CesiumForUnity.CesiumMetadataValueType.isArray
bool isArray
Whether or not this represents an array containing elements of the specified types.
Definition
CesiumMetadataValueType.cs:66
CesiumForUnity.CesiumMetadataValueType.type
CesiumMetadataType type
The type of the metadata property or value.
Definition
CesiumMetadataValueType.cs:54
CesiumForUnity.CesiumMetadataValueType.componentType
CesiumMetadataComponentType componentType
The component of the metadata property or value.
Definition
CesiumMetadataValueType.cs:60
CesiumForUnity.CesiumMetadataValueType.CesiumMetadataValueType
CesiumMetadataValueType(CesiumMetadataType type, CesiumMetadataComponentType componentType, bool isArray)
Constructs a metadata value type from the given parameters.
Definition
CesiumMetadataValueType.cs:76
CesiumForUnity.CesiumMetadataValueType.GetValueType
static CesiumMetadataValueType GetValueType(System.Object inObject)
Definition
CesiumMetadataValueType.cs:86
Runtime
CesiumMetadataValueType.cs
Generated by
1.12.0