本文整理汇总了C#中IntVector3.isOrthogonalUnitVector方法的典型用法代码示例。如果您正苦于以下问题:C# IntVector3.isOrthogonalUnitVector方法的具体用法?C# IntVector3.isOrthogonalUnitVector怎么用?C# IntVector3.isOrthogonalUnitVector使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IntVector3
的用法示例。
在下文中一共展示了IntVector3.isOrthogonalUnitVector方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getCollisionArray
public static int[,] getCollisionArray(int[,,]mapData, IntVector3 direction)
{
/*
where direction is a unit vector, pointing in the direction mapData is travelling
the direction vector decides what the collision plane will be. for example the collision plane
of a moving car is vertical, like the surface of a brick wall, in front of the car.
the returned collisionArray is the heights of the nearest voxel lining up to each (x,y) of that
plane.
*/
//Debug.Log ("getCollisionArray " + direction.i + " " + direction.j + " " + direction.k);
if (! direction.isOrthogonalUnitVector ())
Debug.Log ("warning: getCollisionArray didn't get a unit vector.");
IntVector2 arraySize = getCollisionArraySize (mapData, direction);
int [,] collisionArray = new int [arraySize.x, arraySize.y];
for (int xOffset=0; xOffset<arraySize.x; xOffset++) {
for (int yOffset=0; yOffset<arraySize.y; yOffset++) {
int dist = getClosestVoxelDistance (mapData, xOffset, yOffset, direction);
collisionArray [xOffset, yOffset] = dist;
if (dist != -1) {
//Debug.Log ("xoffset: " + xOffset + " yoffset: " + yOffset + " dist: " + dist);
}
}
}
return collisionArray;
}