diff options
author | Melanie | 2012-11-04 22:44:42 +0000 |
---|---|---|
committer | Melanie | 2012-11-04 22:44:42 +0000 |
commit | c623e358057a9222e872ef648d847dfeb67852aa (patch) | |
tree | 63f474d313e78de31e9ec8b937912e18390903ff /OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs | |
parent | Merge branch 'avination' into careminster (diff) | |
parent | Add a method to query all registered script constants to allow non-XEngine (diff) | |
download | opensim-SC-c623e358057a9222e872ef648d847dfeb67852aa.zip opensim-SC-c623e358057a9222e872ef648d847dfeb67852aa.tar.gz opensim-SC-c623e358057a9222e872ef648d847dfeb67852aa.tar.bz2 opensim-SC-c623e358057a9222e872ef648d847dfeb67852aa.tar.xz |
Merge branch 'master' into careminster
Diffstat (limited to '')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs index 538f905..7127aaf 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs | |||
@@ -63,12 +63,14 @@ public abstract class BSPhysObject : PhysicsActor | |||
63 | public BSLinkset Linkset { get; set; } | 63 | public BSLinkset Linkset { get; set; } |
64 | 64 | ||
65 | // Return the object mass without calculating it or having side effects | 65 | // Return the object mass without calculating it or having side effects |
66 | public abstract float MassRaw { get; } | 66 | public abstract float RawMass { get; } |
67 | // Set the raw mass but also update physical mass properties (inertia, ...) | ||
68 | public abstract void UpdatePhysicalMassProperties(float mass); | ||
67 | 69 | ||
68 | // Reference to the physical body (btCollisionObject) of this object | 70 | // Reference to the physical body (btCollisionObject) of this object |
69 | public BulletBody BSBody; | 71 | public BulletBody PhysBody; |
70 | // Reference to the physical shape (btCollisionShape) of this object | 72 | // Reference to the physical shape (btCollisionShape) of this object |
71 | public BulletShape BSShape; | 73 | public BulletShape PhysShape; |
72 | 74 | ||
73 | // 'true' if the mesh's underlying asset failed to build. | 75 | // 'true' if the mesh's underlying asset failed to build. |
74 | // This will keep us from looping after the first time the build failed. | 76 | // This will keep us from looping after the first time the build failed. |
@@ -76,6 +78,12 @@ public abstract class BSPhysObject : PhysicsActor | |||
76 | 78 | ||
77 | // The objects base shape information. Null if not a prim type shape. | 79 | // The objects base shape information. Null if not a prim type shape. |
78 | public PrimitiveBaseShape BaseShape { get; protected set; } | 80 | public PrimitiveBaseShape BaseShape { get; protected set; } |
81 | // Some types of objects have preferred physical representations. | ||
82 | // Returns SHAPE_UNKNOWN if there is no preference. | ||
83 | public virtual ShapeData.PhysicsShapeType PreferredPhysicalShape | ||
84 | { | ||
85 | get { return ShapeData.PhysicsShapeType.SHAPE_UNKNOWN; } | ||
86 | } | ||
79 | 87 | ||
80 | // When the physical properties are updated, an EntityProperty holds the update values. | 88 | // When the physical properties are updated, an EntityProperty holds the update values. |
81 | // Keep the current and last EntityProperties to enable computation of differences | 89 | // Keep the current and last EntityProperties to enable computation of differences |
@@ -99,8 +107,10 @@ public abstract class BSPhysObject : PhysicsActor | |||
99 | // Tell the object to clean up. | 107 | // Tell the object to clean up. |
100 | public abstract void Destroy(); | 108 | public abstract void Destroy(); |
101 | 109 | ||
110 | public abstract OMV.Vector3 RawPosition { get; set; } | ||
102 | public abstract OMV.Vector3 ForcePosition { get; set; } | 111 | public abstract OMV.Vector3 ForcePosition { get; set; } |
103 | 112 | ||
113 | public abstract OMV.Quaternion RawOrientation { get; set; } | ||
104 | public abstract OMV.Quaternion ForceOrientation { get; set; } | 114 | public abstract OMV.Quaternion ForceOrientation { get; set; } |
105 | 115 | ||
106 | public abstract OMV.Vector3 ForceVelocity { get; set; } | 116 | public abstract OMV.Vector3 ForceVelocity { get; set; } |
@@ -204,7 +214,7 @@ public abstract class BSPhysObject : PhysicsActor | |||
204 | 214 | ||
205 | PhysicsScene.TaintedObject(TypeName+".SubscribeEvents", delegate() | 215 | PhysicsScene.TaintedObject(TypeName+".SubscribeEvents", delegate() |
206 | { | 216 | { |
207 | CurrentCollisionFlags = BulletSimAPI.AddToCollisionFlags2(BSBody.ptr, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS); | 217 | CurrentCollisionFlags = BulletSimAPI.AddToCollisionFlags2(PhysBody.ptr, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS); |
208 | }); | 218 | }); |
209 | } | 219 | } |
210 | else | 220 | else |
@@ -218,7 +228,7 @@ public abstract class BSPhysObject : PhysicsActor | |||
218 | SubscribedEventsMs = 0; | 228 | SubscribedEventsMs = 0; |
219 | PhysicsScene.TaintedObject(TypeName+".UnSubscribeEvents", delegate() | 229 | PhysicsScene.TaintedObject(TypeName+".UnSubscribeEvents", delegate() |
220 | { | 230 | { |
221 | CurrentCollisionFlags = BulletSimAPI.RemoveFromCollisionFlags2(BSBody.ptr, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS); | 231 | CurrentCollisionFlags = BulletSimAPI.RemoveFromCollisionFlags2(PhysBody.ptr, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS); |
222 | }); | 232 | }); |
223 | } | 233 | } |
224 | // Return 'true' if the simulator wants collision events | 234 | // Return 'true' if the simulator wants collision events |