blob: 2c581ae26b106bf17faa089c06f60b32b317cd09 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
|
#include "llviewerprecompiledheaders.h"
#include "hippolimits.h"
#include "hippogridmanager.h"
#include "llviewercontrol.h"
#include <llerror.h>
#include "llagent.h"
#include "llviewerregion.h"
HippoLimits *gHippoLimits = 0;
HippoLimits::HippoLimits()
:
mMaxAgentGroups(100),
mMaxHeight(10000.0f),
mMinHoleSize(0.05f),
mMaxHollow(0.95f),
mMinPrimScale(0.001f),
mMaxPrimScale(256.0f),
mMaxLinkedPrims(-1),
mMaxDragDistance(0.f),
mVoiceConnector("SLVoice"),
mMaxSelectDistance(64.0f)
{
setLimits();
}
void HippoLimits::setLimits()
{
if (gHippoGridManager->getConnectedGrid()->getPlatform() == HippoGridInfo::PLATFORM_SECONDLIFE)
{
setSecondLifeLimits();
}
else
{
setOpenSimLimits();
}
}
void HippoLimits::setOpenSimLimits()
{
mMaxAgentGroups = gHippoGridManager->getConnectedGrid()->getMaxAgentGroups();
if (mMaxAgentGroups < 0)
mMaxAgentGroups = 50;
mMaxPrimScale = 256.0f;
mMinPrimScale = 0.001f;
mMinPrimXPos = 0;
mMinPrimYPos = 0;
mMinPrimZPos = 0;
mMaxPrimXPos = F32_MAX;
mMaxPrimYPos = F32_MAX;
mMaxPrimZPos = F32_MAX;
mMaxHeight = 10000.0f;
mMaxLinkedPrims = -1;
mMaxPhysLinkedPrims = -1;
mAllowParcelWindLight = TRUE;
mAllowMinimap = TRUE;
mMaxInventoryItemsTransfer = -1;
mRenderName = 2;
mAllowPhysicalPrims = TRUE;
skyUseClassicClouds = TRUE;
mEnableTeenMode = FALSE;
mEnforceMaxBuild = FALSE;
mRenderWater = TRUE;
mVoiceConnector = "SLVoice";
mMaxSelectDistance = 192.0f;
if (gHippoGridManager->getConnectedGrid()->isRenderCompat()) {
llinfos << "Using rendering compatible OpenSim limits" << llendl;
mMinHoleSize = 0.05f;
mMaxHollow = 0.95f;
}
else
{
llinfos << "Using Hippo OpenSim limits" << llendl;
mMinHoleSize = 0.01f;
mMaxHollow = 0.99f;
}
}
void HippoLimits::setSecondLifeLimits()
{
llinfos << "Using Second Life limits" << llendl;
S32 max_groups = gHippoGridManager->getConnectedGrid()->getMaxAgentGroups();
mMaxAgentGroups = llmax(max_groups, 25);
setSecondLifeMaxPrimScale();
mMinPrimScale = 0.01f;
mMaxHeight = 4096.0f;
mMinHoleSize = 0.05f;
mMaxHollow = 0.95f;
mMaxLinkedPrims = 255;
mMaxPhysLinkedPrims = 32;
mMinPrimXPos = 0;
mMinPrimYPos = 0;
mMinPrimZPos = 0;
mMaxPrimXPos = 256;
mMaxPrimYPos = 256;
mMaxPrimZPos = 4096;
mAllowParcelWindLight = FALSE;
mAllowMinimap = TRUE;
mMaxInventoryItemsTransfer = 42;
mRenderName = 2;
mAllowPhysicalPrims = TRUE;
skyUseClassicClouds = TRUE;
mEnableTeenMode = FALSE;
mEnforceMaxBuild = FALSE;
mRenderWater = TRUE;
mVoiceConnector = "SLVoice";
mMaxSelectDistance = 64.0f;
}
void HippoLimits::setSecondLifeMaxPrimScale()
{
// SecondLife Mesh sims that allow 64m prims are ones that have BOTH these caps
if (gAgent.getRegion()
&& !gAgent.getRegion()->getCapability("GetMesh").empty()
&& !gAgent.getRegion()->getCapability("ObjectAdd").empty())
{
mMaxPrimScale = 64.f;
}
else
{
mMaxPrimScale = 10.f;
}
}
F32 HippoLimits::getMaxPrimScale() const
{
if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild)
{
return FLT_MAX;
}
else
{
return mMaxPrimScale;
}
}
F32 HippoLimits::getMinPrimScale() const
{
if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild)
{
return 0;
}
else
{
return mMinPrimScale;
}
}
F32 HippoLimits::getMaxPrimXPos() const
{
if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild)
{
return FLT_MAX;
}
else
{
return mMaxPrimXPos;
}
}
F32 HippoLimits::getMaxPrimYPos() const
{
if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild)
{
return FLT_MAX;
}
else
{
return mMaxPrimYPos;
}
}
F32 HippoLimits::getMaxPrimZPos() const
{
if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild)
{
return FLT_MAX;
}
else
{
return mMaxPrimZPos;
}
}
F32 HippoLimits::getMinPrimXPos() const
{
if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild)
{
return FLT_MIN;
}
else
{
return mMinPrimXPos;
}
}
F32 HippoLimits::getMinPrimYPos() const
{
if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild)
{
return FLT_MIN;
}
else
{
return mMinPrimYPos;
}
}
F32 HippoLimits::getMinPrimZPos() const
{
if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild)
{
return FLT_MIN;
}
else
{
return mMinPrimZPos;
}
}
F32 HippoLimits::getMaxDragDistance() const
{
if (mMaxDragDistance == 0.f)
{
return FLT_MAX;
}
else
{
F32 max_drag_distance = gSavedSettings.getBOOL("LimitDragDistance") ? gSavedSettings.getF32("MaxDragDistance") : FLT_MAX;
if(max_drag_distance > mMaxDragDistance) //Chose the more restrictive
{
max_drag_distance = mMaxDragDistance;
}
return max_drag_distance;
}
}
|