public bool worldToScreen(Vector3 world, out Vector3 screen) { screen.Z = 0.0f; FMinimalViewInfo pov = this._cameraCache.POV; D3DMatrix d3Dmatrix = new D3DMatrix(pov.Rotation, new Vector3(0.0f, 0.0f, 0.0f)); Vector3 mv1 = new Vector3(d3Dmatrix._11, d3Dmatrix._12, d3Dmatrix._13); Vector3 mv2 = new Vector3(d3Dmatrix._21, d3Dmatrix._22, d3Dmatrix._23); Vector3 mv3 = new Vector3(d3Dmatrix._31, d3Dmatrix._32, d3Dmatrix._33); Vector3 vector3_1 = world - pov.Location; Vector3 vector3_2 = new Vector3(vector3_1.DotProduct(mv2), vector3_1.DotProduct(mv3), vector3_1.DotProduct(mv1)); if ((double)vector3_2.Z < 1.0) { vector3_2.Z = 1f; } float fov = pov.FOV; float num1 = (float)this._width / 2f; float num2 = (float)this._heigth / 2f; screen.X = num1 + vector3_2.X * (num1 / (float)Math.Tan((double)fov * 3.14159274101257 / 360.0)) / vector3_2.Z; screen.Y = num2 - vector3_2.Y * (num1 / (float)Math.Tan((double)fov * 3.14159274101257 / 360.0)) / vector3_2.Z; if ((double)screen.X >= 0.0 && (double)screen.Y <= (double)this._heigth && (double)screen.Y >= 0.0) { return((double)screen.Y <= (double)this._heigth); } return(false); }
// Token: 0x06000226 RID: 550 RVA: 0x00007B5C File Offset: 0x00005D5C public Vector3 GetBone(int boneIndex) { if (this.boneArray != 0UL) { FTransform transform = Program.Client.ReadMemory <FTransform>(this.boneArray + (ulong)((long)(boneIndex * 48))); FTransform transform2 = Program.Client.ReadMemory <FTransform>(this.mesh + 640UL); D3DMatrix d3DMatrix = D3DMatrix.Multiplicate(new D3DMatrix(transform), new D3DMatrix(transform2)); return(new Vector3(d3DMatrix._41, d3DMatrix._42, d3DMatrix._43)); } return(new Vector3(0f, 0f, 0f)); }
public static D3DMatrix Multiplicate(D3DMatrix pM1, D3DMatrix pM2) { return(new D3DMatrix() { _11 = (float)((double)pM1._11 * (double)pM2._11 + (double)pM1._12 * (double)pM2._21 + (double)pM1._13 * (double)pM2._31 + (double)pM1._14 * (double)pM2._41), _12 = (float)((double)pM1._11 * (double)pM2._12 + (double)pM1._12 * (double)pM2._22 + (double)pM1._13 * (double)pM2._32 + (double)pM1._14 * (double)pM2._42), _13 = (float)((double)pM1._11 * (double)pM2._13 + (double)pM1._12 * (double)pM2._23 + (double)pM1._13 * (double)pM2._33 + (double)pM1._14 * (double)pM2._43), _14 = (float)((double)pM1._11 * (double)pM2._14 + (double)pM1._12 * (double)pM2._24 + (double)pM1._13 * (double)pM2._34 + (double)pM1._14 * (double)pM2._44), _21 = (float)((double)pM1._21 * (double)pM2._11 + (double)pM1._22 * (double)pM2._21 + (double)pM1._23 * (double)pM2._31 + (double)pM1._24 * (double)pM2._41), _22 = (float)((double)pM1._21 * (double)pM2._12 + (double)pM1._22 * (double)pM2._22 + (double)pM1._23 * (double)pM2._32 + (double)pM1._24 * (double)pM2._42), _23 = (float)((double)pM1._21 * (double)pM2._13 + (double)pM1._22 * (double)pM2._23 + (double)pM1._23 * (double)pM2._33 + (double)pM1._24 * (double)pM2._43), _24 = (float)((double)pM1._21 * (double)pM2._14 + (double)pM1._22 * (double)pM2._24 + (double)pM1._23 * (double)pM2._34 + (double)pM1._24 * (double)pM2._44), _31 = (float)((double)pM1._31 * (double)pM2._11 + (double)pM1._32 * (double)pM2._21 + (double)pM1._33 * (double)pM2._31 + (double)pM1._34 * (double)pM2._41), _32 = (float)((double)pM1._31 * (double)pM2._12 + (double)pM1._32 * (double)pM2._22 + (double)pM1._33 * (double)pM2._32 + (double)pM1._34 * (double)pM2._42), _33 = (float)((double)pM1._31 * (double)pM2._13 + (double)pM1._32 * (double)pM2._23 + (double)pM1._33 * (double)pM2._33 + (double)pM1._34 * (double)pM2._43), _34 = (float)((double)pM1._31 * (double)pM2._14 + (double)pM1._32 * (double)pM2._24 + (double)pM1._33 * (double)pM2._34 + (double)pM1._34 * (double)pM2._44), _41 = (float)((double)pM1._41 * (double)pM2._11 + (double)pM1._42 * (double)pM2._21 + (double)pM1._43 * (double)pM2._31 + (double)pM1._44 * (double)pM2._41), _42 = (float)((double)pM1._41 * (double)pM2._12 + (double)pM1._42 * (double)pM2._22 + (double)pM1._43 * (double)pM2._32 + (double)pM1._44 * (double)pM2._42), _43 = (float)((double)pM1._41 * (double)pM2._13 + (double)pM1._42 * (double)pM2._23 + (double)pM1._43 * (double)pM2._33 + (double)pM1._44 * (double)pM2._43), _44 = (float)((double)pM1._41 * (double)pM2._14 + (double)pM1._42 * (double)pM2._24 + (double)pM1._43 * (double)pM2._34 + (double)pM1._44 * (double)pM2._44) }); }
// Token: 0x06000237 RID: 567 RVA: 0x00007FA4 File Offset: 0x000061A4 public static D3DMatrix Multiplicate(D3DMatrix pM1, D3DMatrix pM2) { return(new D3DMatrix { _11 = pM1._11 * pM2._11 + pM1._12 * pM2._21 + pM1._13 * pM2._31 + pM1._14 * pM2._41, _12 = pM1._11 * pM2._12 + pM1._12 * pM2._22 + pM1._13 * pM2._32 + pM1._14 * pM2._42, _13 = pM1._11 * pM2._13 + pM1._12 * pM2._23 + pM1._13 * pM2._33 + pM1._14 * pM2._43, _14 = pM1._11 * pM2._14 + pM1._12 * pM2._24 + pM1._13 * pM2._34 + pM1._14 * pM2._44, _21 = pM1._21 * pM2._11 + pM1._22 * pM2._21 + pM1._23 * pM2._31 + pM1._24 * pM2._41, _22 = pM1._21 * pM2._12 + pM1._22 * pM2._22 + pM1._23 * pM2._32 + pM1._24 * pM2._42, _23 = pM1._21 * pM2._13 + pM1._22 * pM2._23 + pM1._23 * pM2._33 + pM1._24 * pM2._43, _24 = pM1._21 * pM2._14 + pM1._22 * pM2._24 + pM1._23 * pM2._34 + pM1._24 * pM2._44, _31 = pM1._31 * pM2._11 + pM1._32 * pM2._21 + pM1._33 * pM2._31 + pM1._34 * pM2._41, _32 = pM1._31 * pM2._12 + pM1._32 * pM2._22 + pM1._33 * pM2._32 + pM1._34 * pM2._42, _33 = pM1._31 * pM2._13 + pM1._32 * pM2._23 + pM1._33 * pM2._33 + pM1._34 * pM2._43, _34 = pM1._31 * pM2._14 + pM1._32 * pM2._24 + pM1._33 * pM2._34 + pM1._34 * pM2._44, _41 = pM1._41 * pM2._11 + pM1._42 * pM2._21 + pM1._43 * pM2._31 + pM1._44 * pM2._41, _42 = pM1._41 * pM2._12 + pM1._42 * pM2._22 + pM1._43 * pM2._32 + pM1._44 * pM2._42, _43 = pM1._41 * pM2._13 + pM1._42 * pM2._23 + pM1._43 * pM2._33 + pM1._44 * pM2._43, _44 = pM1._41 * pM2._14 + pM1._42 * pM2._24 + pM1._43 * pM2._34 + pM1._44 * pM2._44 }); }
// Token: 0x06000274 RID: 628 RVA: 0x0000932C File Offset: 0x0000752C public bool worldToScreen(Vector3 world, out Vector3 screen) { screen.Z = 0f; FMinimalViewInfo pov = this._cameraCache.POV; Vector3 rotation = pov.Rotation; D3DMatrix d3DMatrix = new D3DMatrix(rotation, new Vector3(0f, 0f, 0f)); Vector3 mv = new Vector3(d3DMatrix._11, d3DMatrix._12, d3DMatrix._13); Vector3 mv2 = new Vector3(d3DMatrix._21, d3DMatrix._22, d3DMatrix._23); Vector3 mv3 = new Vector3(d3DMatrix._31, d3DMatrix._32, d3DMatrix._33); Vector3 vector = world - pov.Location; Vector3 vector2 = new Vector3(vector.DotProduct(mv2), vector.DotProduct(mv3), vector.DotProduct(mv)); if (vector2.Z < 1f) { vector2.Z = 1f; } float fov = pov.FOV; float num = (float)this._width / 2f; float num2 = (float)this._heigth / 2f; screen.X = num + vector2.X * (num / (float)Math.Tan((double)(fov * 3.14159274f / 360f))) / vector2.Z; screen.Y = num2 - vector2.Y * (num / (float)Math.Tan((double)(fov * 3.14159274f / 360f))) / vector2.Z; return(screen.X >= 0f && screen.Y <= (float)this._heigth && screen.Y >= 0f && screen.Y <= (float)this._heigth); }