代码拉取完成,页面将自动刷新
同步操作将从 gsbhzh/wechat-game-tiaoyitiao 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
namespace TiaoYiTiao
{
#if NET40
//[Conditional("NET40")]
public class Vector3
{
public int x;
public int y;
public int z;
public Vector3(int x, int y, int z)
{
this.x = x;
this.y = y;
this.z = z;
}
public static Vector3 operator -(Vector3 A, Vector3 vtarger)
{
Vector3 v3 = Zero();
v3.x = A.x - vtarger.x;
v3.y = A.y - vtarger.y;
v3.z = A.z = vtarger.z;
return v3;
}
public static Vector3 operator +(Vector3 vtarger)
{
Vector3 v3 = Zero();
//v3.x = x + vtarger.x;
//v3.y = this.y + vtarger.y;
//v3.z = this.z = vtarger.z;
return v3;
}
public static Vector3 operator *(Vector3 A, Vector3 B)
{
Vector3 v3 = Zero();
v3.x = A.x + B.x;
v3.y = A.y + B.y;
v3.z = A.z + B.z;
return v3;
}
/// <summary>
/// a = [a1,a2,a3] b = [b1,b2,b3] axb=[a2b3-a3b2,a3b1-a1b3,a1b2-a2b1]差乘
/// </summary>
/// <param name="vtarger"></param>
/// <returns></returns>
public Vector3 Cross(Vector3 vtarger)
{
Vector3 v3 = Zero();
v3.x = this.y * vtarger.z - this.z * vtarger.y;
v3.y = this.z * vtarger.x - this.x * vtarger.z;
v3.z = this.x * vtarger.y - this.y * vtarger.x;
return v3;
}
/// <summary>
/// 点积
/// </summary>
/// <param name="vtarger"></param>
/// <returns></returns>
public float Dot(Vector3 vtarger)
{
return this.x * vtarger.x + this.y * vtarger.y + this.z * vtarger.z;
}
public static Vector3 Zero()
{
Vector3 v3 = new Vector3(0, 0, 0);
return v3;
}
public static Vector3 One()
{
Vector3 v3 = new Vector3(1, 1, 1);
return v3;
}
public float LengthSquared()
{
//if (Vector.IsHardwareAccelerated)
//{
// return Vector3.Dot(this, this);
//}
return this.x * this.x + this.y * this.y + this.z * this.z;
}
}
#endif
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。