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

Represents the EXT_mesh_features of a glTF primitive in a Cesium3DTileset. More...

Inheritance diagram for CesiumForUnity.CesiumPrimitiveFeatures:

Public Member Functions

CesiumFeatureIdSet[] GetFeatureIdSetsOfType (CesiumFeatureIdSetType type)
 Gets all the feature ID sets of the given type.
 
Int64 GetFeatureIdFromTriangle (int triangleIndex, Int64 featureIdSetIndex=0)
 Gets the feature ID associated with the given triangle, specified by index.
 
Int64 GetFeatureIdFromRaycastHit (RaycastHit hitInfo, Int64 featureIdSetIndex=0)
 Gets the feature ID from the given raycast hit, assuming it has hit a glTF primitive component containing this CesiumPrimitiveFeatures.
 

Static Public Member Functions

static int GetFirstVertexFromHitTriangle (RaycastHit hitInfo)
 Given a successful raycast hit, finds the index of the first vertex from the hit triangle.
 

Properties

CesiumFeatureIdSet[] featureIdSets [get, set]
 The CesiumFeatureIdSets available on this primitive.
 

Detailed Description

Represents the EXT_mesh_features of a glTF primitive in a Cesium3DTileset.

It holds views of the feature ID sets associated with this primitive.

This component is automatically added to primitive game objects if they contain the extension.

Definition at line 17 of file CesiumPrimitiveFeatures.cs.

Member Function Documentation

◆ GetFeatureIdFromRaycastHit()

Int64 CesiumForUnity.CesiumPrimitiveFeatures.GetFeatureIdFromRaycastHit ( RaycastHit hitInfo,
Int64 featureIdSetIndex = 0 )
inline

Gets the feature ID from the given raycast hit, assuming it has hit a glTF primitive component containing this CesiumPrimitiveFeatures.

A primitive may have multiple feature ID sets, so this allows a feature ID set to be specified by index. This value should index into the array of CesiumFeatureIdSets in the CesiumPrimitiveFeatures. If the specified feature ID set index is invalid, this returns -1.

Parameters
hitInfoThe raycast hit info.
featureIdSetIndexThe index of the target feature ID set.
Returns
The feature ID, or -1 if the specified feature ID set is invalid.

Definition at line 115 of file CesiumPrimitiveFeatures.cs.

◆ GetFeatureIdFromTriangle()

Int64 CesiumForUnity.CesiumPrimitiveFeatures.GetFeatureIdFromTriangle ( int triangleIndex,
Int64 featureIdSetIndex = 0 )
inline

Gets the feature ID associated with the given triangle, specified by index.

A primitive may have multiple feature ID sets, so this allows a feature ID set to be specified by index.This value should index into the array of CesiumFeatureIdSets in the CesiumPrimitiveFeatures. If the specified feature ID set index is invalid, this returns -1.

Parameters
triangleIndexThe index of the target triangle.
featureIdSetIndexThe index of the target feature ID set.
Returns
The feature ID, or -1 if the specified triangle or feature ID set is invalid.

Definition at line 88 of file CesiumPrimitiveFeatures.cs.

◆ GetFeatureIdSetsOfType()

CesiumFeatureIdSet[] CesiumForUnity.CesiumPrimitiveFeatures.GetFeatureIdSetsOfType ( CesiumFeatureIdSetType type)
inline

Gets all the feature ID sets of the given type.

If the primitive has no sets of that type, the returned array will be empty.

Parameters
typeThe desired feature ID set type.
Returns
An array of feature ID sets of the specified type, if any exist on the CesiumPrimitiveFeatures.

Definition at line 70 of file CesiumPrimitiveFeatures.cs.

◆ GetFirstVertexFromHitTriangle()

static int CesiumForUnity.CesiumPrimitiveFeatures.GetFirstVertexFromHitTriangle ( RaycastHit hitInfo)
inlinestatic

Given a successful raycast hit, finds the index of the first vertex from the hit triangle.


Parameters
hitInfoThe raycast hit.
Returns
The index of the first vertex on the triangle, or -1 if the hit was unsuccessful.

Definition at line 58 of file CesiumPrimitiveFeatures.cs.

Property Documentation

◆ featureIdSets

CesiumFeatureIdSet [] CesiumForUnity.CesiumPrimitiveFeatures.featureIdSets
getset

The CesiumFeatureIdSets available on this primitive.

Definition at line 22 of file CesiumPrimitiveFeatures.cs.


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