Cesium for Unity 1.15.2
Loading...
Searching...
No Matches
CesiumForUnity.CesiumFeatureIdSet Class Reference

Represents a feature ID set from a glTF primitive. More...

Inheritance diagram for CesiumForUnity.CesiumFeatureIdSet:
CesiumForUnity.CesiumFeatureIdAttribute CesiumForUnity.CesiumFeatureIdTexture

Public Member Functions

virtual Int64 GetFeatureIdForVertex (Int64 vertexIndex)
 Gets the feature ID associated with a given vertex.
 
virtual Int64 GetFeatureIdFromRaycastHit (RaycastHit hitInfo)
 Gets the feature ID from the feature ID set using the given raycast hit.
 
virtual void Dispose ()
 

Properties

CesiumFeatureIdSetType type [get, protected set]
 The type of this feature ID set.
 
String label [get, set]
 The label assigned to this feature ID set.
 
Int64 featureCount [get, set]
 The number of features this primitive has.
 
Int64 nullFeatureId [get, set]
 The null feature ID, i.e., the value that indicates no feature is associated with the owner.In other words, if a vertex or texel returns this value, then it is not associated with any feature.
 
Int64 propertyTableIndex [get, set]
 The index of the property table corresponding to this feature ID set.
 

Detailed Description

Represents a feature ID set from a glTF primitive.

A feature ID can be defined as a per-vertex attribute, as a feature ID texture, or implicitly via vertex ID. These can be used with the corresponding CesiumPropertyTable to access per-feature metadata.

Definition at line 24 of file CesiumFeatureIdSet.cs.

Member Function Documentation

◆ Dispose()

virtual void CesiumForUnity.CesiumFeatureIdSet.Dispose ( )
inlinevirtual

Definition at line 163 of file CesiumFeatureIdSet.cs.

◆ GetFeatureIdForVertex()

virtual Int64 CesiumForUnity.CesiumFeatureIdSet.GetFeatureIdForVertex ( Int64 vertexIndex)
inlinevirtual

Gets the feature ID associated with a given vertex.

The feature ID can be used with a CesiumPropertyTable to retrieve the corresponding metadata.

This returns -1 if the given vertex is out-of-bounds, or if the feature ID set is invalid.

Parameters
vertexIndexThe index of the target vertex.
Returns
The feature ID associated with the given vertex, or -1 for an invalid feature ID set or invalid input.

Reimplemented in CesiumForUnity.CesiumFeatureIdAttribute, and CesiumForUnity.CesiumFeatureIdTexture.

Definition at line 110 of file CesiumFeatureIdSet.cs.

◆ GetFeatureIdFromRaycastHit()

virtual Int64 CesiumForUnity.CesiumFeatureIdSet.GetFeatureIdFromRaycastHit ( RaycastHit hitInfo)
inlinevirtual

Gets the feature ID from the feature ID set using the given raycast hit.

This returns a more accurate value for feature ID textures, since they define feature IDs per-texel instead of per-vertex. The feature ID can be used with a CesiumPropertyTable to retrieve the corresponding metadata.

This can still retrieve the feature IDs for non-texture feature ID sets. For attribute or implicit feature IDs, the first feature ID associated with the first vertex of the intersected face is returned.

This returns -1 if the feature ID set is invalid.

Parameters
hitInfoThe raycast hit info.
Returns
The feature ID associated with the given vertex, or -1 for an invalid feature ID set.

Reimplemented in CesiumForUnity.CesiumFeatureIdAttribute, and CesiumForUnity.CesiumFeatureIdTexture.

Definition at line 144 of file CesiumFeatureIdSet.cs.

Property Documentation

◆ featureCount

Int64 CesiumForUnity.CesiumFeatureIdSet.featureCount
getset

The number of features this primitive has.

Definition at line 48 of file CesiumFeatureIdSet.cs.

◆ label

String CesiumForUnity.CesiumFeatureIdSet.label
getset

The label assigned to this feature ID set.

If no label was present in the glTF feature ID set, this returns an empty string.

Definition at line 40 of file CesiumFeatureIdSet.cs.

◆ nullFeatureId

Int64 CesiumForUnity.CesiumFeatureIdSet.nullFeatureId
getset

The null feature ID, i.e., the value that indicates no feature is associated with the owner.In other words, if a vertex or texel returns this value, then it is not associated with any feature.

If this value was not defined in the glTF feature ID set, this returns -1.

Definition at line 61 of file CesiumFeatureIdSet.cs.

◆ propertyTableIndex

Int64 CesiumForUnity.CesiumFeatureIdSet.propertyTableIndex
getset

The index of the property table corresponding to this feature ID set.

The index can be used to fetch the appropriate CesiumPropertyTable from the CesiumModelMetadata.

If the feature ID set does not specify a property table, this returns -1.

Definition at line 74 of file CesiumFeatureIdSet.cs.

◆ type

CesiumFeatureIdSetType CesiumForUnity.CesiumFeatureIdSet.type
getprotected set

The type of this feature ID set.

Definition at line 31 of file CesiumFeatureIdSet.cs.


The documentation for this class was generated from the following file: