llvolume.cpp File Reference

#include "linden_common.h"
#include "llmath.h"
#include <set>
#include "llerror.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
#define MAX_INDEX   10000

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)
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.005f
const F32 APPROXIMATELY_ZERO = 0.001f
const F32 VERTEX_SLOP = 0.00001f
const F32 VERTEX_SLOP_SQRD = VERTEX_SLOP * VERTEX_SLOP


Detailed Description

LicenseInfo
firstyear=2002&license=viewergpl

Copyright (c) 2002-2007, 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://secondlife.com/developers/opensource/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://secondlife.com/developers/opensource/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 48 of file llvolume.cpp.

#define DEBUG_SILHOUETTE_EDGE_MAP   0

Definition at line 50 of file llvolume.cpp.

#define DEBUG_SILHOUETTE_NORMALS   0

Definition at line 49 of file llvolume.cpp.

#define MAX_INDEX   10000

Definition at line 2431 of file llvolume.cpp.

Referenced by LLVolume::getTriangleIndices().


Function Documentation

bool approx_zero ( F32  f,
F32  tolerance = APPROXIMATELY_ZERO 
)

Definition at line 2070 of file llvolume.cpp.

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

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 4904 of file llvolume.cpp.

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

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

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

Definition at line 91 of file llvolume.cpp.

References FALSE, and TRUE.

Referenced by LLTriangleLineSegmentIntersect().

BOOL equalTriangle ( const S32 a,
const S32 b 
)

Definition at line 3402 of file llvolume.cpp.

References FALSE, and TRUE.

Referenced by LLVolume::cleanupTriangleData().

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

Definition at line 3994 of file llvolume.cpp.

References LLVolumeFace::VertexData::mBinormal, LLVolumeFace::VertexData::mNormal, LLVolumeFace::VertexData::mPosition, LLVolumeFace::VertexData::mTexCoord, v1, and v2.

Referenced by LLVolumeFace::createUnCutCubeCap().

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

Definition at line 2076 of file llvolume.cpp.

References approx_zero(), and f.

Referenced by LLVolumeParams::setBeginAndEndS(), LLVolumeParams::setBeginAndEndT(), LLVolumeParams::setHollow(), LLVolumeParams::setRatio(), LLVolumeParams::setRevolutions(), LLVolumeParams::setShear(), LLVolumeParams::setTaperX(), LLVolumeParams::setTaperY(), LLVolumeParams::setTwistBegin(), and LLVolumeParams::setTwistEnd().

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

Definition at line 108 of file llvolume.cpp.

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

Referenced by LLVolume::lineSegmentIntersect().

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

Definition at line 3956 of file llvolume.cpp.

References LLVolume::mParams, LLVolume::mPathp, and LLVolume::mProfilep.

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

Definition at line 3946 of file llvolume.cpp.

References LLVolume::mParams, LLVolume::mPathp, and LLVolume::mProfilep.

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

Definition at line 3936 of file llvolume.cpp.

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

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

Definition at line 3925 of file llvolume.cpp.

References LLProfile::mDirty, LLProfile::mOpen, LLProfile::mTotal, and LLProfile::mTotalOut.

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

Definition at line 3916 of file llvolume.cpp.

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

Definition at line 3898 of file llvolume.cpp.

References LLPathParams::mBegin, LLPathParams::mCurveType, LLPathParams::mEnd, LLPathParams::mRadiusOffset, LLPathParams::mRevolutions, LLPathParams::mScale, LLPathParams::mShear, LLPathParams::mSkew, LLPathParams::mTaper, LLPathParams::mTwistBegin, and LLPathParams::mTwistEnd.

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

Definition at line 3887 of file llvolume.cpp.

References LLProfileParams::mBegin, LLProfileParams::mCurveType, LLProfileParams::mEnd, and LLProfileParams::mHollow.

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

Definition at line 1833 of file llvolume.cpp.

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

Referenced by LLVolume::sculpt().

S32 sculpt_sides ( F32  detail  ) 

Definition at line 468 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().


Variable Documentation

const F32 APPROXIMATELY_ZERO = 0.001f

Definition at line 2069 of file llvolume.cpp.

const F32 CUT_MAX = 1.f

