View Single Post
Re: BSP file: a couple of question linked to geometry
Old
  (#29)
Immortal_BLG
Member
 
Status: Offline
Posts: 171
Join Date: Nov 2007
Location: Russian Federation
Default Re: BSP file: a couple of question linked to geometry - 23-08-2010

Quote:
google for"Minkowski sum bsp"
I have found your site in search results (the fourth under the account) - so, I am bad with it have familiarized, since knew about it long before have learned about Minkowski

Quote:
Is that right?
Yes - that's what I want

Thanks for the detailed response!

Code:
		//add the offset non-axial plane to the expanded hull
        VectorCopy(current_plane->origin, origin);
        VectorCopy(current_plane->normal, normal);

		//old code multiplied offset by normal -- this led to post-csg "sticky" walls where a
		//slope met an axial plane from the next brush since the offset from the slope would be less
		//than the full offset for the axial plane -- the discontinuity also contributes to increased
		//clipnodes.  If the normal is zero along an axis, shifting the origin in that direction won't
		//change the plane number, so I don't explicitly test that case.  The old method is still used if
		//preciseclip is turned off to allow backward compatability -- some of the improperly beveled edges
		//grow using the new origins, and might cause additional problems.

		if((g_texinfo[current_face->texinfo].flags & TEX_BEVEL))
		{
			//don't adjust origin - we'll correct g_texinfo's flags in a later step
		}
		else if(g_cliptype == clip_legacy || (g_cliptype == clip_precise && (normal[2] > FLOOR_Z)) || g_cliptype == clip_normalized)
		{
			if(normal[0])
			{ origin[0] += normal[0] * (normal[0] > 0 ? g_hull_size[hullnum][1][0] : -g_hull_size[hullnum][0][0]); }
			if(normal[1])
			{ origin[1] += normal[1] * (normal[1] > 0 ? g_hull_size[hullnum][1][1] : -g_hull_size[hullnum][0][1]); }
			if(normal[2])
			{ origin[2] += normal[2] * (normal[2] > 0 ? g_hull_size[hullnum][1][2] : -g_hull_size[hullnum][0][2]); }
		}
		else
		{
			origin[0] += g_hull_size[hullnum][(normal[0] > 0 ? 1 : 0)][0];
			origin[1] += g_hull_size[hullnum][(normal[1] > 0 ? 1 : 0)][1];
			origin[2] += g_hull_size[hullnum][(normal[2] > 0 ? 1 : 0)][2];
		}

		AddHullPlane(hull,normal,origin,false);
- From zhlt hlcsg brush.cpp ExpandBrush() function.

Maybe is possible to find 'origin'(also known as point0 for computation hull plane normal) from code above by some equation - if possible?

Last edited by Immortal_BLG; 23-08-2010 at 04:06..
  
Reply With Quote