llvoavatar.cpp File Reference

Implementation of LLVOAvatar class which is a derivation fo LLViewerObject. More...

#include "llviewerprecompiledheaders.h"
#include <algorithm>
#include <vector>
#include "llstl.h"
#include "llvoavatar.h"
#include "audioengine.h"
#include "imageids.h"
#include "indra_constants.h"
#include "llchat.h"
#include "llfontgl.h"
#include "llprimitive.h"
#include "lltextureentry.h"
#include "message.h"
#include "noise.h"
#include "sound_ids.h"
#include "lltimer.h"
#include "timing.h"
#include "llagent.h"
#include "llviewercontrol.h"
#include "llcriticaldamp.h"
#include "lldir.h"
#include "lldrawable.h"
#include "lldrawpoolavatar.h"
#include "lldrawpoolalpha.h"
#include "lldrawpoolbump.h"
#include "lldriverparam.h"
#include "lleditingmotion.h"
#include "llemote.h"
#include "llface.h"
#include "llfasttimer.h"
#include "llfirstuse.h"
#include "llfloatercustomize.h"
#include "llfloatertools.h"
#include "llgldbg.h"
#include "llhandmotion.h"
#include "llheadrotmotion.h"
#include "llhudeffectbeam.h"
#include "llhudeffectlookat.h"
#include "llhudeffecttrail.h"
#include "llhudmanager.h"
#include "llhudtext.h"
#include "llinventorymodel.h"
#include "llinventoryview.h"
#include "llkeyframefallmotion.h"
#include "llkeyframemotion.h"
#include "llkeyframemotionparam.h"
#include "llkeyframestandmotion.h"
#include "llkeyframewalkmotion.h"
#include "llmenugl.h"
#include "llmutelist.h"
#include "llnetmap.h"
#include "llnotify.h"
#include "llquantize.h"
#include "llregionhandle.h"
#include "llresmgr.h"
#include "llselectmgr.h"
#include "llsky.h"
#include "llsprite.h"
#include "llstatusbar.h"
#include "lltargetingmotion.h"
#include "lltexlayer.h"
#include "lltoolbar.h"
#include "lltoolgrab.h"
#include "lltoolmgr.h"
#include "lltoolmorph.h"
#include "lltrustnet.h"
#include "llviewercamera.h"
#include "llviewerimagelist.h"
#include "llviewerinventory.h"
#include "llviewermenu.h"
#include "llviewerobjectlist.h"
#include "llviewerparcelmgr.h"
#include "llviewerregion.h"
#include "llviewerstats.h"
#include "llviewerwindow.h"
#include "llvosky.h"
#include "llvovolume.h"
#include "llwearable.h"
#include "llwearablelist.h"
#include "llworld.h"
#include "pipeline.h"
#include "llglslshader.h"
#include "viewer.h"
#include "lscript_byteformat.h"
#include "llgesturemgr.h"
#include "llvoicevisualizer.h"
#include "llvoiceclient.h"

Include dependency graph for llvoavatar.cpp:

Go to the source code of this file.

Classes

struct  LLAvatarTexData
struct  LLTextureMaskData
class  LLBodyNoiseMotion
class  LLBreatheMotionRot
class  LLPelvisFixMotion

Defines

#define DELTA_TIME_MIN   0.01f
#define DELTA_TIME_MAX   0.2f
#define PELVIS_ROT_THRESHOLD_SLOW   60.0f
#define PELVIS_ROT_THRESHOLD_FAST   2.0f
#define TORSO_NOISE_AMOUNT   1.f
#define TORSO_NOISE_SPEED   0.2f
#define PELVIS_NOISE_FACTOR   0.5f
#define AUDIO_STEP_PRI   0xC0000000
#define AUDIO_STEP_LO_SPEED   0.01f
#define AUDIO_STEP_HI_SPEED   3.0f
#define AUDIO_STEP_LO_GAIN   0.15f
#define AUDIO_STEP_HI_GAIN   0.15f
#define AVATAR_HEADER   "Linden Avatar 1.0"
#define AVATAR_SECTION   "[avatar]"
#define AVATAR_DEFAULT_CHAR   "avatar"
#define MIN_REQUIRED_PIXEL_AREA_BODY_NOISE   (10000.f)
#define MIN_REQUIRED_PIXEL_AREA_BREATHE   (10000.f)
#define MIN_REQUIRED_PIXEL_AREA_PELVIS_FIX   (40.f)

Functions

void set_avatar_character (void *charNameArg)
static F32 calc_bouncy_animation (F32 x)

Variables

