diff options
author | UbitUmarov | 2012-02-18 14:08:42 +0000 |
---|---|---|
committer | UbitUmarov | 2012-02-18 14:08:42 +0000 |
commit | 5351ff925c20c0fd189ee7de85c31521aca8cdf3 (patch) | |
tree | a30ffaae2776843bc917fb08b984f9c811650a17 /OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |
parent | Added simple binary serializer/deserializer to chODE. 100% untested and most ... (diff) | |
download | opensim-SC_OLD-5351ff925c20c0fd189ee7de85c31521aca8cdf3.zip opensim-SC_OLD-5351ff925c20c0fd189ee7de85c31521aca8cdf3.tar.gz opensim-SC_OLD-5351ff925c20c0fd189ee7de85c31521aca8cdf3.tar.bz2 opensim-SC_OLD-5351ff925c20c0fd189ee7de85c31521aca8cdf3.tar.xz |
let SOG know about vehicles. Still needs serialization and applyphyscis on deserialize, etc
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 98 |
1 files changed, 91 insertions, 7 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 53edcd6..1bac4d8 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -43,6 +43,7 @@ using OpenSim.Region.Framework.Scenes.Serialization; | |||
43 | 43 | ||
44 | namespace OpenSim.Region.Framework.Scenes | 44 | namespace OpenSim.Region.Framework.Scenes |
45 | { | 45 | { |
46 | |||
46 | [Flags] | 47 | [Flags] |
47 | public enum scriptEvents | 48 | public enum scriptEvents |
48 | { | 49 | { |
@@ -114,6 +115,90 @@ namespace OpenSim.Region.Framework.Scenes | |||
114 | private bool m_suspendUpdates; | 115 | private bool m_suspendUpdates; |
115 | private List<ScenePresence> m_linkedAvatars = new List<ScenePresence>(); | 116 | private List<ScenePresence> m_linkedAvatars = new List<ScenePresence>(); |
116 | 117 | ||
118 | private SOGVehicle m_vehicle = null; | ||
119 | |||
120 | public int VehicleType | ||
121 | { | ||
122 | get | ||
123 | { | ||
124 | if (m_vehicle == null) | ||
125 | return (int)Vehicle.TYPE_NONE; | ||
126 | else | ||
127 | return (int)m_vehicle.Type; | ||
128 | } | ||
129 | set | ||
130 | { | ||
131 | m_vehicle = null; | ||
132 | if (value == (int)Vehicle.TYPE_NONE) | ||
133 | { | ||
134 | if (RootPart.PhysActor != null) | ||
135 | RootPart.PhysActor.VehicleType = (int)Vehicle.TYPE_NONE; | ||
136 | return; | ||
137 | } | ||
138 | m_vehicle = new SOGVehicle(); | ||
139 | m_vehicle.ProcessTypeChange((Vehicle)value); | ||
140 | { | ||
141 | if (RootPart.PhysActor != null) | ||
142 | RootPart.PhysActor.VehicleType = value; | ||
143 | return; | ||
144 | } | ||
145 | |||
146 | } | ||
147 | } | ||
148 | |||
149 | public void SetVehicleFlags(int param, bool remove) | ||
150 | { | ||
151 | if (m_vehicle == null) | ||
152 | return; | ||
153 | |||
154 | m_vehicle.ProcessVehicleFlags(param, remove); | ||
155 | |||
156 | if (RootPart.PhysActor != null) | ||
157 | { | ||
158 | RootPart.PhysActor.VehicleFlags(param, remove); | ||
159 | } | ||
160 | } | ||
161 | |||
162 | public void SetVehicleFloatParam(int param, float value) | ||
163 | { | ||
164 | if (m_vehicle == null) | ||
165 | return; | ||
166 | |||
167 | m_vehicle.ProcessFloatVehicleParam((Vehicle)param, value); | ||
168 | |||
169 | if (RootPart.PhysActor != null) | ||
170 | { | ||
171 | RootPart.PhysActor.VehicleFloatParam(param, value); | ||
172 | } | ||
173 | } | ||
174 | |||
175 | public void SetVehicleVectorParam(int param, Vector3 value) | ||
176 | { | ||
177 | if (m_vehicle == null) | ||
178 | return; | ||
179 | |||
180 | m_vehicle.ProcessVectorVehicleParam((Vehicle)param, value); | ||
181 | |||
182 | if (RootPart.PhysActor != null) | ||
183 | { | ||
184 | RootPart.PhysActor.VehicleVectorParam(param, value); | ||
185 | } | ||
186 | } | ||
187 | |||
188 | public void SetVehicleRotationParam(int param, Quaternion rotation) | ||
189 | { | ||
190 | if (m_vehicle == null) | ||
191 | return; | ||
192 | |||
193 | m_vehicle.ProcessRotationVehicleParam((Vehicle)param, rotation); | ||
194 | |||
195 | if (RootPart.PhysActor != null) | ||
196 | { | ||
197 | RootPart.PhysActor.VehicleRotationParam(param, rotation); | ||
198 | } | ||
199 | } | ||
200 | |||
201 | |||
117 | public bool areUpdatesSuspended | 202 | public bool areUpdatesSuspended |
118 | { | 203 | { |
119 | get | 204 | get |
@@ -1678,10 +1763,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1678 | /// </summary> | 1763 | /// </summary> |
1679 | public void ApplyPhysics() | 1764 | public void ApplyPhysics() |
1680 | { | 1765 | { |
1681 | // Apply physics to the root prim | ||
1682 | // m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive); | ||
1683 | |||
1684 | // Apply physics to child prims | ||
1685 | SceneObjectPart[] parts = m_parts.GetArray(); | 1766 | SceneObjectPart[] parts = m_parts.GetArray(); |
1686 | if (parts.Length > 1) | 1767 | if (parts.Length > 1) |
1687 | { | 1768 | { |
@@ -1689,18 +1770,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
1689 | 1770 | ||
1690 | // Apply physics to the root prim | 1771 | // Apply physics to the root prim |
1691 | m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive, true); | 1772 | m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive, true); |
1773 | |||
1774 | |||
1692 | for (int i = 0; i < parts.Length; i++) | 1775 | for (int i = 0; i < parts.Length; i++) |
1693 | { | 1776 | { |
1694 | SceneObjectPart part = parts[i]; | 1777 | SceneObjectPart part = parts[i]; |
1695 | if (part.LocalId != m_rootPart.LocalId) | 1778 | if (part.LocalId != m_rootPart.LocalId) |
1696 | // part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), part.VolumeDetectActive); | ||
1697 | part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), part.VolumeDetectActive, true); | 1779 | part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), part.VolumeDetectActive, true); |
1698 | |||
1699 | } | 1780 | } |
1700 | // Hack to get the physics scene geometries in the right spot | 1781 | // Hack to get the physics scene geometries in the right spot |
1701 | // ResetChildPrimPhysicsPositions(); | 1782 | // ResetChildPrimPhysicsPositions(); |
1702 | if (m_rootPart.PhysActor != null) | 1783 | if (m_rootPart.PhysActor != null) |
1784 | { | ||
1703 | m_rootPart.PhysActor.Building = false; | 1785 | m_rootPart.PhysActor.Building = false; |
1786 | |||
1787 | } | ||
1704 | } | 1788 | } |
1705 | else | 1789 | else |
1706 | { | 1790 | { |