DayZ 1.28
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
Blend2D.c
См. документацию.
1//----------------------------------------------------------------------------------------
2/*
3 Allows weighted blending of values defined by their 2D position in space.
4*/
5class Blend2D<Class T>
6{
8 private ref array<T> m_Values;
10
11 //----------------------------------------------------------------------------------------
15 void Blend2D()
16 {
17 m_Positions = {};
18 m_Weights = {};
19 m_Values = {};
20 }
21
22 //----------------------------------------------------------------------------------------
26 void Insert(float posX, float posY, T value)
27 {
28 m_Positions.Insert(Vector(posX, posY, 0));
29 m_Values.Insert(value);
30 m_Weights.Insert(0);
31 }
32
33 //----------------------------------------------------------------------------------------
37 void Clear()
38 {
39 m_Positions.Clear();
40 m_Values.Clear();
41 m_Weights.Clear();
42 }
43
44 //----------------------------------------------------------------------------------------
45 /*
46 Evaluate and return the result of the blend sampled at coordinate [posX, posY].
47 */
48 T Blend(float posX, float posY)
49 {
50 vector samplePosition = Vector(posX, posY, 0);
52
53 T result;
54 int numValues = m_Values.Count();
55 for (int v = 0; v < numValues; ++v)
56 {
57 result += (m_Values[v] * m_Weights[v]);
58 }
59
60 return result;
61 }
62
63}
64
65//----------------------------------------------------------------------------------------
66typedef Blend2D<vector> Blend2DVector;
class Blend2D< Class T > Blend2DVector
void Clear()
Определения Blend2D.c:37
void Insert(float posX, float posY, T value)
Определения Blend2D.c:26
ref array< T > m_Values
Определения Blend2D.c:8
void Blend2D()
Определения Blend2D.c:15
ref array< vector > m_Positions
Определения Blend2D.c:7
T Blend(float posX, float posY)
Определения Blend2D.c:48
ref array< float > m_Weights
Определения Blend2D.c:9
Super root of all classes in Enforce script.
Определения EnScript.c:11
Определения EnMath3D.c:28
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Определения EnConvert.c:106
static proto void BlendCartesian(vector samplePosition, notnull array< vector > inPositions, notnull array< float > outWeights)
proto native vector Vector(float x, float y, float z)
Vector constructor from components.