LLSky gSky
BOOL gRenderForSelect
BOOL gDebugAvatarRotation = FALSE
const F32 MIN_PIXEL_AREA_FOR_COMPOSITE = 200.f
F32 SHADOW_OFFSET_AMT = 0.03f
const F32 PELVIS_LAG_FLYING = 0.22f
const F32 PELVIS_LAG_WALKING = 0.4f
const F32 PELVIS_LAG_MOUSELOOK = 0.15f
const F32 MOUSELOOK_PELVIS_FOLLOW_FACTOR = 0.5f
const F32 PELVIS_LAG_WHEN_FOLLOW_CAM_IS_ON = 0.0001f
const F32 MIN_SPEED_PELVIS_FOLLOW = 0.1f
const F32 BREATHE_ROT_MOTION_STRENGTH = 0.05f
const F32 BREATHE_SCALE_MOTION_STRENGTH = 0.005f
const F32 DAMPED_MOTION_TIME_SCALE = 0.15f
const F32 LOOKAT_CAMERA_DIST_SQUARED = 25.f
const F32 MIN_SHADOW_HEIGHT = 0.f
const F32 MAX_SHADOW_HEIGHT = 0.3f
const S32 LOCTEX_IMAGE_SIZE_SELF = 512
const S32 LOCTEX_IMAGE_AREA_SELF = LOCTEX_IMAGE_SIZE_SELF * LOCTEX_IMAGE_SIZE_SELF
const S32 LOCTEX_IMAGE_SIZE_OTHER = LOCTEX_IMAGE_SIZE_SELF / 4
const S32 LOCTEX_IMAGE_AREA_OTHER = LOCTEX_IMAGE_SIZE_OTHER * LOCTEX_IMAGE_SIZE_OTHER
const F32 HEAD_MOVEMENT_AVG_TIME = 0.9f
const S32 MORPH_MASK_REQUESTED_DISCARD = 0
const S32 MIN_PIXEL_AREA_BUMP = 500
const S32 SWITCH_TO_BAKED_DISCARD = 5
const F32 FOOT_COLLIDE_FUDGE = 0.04f
const F32 HOVER_EFFECT_MAX_SPEED = 3.f
const F32 HOVER_EFFECT_STRENGTH = 0.f
F32 UNDERWATER_EFFECT_STRENGTH = 0.1f
const F32 UNDERWATER_FREQUENCY_DAMP = 0.33f
const F32 APPEARANCE_MORPH_TIME = 0.65f
const F32 CAMERA_SHAKE_ACCEL_THRESHOLD_SQUARED = 5.f * 5.f
const F32 TIME_BEFORE_MESH_CLEANUP = 5.f
const S32 AVATAR_RELEASE_THRESHOLD = 10
const F32 FOOT_GROUND_COLLISION_TOLERANCE = 0.25f
const F32 AVATAR_LOD_TWEAK_RANGE = 0.7f
const S32 MAX_LOD_CHANGES_PER_FRAME = 2
const S32 MAX_BUBBLE_CHAT_LENGTH = 1023
const S32 MAX_BUBBLE_CHAT_UTTERANCES = 12
const F32 CHAT_FADE_TIME = 8.0
const F32 BUBBLE_CHAT_TIME = CHAT_FADE_TIME * 3.f
const S32 MAX_BUBBLES = 7
BOOL gPrintMessagesThisFrame


Detailed Description

Implementation of LLVOAvatar class which is a derivation fo LLViewerObject.

LicenseInfo
firstyear=2001&license=viewergpl

Copyright (c) 2001-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 llvoavatar.cpp.


Define Documentation

#define AUDIO_STEP_HI_GAIN   0.15f

Definition at line 181 of file llvoavatar.cpp.

#define AUDIO_STEP_HI_SPEED   3.0f

Definition at line 179 of file llvoavatar.cpp.

#define AUDIO_STEP_LO_GAIN   0.15f

Definition at line 180 of file llvoavatar.cpp.

#define AUDIO_STEP_LO_SPEED   0.01f

Definition at line 178 of file llvoavatar.cpp.

#define AUDIO_STEP_PRI   0xC0000000

Definition at line 177 of file llvoavatar.cpp.

#define AVATAR_DEFAULT_CHAR   "avatar"

Definition at line 190 of file llvoavatar.cpp.

Referenced by LLVOAvatar::initClass(), and LLVOAvatar::LLVOAvatar().

#define AVATAR_HEADER   "Linden Avatar 1.0"

Definition at line 187 of file llvoavatar.cpp.

#define AVATAR_SECTION   "[avatar]"

Definition at line 188 of file llvoavatar.cpp.

#define DELTA_TIME_MAX   0.2f

Definition at line 151 of file llvoavatar.cpp.

Referenced by LLVOAvatar::updateCharacter().

#define DELTA_TIME_MIN   0.01f

Definition at line 150 of file llvoavatar.cpp.

Referenced by LLVOAvatar::updateCharacter().

#define MIN_REQUIRED_PIXEL_AREA_BODY_NOISE   (10000.f)

Definition at line 195 of file llvoavatar.cpp.

Referenced by LLBodyNoiseMotion::getMinPixelArea().

#define MIN_REQUIRED_PIXEL_AREA_BREATHE   (10000.f)

Definition at line 196 of file llvoavatar.cpp.

Referenced by LLBreatheMotionRot::getMinPixelArea().

#define MIN_REQUIRED_PIXEL_AREA_PELVIS_FIX   (40.f)

Definition at line 197 of file llvoavatar.cpp.

Referenced by LLPelvisFixMotion::getMinPixelArea().

#define PELVIS_NOISE_FACTOR   0.5f

Definition at line 175 of file llvoavatar.cpp.

#define PELVIS_ROT_THRESHOLD_FAST   2.0f

Definition at line 163 of file llvoavatar.cpp.

Referenced by LLVOAvatar::updateCharacter().

#define PELVIS_ROT_THRESHOLD_SLOW   60.0f

Definition at line 162 of file llvoavatar.cpp.

Referenced by LLVOAvatar::updateCharacter().

#define TORSO_NOISE_AMOUNT   1.f

Definition at line 168 of file llvoavatar.cpp.

Referenced by LLBodyNoiseMotion::onUpdate().

#define TORSO_NOISE_SPEED   0.2f

Definition at line 169 of file llvoavatar.cpp.

Referenced by LLBodyNoiseMotion::onUpdate().


Function Documentation

static F32 calc_bouncy_animation ( F32  x  )  [static]

Definition at line 247 of file llvoavatar.cpp.

References cosf, f, F_PI, and F_PI_BY_TWO.

void set_avatar_character ( void charNameArg  ) 


Variable Documentation

const F32 APPEARANCE_MORPH_TIME = 0.65f

Definition at line 219 of file llvoavatar.cpp.

Referenced by LLVOAvatar::idleUpdate().

const F32 AVATAR_LOD_TWEAK_RANGE = 0.7f

Definition at line 224 of file llvoavatar.cpp.

Referenced by LLVOAvatar::updateJointLODs().

const S32 AVATAR_RELEASE_THRESHOLD = 10

Definition at line 222 of file llvoavatar.cpp.

Referenced by LLVOAvatar::releaseMeshData().

const F32 BREATHE_ROT_MOTION_STRENGTH = 0.05f

Definition at line 171 of file llvoavatar.cpp.

Referenced by LLBreatheMotionRot::onUpdate().

const F32 BREATHE_SCALE_MOTION_STRENGTH = 0.005f

Definition at line 173 of file llvoavatar.cpp.

const F32 BUBBLE_CHAT_TIME = CHAT_FADE_TIME * 3.f

Definition at line 229 of file llvoavatar.cpp.

Referenced by LLVOAvatar::idleUpdate().

const F32 CAMERA_SHAKE_ACCEL_THRESHOLD_SQUARED = 5.f * 5.f

Definition at line 220 of file llvoavatar.cpp.

const F32 CHAT_FADE_TIME = 8.0

Definition at line 228 of file llvoavatar.cpp.

Referenced by LLVOAvatar::idleUpdate().

const F32 DAMPED_MOTION_TIME_SCALE = 0.15f

Definition at line 183 of file llvoavatar.cpp.

const F32 FOOT_COLLIDE_FUDGE = 0.04f

Definition at line 213 of file llvoavatar.cpp.

Referenced by LLVOAvatar::renderSkinned().

const F32 FOOT_GROUND_COLLISION_TOLERANCE = 0.25f

Definition at line 223 of file llvoavatar.cpp.

Referenced by LLVOAvatar::updateCharacter().

BOOL gDebugAvatarRotation = FALSE

Definition at line 139 of file llvoavatar.cpp.

Referenced by init_debug_avatar_menu(), and LLVOAvatar::updateCharacter().

BOOL gPrintMessagesThisFrame

Definition at line 399 of file viewer.cpp.

Referenced by idle_network().

BOOL gRenderForSelect

Definition at line 139 of file pipeline.cpp.

LLSky gSky

Definition at line 423 of file viewer.cpp.

const F32 HEAD_MOVEMENT_AVG_TIME = 0.9f

Definition at line 204 of file llvoavatar.cpp.

Referenced by LLVOAvatar::updateHeadOffset().

const F32 HOVER_EFFECT_MAX_SPEED = 3.f

Definition at line 215 of file llvoavatar.cpp.

Referenced by LLVOAvatar::idleUpdate().

const F32 HOVER_EFFECT_STRENGTH = 0.f

Definition at line 216 of file llvoavatar.cpp.

Referenced by LLVOAvatar::idleUpdate().

