diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 56 |
1 files changed, 6 insertions, 50 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index a3c7ed3..b00f388 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -1387,46 +1387,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1387 | } | 1387 | } |
1388 | } | 1388 | } |
1389 | 1389 | ||
1390 | private float m_density = 10f; | 1390 | public float Density { get; set; } |
1391 | public float Density { | 1391 | public float GravityModifier { get; set; } |
1392 | get { return m_density; } | 1392 | public float Friction { get; set; } |
1393 | set | 1393 | public float Restitution { get; set; } |
1394 | { | ||
1395 | m_density = value; | ||
1396 | if (PhysActor != null) | ||
1397 | PhysActor.Density = m_density; | ||
1398 | } | ||
1399 | } | ||
1400 | private float m_gravityModifier = 1f; | ||
1401 | public float GravityModifier { | ||
1402 | get { return m_gravityModifier; } | ||
1403 | set | ||
1404 | { | ||
1405 | m_gravityModifier = value; | ||
1406 | if (PhysActor != null) | ||
1407 | PhysActor.GravityModifier = m_gravityModifier; | ||
1408 | } | ||
1409 | } | ||
1410 | private float m_friction = 0.5f; | ||
1411 | public float Friction { | ||
1412 | get { return m_friction; } | ||
1413 | set | ||
1414 | { | ||
1415 | m_friction = value; | ||
1416 | if (PhysActor != null) | ||
1417 | PhysActor.Friction = m_friction; | ||
1418 | } | ||
1419 | } | ||
1420 | private float m_restitution = 0f; | ||
1421 | public float Restitution { | ||
1422 | get { return m_restitution; } | ||
1423 | set | ||
1424 | { | ||
1425 | m_restitution = value; | ||
1426 | if (PhysActor != null) | ||
1427 | PhysActor.Restitution = m_restitution; | ||
1428 | } | ||
1429 | } | ||
1430 | 1394 | ||
1431 | #endregion Public Properties with only Get | 1395 | #endregion Public Properties with only Get |
1432 | 1396 | ||
@@ -1932,18 +1896,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1932 | { | 1896 | { |
1933 | ParentGroup.Scene.AddPhysicalPrim(1); | 1897 | ParentGroup.Scene.AddPhysicalPrim(1); |
1934 | 1898 | ||
1935 | // Update initial values for various physical properties | ||
1936 | pa.SetMaterial(Material); | ||
1937 | pa.Density = Density; | ||
1938 | pa.Friction = Friction; | ||
1939 | pa.Restitution = Restitution; | ||
1940 | pa.GravityModifier = GravityModifier; | ||
1941 | |||
1942 | // Link up callbacks for property updates from the physics engine | ||
1943 | pa.OnRequestTerseUpdate += PhysicsRequestingTerseUpdate; | 1899 | pa.OnRequestTerseUpdate += PhysicsRequestingTerseUpdate; |
1944 | pa.OnOutOfBounds += PhysicsOutOfBounds; | 1900 | pa.OnOutOfBounds += PhysicsOutOfBounds; |
1945 | |||
1946 | // If this is a child prim, tell the physics engine about the parent | ||
1947 | if (ParentID != 0 && ParentID != LocalId) | 1901 | if (ParentID != 0 && ParentID != LocalId) |
1948 | { | 1902 | { |
1949 | PhysicsActor parentPa = ParentGroup.RootPart.PhysActor; | 1903 | PhysicsActor parentPa = ParentGroup.RootPart.PhysActor; |
@@ -4108,6 +4062,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4108 | 4062 | ||
4109 | if (pa != null) | 4063 | if (pa != null) |
4110 | { | 4064 | { |
4065 | pa.SetMaterial(Material); | ||
4111 | DoPhysicsPropertyUpdate(UsePhysics, true); | 4066 | DoPhysicsPropertyUpdate(UsePhysics, true); |
4112 | 4067 | ||
4113 | if ( | 4068 | if ( |
@@ -4220,6 +4175,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4220 | if (pa != null) | 4175 | if (pa != null) |
4221 | { | 4176 | { |
4222 | pa.SOPName = this.Name; // save object into the PhysActor so ODE internals know the joint/body info | 4177 | pa.SOPName = this.Name; // save object into the PhysActor so ODE internals know the joint/body info |
4178 | pa.SetMaterial(Material); | ||
4223 | DoPhysicsPropertyUpdate(rigidBody, true); | 4179 | DoPhysicsPropertyUpdate(rigidBody, true); |
4224 | } | 4180 | } |
4225 | 4181 | ||