PageRenderTime 334ms queryTime 35ms sortTime 0ms getByIdsTime 254ms findMatchingLines 14ms

28+ results for 'float Q_rsqrt repo:quake' (334 ms)

Not the results you expected?
q_math.c https://github.com/tario/fixedquake.git | C | 1287 lines
                    
248
                    
249unsigned ColorBytes3 (float r, float g, float b) {
                    
250	unsigned	i;
                    
258
                    
259unsigned ColorBytes4 (float r, float g, float b, float a) {
                    
260	unsigned	i;
                    
325	float	zrot[3][3];
                    
326	float	tmpmat[3][3];
                    
327	float	rot[3][3];
                    
529/*
                    
530** float q_rsqrt( float number )
                    
531*/
                    
531*/
                    
532float Q_rsqrt( float number )
                    
533{
                    
                
colldet.c git://pkgs.fedoraproject.org/freedroidrpg | C | 688 lines
                    
53
                    
54inline int normalize_vect(float x1, float y1, float *x2, float *y2)
                    
55{
                    
79 */
                    
80static inline float calc_squared_distance_seg_point_normalized(float x1, float y1, float x2, float y2, float x2n, float y2n, float px, float py)
                    
81{
                    
203 */
                    
204int way_free_of_droids(float x1, float y1, float x2, float y2, int levelnum, freeway_context * ctx)
                    
205{
                    
247
                    
248static inline char get_point_flag(float xmin, float ymin, float xmax, float ymax, float px, float py)
                    
249{
                    
444
                    
445int DirectLineColldet(float x1, float y1, float x2, float y2, int z, colldet_filter * filter)
                    
446{
                    
                
q_math.c http://quakeconstruct.googlecode.com/svn/trunk/ | C | 1321 lines
                    
192
                    
193	ilength = Q_rsqrt( DotProduct( v, v ) );
                    
194
                    
238	int		i, best;
                    
239	float	d, bestd;
                    
240
                    
268
                    
269unsigned ColorBytes3 (float r, float g, float b) {
                    
270	unsigned	i;
                    
278
                    
279unsigned ColorBytes4 (float r, float g, float b, float a) {
                    
280	unsigned	i;
                    
341void RotatePointAroundVector( vec3_t dst, const vec3_t dir, const vec3_t point,
                    
342							 float degrees ) {
                    
343	float	m[3][3];
                    
                
q_math.c https://quake.svn.sourceforge.net/svnroot/quake | C | 1309 lines
                    
192
                    
193	ilength = Q_rsqrt( DotProduct( v, v ) );
                    
194
                    
268
                    
269unsigned ColorBytes3 (float r, float g, float b) {
                    
270	unsigned	i;
                    
278
                    
279unsigned ColorBytes4 (float r, float g, float b, float a) {
                    
280	unsigned	i;
                    
341void RotatePointAroundVector( vec3_t dst, const vec3_t dir, const vec3_t point,
                    
342							 float degrees ) {
                    
343	float	m[3][3];
                    
344	float	im[3][3];
                    
345	float	zrot[3][3];
                    
346	float	tmpmat[3][3];
                    
                
q_math.h git://github.com/mrwonko/Jedi-Academy--Renaissance.git | C Header | 296 lines
                    
105int Com_Clampi( int min, int max, int value );
                    
106float Com_Clamp( float min, float max, float value );
                    
107int Com_AbsClampi( int min, int max, int value );
                    
109
                    
110float Q_rsqrt( float number );
                    
111float Q_fabs( float f );
                    
118
                    
119float LerpAngle(float from, float to, float frac);
                    
120float AngleSubtract( float a1, float a2 );
                    
286void VectorCopy4( const vec4_t vecIn, vec4_t vecOut );
                    
287void VectorSet4( vec4_t vec, float x, float y, float z, float w );
                    
288void VectorClear4( vec4_t vec );
                    
294///////////////////////////////////////////////////////////////////////////
                    
295void VectorSet5( vec5_t vec, float x, float y, float z, float w, float u );
                    
296
                    
                
emulate.cxx https://github.com/somian/Path64.git | C++ | 5500 lines
                    
110  EM_LL_M3_DSRLV,	/* mips 3 simulation of dsrlv */
                    
111  EM_LL_TO_F,		/* cvt double-word to float */
                    
112  EM_ULL_TO_F,		/* cvt unsigned double-word to float */
                    
112  EM_ULL_TO_F,		/* cvt unsigned double-word to float */
                    
113  EM_LL_TO_D,		/* cvt double-word to double float */
                    
114  EM_ULL_TO_D,		/* cvt unsigned double-word to double float */
                    
114  EM_ULL_TO_D,		/* cvt unsigned double-word to double float */
                    
115  EM_F_TO_LL,		/* cvt float to double-word */
                    
116  EM_F_TO_ULL,		/* cvt float to unsigned double-word */
                    
116  EM_F_TO_ULL,		/* cvt float to unsigned double-word */
                    
117  EM_F_ROUND_LL_F,	/* round float to float */
                    
118  EM_F_TRUNC_LL_F,	/* trunc float to float */
                    
118  EM_F_TRUNC_LL_F,	/* trunc float to float */
                    
119  EM_D_TO_LL,		/* cvt double float to double-word */
                    
120  EM_D_TO_ULL,		/* cvt double float to unsigned double-word */
                    
                
q_shared.c https://github.com/hifi-unmaintained/aprq2.git | C | 1687 lines
                    
74
                    
75void Q_sincos( float angle, float *s, float *c )
                    
76{
                    
250*/
                    
251void R_ConcatRotations (float in1[3][3], float in2[3][3], float out[3][3])
                    
252{
                    
310
                    
311float Q_RSqrt (float number)
                    
312{
                    
326*/
                    
327float LerpAngle (float a2, float a1, float frac)
                    
328{
                    
341*/
                    
342float CalcFov (float fov_x, float width, float height)
                    
343{
                    
                
tr_main.cpp https://gitlab.com/xonotic/daemon.git | C++ | 2811 lines
                    
258		trace = tangent2[ 0 ] - binormal2[ 1 ] - normal2[ 2 ] + 1.0f;
                    
259		scale = 0.5f * Q_rsqrt( trace );
                    
260
                    
280		trace = -tangent2[ 0 ] - binormal2[ 1 ] + normal2[ 2 ] + 1.0f;
                    
281		scale = 0.5f * Q_rsqrt( trace );
                    
282
                    
518*/
                    
519void R_TransformWorldToClip( const vec3_t src, const float *cameraViewMatrix, const float *projectionMatrix, vec4_t eye,
                    
520                             vec4_t dst )
                    
535*/
                    
536void R_TransformModelToClip( const vec3_t src, const float *modelViewMatrix, const float *projectionMatrix, vec4_t eye, vec4_t dst )
                    
537{
                    
570*/
                    
571float R_ProjectRadius( float r, vec3_t location )
                    
572{
                    
                
q_math.cpp https://gitlab.com/xonotic/daemon.git | C++ | 3480 lines
                    
145// Range of [0,1]
                    
146float Q_random( int *seed )
                    
147{
                    
147{
                    
148	return ( Q_rand( seed ) & 0xffff ) / ( float ) 0x10000;
                    
149}
                    
151// Range of [-1,1]
                    
152float Q_crandom( int *seed )
                    
153{
                    
192	int   i, best;
                    
193	float d, bestd;
                    
194
                    
239
                    
240	ilength = Q_rsqrt( length2 );
                    
241	plane[ 0 ] = plane[ 0 ] * ilength;
                    
                
delta.cpp https://bitbucket.org/sbenjaminp/marlin.git | C++ | 300 lines
                    
102   */
                    
103  float Q_rsqrt(float number) {
                    
104    long i;
                    
104    long i;
                    
105    float x2, y;
                    
106    const float threehalfs = 1.5f;
                    
146 */
                    
147float delta_safe_distance_from_top() {
                    
148  float cartesian[XYZ] = { 0, 0, 0 };
                    
149  inverse_kinematics(cartesian);
                    
150  float centered_extent = delta[A_AXIS];
                    
151  cartesian[Y_AXIS] = DELTA_PRINTABLE_RADIUS;
                    
180 */
                    
181void forward_kinematics_DELTA(float z1, float z2, float z3) {
                    
182  // Create a vector in old coordinates along x axis of new coordinate
                    
                
q_math.c https://bitbucket.org/bshaw/jk3game_sdk_mingw.git | C | 1700 lines
                    
196#if 0
                    
197void CrossProductA (float *v1, float *v2, float *cross)
                    
198{
                    
332
                    
333unsigned ColorBytes3 (float r, float g, float b) {
                    
334	unsigned	i;
                    
342
                    
343unsigned ColorBytes4 (float r, float g, float b, float a) {
                    
344	unsigned	i;
                    
353
                    
354float NormalizeColor( const vec3_t in, vec3_t out ) {
                    
355	float	max;
                    
405void RotatePointAroundVector( vec3_t dst, const vec3_t dir, const vec3_t point,
                    
406							 float degrees ) {
                    
407	float	m[3][3];
                    
                
q_math.cpp https://gitlab.com/TimePath/daemon2.git | C++ | 3891 lines
                    
212// Range of [0,1]
                    
213float Q_random( int *seed )
                    
214{
                    
214{
                    
215	return ( Q_rand( seed ) & 0xffff ) / ( float ) 0x10000;
                    
216}
                    
218// Range of [-1,1]
                    
219float Q_crandom( int *seed )
                    
220{
                    
309
                    
310unsigned ColorBytes3( float r, float g, float b )
                    
311{
                    
320
                    
321unsigned ColorBytes4( float r, float g, float b, float a )
                    
322{
                    
                
g_func_decs.h https://github.com/mgrdcm/ET-GPL.git | C Header | 1340 lines
                    
35extern char * Info_ValueForKey ( const char * s , const char * key ) ;
                    
36extern float * tv ( float x , float y , float z ) ;
                    
37extern char * QDECL va ( char * format , ... ) ;
                    
101extern void COM_FixPath ( char * pathname ) ;
                    
102extern float Com_Clamp ( float min , float max , float value ) ;
                    
103extern float Q_fabs ( float f ) ;
                    
103extern float Q_fabs ( float f ) ;
                    
104extern float Q_rsqrt ( float number ) ;
                    
105extern void VectorRotate ( vec3_t in , vec3_t matrix [ 3 ] , vec3_t out ) ;
                    
112extern void RotateAroundDirection ( vec3_t axis [ 3 ] , float yaw ) ;
                    
113extern void RotatePointAroundVertex ( vec3_t pnt , float rot_x , float rot_y , float rot_z , const vec3_t origin ) ;
                    
114extern void RotatePointAroundVector ( vec3_t dst , const vec3_t dir , const vec3_t point , float degrees ) ;
                    
116extern float NormalizeColor ( const vec3_t in , vec3_t out ) ;
                    
117extern unsigned ColorBytes4 ( float r , float g , float b , float a ) ;
                    
118extern unsigned ColorBytes3 ( float r , float g , float b ) ;
                    
                
delta.h https://bitbucket.org/cpdevelops/anet-marlin.git | C Header | 133 lines
                    
29
                    
30extern float delta_height,
                    
31             delta_endstop_adj[ABC],
                    
37
                    
38extern float delta_tower[ABC][2],
                    
39             delta_diagonal_rod_2_tower[ABC],
                    
60 * - Disable the home_offset (M206) and/or position_shift (G92)
                    
61 *   features to remove up to 12 float additions.
                    
62 *
                    
71   */
                    
72  float Q_rsqrt(float number);
                    
73  #define _SQRT(n) (1.0f / Q_rsqrt(n))
                    
124 */
                    
125void forward_kinematics_DELTA(float z1, float z2, float z3);
                    
126
                    
                
rsqrt_carmack.h https://bitbucket.org/rayburgemeestre/sqrtvis | C Header | 109 lines
                    
11// original, as copied from the Quake 3 source, without useless preprocessor code
                    
12inline float Q_rsqrt(float number)
                    
13{
                    
21	i  = 0x5f3759df - (i >> 1);                 // what the fuck?
                    
22	y  = * (float *) &i;
                    
23	y  = y * (threehalfs - (x2 * y * y));       // 1st iteration
                    
27
                    
28inline float Q_frsqrt(float number)
                    
29{
                    
45// Doom 3's version of Q_rsqrt
                    
46inline float D3RSqrt(float x)
                    
47{
                    
91// Doom 3's rsqrt/invsqrt version
                    
92inline float D3InvSqrt(float x)
                    
93{
                    
                
trickmath.c https://github.com/AlbertVeli/Carnival.git | C | 138 lines
                    
76/* Taken from Quake III source code */
                    
77float Q_rsqrt(float number)
                    
78{
                    
84   y  = number;
                    
85   i  = *(long *)&y;                      // evil floating point bit level hacking
                    
86   i  = 0x5f3759df - (i >> 1);            // what the fuck?
                    
94/* Lookup in sintab (taken from Rockbox source code) */
                    
95inline float u8sin(unsigned char v)
                    
96{
                    
115/* interpolate from sintab */
                    
116inline float u8sinf(float v)
                    
117{
                    
124
                    
125inline float u8cosf(float v)
                    
126{
                    
                
Attraction.h https://github.com/bloomtime/CinderTraer.git | C Header | 51 lines
                    
15	Particle* b;
                    
16	float k;
                    
17	bool on;
                    
17	bool on;
                    
18	float distanceMin;
                    
19	float distanceMinSquared;
                    
20	
                    
21	Attraction( Particle* a, Particle* b, float k, float distanceMin );
                    
22
                    
22
                    
23	float getMinimumDistance();
                    
24
                    
46    // http://en.wikipedia.org/wiki/Fast_inverse_square_root
                    
47    float Q_rsqrt( float number );
                    
48    
                    
                
q_math.c https://github.com/Racenet/racesow.git | C | 1209 lines
                    
366
                    
367float Q_RSqrt( float number )
                    
368{
                    
395//===============
                    
396float LerpAngle( float a2, float a1, const float frac )
                    
397{
                    
467//=================
                    
468float AngleDelta( float angle1, float angle2 )
                    
469{
                    
484//====================
                    
485float CalcFov( float fov_x, float width, float height )
                    
486{
                    
499//====================
                    
500void AdjustFov( float *fov_x, float *fov_y, float width, float height, qboolean lock_x )
                    
501{
                    
                
Attraction.cpp https://github.com/bloomtime/CinderTraer.git | C++ | 119 lines
                    
8	
                    
9    Attraction::Attraction( Particle* _a, Particle* _b, float _k, float _distanceMin )
                    
10	{
                    
39
                    
40	void Attraction::setStrength( float _k )
                    
41	{
                    
60
                    
61			float a2bDistanceSquared = a2b.lengthSquared();
                    
62
                    
75            
                    
76            a2b *= Q_rsqrt(a2bDistanceSquared) * force;
                    
77
                    
101
                    
102    float Attraction::Q_rsqrt( float number )
                    
103    {
                    
                
trickmath.h https://github.com/AlbertVeli/Carnival.git | C Header | 72 lines
                    
47 */
                    
48#define SQRTFAST(x) ((x) * Q_rsqrt(x))
                    
49
                    
55
                    
56float Q_rsqrt(float number);
                    
57inline float u8sin(unsigned char v);
                    
58inline float u8cos(unsigned char v);
                    
59inline float u8sinf(float v);
                    
60inline float u8cosf(float v);
                    
                
volk_32f_invsqrt_32f.h https://github.com/trondeau/gnuradio-old.git | C Header | 143 lines
                    
8
                    
9static inline float Q_rsqrt( float number )
                    
10{
                    
34*/
                    
35static inline void volk_32f_invsqrt_32f_a_avx(float* cVector, const float* aVector, unsigned int num_points){
                    
36    unsigned int number = 0;
                    
65*/
                    
66static inline void volk_32f_invsqrt_32f_a_sse(float* cVector, const float* aVector, unsigned int num_points){
                    
67    unsigned int number = 0;
                    
99*/
                    
100static inline void volk_32f_invsqrt_32f_generic(float* cVector, const float* aVector, unsigned int num_points){
                    
101    float* cPtr = cVector;
                    
117*/
                    
118static inline void volk_32f_invsqrt_32f_u_avx(float* cVector, const float* aVector, unsigned int num_points){
                    
119    unsigned int number = 0;
                    
                
volk_32f_invsqrt_32f.h https://github.com/balister/GNU-Radio.git | C Header | 77 lines
                    
7
                    
8static inline float Q_rsqrt( float number )
                    
9{
                    
15        y  = number;
                    
16        i  = * ( long * ) &y;                       // evil floating point bit level hacking
                    
17        i  = 0x5f3759df - ( i >> 1 );               // what the fuck?
                    
17        i  = 0x5f3759df - ( i >> 1 );               // what the fuck?
                    
18        y  = * ( float * ) &i;
                    
19        y  = y * ( threehalfs - ( x2 * y * y ) );   // 1st iteration
                    
32*/
                    
33static inline void volk_32f_invsqrt_32f_a_sse(float* cVector, const float* aVector, unsigned int num_points){
                    
34    unsigned int number = 0;
                    
66*/
                    
67static inline void volk_32f_invsqrt_32f_generic(float* cVector, const float* aVector, unsigned int num_points){
                    
68    float* cPtr = cVector;
                    
                
q_math.h https://github.com/Racenet/racesow.git | C Header | 279 lines
                    
133
                    
134float	Q_RSqrt( float number );
                    
135int	Q_log2( int val );
                    
202float anglemod( float a );
                    
203float LerpAngle( float a1, float a2, const float frac );
                    
204float AngleSubtract( float a1, float a2 );
                    
205void AnglesSubtract( vec3_t v1, vec3_t v2, vec3_t v3 );
                    
206float AngleNormalize360( float angle );
                    
207float AngleNormalize180( float angle );
                    
207float AngleNormalize180( float angle );
                    
208float AngleDelta( float angle1, float angle2 );
                    
209void VecToAngles( const vec3_t vec, vec3_t angles );
                    
216float CalcFov( float fov_x, float width, float height );
                    
217void AdjustFov( float *fov_x, float *fov_y, float width, float height, qboolean lock_x );
                    
218
                    
                
main.cpp https://bitbucket.org/rayburgemeestre/sqrtvis | C++ | 221 lines
                    
53double walsh_invsqrt(double in) { return 1.0 / walsh::invSqrt(in); }
                    
54double carmack_q_rsqrt(double in) { return 1.0 / carmack::Q_rsqrt(in); }
                    
55double carmack_q_frsqrt(double in) { return 1.0 / carmack::Q_frsqrt(in); }
                    
85		funcs["walsh::invSqrt"] = walsh_invsqrt;
                    
86		funcs["carmack::Q_rsqrt"] = carmack_q_rsqrt;
                    
87		funcs["carmack::Q_frsqrt"] = carmack_q_frsqrt;
                    
110
                    
111	const int centerX = static_cast<int>(static_cast<float>(width) / 2.0 + 0.5);
                    
112	const int centerY = static_cast<int>(static_cast<float>(sliceHeight) / 2.0 + 0.5);
                    
                
q_math.c https://github.com/xzero450/revolution.git | C | 1477 lines
                    
317
                    
318float	Q_random( int *seed ) {
                    
319	return ( Q_rand( seed ) & 0xffff ) / (float)0x10000;
                    
321
                    
322float	Q_crandom( int *seed ) {
                    
323	return 2.0 * ( Q_random( seed ) - 0.5 );
                    
360{
                    
361	float ilength;
                    
362
                    
362
                    
363	ilength = Q_rsqrt( DotProduct( v, v ) );
                    
364
                    
408	int		i, best;
                    
409	float	d, bestd;
                    
410
                    
                
Neo-Library-Mathmatics.ads https://github.com/AdaDoom3/AdaDoom3.git | Ada | 205 lines
                    
149  static int          Abs( int x );       -- returns the absolute value of the integer value (for reference only)
                    
150  static float        Fabs( float f );      -- returns the absolute value of the floating point value
                    
151  static float        Floor( float f );     -- returns the largest integer that is less than or equal to the given value
                    
155  static int          Ftoi( float f );      -- float to int conversion
                    
156  static char         Ftoi8( float f );     -- float to char conversion
                    
157  static short        Ftoi16( float f );      -- float to short conversion
                    
162  static int          ClampInt( int min, int max, int value );
                    
163  static float        ClampFloat( float min, float max, float value );
                    
164  static float        AngleNormalize360( float angle );
                    
165  static float        AngleNormalize180( float angle );
                    
166  static float        AngleDelta( float angle1, float angle2 );
                    
167  static int          FloatToBits( float f, int exponentBits, int mantissaBits );
                    
169  static int          FloatHash( const float *array, const int numFloats );
                    
170  static float        LerpToWithScale( const float cur, const float dest, const float scale );
                    
171-------
                    
                
Vector3d.h https://github.com/KonstantinChizhov/Mcucpp.git | C Header | 215 lines
                    
99
                    
100		inline Vec3d RotateX(float a)
                    
101		{
                    
101		{
                    
102			float ca=cos(a), sa=sin(a);
                    
103			float zn=z*ca+y*sa;
                    
103			float zn=z*ca+y*sa;
                    
104			float yn=y*ca-z*sa;
                    
105			return Vec3d(x, yn, zn);
                    
107
                    
108		inline Vec3d RotateY(float a)
                    
109		{
                    
109		{
                    
110			float ca=cos(a), sa=sin(a);
                    
111			float xn=x*ca+z*sa;
                    
                
fisr.c https://github.com/mwhooker/syntax.git | C | 18 lines
                    
2
                    
3float Q_rsqrt( float number )
                    
4{
                    
5	long i;
                    
6	float x2, y;
                    
7	const float threehalfs = 1.5F;
                    
10	y  = number;
                    
11	i  = * ( long * ) &y;                       // evil floating point bit level hacking
                    
12	i  = 0x5f3759df - ( i >> 1 );               // what the fuck? 
                    
12	i  = 0x5f3759df - ( i >> 1 );               // what the fuck? 
                    
13	y  = * ( float * ) &i;
                    
14	y  = y * ( threehalfs - ( x2 * y * y ) );   // 1st iteration
                    
                
 

Source

Language