diff options
author | Dr Scofield | 2009-02-10 13:10:57 +0000 |
---|---|---|
committer | Dr Scofield | 2009-02-10 13:10:57 +0000 |
commit | 180be7de07014aa33bc6066f12a0819b731c1c9d (patch) | |
tree | 3aa13af3cda4b808fa9453655875327699b61311 /OpenSim/Region/OptionalModules/ContentManagementSystem/AuraMetaEntity.cs | |
parent | Stopgap measure: To use gridlaunch, or GUI, start opensim with (diff) | |
download | opensim-SC_OLD-180be7de07014aa33bc6066f12a0819b731c1c9d.zip opensim-SC_OLD-180be7de07014aa33bc6066f12a0819b731c1c9d.tar.gz opensim-SC_OLD-180be7de07014aa33bc6066f12a0819b731c1c9d.tar.bz2 opensim-SC_OLD-180be7de07014aa33bc6066f12a0819b731c1c9d.tar.xz |
this is step 2 of 2 of the OpenSim.Region.Environment refactor.
NOTHING has been deleted or moved off to forge at this point. what
has happened is that OpenSim.Region.Environment.Modules has been split
in two:
- OpenSim.Region.CoreModules: all those modules that are either
directly or indirectly referenced from other OpenSim packages, or
that provide functionality that the OpenSim developer community
considers core functionality:
CoreModules/Agent/AssetTransaction
CoreModules/Agent/Capabilities
CoreModules/Agent/TextureDownload
CoreModules/Agent/TextureSender
CoreModules/Agent/TextureSender/Tests
CoreModules/Agent/Xfer
CoreModules/Avatar/AvatarFactory
CoreModules/Avatar/Chat/ChatModule
CoreModules/Avatar/Combat
CoreModules/Avatar/Currency/SampleMoney
CoreModules/Avatar/Dialog
CoreModules/Avatar/Friends
CoreModules/Avatar/Gestures
CoreModules/Avatar/Groups
CoreModules/Avatar/InstantMessage
CoreModules/Avatar/Inventory
CoreModules/Avatar/Inventory/Archiver
CoreModules/Avatar/Inventory/Transfer
CoreModules/Avatar/Lure
CoreModules/Avatar/ObjectCaps
CoreModules/Avatar/Profiles
CoreModules/Communications/Local
CoreModules/Communications/REST
CoreModules/Framework/EventQueue
CoreModules/Framework/InterfaceCommander
CoreModules/Hypergrid
CoreModules/InterGrid
CoreModules/Scripting/DynamicTexture
CoreModules/Scripting/EMailModules
CoreModules/Scripting/HttpRequest
CoreModules/Scripting/LoadImageURL
CoreModules/Scripting/VectorRender
CoreModules/Scripting/WorldComm
CoreModules/Scripting/XMLRPC
CoreModules/World/Archiver
CoreModules/World/Archiver/Tests
CoreModules/World/Estate
CoreModules/World/Land
CoreModules/World/Permissions
CoreModules/World/Serialiser
CoreModules/World/Sound
CoreModules/World/Sun
CoreModules/World/Terrain
CoreModules/World/Terrain/DefaultEffects
CoreModules/World/Terrain/DefaultEffects/bin
CoreModules/World/Terrain/DefaultEffects/bin/Debug
CoreModules/World/Terrain/Effects
CoreModules/World/Terrain/FileLoaders
CoreModules/World/Terrain/FloodBrushes
CoreModules/World/Terrain/PaintBrushes
CoreModules/World/Terrain/Tests
CoreModules/World/Vegetation
CoreModules/World/Wind
CoreModules/World/WorldMap
- OpenSim.Region.OptionalModules: all those modules that are not core
modules:
OptionalModules/Avatar/Chat/IRC-stuff
OptionalModules/Avatar/Concierge
OptionalModules/Avatar/Voice/AsterixVoice
OptionalModules/Avatar/Voice/SIPVoice
OptionalModules/ContentManagementSystem
OptionalModules/Grid/Interregion
OptionalModules/Python
OptionalModules/SvnSerialiser
OptionalModules/World/NPC
OptionalModules/World/TreePopulator
Diffstat (limited to 'OpenSim/Region/OptionalModules/ContentManagementSystem/AuraMetaEntity.cs')
-rw-r--r-- | OpenSim/Region/OptionalModules/ContentManagementSystem/AuraMetaEntity.cs | 161 |
1 files changed, 161 insertions, 0 deletions
diff --git a/OpenSim/Region/OptionalModules/ContentManagementSystem/AuraMetaEntity.cs b/OpenSim/Region/OptionalModules/ContentManagementSystem/AuraMetaEntity.cs new file mode 100644 index 0000000..d4acc34 --- /dev/null +++ b/OpenSim/Region/OptionalModules/ContentManagementSystem/AuraMetaEntity.cs | |||
@@ -0,0 +1,161 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | #region Header | ||
29 | |||
30 | // AuraMetaEntity.cs created with MonoDevelop | ||
31 | // User: bongiojp at 3:03 PMĀ 8/6/2008 | ||
32 | // | ||
33 | // To change standard headers go to Edit->Preferences->Coding->Standard Headers | ||
34 | // | ||
35 | |||
36 | #endregion Header | ||
37 | |||
38 | using System; | ||
39 | using System.Collections.Generic; | ||
40 | using System.Drawing; | ||
41 | |||
42 | using OpenMetaverse; | ||
43 | |||
44 | using Nini.Config; | ||
45 | |||
46 | using OpenSim.Framework; | ||
47 | using OpenSim.Region.Framework.Interfaces; | ||
48 | using OpenSim.Region.Framework.Scenes; | ||
49 | using OpenSim.Region.Physics.Manager; | ||
50 | |||
51 | using log4net; | ||
52 | |||
53 | namespace OpenSim.Region.OptionalModules.ContentManagement | ||
54 | { | ||
55 | public class AuraMetaEntity : PointMetaEntity | ||
56 | { | ||
57 | #region Constructors | ||
58 | |||
59 | //transparency of root part, NOT particle system. Should probably add support for changing particle system transparency. | ||
60 | public AuraMetaEntity(Scene scene, Vector3 groupPos, float transparency, Vector3 color, Vector3 scale) | ||
61 | : base(scene, groupPos, transparency) | ||
62 | { | ||
63 | SetAura(color, scale); | ||
64 | } | ||
65 | |||
66 | public AuraMetaEntity(Scene scene, UUID uuid, Vector3 groupPos, float transparency, Vector3 color, Vector3 scale) | ||
67 | : base(scene, uuid, groupPos, transparency) | ||
68 | { | ||
69 | SetAura(color, scale); | ||
70 | } | ||
71 | |||
72 | #endregion Constructors | ||
73 | |||
74 | #region Private Methods | ||
75 | |||
76 | private float Average(Vector3 values) | ||
77 | { | ||
78 | return (values.X + values.Y + values.Z)/3f; | ||
79 | } | ||
80 | |||
81 | #endregion Private Methods | ||
82 | |||
83 | #region Public Methods | ||
84 | |||
85 | public void SetAura(Vector3 color, Vector3 scale) | ||
86 | { | ||
87 | SetAura(color, Average(scale) * 2.0f); | ||
88 | } | ||
89 | |||
90 | public void SetAura(Vector3 color, float radius) | ||
91 | { | ||
92 | SceneObjectPart From = m_Entity.RootPart; | ||
93 | |||
94 | //m_log.Debug("[META ENTITY] BEFORE: radius = " + radius); | ||
95 | float burstRadius = 0.1f; | ||
96 | Primitive.ParticleSystem.SourcePattern patternFlags = Primitive.ParticleSystem.SourcePattern.None; | ||
97 | float age = 1.5f; | ||
98 | float burstRate = 0.4f; | ||
99 | if (radius >= 8.0f) | ||
100 | { | ||
101 | //float sizeOfObject = radius / 2.0f; | ||
102 | burstRadius = (radius - 8.0f)/3f; | ||
103 | burstRate = 1.5f; | ||
104 | radius = 7.99f; | ||
105 | patternFlags = Primitive.ParticleSystem.SourcePattern.Explode; | ||
106 | age = 4.0f; | ||
107 | } | ||
108 | SetAura(From, color, radius, burstRadius, age, burstRate, patternFlags); | ||
109 | } | ||
110 | |||
111 | public void SetAura(SceneObjectPart From, Vector3 color, float radius, float burstRadius, float age, float burstRate, Primitive.ParticleSystem.SourcePattern patternFlags) | ||
112 | { | ||
113 | Primitive.ParticleSystem prules = new Primitive.ParticleSystem(); | ||
114 | //prules.PartDataFlags = Primitive.ParticleSystem.ParticleDataFlags.Emissive | | ||
115 | // Primitive.ParticleSystem.ParticleDataFlags.FollowSrc; //PSYS_PART_FLAGS | ||
116 | //prules.PartDataFlags = Primitive.ParticleSystem.ParticleDataFlags.Beam | | ||
117 | // Primitive.ParticleSystem.ParticleDataFlags.TargetPos; | ||
118 | prules.PartStartColor.R = color.X; //PSYS_PART_START_COLOR | ||
119 | prules.PartStartColor.G = color.Y; | ||
120 | prules.PartStartColor.B = color.Z; | ||
121 | prules.PartStartColor.A = 0.5f; //PSYS_PART_START_ALPHA, transparency | ||
122 | prules.PartEndColor.R = color.X; //PSYS_PART_END_COLOR | ||
123 | prules.PartEndColor.G = color.Y; | ||
124 | prules.PartEndColor.B = color.Z; | ||
125 | prules.PartEndColor.A = 0.5f; //PSYS_PART_END_ALPHA, transparency | ||
126 | /*prules.PartStartScaleX = 0.5f; //PSYS_PART_START_SCALE | ||
127 | prules.PartStartScaleY = 0.5f; | ||
128 | prules.PartEndScaleX = 0.5f; //PSYS_PART_END_SCALE | ||
129 | prules.PartEndScaleY = 0.5f; | ||
130 | */ | ||
131 | prules.PartStartScaleX = radius; //PSYS_PART_START_SCALE | ||
132 | prules.PartStartScaleY = radius; | ||
133 | prules.PartEndScaleX = radius; //PSYS_PART_END_SCALE | ||
134 | prules.PartEndScaleY = radius; | ||
135 | prules.PartMaxAge = age; //PSYS_PART_MAX_AGE | ||
136 | prules.PartAcceleration.X = 0.0f; //PSYS_SRC_ACCEL | ||
137 | prules.PartAcceleration.Y = 0.0f; | ||
138 | prules.PartAcceleration.Z = 0.0f; | ||
139 | prules.Pattern = patternFlags; //PSYS_SRC_PATTERN | ||
140 | //prules.Texture = UUID.Zero;//= UUID //PSYS_SRC_TEXTURE, default used if blank | ||
141 | prules.BurstRate = burstRate; //PSYS_SRC_BURST_RATE | ||
142 | prules.BurstPartCount = 2; //PSYS_SRC_BURST_PART_COUNT | ||
143 | //prules.BurstRadius = radius; //PSYS_SRC_BURST_RADIUS | ||
144 | prules.BurstRadius = burstRadius; //PSYS_SRC_BURST_RADIUS | ||
145 | prules.BurstSpeedMin = 0.001f; //PSYS_SRC_BURST_SPEED_MIN | ||
146 | prules.BurstSpeedMax = 0.001f; //PSYS_SRC_BURST_SPEED_MAX | ||
147 | prules.MaxAge = 0.0f; //PSYS_SRC_MAX_AGE | ||
148 | //prules.Target = To; //PSYS_SRC_TARGET_KEY | ||
149 | prules.AngularVelocity.X = 0.0f; //PSYS_SRC_OMEGA | ||
150 | prules.AngularVelocity.Y = 0.0f; | ||
151 | prules.AngularVelocity.Z = 0.0f; | ||
152 | prules.InnerAngle = 0.0f; //PSYS_SRC_ANGLE_BEGIN | ||
153 | prules.OuterAngle = 0.0f; //PSYS_SRC_ANGLE_END | ||
154 | |||
155 | prules.CRC = 1; //activates the particle system?? | ||
156 | From.AddNewParticleSystem(prules); | ||
157 | } | ||
158 | |||
159 | #endregion Public Methods | ||
160 | } | ||
161 | } | ||