llvolume.cpp File Reference

#include "linden_common.h"
#include "llmath.h"
#include <set>
#include "llerror.h"
#include "llmemtype.h"
#include "llvolumemgr.h"
#include "v2math.h"
#include "v3math.h"
#include "v4math.h"
#include "m4math.h"
#include "m3math.h"
#include "lldarray.h"
#include "llvolume.h"
#include "llstl.h"

Include dependency graph for llvolume.cpp:

Go to the source code of this file.

Classes

class  LLVertexIndexPair
struct  lessVertex
struct  lessTriangle

Defines

#define DEBUG_SILHOUETTE_BINORMALS   0
#define DEBUG_SILHOUETTE_NORMALS   0
#define DEBUG_SILHOUETTE_EDGE_MAP   0

Functions

BOOL check_same_clock_dir (const LLVector3 &pt1, const LLVector3 &pt2, const LLVector3 &pt3, const LLVector3 &norm)
BOOL LLTriangleLineSegmentIntersect (const LLVector3 &pt1, const LLVector3 &pt2, const LLVector3 &pt3, LLVector3 &linept, const LLVector3 &vect)
S32 sculpt_sides (F32 detail)
LLVector3 sculpt_rgb_to_vector (U8 r, U8 g, U8 b)
U32 sculpt_xy_to_index (U32 x, U32 y, U16 sculpt_width, U16 sculpt_height, S8 sculpt_components)
U32 sculpt_st_to_index (S32 s, S32 t, S32 size_s, S32 size_t, U16 sculpt_width, U16 sculpt_height, S8 sculpt_components)
LLVector3 sculpt_index_to_vector (U32 index, const U8 *sculpt_data)
LLVector3 sculpt_st_to_vector (S32 s, S32 t, S32 size_s, S32 size_t, U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8 *sculpt_data)
LLVector3 sculpt_xy_to_vector (U32 x, U32 y, U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8 *sculpt_data)
bool approx_zero (F32 f, F32 tolerance=APPROXIMATELY_ZERO)
static bool limit_range (F32 &v, F32 min, F32 max, F32 tolerance=APPROXIMATELY_ZERO)
BOOL equalTriangle (const S32 *a, const S32 *b)
std::ostream & operator<< (std::ostream &s, const LLProfileParams &profile_params)
std::ostream & operator<< (std::ostream &s, const LLPathParams &path_params)
std::ostream & operator<< (std::ostream &s, const LLVolumeParams &volume_params)
std::ostream & operator<< (std::ostream &s, const LLProfile &profile)
std::ostream & operator<< (std::ostream &s, const LLPath &path)
std::ostream & operator<< (std::ostream &s, const LLVolume &volume)
std::ostream & operator<< (std::ostream &s, const LLVolume *volumep)
void LerpPlanarVertex (LLVolumeFace::VertexData &v0, LLVolumeFace::VertexData &v1, LLVolumeFace::VertexData &v2, LLVolumeFace::VertexData &vout, F32 coef01, F32 coef02)
LLVector3 calc_binormal_from_triangle (const LLVector3 &pos0, const LLVector2 &tex0, const LLVector3 &pos1, const LLVector2 &tex1, const LLVector3 &pos2, const LLVector2 &tex2)

Variables

const F32 CUT_MIN = 0.f
const F32 CUT_MAX = 1.f
const F32 MIN_CUT_DELTA = 0.02f
const F32 HOLLOW_MIN = 0.f
const F32 HOLLOW_MAX = 0.95f
const F32 HOLLOW_MAX_SQUARE = 0.7f
const F32 TWIST_MIN = -1.f
const F32 TWIST_MAX = 1.f
const F32 RATIO_MIN = 0.f
const F32 RATIO_MAX = 2.f
const F32 HOLE_X_MIN = 0.05f
const F32 HOLE_X_MAX = 1.0f
const F32 HOLE_Y_MIN = 0.05f
const F32 HOLE_Y_MAX = 0.5f
const F32 SHEAR_MIN = -0.5f
const F32 SHEAR_MAX = 0.5f
const F32 REV_MIN = 1.f
const F32 REV_MAX = 4.f
const F32 TAPER_MIN = -1.f
const F32 TAPER_MAX = 1.f
const F32 SKEW_MIN = -0.95f
const F32 SKEW_MAX = 0.95f
const S32 SCULPT_REZ_1 = 6
const S32 SCULPT_REZ_2 = 8
const S32 SCULPT_REZ_3 = 16
const S32 SCULPT_REZ_4 = 32
const F32 SCULPT_MIN_AREA = 0.002f
const F32 APPROXIMATELY_ZERO = 0.001f
const F32 VERTEX_SLOP = 0.00001f
const F32 VERTEX_SLOP_SQRD = VERTEX_SLOP * VERTEX_SLOP
const F32 MIN_CONCAVE_PROFILE_WEDGE = 0.125f
const F32 MIN_CONCAVE_PATH_WEDGE = 0.111111f


Detailed Description

LicenseInfo
firstyear=2002&license=viewergpl

Copyright (c) 2002-2008, Linden Research, Inc.

Second Life Viewer Source Code The source code in this file ("Source Code") is provided by Linden Lab to you under the terms of the GNU General Public License, version 2.0 ("GPL"), unless you have obtained a separate licensing agreement ("Other License"), formally executed by you and Linden Lab. Terms of the GPL can be found in doc/GPL-license.txt in this distribution, or online at http://secondlifegrid.net/programs/open_source/licensing/gplv2

There are special exceptions to the terms and conditions of the GPL as it is applied to this Source Code. View the full text of the exception in the file doc/FLOSS-exception.txt in this software distribution, or online at http://secondlifegrid.net/programs/open_source/licensing/flossexception

By copying, modifying or distributing this software, you acknowledge that you have read and understood your obligations described above, and agree to abide by those obligations.

ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, COMPLETENESS OR PERFORMANCE. $/LicenseInfo$

Definition in file llvolume.cpp.


Define Documentation

#define DEBUG_SILHOUETTE_BINORMALS   0

Definition at line 49 of file llvolume.cpp.

#define DEBUG_SILHOUETTE_EDGE_MAP   0

Definition at line 51 of file llvolume.cpp.

#define DEBUG_SILHOUETTE_NORMALS   0

Definition at line 50 of file llvolume.cpp.


Function Documentation

bool approx_zero ( F32  f,
F32  tolerance = APPROXIMATELY_ZERO 
)

Definition at line 2170 of file llvolume.cpp.

Referenced by limit_range(), LLVolumeParams::setRadiusOffset(), and LLVolumeParams::setSkew().

Here is the caller graph for this function:

LLVector3 calc_binormal_from_triangle ( const LLVector3 pos0,
const LLVector2 tex0,
const LLVector3 pos1,
const LLVector2 tex1,
const LLVector3 pos2,
const LLVector2 tex2 
)

Definition at line 5119 of file llvolume.cpp.

References LLVector2::mV, LLVector3::mV, r1, r2, VX, VY, and VZ.

Referenced by LLVolumeFace::createBinormals(), LLVolumeFace::createCap(), and LLVolumeFace::createUnCutCubeCap().

Here is the caller graph for this function:

BOOL check_same_clock_dir ( const LLVector3 pt1,
const LLVector3 pt2,
const LLVector3 pt3,
const LLVector3 norm 
)

Definition at line 92 of file llvolume.cpp.

References FALSE, and TRUE.

Referenced by LLTriangleLineSegmentIntersect().

Here is the caller graph for this function:

BOOL equalTriangle ( const S32 a,
const S32 b 
)

Definition at line 3541 of file llvolume.cpp.

References FALSE, and TRUE.

Referenced by LLVolume::cleanupTriangleData().

Here is the caller graph for this function:

void LerpPlanarVertex ( LLVolumeFace::VertexData v0,
LLVolumeFace::VertexData v1,
LLVolumeFace::VertexData v2,
LLVolumeFace::VertexData vout,
F32  coef01,
F32  coef02 
)

static bool limit_range ( F32 v,
F32  min,
F32  max,
F32  tolerance = APPROXIMATELY_ZERO 
) [static]

BOOL LLTriangleLineSegmentIntersect ( const LLVector3 pt1,
const LLVector3 pt2,
const LLVector3 pt3,
LLVector3 linept,
const LLVector3 vect 
)

Definition at line 109 of file llvolume.cpp.

References check_same_clock_dir(), FALSE, LLVector3::setVec(), and TRUE.

Referenced by LLVolume::lineSegmentIntersect().

Here is the call graph for this function:

