Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
vp.h
Go to the documentation of this file.
1/*
2** Command & Conquer Generals Zero Hour(tm)
3** Copyright 2025 Electronic Arts Inc.
4**
5** This program is free software: you can redistribute it and/or modify
6** it under the terms of the GNU General Public License as published by
7** the Free Software Foundation, either version 3 of the License, or
8** (at your option) any later version.
9**
10** This program is distributed in the hope that it will be useful,
11** but WITHOUT ANY WARRANTY; without even the implied warranty of
12** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13** GNU General Public License for more details.
14**
15** You should have received a copy of the GNU General Public License
16** along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19/***********************************************************************************************
20 *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
21 ***********************************************************************************************
22 * *
23 * Project Name : wwmath *
24 * *
25 * $Archive:: /Commando/Code/WWMath/vp.h $*
26 * *
27 * Org Author:: Hector Yee *
28 * *
29 * Author : Kenny Mitchell *
30 * *
31 * $Modtime:: 06/26/02 4:04p $*
32 * *
33 * $Revision:: 13 $*
34 * *
35 * 06/26/02 KM Matrix name change to avoid MAX conflicts *
36 *---------------------------------------------------------------------------------------------*
37 * Functions: *
38 * Transform - transforms a vector array given Matrix3D *
39 * Copy - Copies data from source to destination *
40 * CopyIndexed-copies dst[]=src[index[]] *
41 * Clear - clears array to zero *
42 * Normalize - normalize the array *
43 * MinMax - Finds the min and max of the array *
44 * *
45 *----------------------------------------------------------------------------------------------*
46 */
47
48#if defined(_MSC_VER)
49#pragma once
50#endif
51
52#ifndef VECTORPROCESSOR_H
53#define VECTORPROCESSOR_H
54
55class Vector2;
56class Vector3;
57class Vector4;
58class Matrix3D;
59class Matrix4x4;
60
62{
63public:
64 static void Transform(Vector3* dst,const Vector3 *src, const Matrix3D& matrix, const int count);
65 static void Transform(Vector4* dst,const Vector3 *src, const Matrix4x4& matrix, const int count);
66 static void Copy(unsigned *dst,const unsigned *src, const int count);
67 static void Copy(Vector2 *dst,const Vector2 *src, const int count);
68 static void Copy(Vector3 *dst,const Vector3 *src, const int count);
69 static void Copy(Vector4 *dst,const Vector4 *src, const int count);
70 static void Copy(Vector4 *dst,const Vector3 *src, const float * srca, const int count);
71 static void Copy(Vector4 *dst,const Vector3 *src, const float srca, const int count);
72 static void Copy(Vector4 *dst,const Vector3 &src, const float * srca, const int count);
73 static void CopyIndexed(unsigned *dst,const unsigned *src, const unsigned int *index, const int count);
74 static void CopyIndexed(Vector2 *dst,const Vector2 *src, const unsigned int *index, const int count);
75 static void CopyIndexed(Vector3 *dst,const Vector3 *src, const unsigned int *index, const int count);
76 static void CopyIndexed(Vector4 *dst,const Vector4 *src, const unsigned int *index, const int count);
77 static void CopyIndexed(unsigned char* dst, const unsigned char* src, const unsigned int *index, int count);
78 static void CopyIndexed(float* dst, float* src, const unsigned int *index, int count);
79 static void Clamp(Vector4 *dst,const Vector4 *src, const float min, const float max, const int count);
80 static void Clear (Vector3 *dst, const int count);
81 static void Normalize(Vector3 *dst, const int count);
82 static void MinMax(Vector3 *src, Vector3 &min, Vector3 &max, const int count);
83
84 static void MulAdd(float * dest,float multiplier,float add,int count);
85
86 static void Prefetch(void* address);
87
88 static void DotProduct(float *dst, const Vector3 &a, const Vector3 *b,const int count);
89 static void ClampMin(float *dst, float *src, const float min, const int count);
90 static void Power(float *dst, float *src, const float pow, const int count);
91};
92
93#endif // VECTORPROCESSOR_H
#define min(x, y)
Definition BaseType.h:101
#define max(x, y)
Definition BaseType.h:105
void add(float *sum, float *addend)
static void ClampMin(float *dst, float *src, const float min, const int count)
Definition vp.cpp:529
static void Normalize(Vector3 *dst, const int count)
Definition vp.cpp:487
static void Transform(Vector3 *dst, const Vector3 *src, const Matrix3D &matrix, const int count)
Definition vp.cpp:80
static void Clamp(Vector4 *dst, const Vector4 *src, const float min, const float max, const int count)
Definition vp.cpp:459
static void MulAdd(float *dest, float multiplier, float add, int count)
Definition vp.cpp:516
static void Clear(Vector3 *dst, const int count)
Definition vp.cpp:480
static void Power(float *dst, float *src, const float pow, const int count)
Definition vp.cpp:535
static void Prefetch(void *address)
Definition vp.cpp:66
static void MinMax(Vector3 *src, Vector3 &min, Vector3 &max, const int count)
Definition vp.cpp:496
static void DotProduct(float *dst, const Vector3 &a, const Vector3 *b, const int count)
Definition vp.cpp:523
static void CopyIndexed(unsigned *dst, const unsigned *src, const unsigned int *index, const int count)
Definition vp.cpp:393
static void Copy(unsigned *dst, const unsigned *src, const int count)
Definition vp.cpp:333