| 572 |
else |
else |
| 573 |
{ |
{ |
| 574 |
UnAssignedChildObjectModQueue.Enqueue(vObj); |
UnAssignedChildObjectModQueue.Enqueue(vObj); |
| 575 |
|
continue; |
| 576 |
} |
} |
| 577 |
|
|
| 578 |
} |
} |
| 582 |
//} |
//} |
| 583 |
bool creatednode = false; |
bool creatednode = false; |
| 584 |
SceneNode node = null; |
SceneNode node = null; |
|
if (vObj.node == null) |
|
|
{ |
|
| 585 |
if (vObj.prim is Avatar) |
if (vObj.prim is Avatar) |
| 586 |
{ |
{ |
| 587 |
|
if (((Avatar)vObj.prim).ID.ToString().Contains("dead")) |
| 588 |
|
continue; |
| 589 |
|
if (vObj.node == null && vObj.updateFullYN) |
| 590 |
|
{ |
| 591 |
|
|
| 592 |
|
|
| 593 |
AnimatedMesh avmesh = smgr.GetMesh(avatarMesh); |
AnimatedMesh avmesh = smgr.GetMesh(avatarMesh); |
| 594 |
|
lock (Entities) |
| 595 |
|
{ |
| 596 |
|
vObj.node = smgr.AddAnimatedMeshSceneNode(avmesh); |
| 597 |
|
node = vObj.node; |
| 598 |
|
} |
| 599 |
|
|
| 600 |
|
|
| 601 |
|
|
|
AnimatedMeshSceneNode node2 = smgr.AddAnimatedMeshSceneNode(avmesh); |
|
|
node = node2; |
|
|
vObj.node = node2; |
|
| 602 |
node.Scale = new Vector3D(0.035f, 0.035f, 0.035f); |
node.Scale = new Vector3D(0.035f, 0.035f, 0.035f); |
| 603 |
node.SetMaterialTexture(0, driver.GetTexture(avatarMaterial)); |
node.SetMaterialTexture(0, driver.GetTexture(avatarMaterial)); |
| 604 |
node.SetMaterialFlag(MaterialFlag.Lighting, true); |
node.SetMaterialFlag(MaterialFlag.Lighting, true); |
| 613 |
interpolationTargets.Add(simhandle.ToString() + vObj.prim.LocalID.ToString(), vObj); |
interpolationTargets.Add(simhandle.ToString() + vObj.prim.LocalID.ToString(), vObj); |
| 614 |
} |
} |
| 615 |
} |
} |
| 616 |
|
|
| 617 |
} |
} |
| 618 |
else |
else |
| 619 |
{ |
{ |
| 620 |
node = smgr.AddMeshSceneNode(vObj.mesh, parentNode, (int)vObj.prim.LocalID); |
node = vObj.node; |
|
creatednode = true; |
|
|
vObj.node = node; |
|
| 621 |
} |
} |
| 622 |
|
|
| 623 |
} |
} |
| 624 |
else |
else |
| 625 |
{ |
{ |
| 626 |
node = vObj.node; |
node = smgr.AddMeshSceneNode(vObj.mesh, parentNode, (int)vObj.prim.LocalID); |
| 627 |
|
creatednode = true; |
| 628 |
|
vObj.node = node; |
| 629 |
} |
} |
| 630 |
|
|
| 631 |
|
if (node == null && vObj.prim is Avatar) |
| 632 |
|
{ |
| 633 |
|
// why would node = null? |
| 634 |
|
continue; |
| 635 |
|
} |
| 636 |
if (vObj.prim is Avatar) |
if (vObj.prim is Avatar) |
| 637 |
{ |
{ |
| 638 |
|
|
| 1577 |
if (Entities.ContainsKey(regionHandle.ToString() + update.LocalID.ToString())) |
if (Entities.ContainsKey(regionHandle.ToString() + update.LocalID.ToString())) |
| 1578 |
{ |
{ |
| 1579 |
obj = Entities[regionHandle.ToString() + update.LocalID.ToString()]; |
obj = Entities[regionHandle.ToString() + update.LocalID.ToString()]; |
| 1580 |
|
if (obj.prim is Avatar) |
| 1581 |
|
{ |
| 1582 |
|
if (obj.node != null) |
| 1583 |
|
{ |
| 1584 |
|
obj.updateFullYN = false; |
| 1585 |
|
} |
| 1586 |
|
|
| 1587 |
|
} |
| 1588 |
|
else |
| 1589 |
|
{ |
| 1590 |
obj.updateFullYN = false; |
obj.updateFullYN = false; |
| 1591 |
|
} |
| 1592 |
|
|
| 1593 |
obj.prim.Acceleration = update.Acceleration; |
obj.prim.Acceleration = update.Acceleration; |
| 1594 |
obj.prim.AngularVelocity = update.AngularVelocity; |
obj.prim.AngularVelocity = update.AngularVelocity; |
| 1595 |
obj.prim.CollisionPlane = update.CollisionPlane; |
obj.prim.CollisionPlane = update.CollisionPlane; |
| 1598 |
obj.prim.PrimData.State = update.State; |
obj.prim.PrimData.State = update.State; |
| 1599 |
obj.prim.Textures = update.Textures; |
obj.prim.Textures = update.Textures; |
| 1600 |
obj.prim.Velocity = update.Velocity; |
obj.prim.Velocity = update.Velocity; |
| 1601 |
|
|
| 1602 |
Entities[regionHandle.ToString() + update.LocalID.ToString()] = obj; |
Entities[regionHandle.ToString() + update.LocalID.ToString()] = obj; |
| 1603 |
} |
} |
| 1604 |
} |
} |
| 1606 |
{ |
{ |
| 1607 |
if (obj.prim is Avatar) |
if (obj.prim is Avatar) |
| 1608 |
{ |
{ |
| 1609 |
|
if (obj.node != null) |
| 1610 |
|
{ |
| 1611 |
lock (objectModQueue) |
lock (objectModQueue) |
| 1612 |
{ |
{ |
| 1613 |
objectModQueue.Enqueue(obj); |
objectModQueue.Enqueue(obj); |
| 1614 |
} |
} |
| 1615 |
} |
} |
| 1616 |
|
} |
| 1617 |
else |
else |
| 1618 |
{ |
{ |
| 1619 |
enqueueVObject(obj); |
enqueueVObject(obj); |
| 1649 |
} |
} |
| 1650 |
if (cam.SNtarget == obj.node) |
if (cam.SNtarget == obj.node) |
| 1651 |
cam.SNtarget = null; |
cam.SNtarget = null; |
| 1652 |
|
|
| 1653 |
smgr.AddToDeletionQueue(obj.node); |
smgr.AddToDeletionQueue(obj.node); |
| 1654 |
obj.node = null; |
obj.node = null; |
| 1655 |
|
|
| 1656 |
} |
} |
| 1657 |
Entities.Remove(regionHandle.ToString() + pLocalID.ToString()); |
Entities.Remove(regionHandle.ToString() + pLocalID.ToString()); |
| 1658 |
} |
} |
| 1675 |
private void newAvatarCallback(Simulator sim, Avatar avatar, ulong regionHandle, |
private void newAvatarCallback(Simulator sim, Avatar avatar, ulong regionHandle, |
| 1676 |
ushort timeDilation) |
ushort timeDilation) |
| 1677 |
{ |
{ |
| 1678 |
VObject avob = new VObject(); |
VObject avob = null; |
| 1679 |
avob.prim = avatar; |
|
|
avob.mesh = null; |
|
|
avob.node = null; |
|
| 1680 |
lock (Avatars) |
lock (Avatars) |
| 1681 |
{ |
{ |
| 1682 |
if (Avatars.ContainsKey(avatar.ID)) |
if (Avatars.ContainsKey(avatar.ID)) |
| 1693 |
if (Entities.ContainsKey(regionHandle.ToString() + avatar.LocalID.ToString())) |
if (Entities.ContainsKey(regionHandle.ToString() + avatar.LocalID.ToString())) |
| 1694 |
{ |
{ |
| 1695 |
VObject existingob = Entities[regionHandle.ToString() + avatar.LocalID.ToString()]; |
VObject existingob = Entities[regionHandle.ToString() + avatar.LocalID.ToString()]; |
| 1696 |
if (existingob.node != null) |
existingob.prim = avatar; |
| 1697 |
{ |
Entities[regionHandle.ToString() + avatar.LocalID.ToString()] = existingob; |
| 1698 |
smgr.AddToDeletionQueue(existingob.node); |
avob = existingob; |
|
} |
|
|
Entities[regionHandle.ToString() + avatar.LocalID.ToString()] = avob; |
|
| 1699 |
} |
} |
| 1700 |
else |
else |
| 1701 |
{ |
{ |
| 1702 |
|
avob = new VObject(); |
| 1703 |
|
avob.prim = avatar; |
| 1704 |
|
avob.mesh = null; |
| 1705 |
|
avob.node = null; |
| 1706 |
Entities.Add(regionHandle.ToString() + avatar.LocalID.ToString(), avob); |
Entities.Add(regionHandle.ToString() + avatar.LocalID.ToString(), avob); |
| 1707 |
|
|
| 1708 |
} |
} |
| 1709 |
} |
} |
| 1710 |
lock (objectModQueue) |
lock (objectModQueue) |
| 1711 |
{ |
{ |
| 1712 |
|
avob.updateFullYN = true; |
| 1713 |
objectModQueue.Enqueue(avob); |
objectModQueue.Enqueue(avob); |
| 1714 |
} |
} |
| 1715 |
} |
} |