diff options
Diffstat (limited to 'OpenSim/Framework/PrimitiveBaseShape.cs')
-rw-r--r-- | OpenSim/Framework/PrimitiveBaseShape.cs | 681 |
1 files changed, 142 insertions, 539 deletions
diff --git a/OpenSim/Framework/PrimitiveBaseShape.cs b/OpenSim/Framework/PrimitiveBaseShape.cs index 2811615..12ca688 100644 --- a/OpenSim/Framework/PrimitiveBaseShape.cs +++ b/OpenSim/Framework/PrimitiveBaseShape.cs | |||
@@ -78,57 +78,23 @@ 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; | ||
103 | 97 | ||
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 | |||
132 | public byte ProfileCurve | 98 | public byte ProfileCurve |
133 | { | 99 | { |
134 | get { return (byte)((byte)HollowShape | (byte)ProfileShape); } | 100 | get { return (byte)((byte)HollowShape | (byte)ProfileShape); } |
@@ -144,11 +110,11 @@ namespace OpenSim.Framework | |||
144 | "[SHAPE]: Attempt to set a ProfileCurve with a hollow shape value of {0}, which isn't a valid enum. Replacing with default shape.", | 110 | "[SHAPE]: Attempt to set a ProfileCurve with a hollow shape value of {0}, which isn't a valid enum. Replacing with default shape.", |
145 | hollowShapeByte); | 111 | hollowShapeByte); |
146 | 112 | ||
147 | this._hollowShape = HollowShape.Same; | 113 | this.HollowShape = HollowShape.Same; |
148 | } | 114 | } |
149 | else | 115 | else |
150 | { | 116 | { |
151 | this._hollowShape = (HollowShape)hollowShapeByte; | 117 | this.HollowShape = (HollowShape)hollowShapeByte; |
152 | } | 118 | } |
153 | 119 | ||
154 | // Handle profile shape component | 120 | // Handle profile shape component |
@@ -160,16 +126,47 @@ namespace OpenSim.Framework | |||
160 | "[SHAPE]: Attempt to set a ProfileCurve with a profile shape value of {0}, which isn't a valid enum. Replacing with square.", | 126 | "[SHAPE]: Attempt to set a ProfileCurve with a profile shape value of {0}, which isn't a valid enum. Replacing with square.", |
161 | profileShapeByte); | 127 | profileShapeByte); |
162 | 128 | ||
163 | this._profileShape = ProfileShape.Square; | 129 | this.ProfileShape = ProfileShape.Square; |
164 | } | 130 | } |
165 | else | 131 | else |
166 | { | 132 | { |
167 | this._profileShape = (ProfileShape)profileShapeByte; | 133 | this.ProfileShape = (ProfileShape)profileShapeByte; |
168 | } | 134 | } |
169 | } | 135 | } |
170 | } | 136 | } |
171 | 137 | ||
138 | public ushort ProfileEnd; | ||
139 | public ushort ProfileHollow; | ||
140 | public LLVector3 Scale; | ||
141 | public byte State; | ||
172 | 142 | ||
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; | ||
173 | 170 | ||
174 | 171 | ||
175 | static PrimitiveBaseShape() | 172 | static PrimitiveBaseShape() |
@@ -200,7 +197,9 @@ namespace OpenSim.Framework | |||
200 | set { m_textureEntry = value; } | 197 | set { m_textureEntry = value; } |
201 | } | 198 | } |
202 | 199 | ||
200 | public ProfileShape ProfileShape; | ||
203 | 201 | ||
202 | public HollowShape HollowShape; | ||
204 | 203 | ||
205 | public static PrimitiveBaseShape Default | 204 | public static PrimitiveBaseShape Default |
206 | { | 205 | { |
@@ -224,10 +223,10 @@ namespace OpenSim.Framework | |||
224 | { | 223 | { |
225 | PrimitiveBaseShape shape = Create(); | 224 | PrimitiveBaseShape shape = Create(); |
226 | 225 | ||
227 | shape._pathCurve = (byte) Extrusion.Straight; | 226 | shape.PathCurve = (byte) Extrusion.Straight; |
228 | shape._profileShape = ProfileShape.Square; | 227 | shape.ProfileShape = ProfileShape.Square; |
229 | shape._pathScaleX = 100; | 228 | shape.PathScaleX = 100; |
230 | shape._pathScaleY = 100; | 229 | shape.PathScaleY = 100; |
231 | 230 | ||
232 | return shape; | 231 | return shape; |
233 | } | 232 | } |
@@ -236,28 +235,28 @@ namespace OpenSim.Framework | |||
236 | { | 235 | { |
237 | PrimitiveBaseShape shape = Create(); | 236 | PrimitiveBaseShape shape = Create(); |
238 | 237 | ||
239 | shape._pathCurve = (byte) Extrusion.Curve1; | 238 | shape.PathCurve = (byte) Extrusion.Curve1; |
240 | shape._profileShape = ProfileShape.Square; | 239 | shape.ProfileShape = ProfileShape.Square; |
241 | 240 | ||
242 | shape._pathScaleX = 100; | 241 | shape.PathScaleX = 100; |
243 | shape._pathScaleY = 100; | 242 | shape.PathScaleY = 100; |
244 | 243 | ||
245 | return shape; | 244 | return shape; |
246 | } | 245 | } |
247 | 246 | ||
248 | public void SetScale(float side) | 247 | public void SetScale(float side) |
249 | { | 248 | { |
250 | _scale = new LLVector3(side, side, side); | 249 | Scale = new LLVector3(side, side, side); |
251 | } | 250 | } |
252 | 251 | ||
253 | public void SetHeigth(float heigth) | 252 | public void SetHeigth(float heigth) |
254 | { | 253 | { |
255 | _scale.Z = heigth; | 254 | Scale.Z = heigth; |
256 | } | 255 | } |
257 | 256 | ||
258 | public void SetRadius(float radius) | 257 | public void SetRadius(float radius) |
259 | { | 258 | { |
260 | _scale.X = _scale.Y = radius * 2f; | 259 | Scale.X = Scale.Y = radius * 2f; |
261 | } | 260 | } |
262 | 261 | ||
263 | // TODO: void returns need to change of course | 262 | // TODO: void returns need to change of course |
@@ -282,20 +281,20 @@ namespace OpenSim.Framework | |||
282 | 281 | ||
283 | public void SetPathRange(LLVector3 pathRange) | 282 | public void SetPathRange(LLVector3 pathRange) |
284 | { | 283 | { |
285 | _pathBegin = LLObject.PackBeginCut(pathRange.X); | 284 | PathBegin = LLObject.PackBeginCut(pathRange.X); |
286 | _pathEnd = LLObject.PackEndCut(pathRange.Y); | 285 | PathEnd = LLObject.PackEndCut(pathRange.Y); |
287 | } | 286 | } |
288 | 287 | ||
289 | public void SetSculptData(byte sculptType, LLUUID SculptTextureUUID) | 288 | public void SetSculptData(byte sculptType, LLUUID SculptTextureUUID) |
290 | { | 289 | { |
291 | _sculptType = sculptType; | 290 | SculptType = sculptType; |
292 | _sculptTexture = SculptTextureUUID; | 291 | SculptTexture = SculptTextureUUID; |
293 | } | 292 | } |
294 | 293 | ||
295 | public void SetProfileRange(LLVector3 profileRange) | 294 | public void SetProfileRange(LLVector3 profileRange) |
296 | { | 295 | { |
297 | _profileBegin = LLObject.PackBeginCut(profileRange.X); | 296 | ProfileBegin = LLObject.PackBeginCut(profileRange.X); |
298 | _profileEnd = LLObject.PackEndCut(profileRange.Y); | 297 | ProfileEnd = LLObject.PackEndCut(profileRange.Y); |
299 | } | 298 | } |
300 | 299 | ||
301 | public byte[] ExtraParams | 300 | public byte[] ExtraParams |
@@ -310,402 +309,6 @@ namespace OpenSim.Framework | |||
310 | } | 309 | } |
311 | } | 310 | } |
312 | 311 | ||
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 | |||
709 | public byte[] ExtraParamsToBytes() | 312 | public byte[] ExtraParamsToBytes() |
710 | { | 313 | { |
711 | ushort FlexiEP = 0x10; | 314 | ushort FlexiEP = 0x10; |
@@ -716,19 +319,19 @@ namespace OpenSim.Framework | |||
716 | uint TotalBytesLength = 1; // ExtraParamsNum | 319 | uint TotalBytesLength = 1; // ExtraParamsNum |
717 | 320 | ||
718 | uint ExtraParamsNum = 0; | 321 | uint ExtraParamsNum = 0; |
719 | if (_flexiEntry) | 322 | if (FlexiEntry) |
720 | { | 323 | { |
721 | ExtraParamsNum++; | 324 | ExtraParamsNum++; |
722 | TotalBytesLength += 16;// data | 325 | TotalBytesLength += 16;// data |
723 | TotalBytesLength += 2 + 4; // type | 326 | TotalBytesLength += 2 + 4; // type |
724 | } | 327 | } |
725 | if (_lightEntry) | 328 | if (LightEntry) |
726 | { | 329 | { |
727 | ExtraParamsNum++; | 330 | ExtraParamsNum++; |
728 | TotalBytesLength += 16;// data | 331 | TotalBytesLength += 16;// data |
729 | TotalBytesLength += 2 + 4; // type | 332 | TotalBytesLength += 2 + 4; // type |
730 | } | 333 | } |
731 | if (_sculptEntry) | 334 | if (SculptEntry) |
732 | { | 335 | { |
733 | ExtraParamsNum++; | 336 | ExtraParamsNum++; |
734 | TotalBytesLength += 17;// data | 337 | TotalBytesLength += 17;// data |
@@ -743,7 +346,7 @@ namespace OpenSim.Framework | |||
743 | // Stick in the number of parameters | 346 | // Stick in the number of parameters |
744 | returnbytes[i++] = (byte)ExtraParamsNum; | 347 | returnbytes[i++] = (byte)ExtraParamsNum; |
745 | 348 | ||
746 | if (_flexiEntry) | 349 | if (FlexiEntry) |
747 | { | 350 | { |
748 | byte[] FlexiData = GetFlexiBytes(); | 351 | byte[] FlexiData = GetFlexiBytes(); |
749 | 352 | ||
@@ -757,7 +360,7 @@ namespace OpenSim.Framework | |||
757 | Array.Copy(FlexiData, 0, returnbytes, i, FlexiData.Length); | 360 | Array.Copy(FlexiData, 0, returnbytes, i, FlexiData.Length); |
758 | i += FlexiData.Length; | 361 | i += FlexiData.Length; |
759 | } | 362 | } |
760 | if (_lightEntry) | 363 | if (LightEntry) |
761 | { | 364 | { |
762 | byte[] LightData = GetLightBytes(); | 365 | byte[] LightData = GetLightBytes(); |
763 | 366 | ||
@@ -771,7 +374,7 @@ namespace OpenSim.Framework | |||
771 | Array.Copy(LightData, 0, returnbytes, i, LightData.Length); | 374 | Array.Copy(LightData, 0, returnbytes, i, LightData.Length); |
772 | i += LightData.Length; | 375 | i += LightData.Length; |
773 | } | 376 | } |
774 | if (_sculptEntry) | 377 | if (SculptEntry) |
775 | { | 378 | { |
776 | byte[] SculptData = GetSculptBytes(); | 379 | byte[] SculptData = GetSculptBytes(); |
777 | 380 | ||
@@ -786,7 +389,7 @@ namespace OpenSim.Framework | |||
786 | i += SculptData.Length; | 389 | i += SculptData.Length; |
787 | } | 390 | } |
788 | 391 | ||
789 | if (!_flexiEntry && !_lightEntry && !_sculptEntry) | 392 | if (!FlexiEntry && !LightEntry && !SculptEntry) |
790 | { | 393 | { |
791 | byte[] returnbyte = new byte[1]; | 394 | byte[] returnbyte = new byte[1]; |
792 | returnbyte[0] = 0; | 395 | returnbyte[0] = 0; |
@@ -810,7 +413,7 @@ namespace OpenSim.Framework | |||
810 | case FlexiEP: | 413 | case FlexiEP: |
811 | if (!inUse) | 414 | if (!inUse) |
812 | { | 415 | { |
813 | _flexiEntry = false; | 416 | FlexiEntry = false; |
814 | return; | 417 | return; |
815 | } | 418 | } |
816 | ReadFlexiData(data, 0); | 419 | ReadFlexiData(data, 0); |
@@ -819,7 +422,7 @@ namespace OpenSim.Framework | |||
819 | case LightEP: | 422 | case LightEP: |
820 | if (!inUse) | 423 | if (!inUse) |
821 | { | 424 | { |
822 | _lightEntry = false; | 425 | LightEntry = false; |
823 | return; | 426 | return; |
824 | } | 427 | } |
825 | ReadLightData(data, 0); | 428 | ReadLightData(data, 0); |
@@ -828,7 +431,7 @@ namespace OpenSim.Framework | |||
828 | case SculptEP: | 431 | case SculptEP: |
829 | if (!inUse) | 432 | if (!inUse) |
830 | { | 433 | { |
831 | _sculptEntry = false; | 434 | SculptEntry = false; |
832 | return; | 435 | return; |
833 | } | 436 | } |
834 | ReadSculptData(data, 0); | 437 | ReadSculptData(data, 0); |
@@ -885,11 +488,11 @@ namespace OpenSim.Framework | |||
885 | } | 488 | } |
886 | 489 | ||
887 | if (!lGotFlexi) | 490 | if (!lGotFlexi) |
888 | _flexiEntry = false; | 491 | FlexiEntry = false; |
889 | if (!lGotLight) | 492 | if (!lGotLight) |
890 | _lightEntry = false; | 493 | LightEntry = false; |
891 | if (!lGotSculpt) | 494 | if (!lGotSculpt) |
892 | _sculptEntry = false; | 495 | SculptEntry = false; |
893 | 496 | ||
894 | } | 497 | } |
895 | 498 | ||
@@ -901,7 +504,7 @@ namespace OpenSim.Framework | |||
901 | 504 | ||
902 | if (data.Length+pos >= 17) | 505 | if (data.Length+pos >= 17) |
903 | { | 506 | { |
904 | _sculptEntry = true; | 507 | SculptEntry = true; |
905 | SculptTextureUUID = new byte[16]; | 508 | SculptTextureUUID = new byte[16]; |
906 | SculptTypel = data[16 + pos]; | 509 | SculptTypel = data[16 + pos]; |
907 | Array.Copy(data, pos, SculptTextureUUID,0, 16); | 510 | Array.Copy(data, pos, SculptTextureUUID,0, 16); |
@@ -909,18 +512,18 @@ namespace OpenSim.Framework | |||
909 | } | 512 | } |
910 | else | 513 | else |
911 | { | 514 | { |
912 | _sculptEntry = false; | 515 | SculptEntry = false; |
913 | SculptUUID = LLUUID.Zero; | 516 | SculptUUID = LLUUID.Zero; |
914 | SculptTypel = 0x00; | 517 | SculptTypel = 0x00; |
915 | } | 518 | } |
916 | 519 | ||
917 | if (_sculptEntry) | 520 | if (SculptEntry) |
918 | { | 521 | { |
919 | if (_sculptType != (byte)1 && _sculptType != (byte)2 && _sculptType != (byte)3 && _sculptType != (byte)4) | 522 | if (SculptType != (byte)1 && SculptType != (byte)2 && SculptType != (byte)3 && SculptType != (byte)4) |
920 | _sculptType = 4; | 523 | SculptType = 4; |
921 | } | 524 | } |
922 | _sculptTexture = SculptUUID; | 525 | SculptTexture = SculptUUID; |
923 | _sculptType = SculptTypel; | 526 | SculptType = SculptTypel; |
924 | //m_log.Info("[SCULPT]:" + SculptUUID.ToString()); | 527 | //m_log.Info("[SCULPT]:" + SculptUUID.ToString()); |
925 | } | 528 | } |
926 | 529 | ||
@@ -928,8 +531,8 @@ namespace OpenSim.Framework | |||
928 | { | 531 | { |
929 | byte[] data = new byte[17]; | 532 | byte[] data = new byte[17]; |
930 | 533 | ||
931 | _sculptTexture.GetBytes().CopyTo(data, 0); | 534 | SculptTexture.GetBytes().CopyTo(data, 0); |
932 | data[16] = (byte)_sculptType; | 535 | data[16] = (byte)SculptType; |
933 | 536 | ||
934 | return data; | 537 | return data; |
935 | } | 538 | } |
@@ -938,30 +541,30 @@ namespace OpenSim.Framework | |||
938 | { | 541 | { |
939 | if (data.Length-pos >= 16) | 542 | if (data.Length-pos >= 16) |
940 | { | 543 | { |
941 | _flexiEntry = true; | 544 | FlexiEntry = true; |
942 | _flexiSoftness = ((data[pos] & 0x80) >> 6) | ((data[pos + 1] & 0x80) >> 7); | 545 | FlexiSoftness = ((data[pos] & 0x80) >> 6) | ((data[pos + 1] & 0x80) >> 7); |
943 | 546 | ||
944 | _flexiTension = (float)(data[pos++] & 0x7F) / 10.0f; | 547 | FlexiTension = (float)(data[pos++] & 0x7F) / 10.0f; |
945 | _flexiDrag = (float)(data[pos++] & 0x7F) / 10.0f; | 548 | FlexiDrag = (float)(data[pos++] & 0x7F) / 10.0f; |
946 | _flexiGravity = (float)(data[pos++] / 10.0f) - 10.0f; | 549 | FlexiGravity = (float)(data[pos++] / 10.0f) - 10.0f; |
947 | _flexiWind = (float)data[pos++] / 10.0f; | 550 | FlexiWind = (float)data[pos++] / 10.0f; |
948 | LLVector3 lForce = new LLVector3(data, pos); | 551 | LLVector3 lForce = new LLVector3(data, pos); |
949 | _flexiForceX = lForce.X; | 552 | FlexiForceX = lForce.X; |
950 | _flexiForceY = lForce.Y; | 553 | FlexiForceY = lForce.Y; |
951 | _flexiForceZ = lForce.Z; | 554 | FlexiForceZ = lForce.Z; |
952 | } | 555 | } |
953 | else | 556 | else |
954 | { | 557 | { |
955 | _flexiEntry = false; | 558 | FlexiEntry = false; |
956 | _flexiSoftness = 0; | 559 | FlexiSoftness = 0; |
957 | 560 | ||
958 | _flexiTension = 0.0f; | 561 | FlexiTension = 0.0f; |
959 | _flexiDrag = 0.0f; | 562 | FlexiDrag = 0.0f; |
960 | _flexiGravity = 0.0f; | 563 | FlexiGravity = 0.0f; |
961 | _flexiWind = 0.0f; | 564 | FlexiWind = 0.0f; |
962 | _flexiForceX = 0f; | 565 | FlexiForceX = 0f; |
963 | _flexiForceY = 0f; | 566 | FlexiForceY = 0f; |
964 | _flexiForceZ = 0f; | 567 | FlexiForceZ = 0f; |
965 | } | 568 | } |
966 | } | 569 | } |
967 | 570 | ||
@@ -971,14 +574,14 @@ namespace OpenSim.Framework | |||
971 | int i = 0; | 574 | int i = 0; |
972 | 575 | ||
973 | // Softness is packed in the upper bits of tension and drag | 576 | // Softness is packed in the upper bits of tension and drag |
974 | data[i] = (byte)((_flexiSoftness & 2) << 6); | 577 | data[i] = (byte)((FlexiSoftness & 2) << 6); |
975 | data[i + 1] = (byte)((_flexiSoftness & 1) << 7); | 578 | data[i + 1] = (byte)((FlexiSoftness & 1) << 7); |
976 | 579 | ||
977 | data[i++] |= (byte)((byte)(_flexiTension * 10.01f) & 0x7F); | 580 | data[i++] |= (byte)((byte)(FlexiTension * 10.01f) & 0x7F); |
978 | data[i++] |= (byte)((byte)(_flexiDrag * 10.01f) & 0x7F); | 581 | data[i++] |= (byte)((byte)(FlexiDrag * 10.01f) & 0x7F); |
979 | data[i++] = (byte)((_flexiGravity + 10.0f) * 10.01f); | 582 | data[i++] = (byte)((FlexiGravity + 10.0f) * 10.01f); |
980 | data[i++] = (byte)(_flexiWind * 10.01f); | 583 | data[i++] = (byte)(FlexiWind * 10.01f); |
981 | LLVector3 lForce = new LLVector3(_flexiForceX, _flexiForceY, _flexiForceZ); | 584 | LLVector3 lForce = new LLVector3(FlexiForceX, FlexiForceY, FlexiForceZ); |
982 | lForce.GetBytes().CopyTo(data, i); | 585 | lForce.GetBytes().CopyTo(data, i); |
983 | 586 | ||
984 | return data; | 587 | return data; |
@@ -988,29 +591,29 @@ namespace OpenSim.Framework | |||
988 | { | 591 | { |
989 | if (data.Length - pos >= 16) | 592 | if (data.Length - pos >= 16) |
990 | { | 593 | { |
991 | _lightEntry = true; | 594 | LightEntry = true; |
992 | LLColor lColor = new LLColor(data, pos, false); | 595 | LLColor lColor = new LLColor(data, pos, false); |
993 | _lightIntensity = lColor.A; | 596 | LightIntensity = lColor.A; |
994 | _lightColorA = 1f; | 597 | LightColorA = 1f; |
995 | _lightColorR = lColor.R; | 598 | LightColorR = lColor.R; |
996 | _lightColorG = lColor.G; | 599 | LightColorG = lColor.G; |
997 | _lightColorB = lColor.B; | 600 | LightColorB = lColor.B; |
998 | 601 | ||
999 | _lightRadius = Helpers.BytesToFloat(data, pos + 4); | 602 | LightRadius = Helpers.BytesToFloat(data, pos + 4); |
1000 | _lightCutoff = Helpers.BytesToFloat(data, pos + 8); | 603 | LightCutoff = Helpers.BytesToFloat(data, pos + 8); |
1001 | _lightFalloff = Helpers.BytesToFloat(data, pos + 12); | 604 | LightFalloff = Helpers.BytesToFloat(data, pos + 12); |
1002 | } | 605 | } |
1003 | else | 606 | else |
1004 | { | 607 | { |
1005 | _lightEntry = false; | 608 | LightEntry = false; |
1006 | _lightColorA = 1f; | 609 | LightColorA = 1f; |
1007 | _lightColorR = 0f; | 610 | LightColorR = 0f; |
1008 | _lightColorG = 0f; | 611 | LightColorG = 0f; |
1009 | _lightColorB = 0f; | 612 | LightColorB = 0f; |
1010 | _lightRadius = 0f; | 613 | LightRadius = 0f; |
1011 | _lightCutoff = 0f; | 614 | LightCutoff = 0f; |
1012 | _lightFalloff = 0f; | 615 | LightFalloff = 0f; |
1013 | _lightIntensity = 0f; | 616 | LightIntensity = 0f; |
1014 | } | 617 | } |
1015 | } | 618 | } |
1016 | 619 | ||
@@ -1019,12 +622,12 @@ namespace OpenSim.Framework | |||
1019 | byte[] data = new byte[16]; | 622 | byte[] data = new byte[16]; |
1020 | 623 | ||
1021 | // Alpha channel in color is intensity | 624 | // Alpha channel in color is intensity |
1022 | LLColor tmpColor = new LLColor(_lightColorR,_lightColorG,_lightColorB,_lightIntensity); | 625 | LLColor tmpColor = new LLColor(LightColorR,LightColorG,LightColorB,LightIntensity); |
1023 | 626 | ||
1024 | tmpColor.GetBytes().CopyTo(data, 0); | 627 | tmpColor.GetBytes().CopyTo(data, 0); |
1025 | Helpers.FloatToBytes(_lightRadius).CopyTo(data, 4); | 628 | Helpers.FloatToBytes(LightRadius).CopyTo(data, 4); |
1026 | Helpers.FloatToBytes(_lightCutoff).CopyTo(data, 8); | 629 | Helpers.FloatToBytes(LightCutoff).CopyTo(data, 8); |
1027 | Helpers.FloatToBytes(_lightFalloff).CopyTo(data, 12); | 630 | Helpers.FloatToBytes(LightFalloff).CopyTo(data, 12); |
1028 | 631 | ||
1029 | return data; | 632 | return data; |
1030 | } | 633 | } |