diff options
author | Sean Dague | 2008-07-16 15:10:35 +0000 |
---|---|---|
committer | Sean Dague | 2008-07-16 15:10:35 +0000 |
commit | f3173735fad0e0712086e4058151adf4815373e4 (patch) | |
tree | 5b9fb6fc5a9b4c5fa8d1de1a4df03428cba7c0ee /OpenSim/Framework | |
parent | refactoring of PrimitiveBaseShape to properties (diff) | |
download | opensim-SC_OLD-f3173735fad0e0712086e4058151adf4815373e4.zip opensim-SC_OLD-f3173735fad0e0712086e4058151adf4815373e4.tar.gz opensim-SC_OLD-f3173735fad0e0712086e4058151adf4815373e4.tar.bz2 opensim-SC_OLD-f3173735fad0e0712086e4058151adf4815373e4.tar.xz |
Revert "refactoring of PrimitiveBaseShape to properties"
This reverts commit 60e13a9997da89d224fbe8a97ab42bfc6114a45f.
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/PrimitiveBaseShape.cs | 681 |
1 files changed, 539 insertions, 142 deletions
diff --git a/OpenSim/Framework/PrimitiveBaseShape.cs b/OpenSim/Framework/PrimitiveBaseShape.cs index 12ca688..2811615 100644 --- a/OpenSim/Framework/PrimitiveBaseShape.cs +++ b/OpenSim/Framework/PrimitiveBaseShape.cs | |||
@@ -78,23 +78,57 @@ namespace OpenSim.Framework | |||
78 | 78 | ||
79 | private byte[] m_textureEntry; | 79 | private byte[] m_textureEntry; |
80 | 80 | ||
81 | public ushort PathBegin; | 81 | public ushort _pathBegin; |
82 | public byte PathCurve; | 82 | public byte _pathCurve; |
83 | public ushort PathEnd; | 83 | public ushort _pathEnd; |
84 | public sbyte PathRadiusOffset; | 84 | public sbyte _pathRadiusOffset; |
85 | public byte PathRevolutions; | 85 | public byte _pathRevolutions; |
86 | public byte PathScaleX; | 86 | public byte _pathScaleX; |
87 | public byte PathScaleY; | 87 | public byte _pathScaleY; |
88 | public byte PathShearX; | 88 | public byte _pathShearX; |
89 | public byte PathShearY; | 89 | public byte _pathShearY; |
90 | public sbyte PathSkew; | 90 | public sbyte _pathSkew; |
91 | public sbyte PathTaperX; | 91 | public sbyte _pathTaperX; |
92 | public sbyte PathTaperY; | 92 | public sbyte _pathTaperY; |
93 | public sbyte PathTwist; | 93 | public sbyte _pathTwist; |
94 | public sbyte PathTwistBegin; | 94 | public sbyte _pathTwistBegin; |
95 | public byte PCode; | 95 | public byte _pCode; |
96 | public ushort ProfileBegin; | 96 | public ushort _profileBegin; |
97 | public ushort _profileEnd; | ||
98 | public ushort _profileHollow; | ||
99 | public LLVector3 _scale; | ||
100 | public byte _state; | ||
101 | public ProfileShape _profileShape; | ||
102 | public HollowShape _hollowShape; | ||
97 | 103 | ||
104 | // Sculpted | ||
105 | [XmlIgnore] public LLUUID _sculptTexture = LLUUID.Zero; | ||
106 | [XmlIgnore] public byte _sculptType = (byte)0; | ||
107 | [XmlIgnore] public byte[] _sculptData = new byte[0]; | ||
108 | |||
109 | // Flexi | ||
110 | [XmlIgnore] public int _flexiSoftness = 0; | ||
111 | [XmlIgnore] public float _flexiTension = 0f; | ||
112 | [XmlIgnore] public float _flexiDrag = 0f; | ||
113 | [XmlIgnore] public float _flexiGravity = 0f; | ||
114 | [XmlIgnore] public float _flexiWind = 0f; | ||
115 | [XmlIgnore] public float _flexiForceX = 0f; | ||
116 | [XmlIgnore] public float _flexiForceY = 0f; | ||
117 | [XmlIgnore] public float _flexiForceZ = 0f; | ||
118 | |||
119 | //Bright n sparkly | ||
120 | [XmlIgnore] public float _lightColorR = 0f; | ||
121 | [XmlIgnore] public float _lightColorG = 0f; | ||
122 | [XmlIgnore] public float _lightColorB = 0f; | ||
123 | [XmlIgnore] public float _lightColorA = 1f; | ||
124 | [XmlIgnore] public float _lightRadius = 0f; | ||
125 | [XmlIgnore] public float _lightCutoff = 0f; | ||
126 | [XmlIgnore] public float _lightFalloff = 0f; | ||
127 | [XmlIgnore] public float _lightIntensity = 1f; | ||
128 | [XmlIgnore] public bool _flexiEntry = false; | ||
129 | [XmlIgnore] public bool _lightEntry = false; | ||
130 | [XmlIgnore] public bool _sculptEntry = false; | ||
131 | |||
98 | public byte ProfileCurve | 132 | public byte ProfileCurve |
99 | { | 133 | { |
100 | get { return (byte)((byte)HollowShape | (byte)ProfileShape); } | 134 | get { return (byte)((byte)HollowShape | (byte)ProfileShape); } |
@@ -110,11 +144,11 @@ namespace OpenSim.Framework | |||
110 | "[SHAPE]: Attempt to set a ProfileCurve with a hollow shape value of {0}, which isn't a valid enum. Replacing with default shape.", | 144 | "[SHAPE]: Attempt to set a ProfileCurve with a hollow shape value of {0}, which isn't a valid enum. Replacing with default shape.", |
111 | hollowShapeByte); | 145 | hollowShapeByte); |
112 | 146 | ||
113 | this.HollowShape = HollowShape.Same; | 147 | this._hollowShape = HollowShape.Same; |
114 | } | 148 | } |
115 | else | 149 | else |
116 | { | 150 | { |
117 | this.HollowShape = (HollowShape)hollowShapeByte; | 151 | this._hollowShape = (HollowShape)hollowShapeByte; |
118 | } | 152 | } |
119 | 153 | ||
120 | // Handle profile shape component | 154 | // Handle profile shape component |
@@ -126,47 +160,16 @@ namespace OpenSim.Framework | |||
126 | "[SHAPE]: Attempt to set a ProfileCurve with a profile shape value of {0}, which isn't a valid enum. Replacing with square.", | 160 | "[SHAPE]: Attempt to set a ProfileCurve with a profile shape value of {0}, which isn't a valid enum. Replacing with square.", |
127 | profileShapeByte); | 161 | profileShapeByte); |
128 | 162 | ||
129 | this.ProfileShape = ProfileShape.Square; | 163 | this._profileShape = ProfileShape.Square; |
130 | } | 164 | } |
131 | else | 165 | else |
132 | { | 166 | { |
133 | this.ProfileShape = (ProfileShape)profileShapeByte; | 167 | this._profileShape = (ProfileShape)profileShapeByte; |
134 | } | 168 | } |
135 | } | 169 | } |
136 | } | 170 | } |
137 | 171 | ||
138 | public ushort ProfileEnd; | ||
139 | public ushort ProfileHollow; | ||
140 | public LLVector3 Scale; | ||
141 | public byte State; | ||
142 | 172 | ||
143 | // Sculpted | ||
144 | [XmlIgnore] public LLUUID SculptTexture = LLUUID.Zero; | ||
145 | [XmlIgnore] public byte SculptType = (byte)0; | ||
146 | [XmlIgnore] public byte[] SculptData = new byte[0]; | ||
147 | |||
148 | // Flexi | ||
149 | [XmlIgnore] public int FlexiSoftness = 0; | ||
150 | [XmlIgnore] public float FlexiTension = 0f; | ||
151 | [XmlIgnore] public float FlexiDrag = 0f; | ||
152 | [XmlIgnore] public float FlexiGravity = 0f; | ||
153 | [XmlIgnore] public float FlexiWind = 0f; | ||
154 | [XmlIgnore] public float FlexiForceX = 0f; | ||
155 | [XmlIgnore] public float FlexiForceY = 0f; | ||
156 | [XmlIgnore] public float FlexiForceZ = 0f; | ||
157 | |||
158 | //Bright n sparkly | ||
159 | [XmlIgnore] public float LightColorR = 0f; | ||
160 | [XmlIgnore] public float LightColorG = 0f; | ||
161 | [XmlIgnore] public float LightColorB = 0f; | ||
162 | [XmlIgnore] public float LightColorA = 1f; | ||
163 | [XmlIgnore] public float LightRadius = 0f; | ||
164 | [XmlIgnore] public float LightCutoff = 0f; | ||
165 | [XmlIgnore] public float LightFalloff = 0f; | ||
166 | [XmlIgnore] public float LightIntensity = 1f; | ||
167 | [XmlIgnore] public bool FlexiEntry = false; | ||
168 | [XmlIgnore] public bool LightEntry = false; | ||
169 | [XmlIgnore] public bool SculptEntry = false; | ||
170 | 173 | ||
171 | 174 | ||
172 | static PrimitiveBaseShape() | 175 | static PrimitiveBaseShape() |
@@ -197,9 +200,7 @@ namespace OpenSim.Framework | |||
197 | set { m_textureEntry = value; } | 200 | set { m_textureEntry = value; } |
198 | } | 201 | } |
199 | 202 | ||
200 | public ProfileShape ProfileShape; | ||
201 | 203 | ||
202 | public HollowShape HollowShape; | ||
203 | 204 | ||
204 | public static PrimitiveBaseShape Default | 205 | public static PrimitiveBaseShape Default |
205 | { | 206 | { |
@@ -223,10 +224,10 @@ namespace OpenSim.Framework | |||
223 | { | 224 | { |
224 | PrimitiveBaseShape shape = Create(); | 225 | PrimitiveBaseShape shape = Create(); |
225 | 226 | ||
226 | shape.PathCurve = (byte) Extrusion.Straight; | 227 | shape._pathCurve = (byte) Extrusion.Straight; |
227 | shape.ProfileShape = ProfileShape.Square; | 228 | shape._profileShape = ProfileShape.Square; |
228 | shape.PathScaleX = 100; | 229 | shape._pathScaleX = 100; |
229 | shape.PathScaleY = 100; | 230 | shape._pathScaleY = 100; |
230 | 231 | ||
231 | return shape; | 232 | return shape; |
232 | } | 233 | } |
@@ -235,28 +236,28 @@ namespace OpenSim.Framework | |||
235 | { | 236 | { |
236 | PrimitiveBaseShape shape = Create(); | 237 | PrimitiveBaseShape shape = Create(); |
237 | 238 | ||
238 | shape.PathCurve = (byte) Extrusion.Curve1; | 239 | shape._pathCurve = (byte) Extrusion.Curve1; |
239 | shape.ProfileShape = ProfileShape.Square; | 240 | shape._profileShape = ProfileShape.Square; |
240 | 241 | ||
241 | shape.PathScaleX = 100; | 242 | shape._pathScaleX = 100; |
242 | shape.PathScaleY = 100; | 243 | shape._pathScaleY = 100; |
243 | 244 | ||
244 | return shape; | 245 | return shape; |
245 | } | 246 | } |
246 | 247 | ||
247 | public void SetScale(float side) | 248 | public void SetScale(float side) |
248 | { | 249 | { |
249 | Scale = new LLVector3(side, side, side); | 250 | _scale = new LLVector3(side, side, side); |
250 | } | 251 | } |
251 | 252 | ||
252 | public void SetHeigth(float heigth) | 253 | public void SetHeigth(float heigth) |
253 | { | 254 | { |
254 | Scale.Z = heigth; | 255 | _scale.Z = heigth; |
255 | } | 256 | } |
256 | 257 | ||
257 | public void SetRadius(float radius) | 258 | public void SetRadius(float radius) |
258 | { | 259 | { |
259 | Scale.X = Scale.Y = radius * 2f; | 260 | _scale.X = _scale.Y = radius * 2f; |
260 | } | 261 | } |
261 | 262 | ||
262 | // TODO: void returns need to change of course | 263 | // TODO: void returns need to change of course |
@@ -281,20 +282,20 @@ namespace OpenSim.Framework | |||
281 | 282 | ||
282 | public void SetPathRange(LLVector3 pathRange) | 283 | public void SetPathRange(LLVector3 pathRange) |
283 | { | 284 | { |
284 | PathBegin = LLObject.PackBeginCut(pathRange.X); | 285 | _pathBegin = LLObject.PackBeginCut(pathRange.X); |
285 | PathEnd = LLObject.PackEndCut(pathRange.Y); | 286 | _pathEnd = LLObject.PackEndCut(pathRange.Y); |
286 | } | 287 | } |
287 | 288 | ||
288 | public void SetSculptData(byte sculptType, LLUUID SculptTextureUUID) | 289 | public void SetSculptData(byte sculptType, LLUUID SculptTextureUUID) |
289 | { | 290 | { |
290 | SculptType = sculptType; | 291 | _sculptType = sculptType; |
291 | SculptTexture = SculptTextureUUID; | 292 | _sculptTexture = SculptTextureUUID; |
292 | } | 293 | } |
293 | 294 | ||
294 | public void SetProfileRange(LLVector3 profileRange) | 295 | public void SetProfileRange(LLVector3 profileRange) |
295 | { | 296 | { |
296 | ProfileBegin = LLObject.PackBeginCut(profileRange.X); | 297 | _profileBegin = LLObject.PackBeginCut(profileRange.X); |
297 | ProfileEnd = LLObject.PackEndCut(profileRange.Y); | 298 | _profileEnd = LLObject.PackEndCut(profileRange.Y); |
298 | } | 299 | } |
299 | 300 | ||
300 | public byte[] ExtraParams | 301 | public byte[] ExtraParams |
@@ -309,6 +310,402 @@ namespace OpenSim.Framework | |||
309 | } | 310 | } |
310 | } | 311 | } |
311 | 312 | ||
313 | public ushort PathBegin { | ||
314 | get { | ||
315 | return _pathBegin; | ||
316 | } | ||
317 | set { | ||
318 | _pathBegin = value; | ||
319 | } | ||
320 | } | ||
321 | |||
322 | public byte PathCurve { | ||
323 | get { | ||
324 | return _pathCurve; | ||
325 | } | ||
326 | set { | ||
327 | _pathCurve = value; | ||
328 | } | ||
329 | } | ||
330 | |||
331 | public ushort PathEnd { | ||
332 | get { | ||
333 | return _pathEnd; | ||
334 | } | ||
335 | set { | ||
336 | _pathEnd = value; | ||
337 | } | ||
338 | } | ||
339 | |||
340 | public sbyte PathRadiusOffset { | ||
341 | get { | ||
342 | return _pathRadiusOffset; | ||
343 | } | ||
344 | set { | ||
345 | _pathRadiusOffset = value; | ||
346 | } | ||
347 | } | ||
348 | |||
349 | public byte PathRevolutions { | ||
350 | get { | ||
351 | return _pathRevolutions; | ||
352 | } | ||
353 | set { | ||
354 | _pathRevolutions = value; | ||
355 | } | ||
356 | } | ||
357 | |||
358 | public byte PathScaleX { | ||
359 | get { | ||
360 | return _pathScaleX; | ||
361 | } | ||
362 | set { | ||
363 | _pathScaleX = value; | ||
364 | } | ||
365 | } | ||
366 | |||
367 | public byte PathScaleY { | ||
368 | get { | ||
369 | return _pathScaleY; | ||
370 | } | ||
371 | set { | ||
372 | _pathScaleY = value; | ||
373 | } | ||
374 | } | ||
375 | |||
376 | public byte PathShearX { | ||
377 | get { | ||
378 | return _pathShearX; | ||
379 | } | ||
380 | set { | ||
381 | _pathShearX = value; | ||
382 | } | ||
383 | } | ||
384 | |||
385 | public byte PathShearY { | ||
386 | get { | ||
387 | return _pathShearY; | ||
388 | } | ||
389 | set { | ||
390 | _pathShearY = value; | ||
391 | } | ||
392 | } | ||
393 | |||
394 | public sbyte PathSkew { | ||
395 | get { | ||
396 | return _pathSkew; | ||
397 | } | ||
398 | set { | ||
399 | _pathSkew = value; | ||
400 | } | ||
401 | } | ||
402 | |||
403 | public sbyte PathTaperX { | ||
404 | get { | ||
405 | return _pathTaperX; | ||
406 | } | ||
407 | set { | ||
408 | _pathTaperX = value; | ||
409 | } | ||
410 | } | ||
411 | |||
412 | public sbyte PathTaperY { | ||
413 | get { | ||
414 | return _pathTaperY; | ||
415 | } | ||
416 | set { | ||
417 | _pathTaperY = value; | ||
418 | } | ||
419 | } | ||
420 | |||
421 | public sbyte PathTwist { | ||
422 | get { | ||
423 | return _pathTwist; | ||
424 | } | ||
425 | set { | ||
426 | _pathTwist = value; | ||
427 | } | ||
428 | } | ||
429 | |||
430 | public sbyte PathTwistBegin { | ||
431 | get { | ||
432 | return _pathTwistBegin; | ||
433 | } | ||
434 | set { | ||
435 | _pathTwistBegin = value; | ||
436 | } | ||
437 | } | ||
438 | |||
439 | public byte PCode { | ||
440 | get { | ||
441 | return _pCode; | ||
442 | } | ||
443 | set { | ||
444 | _pCode = value; | ||
445 | } | ||
446 | } | ||
447 | |||
448 | public ushort ProfileBegin { | ||
449 | get { | ||
450 | return _profileBegin; | ||
451 | } | ||
452 | set { | ||
453 | _profileBegin = value; | ||
454 | } | ||
455 | } | ||
456 | |||
457 | public ushort ProfileEnd { | ||
458 | get { | ||
459 | return _profileEnd; | ||
460 | } | ||
461 | set { | ||
462 | _profileEnd = value; | ||
463 | } | ||
464 | } | ||
465 | |||
466 | public ushort ProfileHollow { | ||
467 | get { | ||
468 | return _profileHollow; | ||
469 | } | ||
470 | set { | ||
471 | _profileHollow = value; | ||
472 | } | ||
473 | } | ||
474 | |||
475 | public LLVector3 Scale { | ||
476 | get { | ||
477 | return _scale; | ||
478 | } | ||
479 | set { | ||
480 | _scale = value; | ||
481 | } | ||
482 | } | ||
483 | |||
484 | public byte State { | ||
485 | get { | ||
486 | return _state; | ||
487 | } | ||
488 | set { | ||
489 | _state = value; | ||
490 | } | ||
491 | } | ||
492 | |||
493 | public ProfileShape ProfileShape { | ||
494 | get { | ||
495 | return _profileShape; | ||
496 | } | ||
497 | set { | ||
498 | _profileShape = value; | ||
499 | } | ||
500 | } | ||
501 | |||
502 | public HollowShape HollowShape { | ||
503 | get { | ||
504 | return _hollowShape; | ||
505 | } | ||
506 | set { | ||
507 | _hollowShape = value; | ||
508 | } | ||
509 | } | ||
510 | |||
511 | public LLUUID SculptTexture { | ||
512 | get { | ||
513 | return _sculptTexture; | ||
514 | } | ||
515 | set { | ||
516 | _sculptTexture = value; | ||
517 | } | ||
518 | } | ||
519 | |||
520 | public byte SculptType { | ||
521 | get { | ||
522 | return _sculptType; | ||
523 | } | ||
524 | set { | ||
525 | _sculptType = value; | ||
526 | } | ||
527 | } | ||
528 | |||
529 | public byte[] SculptData { | ||
530 | get { | ||
531 | return _sculptData; | ||
532 | } | ||
533 | set { | ||
534 | _sculptData = value; | ||
535 | } | ||
536 | } | ||
537 | |||
538 | public int FlexiSoftness { | ||
539 | get { | ||
540 | return _flexiSoftness; | ||
541 | } | ||
542 | set { | ||
543 | _flexiSoftness = value; | ||
544 | } | ||
545 | } | ||
546 | |||
547 | public float FlexiTension { | ||
548 | get { | ||
549 | return _flexiTension; | ||
550 | } | ||
551 | set { | ||
552 | _flexiTension = value; | ||
553 | } | ||
554 | } | ||
555 | |||
556 | public float FlexiDrag { | ||
557 | get { | ||
558 | return _flexiDrag; | ||
559 | } | ||
560 | set { | ||
561 | _flexiDrag = value; | ||
562 | } | ||
563 | } | ||
564 | |||
565 | public float FlexiGravity { | ||
566 | get { | ||
567 | return _flexiGravity; | ||
568 | } | ||
569 | set { | ||
570 | _flexiGravity = value; | ||
571 | } | ||
572 | } | ||
573 | |||
574 | public float FlexiWind { | ||
575 | get { | ||
576 | return _flexiWind; | ||
577 | } | ||
578 | set { | ||
579 | _flexiWind = value; | ||
580 | } | ||
581 | } | ||
582 | |||
583 | public float FlexiForceX { | ||
584 | get { | ||
585 | return _flexiForceX; | ||
586 | } | ||
587 | set { | ||
588 | _flexiForceX = value; | ||
589 | } | ||
590 | } | ||
591 | |||
592 | public float FlexiForceY { | ||
593 | get { | ||
594 | return _flexiForceY; | ||
595 | } | ||
596 | set { | ||
597 | _flexiForceY = value; | ||
598 | } | ||
599 | } | ||
600 | |||
601 | public float FlexiForceZ { | ||
602 | get { | ||
603 | return _flexiForceZ; | ||
604 | } | ||
605 | set { | ||
606 | _flexiForceZ = value; | ||
607 | } | ||
608 | } | ||
609 | |||
610 | public float LightColorR { | ||
611 | get { | ||
612 | return _lightColorR; | ||
613 | } | ||
614 | set { | ||
615 | _lightColorR = value; | ||
616 | } | ||
617 | } | ||
618 | |||
619 | public float LightColorG { | ||
620 | get { | ||
621 | return _lightColorG; | ||
622 | } | ||
623 | set { | ||
624 | _lightColorG = value; | ||
625 | } | ||
626 | } | ||
627 | |||
628 | public float LightColorB { | ||
629 | get { | ||
630 | return _lightColorB; | ||
631 | } | ||
632 | set { | ||
633 | _lightColorB = value; | ||
634 | } | ||
635 | } | ||
636 | |||
637 | public float LightColorA { | ||
638 | get { | ||
639 | return _lightColorA; | ||
640 | } | ||
641 | set { | ||
642 | _lightColorA = value; | ||
643 | } | ||
644 | } | ||
645 | |||
646 | public float LightRadius { | ||
647 | get { | ||
648 | return _lightRadius; | ||
649 | } | ||
650 | set { | ||
651 | _lightRadius = value; | ||
652 | } | ||
653 | } | ||
654 | |||
655 | public float LightCutoff { | ||
656 | get { | ||
657 | return _lightCutoff; | ||
658 | } | ||
659 | set { | ||
660 | _lightCutoff = value; | ||
661 | } | ||
662 | } | ||
663 | |||
664 | public float LightFalloff { | ||
665 | get { | ||
666 | return _lightFalloff; | ||
667 | } | ||
668 | set { | ||
669 | _lightFalloff = value; | ||
670 | } | ||
671 | } | ||
672 | |||
673 | public float LightIntensity { | ||
674 | get { | ||
675 | return _lightIntensity; | ||
676 | } | ||
677 | set { | ||
678 | _lightIntensity = value; | ||
679 | } | ||
680 | } | ||
681 | |||
682 | public bool FlexiEntry { | ||
683 | get { | ||
684 | return _flexiEntry; | ||
685 | } | ||
686 | set { | ||
687 | _flexiEntry = value; | ||
688 | } | ||
689 | } | ||
690 | |||
691 | public bool LightEntry { | ||
692 | get { | ||
693 | return _lightEntry; | ||
694 | } | ||
695 | set { | ||
696 | _lightEntry = value; | ||
697 | } | ||
698 | } | ||
699 | |||
700 | public bool SculptEntry { | ||
701 | get { | ||
702 | return _sculptEntry; | ||
703 | } | ||
704 | set { | ||
705 | _sculptEntry = value; | ||
706 | } | ||
707 | } | ||
708 | |||
312 | public byte[] ExtraParamsToBytes() | 709 | public byte[] ExtraParamsToBytes() |
313 | { | 710 | { |
314 | ushort FlexiEP = 0x10; | 711 | ushort FlexiEP = 0x10; |
@@ -319,19 +716,19 @@ namespace OpenSim.Framework | |||
319 | uint TotalBytesLength = 1; // ExtraParamsNum | 716 | uint TotalBytesLength = 1; // ExtraParamsNum |
320 | 717 | ||
321 | uint ExtraParamsNum = 0; | 718 | uint ExtraParamsNum = 0; |
322 | if (FlexiEntry) | 719 | if (_flexiEntry) |
323 | { | 720 | { |
324 | ExtraParamsNum++; | 721 | ExtraParamsNum++; |
325 | TotalBytesLength += 16;// data | 722 | TotalBytesLength += 16;// data |
326 | TotalBytesLength += 2 + 4; // type | 723 | TotalBytesLength += 2 + 4; // type |
327 | } | 724 | } |
328 | if (LightEntry) | 725 | if (_lightEntry) |
329 | { | 726 | { |
330 | ExtraParamsNum++; | 727 | ExtraParamsNum++; |
331 | TotalBytesLength += 16;// data | 728 | TotalBytesLength += 16;// data |
332 | TotalBytesLength += 2 + 4; // type | 729 | TotalBytesLength += 2 + 4; // type |
333 | } | 730 | } |
334 | if (SculptEntry) | 731 | if (_sculptEntry) |
335 | { | 732 | { |
336 | ExtraParamsNum++; | 733 | ExtraParamsNum++; |
337 | TotalBytesLength += 17;// data | 734 | TotalBytesLength += 17;// data |
@@ -346,7 +743,7 @@ namespace OpenSim.Framework | |||
346 | // Stick in the number of parameters | 743 | // Stick in the number of parameters |
347 | returnbytes[i++] = (byte)ExtraParamsNum; | 744 | returnbytes[i++] = (byte)ExtraParamsNum; |
348 | 745 | ||
349 | if (FlexiEntry) | 746 | if (_flexiEntry) |
350 | { | 747 | { |
351 | byte[] FlexiData = GetFlexiBytes(); | 748 | byte[] FlexiData = GetFlexiBytes(); |
352 | 749 | ||
@@ -360,7 +757,7 @@ namespace OpenSim.Framework | |||
360 | Array.Copy(FlexiData, 0, returnbytes, i, FlexiData.Length); | 757 | Array.Copy(FlexiData, 0, returnbytes, i, FlexiData.Length); |
361 | i += FlexiData.Length; | 758 | i += FlexiData.Length; |
362 | } | 759 | } |
363 | if (LightEntry) | 760 | if (_lightEntry) |
364 | { | 761 | { |
365 | byte[] LightData = GetLightBytes(); | 762 | byte[] LightData = GetLightBytes(); |
366 | 763 | ||
@@ -374,7 +771,7 @@ namespace OpenSim.Framework | |||
374 | Array.Copy(LightData, 0, returnbytes, i, LightData.Length); | 771 | Array.Copy(LightData, 0, returnbytes, i, LightData.Length); |
375 | i += LightData.Length; | 772 | i += LightData.Length; |
376 | } | 773 | } |
377 | if (SculptEntry) | 774 | if (_sculptEntry) |
378 | { | 775 | { |
379 | byte[] SculptData = GetSculptBytes(); | 776 | byte[] SculptData = GetSculptBytes(); |
380 | 777 | ||
@@ -389,7 +786,7 @@ namespace OpenSim.Framework | |||
389 | i += SculptData.Length; | 786 | i += SculptData.Length; |
390 | } | 787 | } |
391 | 788 | ||
392 | if (!FlexiEntry && !LightEntry && !SculptEntry) | 789 | if (!_flexiEntry && !_lightEntry && !_sculptEntry) |
393 | { | 790 | { |
394 | byte[] returnbyte = new byte[1]; | 791 | byte[] returnbyte = new byte[1]; |
395 | returnbyte[0] = 0; | 792 | returnbyte[0] = 0; |
@@ -413,7 +810,7 @@ namespace OpenSim.Framework | |||
413 | case FlexiEP: | 810 | case FlexiEP: |
414 | if (!inUse) | 811 | if (!inUse) |
415 | { | 812 | { |
416 | FlexiEntry = false; | 813 | _flexiEntry = false; |
417 | return; | 814 | return; |
418 | } | 815 | } |
419 | ReadFlexiData(data, 0); | 816 | ReadFlexiData(data, 0); |
@@ -422,7 +819,7 @@ namespace OpenSim.Framework | |||
422 | case LightEP: | 819 | case LightEP: |
423 | if (!inUse) | 820 | if (!inUse) |
424 | { | 821 | { |
425 | LightEntry = false; | 822 | _lightEntry = false; |
426 | return; | 823 | return; |
427 | } | 824 | } |
428 | ReadLightData(data, 0); | 825 | ReadLightData(data, 0); |
@@ -431,7 +828,7 @@ namespace OpenSim.Framework | |||
431 | case SculptEP: | 828 | case SculptEP: |
432 | if (!inUse) | 829 | if (!inUse) |
433 | { | 830 | { |
434 | SculptEntry = false; | 831 | _sculptEntry = false; |
435 | return; | 832 | return; |
436 | } | 833 | } |
437 | ReadSculptData(data, 0); | 834 | ReadSculptData(data, 0); |
@@ -488,11 +885,11 @@ namespace OpenSim.Framework | |||
488 | } | 885 | } |
489 | 886 | ||
490 | if (!lGotFlexi) | 887 | if (!lGotFlexi) |
491 | FlexiEntry = false; | 888 | _flexiEntry = false; |
492 | if (!lGotLight) | 889 | if (!lGotLight) |
493 | LightEntry = false; | 890 | _lightEntry = false; |
494 | if (!lGotSculpt) | 891 | if (!lGotSculpt) |
495 | SculptEntry = false; | 892 | _sculptEntry = false; |
496 | 893 | ||
497 | } | 894 | } |
498 | 895 | ||
@@ -504,7 +901,7 @@ namespace OpenSim.Framework | |||
504 | 901 | ||
505 | if (data.Length+pos >= 17) | 902 | if (data.Length+pos >= 17) |
506 | { | 903 | { |
507 | SculptEntry = true; | 904 | _sculptEntry = true; |
508 | SculptTextureUUID = new byte[16]; | 905 | SculptTextureUUID = new byte[16]; |
509 | SculptTypel = data[16 + pos]; | 906 | SculptTypel = data[16 + pos]; |
510 | Array.Copy(data, pos, SculptTextureUUID,0, 16); | 907 | Array.Copy(data, pos, SculptTextureUUID,0, 16); |
@@ -512,18 +909,18 @@ namespace OpenSim.Framework | |||
512 | } | 909 | } |
513 | else | 910 | else |
514 | { | 911 | { |
515 | SculptEntry = false; | 912 | _sculptEntry = false; |
516 | SculptUUID = LLUUID.Zero; | 913 | SculptUUID = LLUUID.Zero; |
517 | SculptTypel = 0x00; | 914 | SculptTypel = 0x00; |
518 | } | 915 | } |
519 | 916 | ||
520 | if (SculptEntry) | 917 | if (_sculptEntry) |
521 | { | 918 | { |
522 | if (SculptType != (byte)1 && SculptType != (byte)2 && SculptType != (byte)3 && SculptType != (byte)4) | 919 | if (_sculptType != (byte)1 && _sculptType != (byte)2 && _sculptType != (byte)3 && _sculptType != (byte)4) |
523 | SculptType = 4; | 920 | _sculptType = 4; |
524 | } | 921 | } |
525 | SculptTexture = SculptUUID; | 922 | _sculptTexture = SculptUUID; |
526 | SculptType = SculptTypel; | 923 | _sculptType = SculptTypel; |
527 | //m_log.Info("[SCULPT]:" + SculptUUID.ToString()); | 924 | //m_log.Info("[SCULPT]:" + SculptUUID.ToString()); |
528 | } | 925 | } |
529 | 926 | ||
@@ -531,8 +928,8 @@ namespace OpenSim.Framework | |||
531 | { | 928 | { |
532 | byte[] data = new byte[17]; | 929 | byte[] data = new byte[17]; |
533 | 930 | ||
534 | SculptTexture.GetBytes().CopyTo(data, 0); | 931 | _sculptTexture.GetBytes().CopyTo(data, 0); |
535 | data[16] = (byte)SculptType; | 932 | data[16] = (byte)_sculptType; |
536 | 933 | ||
537 | return data; | 934 | return data; |
538 | } | 935 | } |
@@ -541,30 +938,30 @@ namespace OpenSim.Framework | |||
541 | { | 938 | { |
542 | if (data.Length-pos >= 16) | 939 | if (data.Length-pos >= 16) |
543 | { | 940 | { |
544 | FlexiEntry = true; | 941 | _flexiEntry = true; |
545 | FlexiSoftness = ((data[pos] & 0x80) >> 6) | ((data[pos + 1] & 0x80) >> 7); | 942 | _flexiSoftness = ((data[pos] & 0x80) >> 6) | ((data[pos + 1] & 0x80) >> 7); |
546 | 943 | ||
547 | FlexiTension = (float)(data[pos++] & 0x7F) / 10.0f; | 944 | _flexiTension = (float)(data[pos++] & 0x7F) / 10.0f; |
548 | FlexiDrag = (float)(data[pos++] & 0x7F) / 10.0f; | 945 | _flexiDrag = (float)(data[pos++] & 0x7F) / 10.0f; |
549 | FlexiGravity = (float)(data[pos++] / 10.0f) - 10.0f; | 946 | _flexiGravity = (float)(data[pos++] / 10.0f) - 10.0f; |
550 | FlexiWind = (float)data[pos++] / 10.0f; | 947 | _flexiWind = (float)data[pos++] / 10.0f; |
551 | LLVector3 lForce = new LLVector3(data, pos); | 948 | LLVector3 lForce = new LLVector3(data, pos); |
552 | FlexiForceX = lForce.X; | 949 | _flexiForceX = lForce.X; |
553 | FlexiForceY = lForce.Y; | 950 | _flexiForceY = lForce.Y; |
554 | FlexiForceZ = lForce.Z; | 951 | _flexiForceZ = lForce.Z; |
555 | } | 952 | } |
556 | else | 953 | else |
557 | { | 954 | { |
558 | FlexiEntry = false; | 955 | _flexiEntry = false; |
559 | FlexiSoftness = 0; | 956 | _flexiSoftness = 0; |
560 | 957 | ||
561 | FlexiTension = 0.0f; | 958 | _flexiTension = 0.0f; |
562 | FlexiDrag = 0.0f; | 959 | _flexiDrag = 0.0f; |
563 | FlexiGravity = 0.0f; | 960 | _flexiGravity = 0.0f; |
564 | FlexiWind = 0.0f; | 961 | _flexiWind = 0.0f; |
565 | FlexiForceX = 0f; | 962 | _flexiForceX = 0f; |
566 | FlexiForceY = 0f; | 963 | _flexiForceY = 0f; |
567 | FlexiForceZ = 0f; | 964 | _flexiForceZ = 0f; |
568 | } | 965 | } |
569 | } | 966 | } |
570 | 967 | ||
@@ -574,14 +971,14 @@ namespace OpenSim.Framework | |||
574 | int i = 0; | 971 | int i = 0; |
575 | 972 | ||
576 | // Softness is packed in the upper bits of tension and drag | 973 | // Softness is packed in the upper bits of tension and drag |
577 | data[i] = (byte)((FlexiSoftness & 2) << 6); | 974 | data[i] = (byte)((_flexiSoftness & 2) << 6); |
578 | data[i + 1] = (byte)((FlexiSoftness & 1) << 7); | 975 | data[i + 1] = (byte)((_flexiSoftness & 1) << 7); |
579 | 976 | ||
580 | data[i++] |= (byte)((byte)(FlexiTension * 10.01f) & 0x7F); | 977 | data[i++] |= (byte)((byte)(_flexiTension * 10.01f) & 0x7F); |
581 | data[i++] |= (byte)((byte)(FlexiDrag * 10.01f) & 0x7F); | 978 | data[i++] |= (byte)((byte)(_flexiDrag * 10.01f) & 0x7F); |
582 | data[i++] = (byte)((FlexiGravity + 10.0f) * 10.01f); | 979 | data[i++] = (byte)((_flexiGravity + 10.0f) * 10.01f); |
583 | data[i++] = (byte)(FlexiWind * 10.01f); | 980 | data[i++] = (byte)(_flexiWind * 10.01f); |
584 | LLVector3 lForce = new LLVector3(FlexiForceX, FlexiForceY, FlexiForceZ); | 981 | LLVector3 lForce = new LLVector3(_flexiForceX, _flexiForceY, _flexiForceZ); |
585 | lForce.GetBytes().CopyTo(data, i); | 982 | lForce.GetBytes().CopyTo(data, i); |
586 | 983 | ||
587 | return data; | 984 | return data; |
@@ -591,29 +988,29 @@ namespace OpenSim.Framework | |||
591 | { | 988 | { |
592 | if (data.Length - pos >= 16) | 989 | if (data.Length - pos >= 16) |
593 | { | 990 | { |
594 | LightEntry = true; | 991 | _lightEntry = true; |
595 | LLColor lColor = new LLColor(data, pos, false); | 992 | LLColor lColor = new LLColor(data, pos, false); |
596 | LightIntensity = lColor.A; | 993 | _lightIntensity = lColor.A; |
597 | LightColorA = 1f; | 994 | _lightColorA = 1f; |
598 | LightColorR = lColor.R; | 995 | _lightColorR = lColor.R; |
599 | LightColorG = lColor.G; | 996 | _lightColorG = lColor.G; |
600 | LightColorB = lColor.B; | 997 | _lightColorB = lColor.B; |
601 | 998 | ||
602 | LightRadius = Helpers.BytesToFloat(data, pos + 4); | 999 | _lightRadius = Helpers.BytesToFloat(data, pos + 4); |
603 | LightCutoff = Helpers.BytesToFloat(data, pos + 8); | 1000 | _lightCutoff = Helpers.BytesToFloat(data, pos + 8); |
604 | LightFalloff = Helpers.BytesToFloat(data, pos + 12); | 1001 | _lightFalloff = Helpers.BytesToFloat(data, pos + 12); |
605 | } | 1002 | } |
606 | else | 1003 | else |
607 | { | 1004 | { |
608 | LightEntry = false; | 1005 | _lightEntry = false; |
609 | LightColorA = 1f; | 1006 | _lightColorA = 1f; |
610 | LightColorR = 0f; | 1007 | _lightColorR = 0f; |
611 | LightColorG = 0f; | 1008 | _lightColorG = 0f; |
612 | LightColorB = 0f; | 1009 | _lightColorB = 0f; |
613 | LightRadius = 0f; | 1010 | _lightRadius = 0f; |
614 | LightCutoff = 0f; | 1011 | _lightCutoff = 0f; |
615 | LightFalloff = 0f; | 1012 | _lightFalloff = 0f; |
616 | LightIntensity = 0f; | 1013 | _lightIntensity = 0f; |
617 | } | 1014 | } |
618 | } | 1015 | } |
619 | 1016 | ||
@@ -622,12 +1019,12 @@ namespace OpenSim.Framework | |||
622 | byte[] data = new byte[16]; | 1019 | byte[] data = new byte[16]; |
623 | 1020 | ||
624 | // Alpha channel in color is intensity | 1021 | // Alpha channel in color is intensity |
625 | LLColor tmpColor = new LLColor(LightColorR,LightColorG,LightColorB,LightIntensity); | 1022 | LLColor tmpColor = new LLColor(_lightColorR,_lightColorG,_lightColorB,_lightIntensity); |
626 | 1023 | ||
627 | tmpColor.GetBytes().CopyTo(data, 0); | 1024 | tmpColor.GetBytes().CopyTo(data, 0); |
628 | Helpers.FloatToBytes(LightRadius).CopyTo(data, 4); | 1025 | Helpers.FloatToBytes(_lightRadius).CopyTo(data, 4); |
629 | Helpers.FloatToBytes(LightCutoff).CopyTo(data, 8); | 1026 | Helpers.FloatToBytes(_lightCutoff).CopyTo(data, 8); |
630 | Helpers.FloatToBytes(LightFalloff).CopyTo(data, 12); | 1027 | Helpers.FloatToBytes(_lightFalloff).CopyTo(data, 12); |
631 | 1028 | ||
632 | return data; | 1029 | return data; |
633 | } | 1030 | } |