📄 triangle.cpp
字号:
#include "triangle.h"
// TODO: Store points and normal + cached public ones
GcTriangle::GcTriangle()
{
}
GcTriangle::GcTriangle( triType tA, triType tB, triType tC ) : a(tA), b(tB), c(tC)
{
}
GcVector3 GcTriangle::Normal() const
{
// Get 2 vectors from the triangle
GcVector3 Vector1 = c - a;
GcVector3 Vector2 = b - a;
// Use the cross product of our 2 vectors to calculate the normal
GcVector3 Normal = Vector1.CrossProduct(Vector2);
// Normalize the normal
Normal.Normalize();
return Normal;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -