I guess it's a flat 3do.
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
This is the static archive of the Massassi Forums. The forums are
closed indefinitely. Thanks for all the memories!
You can also download
Super Old Archived Message Boards
from when Massassi first started.
"View" counts are as of the day the forums were archived, and will no longer increase.
# Jedi Knight cog script to counter the ugly z-fighting for things close to walls # Created by zagibu@gmx.ch flags=0x240 symbols thing player local thing decor0=-1 thing decor1=-1 thing decor2=-1 thing decor3=-1 thing decor4=-1 thing decor5=-1 thing decor6=-1 thing decor7=-1 thing decor8=-1 thing decor9=-1 vector player_relative local float min_angle=0.1 desc=Minimum dot product result between player and object that triggers offset of object float distance=0.05 desc=Offset from wall (in JKU's) that prevents Z-fighting float cur_dist0=0 local float cur_dist1=0 local float cur_dist2=0 local float cur_dist3=0 local float cur_dist4=0 local float cur_dist5=0 local float cur_dist6=0 local float cur_dist7=0 local float cur_dist8=0 local float cur_dist9=0 local float curr_angle local int i local message startup message pulse end code startup: Sleep(1); player = GetLocalPlayerThing(); SetPulse(0.5); Return; pulse: // Check all decor objects for(i = 0; i < 10; i = i + 1) { object = decor0; // Handle only valid objects if(object != -1) { object_pos = GetThingPos(object); object_look = GetThingLVec(object); player_relative = VectorNorm(VectorSub(GetThingPos(player), object_pos)); curr_angle = VectorDot(object_look, player_relative); // Check player's angle to current object (dot product) if(curr_angle > min_angle * 2) { // Player is in front of object if(cur_dist0 == 0) { SetThingPos(object, VectorAdd(object_pos, VectorScale(object_look, distance))); cur_dist0 = 1; } } else if(curr_angle < min_angle) { // Player is at side of object if(cur_dist0 == 1) { SetThingPos(object, VectorSub(object_pos, VectorScale(object_look, distance))); cur_dist0 = 0; } } } } Return; end