| 597 |
tex = new TextureExtended(driver.GetTexture(tx.texture).Raw); |
tex = new TextureExtended(driver.GetTexture(tx.texture).Raw); |
| 598 |
} |
} |
| 599 |
|
|
| 600 |
if (tx.node != null && tex != null) |
if (tx.vObj != null && tex != null) |
| 601 |
{ |
{ |
| 602 |
textureMan.applyTexture(tex, tx.node); |
textureMan.applyTexture(tex, tx.vObj); |
| 603 |
} |
} |
| 604 |
} |
} |
| 605 |
|
|
| 773 |
{ |
{ |
| 774 |
if (vObj.mesh == null) |
if (vObj.mesh == null) |
| 775 |
continue; |
continue; |
| 776 |
|
if (vObj.updateFullYN) |
| 777 |
|
{ |
| 778 |
node = smgr.AddMeshSceneNode(vObj.mesh, parentNode, (int)vObj.prim.LocalID); |
node = smgr.AddMeshSceneNode(vObj.mesh, parentNode, (int)vObj.prim.LocalID); |
| 779 |
if (node == null) |
|
|
continue; |
|
| 780 |
creatednode = true; |
creatednode = true; |
| 781 |
vObj.node = node; |
vObj.node = node; |
| 782 |
} |
} |
| 783 |
|
else |
| 784 |
|
{ |
| 785 |
|
node = vObj.node; |
| 786 |
|
} |
| 787 |
|
if (node == null) |
| 788 |
|
continue; |
| 789 |
|
} |
| 790 |
|
|
| 791 |
if (node == null && vObj.prim is Avatar) |
if (node == null && vObj.prim is Avatar) |
| 792 |
{ |
{ |
| 885 |
continue; |
continue; |
| 886 |
node.Rotation = finalpos.Matrix.RotationDegrees; |
node.Rotation = finalpos.Matrix.RotationDegrees; |
| 887 |
if (creatednode) |
if (creatednode) |
| 888 |
{ node.SetMaterialFlag(MaterialFlag.NormalizeNormals, true); |
{ |
| 889 |
node.SetMaterialFlag(MaterialFlag.BackFaceCulling, backFaceCulling); |
//node.SetMaterialFlag(MaterialFlag.NormalizeNormals, true); |
| 890 |
node.SetMaterialFlag(MaterialFlag.GouraudShading, true); |
//node.SetMaterialFlag(MaterialFlag.BackFaceCulling, backFaceCulling); |
| 891 |
node.SetMaterialFlag(MaterialFlag.Lighting, true); |
//node.SetMaterialFlag(MaterialFlag.GouraudShading, true); |
| 892 |
node.SetMaterialTexture(0, driver.GetTexture("red_stained_wood.tga")); |
//node.SetMaterialFlag(MaterialFlag.Lighting, true); |
| 893 |
|
//node.SetMaterialTexture(0, driver.GetTexture("red_stained_wood.tga")); |
| 894 |
|
|
| 895 |
TriangleSelector trisel = smgr.CreateTriangleSelector(vObj.mesh, node); |
TriangleSelector trisel = smgr.CreateTriangleSelector(vObj.mesh, node); |
| 896 |
node.TriangleSelector = trisel; |
node.TriangleSelector = trisel; |
| 906 |
{ |
{ |
| 907 |
UUID textureID = vObj.prim.Textures.DefaultTexture.TextureID; |
UUID textureID = vObj.prim.Textures.DefaultTexture.TextureID; |
| 908 |
if (textureMan != null) |
if (textureMan != null) |
| 909 |
textureMan.RequestImage(textureID, node); |
textureMan.RequestImage(textureID, vObj); |
| 910 |
|
|
| 911 |
} |
} |
| 912 |
} |
} |
| 925 |
if (textureID != UUID.Zero) |
if (textureID != UUID.Zero) |
| 926 |
{ |
{ |
| 927 |
if (textureMan != null) |
if (textureMan != null) |
| 928 |
textureMan.RequestImage(textureID, node); |
textureMan.RequestImage(textureID, vObj); |
| 929 |
} |
} |
| 930 |
} |
} |
| 931 |
} |
} |
| 1044 |
|
|
| 1045 |
if (creatednode) |
if (creatednode) |
| 1046 |
{ |
{ |
| 1047 |
node.SetMaterialFlag(MaterialFlag.NormalizeNormals, true); |
//node.SetMaterialFlag(MaterialFlag.NormalizeNormals, true); |
| 1048 |
node.SetMaterialFlag(MaterialFlag.BackFaceCulling, backFaceCulling); |
//node.SetMaterialFlag(MaterialFlag.BackFaceCulling, backFaceCulling); |
| 1049 |
node.SetMaterialFlag(MaterialFlag.GouraudShading, true); |
//node.SetMaterialFlag(MaterialFlag.GouraudShading, true); |
| 1050 |
node.SetMaterialFlag(MaterialFlag.Lighting, true); |
//node.SetMaterialFlag(MaterialFlag.Lighting, true); |
| 1051 |
node.SetMaterialTexture(0, driver.GetTexture("red_stained_wood.tga")); |
//node.SetMaterialTexture(0, driver.GetTexture("red_stained_wood.tga")); |
| 1052 |
|
|
| 1053 |
|
|
| 1054 |
TriangleSelector trisel = smgr.CreateTriangleSelector(vObj.mesh, node); |
TriangleSelector trisel = smgr.CreateTriangleSelector(vObj.mesh, node); |
| 1065 |
{ |
{ |
| 1066 |
UUID textureID = vObj.prim.Textures.DefaultTexture.TextureID; |
UUID textureID = vObj.prim.Textures.DefaultTexture.TextureID; |
| 1067 |
if (textureMan != null) |
if (textureMan != null) |
| 1068 |
textureMan.RequestImage(textureID, node); |
textureMan.RequestImage(textureID, vObj); |
| 1069 |
|
|
| 1070 |
} |
} |
| 1071 |
} |
} |
| 1081 |
if (textureID != UUID.Zero) |
if (textureID != UUID.Zero) |
| 1082 |
{ |
{ |
| 1083 |
if (textureMan != null) |
if (textureMan != null) |
| 1084 |
textureMan.RequestImage(textureID, node); |
textureMan.RequestImage(textureID, vObj); |
| 1085 |
} |
} |
| 1086 |
} |
} |
| 1087 |
} |
} |
| 2264 |
|
|
| 2265 |
#endregion |
#endregion |
| 2266 |
|
|
| 2267 |
public void textureCompleteCallback(string tex, SceneNode node) |
public void textureCompleteCallback(string tex, VObject vObj) |
| 2268 |
{ |
{ |
| 2269 |
TextureComplete tx = new TextureComplete(); |
TextureComplete tx = new TextureComplete(); |
| 2270 |
tx.texture = tex; |
tx.texture = tex; |
| 2271 |
tx.node = node; |
tx.vObj = vObj; |
| 2272 |
assignTextureQueue.Enqueue(tx); |
assignTextureQueue.Enqueue(tx); |
| 2273 |
} |
} |
| 2274 |
} |
} |
| 2275 |
|
|
| 2276 |
public struct TextureComplete |
public struct TextureComplete |
| 2277 |
{ |
{ |
| 2278 |
public SceneNode node; |
public VObject vObj; |
| 2279 |
public string texture; |
public string texture; |
| 2280 |
|
|
| 2281 |
} |
} |