diff options
author | BlueWall | 2012-12-12 16:15:32 -0500 |
---|---|---|
committer | BlueWall | 2012-12-12 16:15:32 -0500 |
commit | c5d333c16cddbcbcceb1ed0bc937e5775c99c2bc (patch) | |
tree | 644d21cbd5b7e86d9ba3316979fd9a85bc028f51 /OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs | |
parent | Replace Mono.Addins libraries (diff) | |
parent | BulletSim: do not return the current velocity for targetVelocity. (diff) | |
download | opensim-SC_OLD-c5d333c16cddbcbcceb1ed0bc937e5775c99c2bc.zip opensim-SC_OLD-c5d333c16cddbcbcceb1ed0bc937e5775c99c2bc.tar.gz opensim-SC_OLD-c5d333c16cddbcbcceb1ed0bc937e5775c99c2bc.tar.bz2 opensim-SC_OLD-c5d333c16cddbcbcceb1ed0bc937e5775c99c2bc.tar.xz |
Merge branch 'master' of /home/opensim/var/repo/opensim
Diffstat (limited to '')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs index f6a890e..f3b6993 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs | |||
@@ -60,6 +60,9 @@ public abstract class BSPhysObject : PhysicsActor | |||
60 | Linkset = BSLinkset.Factory(PhysicsScene, this); | 60 | Linkset = BSLinkset.Factory(PhysicsScene, this); |
61 | LastAssetBuildFailed = false; | 61 | LastAssetBuildFailed = false; |
62 | 62 | ||
63 | // Default material type | ||
64 | Material = MaterialAttributes.Material.Wood; | ||
65 | |||
63 | CollisionCollection = new CollisionEventUpdate(); | 66 | CollisionCollection = new CollisionEventUpdate(); |
64 | SubscribedEventsMs = 0; | 67 | SubscribedEventsMs = 0; |
65 | CollidingStep = 0; | 68 | CollidingStep = 0; |
@@ -72,6 +75,7 @@ public abstract class BSPhysObject : PhysicsActor | |||
72 | public string TypeName { get; protected set; } | 75 | public string TypeName { get; protected set; } |
73 | 76 | ||
74 | public BSLinkset Linkset { get; set; } | 77 | public BSLinkset Linkset { get; set; } |
78 | public BSLinksetInfo LinksetInfo { get; set; } | ||
75 | 79 | ||
76 | // Return the object mass without calculating it or having side effects | 80 | // Return the object mass without calculating it or having side effects |
77 | public abstract float RawMass { get; } | 81 | public abstract float RawMass { get; } |
@@ -109,6 +113,13 @@ public abstract class BSPhysObject : PhysicsActor | |||
109 | public abstract bool IsSolid { get; } | 113 | public abstract bool IsSolid { get; } |
110 | public abstract bool IsStatic { get; } | 114 | public abstract bool IsStatic { get; } |
111 | 115 | ||
116 | // Materialness | ||
117 | public MaterialAttributes.Material Material { get; private set; } | ||
118 | public override void SetMaterial(int material) | ||
119 | { | ||
120 | Material = (MaterialAttributes.Material)material; | ||
121 | } | ||
122 | |||
112 | // Stop all physical motion. | 123 | // Stop all physical motion. |
113 | public abstract void ZeroMotion(bool inTaintTime); | 124 | public abstract void ZeroMotion(bool inTaintTime); |
114 | public abstract void ZeroAngularMotion(bool inTaintTime); | 125 | public abstract void ZeroAngularMotion(bool inTaintTime); |
@@ -128,6 +139,17 @@ public abstract class BSPhysObject : PhysicsActor | |||
128 | public abstract OMV.Quaternion RawOrientation { get; set; } | 139 | public abstract OMV.Quaternion RawOrientation { get; set; } |
129 | public abstract OMV.Quaternion ForceOrientation { get; set; } | 140 | public abstract OMV.Quaternion ForceOrientation { get; set; } |
130 | 141 | ||
142 | // The system is telling us the velocity it wants to move at. | ||
143 | protected OMV.Vector3 m_targetVelocity; | ||
144 | public override OMV.Vector3 TargetVelocity | ||
145 | { | ||
146 | get { return m_targetVelocity; } | ||
147 | set | ||
148 | { | ||
149 | m_targetVelocity = value; | ||
150 | Velocity = value; | ||
151 | } | ||
152 | } | ||
131 | public abstract OMV.Vector3 ForceVelocity { get; set; } | 153 | public abstract OMV.Vector3 ForceVelocity { get; set; } |
132 | 154 | ||
133 | public abstract OMV.Vector3 ForceRotationalVelocity { get; set; } | 155 | public abstract OMV.Vector3 ForceRotationalVelocity { get; set; } |
@@ -243,7 +265,9 @@ public abstract class BSPhysObject : PhysicsActor | |||
243 | SubscribedEventsMs = 0; | 265 | SubscribedEventsMs = 0; |
244 | PhysicsScene.TaintedObject(TypeName+".UnSubscribeEvents", delegate() | 266 | PhysicsScene.TaintedObject(TypeName+".UnSubscribeEvents", delegate() |
245 | { | 267 | { |
246 | CurrentCollisionFlags = BulletSimAPI.RemoveFromCollisionFlags2(PhysBody.ptr, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS); | 268 | // Make sure there is a body there because sometimes destruction happens in an un-ideal order. |
269 | if (PhysBody.HasPhysicalBody) | ||
270 | CurrentCollisionFlags = BulletSimAPI.RemoveFromCollisionFlags2(PhysBody.ptr, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS); | ||
247 | }); | 271 | }); |
248 | } | 272 | } |
249 | // Return 'true' if the simulator wants collision events | 273 | // Return 'true' if the simulator wants collision events |