Here is the caller graph for this function:

std::ostream& operator<< ( std::ostream &  s,
const LLVolume volumep 
)

Definition at line 4174 of file llvolume.cpp.

References LLVolume::getParams(), LLVolume::mPathp, and LLVolume::mProfilep.

Here is the call graph for this function:

std::ostream& operator<< ( std::ostream &  s,
const LLVolume volume 
)

Definition at line 4164 of file llvolume.cpp.

References LLVolume::getParams(), LLVolume::mPathp, and LLVolume::mProfilep.

Here is the call graph for this function:

std::ostream& operator<< ( std::ostream &  s,
const LLPath path 
)

Definition at line 4154 of file llvolume.cpp.

References LLPath::mDirty, LLPath::mOpen, LLPath::mStep, and LLPath::mTotal.

std::ostream& operator<< ( std::ostream &  s,
const LLProfile profile 
)

std::ostream& operator<< ( std::ostream &  s,
const LLVolumeParams volume_params 
)

Definition at line 4134 of file llvolume.cpp.

References LLVolumeParams::mPathParams, and LLVolumeParams::mProfileParams.

std::ostream& operator<< ( std::ostream &  s,
const LLPathParams path_params 
)

std::ostream& operator<< ( std::ostream &  s,
const LLProfileParams profile_params 
)

LLVector3 sculpt_index_to_vector ( U32  index,
const U8 sculpt_data 
) [inline]

Definition at line 1890 of file llvolume.cpp.

References sculpt_rgb_to_vector().

Referenced by sculpt_st_to_vector(), and sculpt_xy_to_vector().

Here is the call graph for this function:

Here is the caller graph for this function:

LLVector3 sculpt_rgb_to_vector ( U8  r,
U8  g,
U8  b 
) [inline]

Definition at line 1863 of file llvolume.cpp.

References LLVector3::mV, VX, VY, and VZ.

Referenced by sculpt_index_to_vector().

Here is the caller graph for this function:

S32 sculpt_sides ( F32  detail  ) 

Definition at line 475 of file llvolume.cpp.

References SCULPT_REZ_1, SCULPT_REZ_2, SCULPT_REZ_3, and SCULPT_REZ_4.

Referenced by LLPath::generate(), and LLProfile::generate().

Here is the caller graph for this function:

U32 sculpt_st_to_index ( S32  s,
S32  t,
S32  size_s,
S32  size_t,
U16  sculpt_width,
U16  sculpt_height,
S8  sculpt_components 
) [inline]

Definition at line 1881 of file llvolume.cpp.

References sculpt_xy_to_index().

Referenced by sculpt_st_to_vector().

Here is the call graph for this function:

Here is the caller graph for this function:

LLVector3 sculpt_st_to_vector ( S32  s,
S32  t,
S32  size_s,
S32  size_t,
U16  sculpt_width,
U16  sculpt_height,
S8  sculpt_components,
const U8 sculpt_data 
) [inline]

Definition at line 1897 of file llvolume.cpp.

References sculpt_index_to_vector(), and sculpt_st_to_index().

Referenced by LLVolume::sculptGetSurfaceArea().

Here is the call graph for this function:

Here is the caller graph for this function:

U32 sculpt_xy_to_index ( U32  x,
U32  y,
U16  sculpt_width,
U16  sculpt_height,
S8  sculpt_components 
) [inline]

Definition at line 1874 of file llvolume.cpp.

Referenced by sculpt_st_to_index(), and sculpt_xy_to_vector().

Here is the caller graph for this function:

LLVector3 sculpt_xy_to_vector ( U32  x,
U32  y,
U16  sculpt_width,
U16  sculpt_height,
S8  sculpt_components,
const U8 sculpt_data 
) [inline]

Definition at line 1904 of file llvolume.cpp.

References sculpt_index_to_vector(), and sculpt_xy_to_index().

Referenced by LLVolume::sculptGenerateMapVertices().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

const F32 APPROXIMATELY_ZERO = 0.001f

Definition at line 2169 of file llvolume.cpp.

const F32 CUT_MAX = 1.f

Definition at line 54 of file llvolume.cpp.

const F32 CUT_MIN = 0.f

Definition at line 53 of file llvolume.cpp.

const F32 HOLE_X_MAX = 1.0f

Definition at line 68 of file llvolume.cpp.

