Added replicate and notify parameters to ResetConVar() - these were already available for SetConVarX()
3 * ===============================================================
4 * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved.
5 * ===============================================================
7 * This file is part of the SourceMod/SourcePawn SDK. This file may only be used
8 * or modified under the Terms and Conditions of its License Agreement, which is found
9 * in LICENSE.txt. The Terms and Conditions for making SourceMod extensions/plugins
10 * may change at any time. To view the latest information, see:
11 * http://www.sourcemod.net/license.php
16 #if defined _vector_included
19 #define _vector_included
22 * Calculates a vector's length.
25 * @param squared If true, the result will be squared (for optimization).
26 * @return Vector length (magnitude).
28 native Float:GetVectorLength(const Float:vec[3], bool:squared=false);
31 * Calculates the distance between two vectors.
33 * @param vec1 First vector.
34 * @param vec2 Second vector.
35 * @param squared If true, the result will be squared (for optimization).
36 * @return Vector distance.
38 native Float:GetVectorDistance(const Float:vec1[3], const Float:vec2[3], bool:squared=false);
41 * Calculates the dot product of two vectors.
43 * @param vec1 First vector.
44 * @param vec2 Second vector.
45 * @return Dot product of the two vectors.
47 native Float:GetVectorDotProduct(const Float:vec1[3], const Float:vec2[3]);
50 * Computes the cross product of two vectors. Any input array can be the same
51 * as the output array.
53 * @param vec1 First vector.
54 * @param vec2 Second vector.
55 * @param result Resultant vector.
58 native GetVectorCrossProduct(const Float:vec1[3], const Float:vec2[3], Float:result[3]);
61 * Normalizes a vector. The input array can be the same as the output array.
64 * @param result Resultant vector.
65 * @return Vector length.
67 native Float:NormalizeVector(const Float:vec[3], Float:result[3]);
70 * Returns vectors in the direction of an angle.
73 * @param fwd Forward vector buffer or NULL_VECTOR.
74 * @param right Right vector buffer or NULL_VECTOR.
75 * @param up Up vector buffer or NULL_VECTOR.
78 native GetAngleVectors(const Float:angle[3], Float:fwd[3], Float:right[3], Float:up[3]);
81 * Returns angles from a vector.
84 * @param angle Angle buffer.
87 native GetVectorAngles(const Float:vec[3], Float:angle[3]);
90 * Returns direction vectors from a vector.
93 * @param right Right vector buffer or NULL_VECTOR.
94 * @param up Up vector buffer or NULL_VECTOR.
97 native GetVectorVectors(const Float:vec[3], Float:right[3], Float:up[3]);
100 * Adds two vectors. It is safe to use either input buffer as an output
103 * @param vec1 First vector.
104 * @param vec2 Second vector.
105 * @param result Result buffer.
108 stock AddVectors(const Float:vec1[3], const Float:vec2[3], Float:result[3])
110 result[0] = vec1[0] + vec2[0];
111 result[1] = vec1[1] + vec2[1];
112 result[2] = vec1[2] + vec2[2];
116 * Subtracts a vector from another vector. It is safe to use either input
117 * buffer as an output buffer.
119 * @param vec1 First vector.
120 * @param vec2 Second vector to subtract from first.
121 * @param result Result buffer.
124 stock SubtractVectors(const Float:vec1[3], const Float:vec2[3], Float:result[3])
126 result[0] = vec1[0] - vec2[0];
127 result[1] = vec1[1] - vec2[1];
128 result[2] = vec1[2] - vec2[2];
135 * @param scale Scale value.
138 stock ScaleVector(Float:vec[3], Float:scale)
146 * Negatives a vector.
151 stock NegateVector(Float:vec[3])
159 * Builds a vector from two points by subtracting the points.
161 * @param pt1 First point (to be subtracted from the second).
162 * @param pt2 Second point.
163 * @param output Output vector buffer.
166 stock MakeVectorFromPoints(const Float:pt1[3], const Float:pt2[3], Float:output[3])
168 output[0] = pt2[0] - pt1[0];
169 output[1] = pt2[1] - pt1[1];
170 output[2] = pt2[2] - pt1[2];