separated X and Y radius for clip entities
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@3189 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -30,9 +30,9 @@ void renderent(entity &e)
|
||||
|
||||
void renderclip(entity &e)
|
||||
{
|
||||
float radius = max(float(e.attr2), 0.1f);
|
||||
vec bbmin(e.x - radius, e.y - radius, float(S(e.x, e.y)->floor+e.attr1)),
|
||||
bbmax(e.x + radius, e.y + radius, bbmin.z + max(float(e.attr3), 1.0f));
|
||||
float xradius = max(float(e.attr2), 0.1f), yradius = max(float(e.attr3), 0.1f);
|
||||
vec bbmin(e.x - xradius, e.y - yradius, float(S(e.x, e.y)->floor+e.attr1)),
|
||||
bbmax(e.x + xradius, e.y + yradius, bbmin.z + max(float(e.attr4), 0.1f));
|
||||
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
linestyle(1, 0xFF, 0xFF, 0);
|
||||
|
||||
@@ -116,10 +116,9 @@ bool mmcollide(physent *d, float &hi, float &lo) // collide with a map
|
||||
entity &e = ents[i];
|
||||
if(e.type==CLIP)
|
||||
{
|
||||
const float r = e.attr2 + d->radius;
|
||||
if(fabs(e.x-d->o.x)<r && fabs(e.y-d->o.y)<r)
|
||||
if(fabs(e.x-d->o.x) < e.attr2 + d->radius && fabs(e.y-d->o.y) < e.attr3 + d->radius)
|
||||
{
|
||||
const float cz = float(S(e.x, e.y)->floor+e.attr1), ch = max(float(e.attr3), 1.0f);
|
||||
const float cz = float(S(e.x, e.y)->floor+e.attr1), ch = float(e.attr4);
|
||||
const float dz = d->o.z-d->eyeheight;
|
||||
if(dz<cz) { if(cz<hi) hi = cz; }
|
||||
else if(cz+ch>lo) lo = cz+ch;
|
||||
|
||||
@@ -213,11 +213,6 @@ entity *newentity(int index, int x, int y, int z, char *what, int v1, int v2, in
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case CLIP:
|
||||
if(v2<0) e.attr2 = 0;
|
||||
if(v3<=0) e.attr3 = 1;
|
||||
break;
|
||||
|
||||
case LIGHT:
|
||||
if(v1>64) e.attr1 = 64;
|
||||
if(!v1) e.attr1 = 16;
|
||||
|
||||
Reference in New Issue
Block a user