Definition at line 53 of file llvolume.cpp.

const F32 CUT_MIN = 0.f

Definition at line 52 of file llvolume.cpp.

const F32 HOLE_X_MAX = 1.0f

Definition at line 67 of file llvolume.cpp.

Referenced by LLVolumeParams::setRatio().

const F32 HOLE_X_MIN = 0.05f

Definition at line 66 of file llvolume.cpp.

Referenced by LLVolumeParams::setRatio().

const F32 HOLE_Y_MAX = 0.5f

Definition at line 70 of file llvolume.cpp.

Referenced by LLVolumeParams::setRatio().

const F32 HOLE_Y_MIN = 0.05f

Definition at line 69 of file llvolume.cpp.

Referenced by LLVolumeParams::setRatio().

const F32 HOLLOW_MAX = 0.95f

Definition at line 57 of file llvolume.cpp.

Referenced by LLVolumeParams::setHollow().

const F32 HOLLOW_MAX_SQUARE = 0.7f

Definition at line 58 of file llvolume.cpp.

Referenced by LLVolumeParams::setHollow().

const F32 HOLLOW_MIN = 0.f

Definition at line 56 of file llvolume.cpp.

Referenced by LLVolumeParams::setHollow().

const F32 MIN_CUT_DELTA = 0.02f

Definition at line 54 of file llvolume.cpp.

Referenced by LLVolumeParams::setBeginAndEndS(), and LLVolumeParams::setBeginAndEndT().

const F32 RATIO_MAX = 2.f

Definition at line 64 of file llvolume.cpp.

Referenced by LLVolumeParams::setRatio().

const F32 RATIO_MIN = 0.f

Definition at line 63 of file llvolume.cpp.

Referenced by LLVolumeParams::setRatio().

const F32 REV_MAX = 4.f

Definition at line 76 of file llvolume.cpp.

Referenced by LLVolumeParams::setRevolutions().

const F32 REV_MIN = 1.f

Definition at line 75 of file llvolume.cpp.

Referenced by LLVolumeParams::setRevolutions().

const F32 SCULPT_MIN_AREA = 0.005f

Definition at line 89 of file llvolume.cpp.

Referenced by LLVolume::sculpt().

const S32 SCULPT_REZ_1 = 6

Definition at line 84 of file llvolume.cpp.

Referenced by sculpt_sides().

const S32 SCULPT_REZ_2 = 8

Definition at line 85 of file llvolume.cpp.

Referenced by sculpt_sides().

const S32 SCULPT_REZ_3 = 16

Definition at line 86 of file llvolume.cpp.

Referenced by sculpt_sides().

const S32 SCULPT_REZ_4 = 32

Definition at line 87 of file llvolume.cpp.

Referenced by sculpt_sides().

const F32 SHEAR_MAX = 0.5f

Definition at line 73 of file llvolume.cpp.

Referenced by LLVolumeParams::setShear().

const F32 SHEAR_MIN = -0.5f

Definition at line 72 of file llvolume.cpp.

Referenced by LLVolumeParams::setShear().

const F32 SKEW_MAX = 0.95f

Definition at line 82 of file llvolume.cpp.

Referenced by LLVolumeParams::setSkew().

const F32 SKEW_MIN = -0.95f

Definition at line 81 of file llvolume.cpp.

Referenced by LLVolumeParams::setSkew().

const F32 TAPER_MAX = 1.f

Definition at line 79 of file llvolume.cpp.

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

const F32 TAPER_MIN = -1.f

Definition at line 78 of file llvolume.cpp.

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

const F32 TWIST_MAX = 1.f

Definition at line 61 of file llvolume.cpp.

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

const F32 TWIST_MIN = -1.f

Definition at line 60 of file llvolume.cpp.

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

const F32 VERTEX_SLOP = 0.00001f

Definition at line 3327 of file llvolume.cpp.

Referenced by lessVertex::operator()().

const F32 VERTEX_SLOP_SQRD = VERTEX_SLOP * VERTEX_SLOP

Definition at line 3328 of file llvolume.cpp.

Referenced by LLVolume::cleanupTriangleData().


Generated on Thu Jul 1 06:10:49 2010 for Second Life Viewer by  doxygen 1.4.7