const S32 LOCTEX_IMAGE_AREA_OTHER = LOCTEX_IMAGE_SIZE_OTHER * LOCTEX_IMAGE_SIZE_OTHER

Definition at line 202 of file llvoavatar.cpp.

Referenced by LLVOAvatar::addLocalTextureStats().

const S32 LOCTEX_IMAGE_AREA_SELF = LOCTEX_IMAGE_SIZE_SELF * LOCTEX_IMAGE_SIZE_SELF

Definition at line 200 of file llvoavatar.cpp.

Referenced by LLVOAvatar::addLocalTextureStats().

const S32 LOCTEX_IMAGE_SIZE_OTHER = LOCTEX_IMAGE_SIZE_SELF / 4

Definition at line 201 of file llvoavatar.cpp.

const S32 LOCTEX_IMAGE_SIZE_SELF = 512

Definition at line 199 of file llvoavatar.cpp.

Referenced by LLVOAvatar::setPixelAreaAndAngle().

const F32 LOOKAT_CAMERA_DIST_SQUARED = 25.f

Definition at line 185 of file llvoavatar.cpp.

const S32 MAX_BUBBLE_CHAT_LENGTH = 1023

Definition at line 226 of file llvoavatar.cpp.

Referenced by LLVOAvatar::addChat().

const S32 MAX_BUBBLE_CHAT_UTTERANCES = 12

Definition at line 227 of file llvoavatar.cpp.

Referenced by LLVOAvatar::addChat(), and LLVOAvatar::idleUpdate().

const S32 MAX_BUBBLES = 7

Definition at line 230 of file llvoavatar.cpp.

const S32 MAX_LOD_CHANGES_PER_FRAME = 2

Definition at line 225 of file llvoavatar.cpp.

const F32 MAX_SHADOW_HEIGHT = 0.3f

Definition at line 193 of file llvoavatar.cpp.

Referenced by LLVOAvatar::updateShadowFaces().

const S32 MIN_PIXEL_AREA_BUMP = 500

Definition at line 207 of file llvoavatar.cpp.

const F32 MIN_PIXEL_AREA_FOR_COMPOSITE = 200.f

Definition at line 146 of file llvoavatar.cpp.

Referenced by LLVOAvatar::areAllNearbyInstancesBaked(), LLVOAvatar::cullAvatarsByPixelArea(), and LLVOAvatar::updateCharacter().

const F32 MIN_SHADOW_HEIGHT = 0.f

Definition at line 192 of file llvoavatar.cpp.

Referenced by LLVOAvatar::updateShadowFaces().

const F32 MIN_SPEED_PELVIS_FOLLOW = 0.1f

Definition at line 166 of file llvoavatar.cpp.

const S32 MORPH_MASK_REQUESTED_DISCARD = 0

Definition at line 206 of file llvoavatar.cpp.

Referenced by LLVOAvatar::onFirstTEMessageReceived(), and LLVOAvatar::updateMeshTextures().

const F32 MOUSELOOK_PELVIS_FOLLOW_FACTOR = 0.5f

Definition at line 158 of file llvoavatar.cpp.

Referenced by LLVOAvatar::updateCharacter().

const F32 PELVIS_LAG_FLYING = 0.22f

Definition at line 153 of file llvoavatar.cpp.

Referenced by LLVOAvatar::updateCharacter().

const F32 PELVIS_LAG_MOUSELOOK = 0.15f

Definition at line 157 of file llvoavatar.cpp.

Referenced by LLVOAvatar::updateCharacter().

const F32 PELVIS_LAG_WALKING = 0.4f

Definition at line 155 of file llvoavatar.cpp.

Referenced by LLVOAvatar::updateCharacter().

const F32 PELVIS_LAG_WHEN_FOLLOW_CAM_IS_ON = 0.0001f

Definition at line 160 of file llvoavatar.cpp.

F32 SHADOW_OFFSET_AMT = 0.03f

Definition at line 148 of file llvoavatar.cpp.

Referenced by LLVOAvatar::updateShadowFaces().

const S32 SWITCH_TO_BAKED_DISCARD = 5

Definition at line 211 of file llvoavatar.cpp.

Referenced by LLVOAvatar::updateMeshTextures().

const F32 TIME_BEFORE_MESH_CLEANUP = 5.f

Definition at line 221 of file llvoavatar.cpp.

Referenced by LLVOAvatar::updateVisibility().

F32 UNDERWATER_EFFECT_STRENGTH = 0.1f

Definition at line 217 of file llvoavatar.cpp.

Referenced by LLVOAvatar::idleUpdate().

const F32 UNDERWATER_FREQUENCY_DAMP = 0.33f

Definition at line 218 of file llvoavatar.cpp.

Referenced by LLVOAvatar::idleUpdate().


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