Referenced by LLVolumeParams::setRatio().

const F32 HOLE_X_MIN = 0.05f

Definition at line 67 of file llvolume.cpp.

Referenced by LLVolumeParams::setRatio().

const F32 HOLE_Y_MAX = 0.5f

Definition at line 71 of file llvolume.cpp.

Referenced by LLVolumeParams::setRatio().

const F32 HOLE_Y_MIN = 0.05f

Definition at line 70 of file llvolume.cpp.

Referenced by LLVolumeParams::setRatio().

const F32 HOLLOW_MAX = 0.95f

Definition at line 58 of file llvolume.cpp.

Referenced by LLVolumeParams::setHollow().

const F32 HOLLOW_MAX_SQUARE = 0.7f

Definition at line 59 of file llvolume.cpp.

Referenced by LLVolumeParams::setHollow().

const F32 HOLLOW_MIN = 0.f

Definition at line 57 of file llvolume.cpp.

Referenced by LLVolumeParams::setHollow().

const F32 MIN_CONCAVE_PATH_WEDGE = 0.111111f

Definition at line 3937 of file llvolume.cpp.

Referenced by LLVolumeParams::isConvex().

Definition at line 3936 of file llvolume.cpp.

Referenced by LLVolumeParams::isConvex().

const F32 MIN_CUT_DELTA = 0.02f

const F32 RATIO_MAX = 2.f

Definition at line 65 of file llvolume.cpp.

Referenced by LLVolumeParams::setRatio().

const F32 RATIO_MIN = 0.f

Definition at line 64 of file llvolume.cpp.

Referenced by LLVolumeParams::setRatio().

const F32 REV_MAX = 4.f

Definition at line 77 of file llvolume.cpp.

Referenced by LLVolumeParams::setRevolutions().

const F32 REV_MIN = 1.f

Definition at line 76 of file llvolume.cpp.

Referenced by LLVolumeParams::setRevolutions().

const F32 SCULPT_MIN_AREA = 0.002f

Definition at line 90 of file llvolume.cpp.

Referenced by LLVolume::sculpt().

const S32 SCULPT_REZ_1 = 6

Definition at line 85 of file llvolume.cpp.

Referenced by sculpt_sides().

const S32 SCULPT_REZ_2 = 8

Definition at line 86 of file llvolume.cpp.

Referenced by sculpt_sides().

const S32 SCULPT_REZ_3 = 16

Definition at line 87 of file llvolume.cpp.

Referenced by sculpt_sides().

const S32 SCULPT_REZ_4 = 32

Definition at line 88 of file llvolume.cpp.

Referenced by sculpt_sides().

const F32 SHEAR_MAX = 0.5f

Definition at line 74 of file llvolume.cpp.

Referenced by LLVolumeParams::setShear().

const F32 SHEAR_MIN = -0.5f

Definition at line 73 of file llvolume.cpp.

Referenced by LLVolumeParams::setShear().

const F32 SKEW_MAX = 0.95f

Definition at line 83 of file llvolume.cpp.

Referenced by LLVolumeParams::setSkew().

const F32 SKEW_MIN = -0.95f

Definition at line 82 of file llvolume.cpp.

Referenced by LLVolumeParams::setSkew().

const F32 TAPER_MAX = 1.f

Definition at line 80 of file llvolume.cpp.

Referenced by LLVolumeParams::setTaperX(), and LLVolumeParams::setTaperY().

const F32 TAPER_MIN = -1.f

Definition at line 79 of file llvolume.cpp.

Referenced by LLVolumeParams::setTaperX(), and LLVolumeParams::setTaperY().

const F32 TWIST_MAX = 1.f

Definition at line 62 of file llvolume.cpp.

Referenced by LLVolumeParams::setTwistBegin(), and LLVolumeParams::setTwistEnd().

const F32 TWIST_MIN = -1.f

Definition at line 61 of file llvolume.cpp.

Referenced by LLVolumeParams::setTwistBegin(), and LLVolumeParams::setTwistEnd().

const F32 VERTEX_SLOP = 0.00001f

Definition at line 3466 of file llvolume.cpp.

Referenced by lessVertex::operator()().

Definition at line 3467 of file llvolume.cpp.

Referenced by LLVolume::cleanupTriangleData().


Generated on Fri May 16 08:35:14 2008 for SecondLife by  doxygen 1.5.5