Fixed build scripts for OS X 10.7 build slave.
3 * =============================================================================
4 * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
5 * =============================================================================
7 * This file is part of the SourceMod/SourcePawn SDK.
9 * This program is free software; you can redistribute it and/or modify it under
10 * the terms of the GNU General Public License, version 3.0, as published by the
11 * Free Software Foundation.
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
18 * You should have received a copy of the GNU General Public License along with
19 * this program. If not, see <http://www.gnu.org/licenses/>.
21 * As a special exception, AlliedModders LLC gives you permission to link the
22 * code of this program (as well as its derivative works) to "Half-Life 2," the
23 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
24 * by the Valve Corporation. You must obey the GNU General Public License in
25 * all respects for all other code used. Additionally, AlliedModders LLC grants
26 * this exception to all derivative works. AlliedModders LLC defines further
27 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
28 * or <http://www.sourcemod.net/license.php>.
33 #if defined _vector_included
36 #define _vector_included
39 * Calculates a vector's length.
42 * @param squared If true, the result will be squared (for optimization).
43 * @return Vector length (magnitude).
45 native Float:GetVectorLength(const Float:vec[3], bool:squared=false);
48 * Calculates the distance between two vectors.
50 * @param vec1 First vector.
51 * @param vec2 Second vector.
52 * @param squared If true, the result will be squared (for optimization).
53 * @return Vector distance.
55 native Float:GetVectorDistance(const Float:vec1[3], const Float:vec2[3], bool:squared=false);
58 * Calculates the dot product of two vectors.
60 * @param vec1 First vector.
61 * @param vec2 Second vector.
62 * @return Dot product of the two vectors.
64 native Float:GetVectorDotProduct(const Float:vec1[3], const Float:vec2[3]);
67 * Computes the cross product of two vectors. Any input array can be the same
68 * as the output array.
70 * @param vec1 First vector.
71 * @param vec2 Second vector.
72 * @param result Resultant vector.
75 native GetVectorCrossProduct(const Float:vec1[3], const Float:vec2[3], Float:result[3]);
78 * Normalizes a vector. The input array can be the same as the output array.
81 * @param result Resultant vector.
82 * @return Vector length.
84 native Float:NormalizeVector(const Float:vec[3], Float:result[3]);
87 * Returns vectors in the direction of an angle.
90 * @param fwd Forward vector buffer or NULL_VECTOR.
91 * @param right Right vector buffer or NULL_VECTOR.
92 * @param up Up vector buffer or NULL_VECTOR.
95 native GetAngleVectors(const Float:angle[3], Float:fwd[3], Float:right[3], Float:up[3]);
98 * Returns angles from a vector.
101 * @param angle Angle buffer.
104 native GetVectorAngles(const Float:vec[3], Float:angle[3]);
107 * Returns direction vectors from a vector.
110 * @param right Right vector buffer or NULL_VECTOR.
111 * @param up Up vector buffer or NULL_VECTOR.
114 native GetVectorVectors(const Float:vec[3], Float:right[3], Float:up[3]);
117 * Adds two vectors. It is safe to use either input buffer as an output
120 * @param vec1 First vector.
121 * @param vec2 Second vector.
122 * @param result Result buffer.
125 stock AddVectors(const Float:vec1[3], const Float:vec2[3], Float:result[3])
127 result[0] = vec1[0] + vec2[0];
128 result[1] = vec1[1] + vec2[1];
129 result[2] = vec1[2] + vec2[2];
133 * Subtracts a vector from another vector. It is safe to use either input
134 * buffer as an output buffer.
136 * @param vec1 First vector.
137 * @param vec2 Second vector to subtract from first.
138 * @param result Result buffer.
141 stock SubtractVectors(const Float:vec1[3], const Float:vec2[3], Float:result[3])
143 result[0] = vec1[0] - vec2[0];
144 result[1] = vec1[1] - vec2[1];
145 result[2] = vec1[2] - vec2[2];
152 * @param scale Scale value.
155 stock ScaleVector(Float:vec[3], Float:scale)
163 * Negatives a vector.
168 stock NegateVector(Float:vec[3])
176 * Builds a vector from two points by subtracting the points.
178 * @param pt1 First point (to be subtracted from the second).
179 * @param pt2 Second point.
180 * @param output Output vector buffer.
183 stock MakeVectorFromPoints(const Float:pt1[3], const Float:pt2[3], Float:output[3])
185 output[0] = pt2[0] - pt1[0];
186 output[1] = pt2[1] - pt1[1];
187 output[2] = pt2[2] - pt1[2];