* ApplyPhysics now creates the PhysActor as well.

afrisby
lbsa71 2007-12-04 13:46:18 +00:00
parent 90611ebf8d
commit bf8239c7fa
2 changed files with 104 additions and 83 deletions

View File

@ -48,7 +48,8 @@ namespace OpenSim.Region.Environment.Scenes
private string m_inventoryFileName = "";
private LLUUID m_folderID = LLUUID.Zero;
[XmlIgnore] public PhysicsActor PhysActor = null;
[XmlIgnore]
public PhysicsActor PhysActor = null;
protected Dictionary<LLUUID, TaskInventoryItem> TaskInventory = new Dictionary<LLUUID, TaskInventoryItem>();
public LLUUID LastOwnerID;
@ -70,9 +71,12 @@ namespace OpenSim.Region.Environment.Scenes
protected byte[] m_particleSystem = new byte[0];
[XmlIgnore] public uint TimeStampFull = 0;
[XmlIgnore] public uint TimeStampTerse = 0;
[XmlIgnore] public uint TimeStampLastActivity = 0; // Will be used for AutoReturn
[XmlIgnore]
public uint TimeStampFull = 0;
[XmlIgnore]
public uint TimeStampTerse = 0;
[XmlIgnore]
public uint TimeStampLastActivity = 0; // Will be used for AutoReturn
/// <summary>
@ -243,7 +247,8 @@ namespace OpenSim.Region.Environment.Scenes
/// <summary></summary>
public LLVector3 Velocity
{
get {
get
{
//if (PhysActor.Velocity.x != 0 || PhysActor.Velocity.y != 0
//|| PhysActor.Velocity.z != 0)
//{
@ -528,8 +533,24 @@ namespace OpenSim.Region.Environment.Scenes
public void ApplyPhysics()
{
bool UsePhysics = ((ObjectFlags & (uint)LLObject.ObjectFlags.Physics) != 0);
DoPhysicsPropertyUpdate(UsePhysics, true);
bool isPhysical = ((ObjectFlags & (uint)LLObject.ObjectFlags.Physics) != 0);
bool isPhantom = ((ObjectFlags & (uint)LLObject.ObjectFlags.Phantom) != 0);
bool usePhysics = isPhysical && !isPhantom;
if (usePhysics)
{
PhysActor = m_parentGroup.m_scene.PhysicsScene.AddPrimShape(
Name,
Shape,
new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y,
AbsolutePosition.Z),
new PhysicsVector(Scale.X, Scale.Y, Scale.Z),
new Quaternion(RotationOffset.W, RotationOffset.X,
RotationOffset.Y, RotationOffset.Z), usePhysics);
}
DoPhysicsPropertyUpdate(usePhysics, true);
}
public void ApplyPermissions()