Мои Уведомления
Привет, !
Мой Аккаунт Мои Финансы Мои Подписки Мои Настройки Выход
Руководство API скрипты

Объявление

public static Vector3 Cross(Vector3 lhs, Vector3 rhs);

Описание

Cross Product of two vectors.

The cross product of two vectors results in a third vector which is perpendicular to the two input vectors. The result's magnitude is equal to the magnitudes of the two inputs multiplied together and then multiplied by the sine of the angle between the inputs. You can determine the direction of the result vector using the "left hand rule".

The left hand rule applied to Cross(a, b).
using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { // Get the normal to a triangle from the three corner points, a, b and c. Vector3 GetNormal(Vector3 a, Vector3 b, Vector3 c) { // Находим векторы, соответствующие двум сторонам треугольника. Vector3 side1 = b - a; Vector3 side2 = c - a; // Пересеките векторы, чтобы получить перпендикулярный вектор, затем нормализуйте его. return Vector3.Cross(side1, side2).normalized; } }
Вы можете отблагодарить автора, за перевод документации на русский язык. ₽ Спасибо
API скрипты 2021.3