aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs
diff options
context:
space:
mode:
authorRobert Adams2013-02-10 09:51:34 -0800
committerRobert Adams2013-02-12 15:52:08 -0800
commitfb903ff49089d5fd7a56aa2401528c3e7cf1800c (patch)
tree2e6e28f88e6b7711165a8a315e3796241c4a11d2 /OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs
parentExtend TestJsonCreateStore() with a one key input and an input with raw numbe... (diff)
downloadopensim-SC_OLD-fb903ff49089d5fd7a56aa2401528c3e7cf1800c.zip
opensim-SC_OLD-fb903ff49089d5fd7a56aa2401528c3e7cf1800c.tar.gz
opensim-SC_OLD-fb903ff49089d5fd7a56aa2401528c3e7cf1800c.tar.bz2
opensim-SC_OLD-fb903ff49089d5fd7a56aa2401528c3e7cf1800c.tar.xz
BulletSim: More work on center-of-mass. Remove linksetinfo and rely on simulator to update info.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs31
1 files changed, 20 insertions, 11 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs
index de69fa0..8ebb532 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs
@@ -136,6 +136,7 @@ public abstract class BSPhysObject : PhysicsActor
136 136
137 // The objects base shape information. Null if not a prim type shape. 137 // The objects base shape information. Null if not a prim type shape.
138 public PrimitiveBaseShape BaseShape { get; protected set; } 138 public PrimitiveBaseShape BaseShape { get; protected set; }
139
139 // Some types of objects have preferred physical representations. 140 // Some types of objects have preferred physical representations.
140 // Returns SHAPE_UNKNOWN if there is no preference. 141 // Returns SHAPE_UNKNOWN if there is no preference.
141 public virtual BSPhysicsShapeType PreferredPhysicalShape 142 public virtual BSPhysicsShapeType PreferredPhysicalShape
@@ -150,15 +151,17 @@ public abstract class BSPhysObject : PhysicsActor
150 public EntityProperties LastEntityProperties { get; set; } 151 public EntityProperties LastEntityProperties { get; set; }
151 152
152 public virtual OMV.Vector3 Scale { get; set; } 153 public virtual OMV.Vector3 Scale { get; set; }
153 public abstract bool IsSolid { get; }
154 public abstract bool IsStatic { get; }
155 public abstract bool IsSelected { get; }
156 154
157 // It can be confusing for an actor to know if it should move or update an object 155 // It can be confusing for an actor to know if it should move or update an object
158 // depeneding on the setting of 'selected', 'physical, ... 156 // depeneding on the setting of 'selected', 'physical, ...
159 // This flag is the true test -- if true, the object is being acted on in the physical world 157 // This flag is the true test -- if true, the object is being acted on in the physical world
160 public abstract bool IsPhysicallyActive { get; } 158 public abstract bool IsPhysicallyActive { get; }
161 159
160 // Detailed state of the object.
161 public abstract bool IsSolid { get; }
162 public abstract bool IsStatic { get; }
163 public abstract bool IsSelected { get; }
164
162 // Materialness 165 // Materialness
163 public MaterialAttributes.Material Material { get; private set; } 166 public MaterialAttributes.Material Material { get; private set; }
164 public override void SetMaterial(int material) 167 public override void SetMaterial(int material)
@@ -185,14 +188,6 @@ public abstract class BSPhysObject : PhysicsActor
185 public abstract OMV.Quaternion RawOrientation { get; set; } 188 public abstract OMV.Quaternion RawOrientation { get; set; }
186 public abstract OMV.Quaternion ForceOrientation { get; set; } 189 public abstract OMV.Quaternion ForceOrientation { get; set; }
187 190
188 public virtual float TargetSpeed
189 {
190 get
191 {
192 OMV.Vector3 characterOrientedVelocity = TargetVelocity * OMV.Quaternion.Inverse(OMV.Quaternion.Normalize(RawOrientation));
193 return characterOrientedVelocity.X;
194 }
195 }
196 public abstract OMV.Vector3 RawVelocity { get; set; } 191 public abstract OMV.Vector3 RawVelocity { get; set; }
197 public abstract OMV.Vector3 ForceVelocity { get; set; } 192 public abstract OMV.Vector3 ForceVelocity { get; set; }
198 193
@@ -202,6 +197,7 @@ public abstract class BSPhysObject : PhysicsActor
202 197
203 public virtual bool ForceBodyShapeRebuild(bool inTaintTime) { return false; } 198 public virtual bool ForceBodyShapeRebuild(bool inTaintTime) { return false; }
204 199
200 // The current velocity forward
205 public virtual float ForwardSpeed 201 public virtual float ForwardSpeed
206 { 202 {
207 get 203 get
@@ -210,6 +206,19 @@ public abstract class BSPhysObject : PhysicsActor
210 return characterOrientedVelocity.X; 206 return characterOrientedVelocity.X;
211 } 207 }
212 } 208 }
209 // The forward speed we are trying to achieve (TargetVelocity)
210 public virtual float TargetVelocitySpeed
211 {
212 get
213 {
214 OMV.Vector3 characterOrientedVelocity = TargetVelocity * OMV.Quaternion.Inverse(OMV.Quaternion.Normalize(RawOrientation));
215 return characterOrientedVelocity.X;
216 }
217 }
218
219 // The user can optionally set the center of mass. The user's setting will override any
220 // computed center-of-mass (like in linksets).
221 public OMV.Vector3? UserSetCenterOfMass { get; set; }
213 222
214 #region Collisions 223 #region Collisions
215 224