C# Class HoloToolkit.Sharing.Utilities.Utils

Afficher le fichier Open project: OpenHID/InteractivePaint

Méthodes publiques

Méthode Description
ConnectCylinderBetweenPoints ( Transform endPointSpace, Vector3 a, Vector3 b, Transform cylTransform ) : void

Given two points and the transform that they are in, set position, rotation, and scale of a cylinder transform to connect it between the two points

GetChildRecursive ( Transform t, string name ) : Transform

walk hierarchy looking for named transform

IsInEditor ( ) : bool

helper for detecting if running in editor

Map ( float minA, float maxA, float minB, float maxB, float value ) : float

This takes a value, whose proportions are defined by minA and maxA, and scales it to a space defined by minB and maxB. For example, 5 in the space of 0 to 10 will map to 50 in the space of 0 to 100.

MapAndClamp ( float minA, float maxA, float minB, float maxB, float value ) : float

This wrapper performs a map, but sets the results upper and lower limit based on the upper and lower bounds of the new scale.

MoveObjectInFrontOfUser ( Transform stageTransform, Transform tran, Vector3 offset, float yawOffset ) : void

Position transform along the gaze direction and orient yaw to match, with the specified offset

SetLayerRecursively ( GameObject gameObject, int layer ) : void
SetMaterialRecursive ( Transform t, Material mat ) : void

Change material for every object in hierarchy

SetMaterialRecursiveForName ( Transform t, Material mat, string nameToTest ) : void

Change material for every object in hierarchy which has a name equal to nameToTest

Method Details

ConnectCylinderBetweenPoints() public static méthode

Given two points and the transform that they are in, set position, rotation, and scale of a cylinder transform to connect it between the two points
public static ConnectCylinderBetweenPoints ( Transform endPointSpace, Vector3 a, Vector3 b, Transform cylTransform ) : void
endPointSpace UnityEngine.Transform
a UnityEngine.Vector3 One end point in the space of endPointSpace
b UnityEngine.Vector3 Other end point in the space of endPointSpace
cylTransform UnityEngine.Transform transform for the cylinder primitive to connect
Résultat void

GetChildRecursive() public static méthode

walk hierarchy looking for named transform
public static GetChildRecursive ( Transform t, string name ) : Transform
t UnityEngine.Transform root transform to start searching from
name string name to look for
Résultat UnityEngine.Transform

IsInEditor() public static méthode

helper for detecting if running in editor
public static IsInEditor ( ) : bool
Résultat bool

Map() public static méthode

This takes a value, whose proportions are defined by minA and maxA, and scales it to a space defined by minB and maxB. For example, 5 in the space of 0 to 10 will map to 50 in the space of 0 to 100.
public static Map ( float minA, float maxA, float minB, float maxB, float value ) : float
minA float lower bound for the original scale
maxA float upper bound for the original scale
minB float lower bound for new scale
maxB float upper bound for new scale
value float the original scale value to convert to the new /// scale.
Résultat float

MapAndClamp() public static méthode

This wrapper performs a map, but sets the results upper and lower limit based on the upper and lower bounds of the new scale.
public static MapAndClamp ( float minA, float maxA, float minB, float maxB, float value ) : float
minA float lower bound for the original scale
maxA float upper bound for the original scale
minB float lower bound for new scale
maxB float upper bound for new scale
value float the original scale value to convert to the new /// scale.
Résultat float

MoveObjectInFrontOfUser() public static méthode

Position transform along the gaze direction and orient yaw to match, with the specified offset
public static MoveObjectInFrontOfUser ( Transform stageTransform, Transform tran, Vector3 offset, float yawOffset ) : void
stageTransform UnityEngine.Transform transform of higher-level space where 0,1,0 is up
tran UnityEngine.Transform transform to be repositioned
offset UnityEngine.Vector3 translation offset, Z is forward
yawOffset float yaw offset
Résultat void

SetLayerRecursively() public static méthode

public static SetLayerRecursively ( GameObject gameObject, int layer ) : void
gameObject UnityEngine.GameObject
layer int
Résultat void

SetMaterialRecursive() public static méthode

Change material for every object in hierarchy
public static SetMaterialRecursive ( Transform t, Material mat ) : void
t UnityEngine.Transform root transform to start looking for renderers
mat UnityEngine.Material material to set everything to
Résultat void

SetMaterialRecursiveForName() public static méthode

Change material for every object in hierarchy which has a name equal to nameToTest
public static SetMaterialRecursiveForName ( Transform t, Material mat, string nameToTest ) : void
t UnityEngine.Transform root transform to start looking for renderers
mat UnityEngine.Material material to set everything to
nameToTest string
Résultat void