This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--see https://raw.github.com/FloooD/C_lag_comp/master/llc.lua for latest version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(void) | |
{ | |
FILE *pw = fopen("usgn_pw.dat", "rb"); | |
if (pw == NULL) { | |
printf("Put me in the same folder as usgn_pw.dat!\n\nPress enter to exit..."); | |
getchar(); | |
return 1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---------------------------------------------------------------- | |
--LUA Lag Compensation + wallbanging by FlooD------------------- | |
---------------------------------------------------------------- | |
--thx to Jermuk for his custom server, which first encouraged--- | |
-- me to make lag compensation.------------------------------ | |
--thx to lasthope and def3ct for initial testing.--------------- | |
--thx to 3rr0r for ideas and suggestions for refining the code.- | |
---------------------------------------------------------------- | |
--visit cs2d.nl/index.php?mod=board&action=thread&where=120 for- | |
-- the lastest version and information----------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inline int line_square_collision(float ex, float ey, float sqx, float sqy, float sqhlen, float *ox, float *oy) | |
{ | |
if (!ox) {float x; ox = &x;} | |
if (!oy) {float y; oy = &y;} | |
int cx = (fabsf(sqx) <= sqhlen); | |
int cy = (fabsf(sqy) <= sqhlen); | |
if (cx && cy) { | |
if (fabsf(ex - sqx) <= sqhlen && fabsf(ey - sqy) <= sqhlen) { | |
*ox = ex; *oy = ey; | |
return 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int line_seg_circ_polar(float er, float etheta, float cr, float ctheta, float cradius) | |
{ | |
if (cradius >= cr) return 1; | |
if (fabsf(etheta - ctheta) > asinf(cradius / cr)) return 0; | |
if (er * er < cr * cr - cradius * cradius && er * er + cr * cr - 2 * er * cr * cosf(etheta - ctheta) > cradius * cradius) return 0; | |
return 1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> means client to server | |
< means server to client | |
pa | |
ck | |
et | |
id | |
\/ | |
>02:00:03:3e:6b:fc:00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function m_pow(matrix, n) | |
local tr = matrix[1][1]+matrix[2][2] -- trace of matrix | |
local s = math.sqrt((matrix[1][1]-matrix[2][2])^2+4*matrix[1][2]*matrix[2][1]) -- sqrt(tr^2 - 4*determinant) | |
local r1 = 0.5*(tr+s) --1st eigenvalue | |
local r2 = tr-r1 --2nd eigenvalue | |
local r1n = r1^n | |
local r2n = r2^n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function matrixpower(m, n) | |
local d = #m | |
local temp = {} | |
local mm = {} | |
for i = 1, d do | |
temp[i] = {} | |
mm[i] = {} | |
for j = 1, d do | |
mm[i][j] = m[i][j] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---------------------------------------------------------------- | |
--LUA Lag Compensation version 1.0.1 + LaserMod by FlooD-------- | |
---------------------------------------------------------------- | |
--thx to Jermuk for his custom server, which first encouraged--- | |
-- me to make lag compensation.------------------------------ | |
--thx to lasthope and def3ct for initial testing.--------------- | |
--thx to 3rr0r for ideas and suggestions for refining the code.- | |
---------------------------------------------------------------- | |
--visit cs2d.nl/index.php?mod=board&action=thread&where=120 for- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---------------------------------------------------------------- | |
--LUA Lag Compensation version 1.0.1 + snowball by FlooD-------- | |
---------------------------------------------------------------- | |
--thx to Jermuk for his custom server, which first encouraged--- | |
-- me to make lag compensation.------------------------------ | |
--thx to lasthope and def3ct for initial testing.--------------- | |
--thx to 3rr0r for ideas and suggestions for refining the code.- | |
---------------------------------------------------------------- | |
--visit cs2d.nl/index.php?mod=board&action=thread&where=120 for- | |
-- the lastest version and information----------------------- |
OlderNewer