PageRenderTime 21ms CodeModel.GetById 12ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llvowater.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 96 lines | 52 code | 18 blank | 26 comment | 0 complexity | c11aae8b80a0d377371a00189ea71bc7 MD5 | raw file
 1/** 
 2 * @file llvowater.h
 3 * @brief Description of LLVOWater class
 4 *
 5 * $LicenseInfo:firstyear=2001&license=viewerlgpl$
 6 * Second Life Viewer Source Code
 7 * Copyright (C) 2010, Linden Research, Inc.
 8 * 
 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation;
12 * version 2.1 of the License only.
13 * 
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 * Lesser General Public License for more details.
18 * 
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22 * 
23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
24 * $/LicenseInfo$
25 */
26
27#ifndef LL_VOWATER_H
28#define LL_VOWATER_H
29
30#include "llviewerobject.h"
31#include "llviewertexture.h"
32#include "pipeline.h"
33#include "v2math.h"
34
35const U32 N_RES	= 16; //32			// number of subdivisions of wave tile
36const U8  WAVE_STEP		= 8;
37
38class LLSurface;
39class LLHeavenBody;
40class LLVOSky;
41class LLFace;
42
43class LLVOWater : public LLStaticViewerObject
44{
45public:
46	enum 
47	{
48		VERTEX_DATA_MASK =	(1 << LLVertexBuffer::TYPE_VERTEX) |
49							(1 << LLVertexBuffer::TYPE_NORMAL) |
50							(1 << LLVertexBuffer::TYPE_TEXCOORD0) 
51	};
52
53	LLVOWater(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp);
54
55	/*virtual*/ void markDead();
56
57	// Initialize data that's only inited once per class.
58	static void initClass();
59	static void cleanupClass();
60
61	/*virtual*/ BOOL idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time);
62	/*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline);
63	/*virtual*/ BOOL        updateGeometry(LLDrawable *drawable);
64	/*virtual*/ void		updateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax);
65
66	/*virtual*/ void updateTextures();
67	/*virtual*/ void setPixelAreaAndAngle(LLAgent &agent); // generate accurate apparent angle and area
68
69	virtual U32 getPartitionType() const;
70
71	/*virtual*/ BOOL isActive() const; // Whether this object needs to do an idleUpdate.
72
73	void setUseTexture(const BOOL use_texture);
74	void setIsEdgePatch(const BOOL edge_patch);
75	BOOL getUseTexture() const { return mUseTexture; }
76	BOOL getIsEdgePatch() const { return mIsEdgePatch; }
77
78protected:
79	BOOL mUseTexture;
80	BOOL mIsEdgePatch;
81	S32  mRenderType; 
82};
83
84class LLVOVoidWater : public LLVOWater
85{
86public:
87	LLVOVoidWater(LLUUID const& id, LLPCode pcode, LLViewerRegion* regionp) : LLVOWater(id, pcode, regionp)
88	{
89		mRenderType = LLPipeline::RENDER_TYPE_VOIDWATER;
90	}
91
92	/*virtual*/ U32 getPartitionType() const;
93};
94
95
96#endif // LL_VOSURFACEPATCH_H