| 241 |
/*Now we set the caption of the window to some nice text. Note that there is a 'L' in front of the string: the Irrlicht Engine uses |
/*Now we set the caption of the window to some nice text. Note that there is a 'L' in front of the string: the Irrlicht Engine uses |
| 242 |
wide character strings when displaying text. |
wide character strings when displaying text. |
| 243 |
*/ |
*/ |
| 244 |
device.WindowCaption = "IdealistViewer 0.000000000001f"; |
device.WindowCaption = "IdealistViewer 0.000000000002"; |
| 245 |
device.FileSystem.WorkingDirectory = m_startupDirectory + "\\" + Util.MakePath("media", "materials", "textures", ""); //We set Irrlicht's current directory to %application directory%/media |
device.FileSystem.WorkingDirectory = m_startupDirectory + "\\" + Util.MakePath("media", "materials", "textures", ""); //We set Irrlicht's current directory to %application directory%/media |
| 246 |
|
|
| 247 |
// |
// |
| 262 |
// |
// |
| 263 |
cam = new Camera(smgr); |
cam = new Camera(smgr); |
| 264 |
|
|
| 265 |
smgr.SetAmbientLight(new Colorf(0, 0.5f, 0.5f, 0.5f)); |
smgr.VideoDriver.AmbientLight = new Color(255, 128, 128, 128); |
| 266 |
|
|
| 267 |
|
|
| 268 |
//AnimatedMesh mesh = smgr.GetMesh("sydney.md2"); |
//AnimatedMesh mesh = smgr.GetMesh("sydney.md2"); |
| 269 |
//AnimatedMeshSceneNode node99 = smgr.AddAnimatedMeshSceneNode(mesh); |
//AnimatedMeshSceneNode node99 = smgr.AddAnimatedMeshSceneNode(mesh); |
| 282 |
smgr.AddSkyBoxSceneNode(null, new Texture[] { |
smgr.AddSkyBoxSceneNode(null, new Texture[] { |
| 283 |
driver.GetTexture("irrlicht2_up.jpg"), |
driver.GetTexture("irrlicht2_up.jpg"), |
| 284 |
driver.GetTexture("irrlicht2_dn.jpg"), |
driver.GetTexture("irrlicht2_dn.jpg"), |
|
driver.GetTexture("irrlicht2_lf.jpg"), |
|
| 285 |
driver.GetTexture("irrlicht2_rt.jpg"), |
driver.GetTexture("irrlicht2_rt.jpg"), |
| 286 |
|
driver.GetTexture("irrlicht2_lf.jpg"), |
| 287 |
driver.GetTexture("irrlicht2_ft.jpg"), |
driver.GetTexture("irrlicht2_ft.jpg"), |
| 288 |
driver.GetTexture("irrlicht2_bk.jpg")}, 0); |
driver.GetTexture("irrlicht2_bk.jpg")}, 0); |
| 289 |
|
|
| 387 |
doProcessMesh(5); |
doProcessMesh(5); |
| 388 |
doObjectMods(5); |
doObjectMods(5); |
| 389 |
CheckAndApplyParent(5); |
CheckAndApplyParent(5); |
| 390 |
doTextureMods(); |
doTextureMods(1); |
| 391 |
doSetCameraPosition(); |
doSetCameraPosition(); |
| 392 |
} |
} |
| 393 |
//Thread.Sleep(50); |
//Thread.Sleep(50); |
| 476 |
|
|
| 477 |
} |
} |
| 478 |
|
|
| 479 |
private void doTextureMods() |
private void doTextureMods(int pCount) |
| 480 |
{ |
{ |
| 481 |
lock (assignTextureQueue) |
lock (assignTextureQueue) |
| 482 |
{ |
{ |
| 483 |
while (assignTextureQueue.Count > 0) |
if (assignTextureQueue.Count < pCount) |
| 484 |
|
pCount = assignTextureQueue.Count; |
| 485 |
|
} |
| 486 |
|
|
| 487 |
|
for (int i=0;i < pCount; i++) |
| 488 |
|
{ |
| 489 |
|
|
| 490 |
|
TextureComplete tx; |
| 491 |
|
TextureExtended tex = null; |
| 492 |
|
|
| 493 |
|
lock (assignTextureQueue) |
| 494 |
{ |
{ |
| 495 |
TextureComplete tx = assignTextureQueue.Dequeue(); |
if (i >= assignTextureQueue.Count) |
| 496 |
Texture tex = driver.GetTexture(tx.texture); |
break; |
| 497 |
if (tx.node != null) |
|
| 498 |
|
tx = assignTextureQueue.Dequeue(); |
| 499 |
|
tex = (TextureExtended)driver.GetTexture(tx.texture); |
| 500 |
|
} |
| 501 |
|
|
| 502 |
|
if (tx.node != null && tex != null) |
| 503 |
{ |
{ |
| 504 |
textureMan.applyTexture(tex, tx.node); |
textureMan.applyTexture(tex, tx.node); |
| 505 |
} |
} |
| 506 |
} |
} |
| 507 |
} |
|
| 508 |
|
|
| 509 |
} |
} |
| 510 |
private void doSetCameraPosition() |
private void doSetCameraPosition() |
| 511 |
{ |
{ |
| 620 |
node = vObj.node; |
node = vObj.node; |
| 621 |
} |
} |
| 622 |
|
|
| 623 |
|
Mesh avmeshmesh = avmesh.GetMesh(0); |
| 624 |
|
|
| 625 |
|
|
| 626 |
node.Scale = new Vector3D(0.035f, 0.035f, 0.035f); |
node.Scale = new Vector3D(0.035f, 0.035f, 0.035f); |
| 1030 |
} |
} |
| 1031 |
else |
else |
| 1032 |
{ |
{ |
| 1033 |
|
|
| 1034 |
vobj.updateFullYN = true; |
vobj.updateFullYN = true; |
| 1035 |
enqueueVObject(vobj); |
enqueueVObject(vobj); |
| 1036 |
} |
} |
| 1037 |
} |
} |
| 1038 |
|
} |
| 1039 |
|
|
| 1040 |
|
public void doAnimationFrame() |
| 1041 |
|
{ |
| 1042 |
|
lock (Avatars) |
| 1043 |
|
{ |
| 1044 |
|
foreach (UUID avatarID in Avatars.Keys) |
| 1045 |
|
{ |
| 1046 |
|
VObject avobj = Avatars[avatarID]; |
| 1047 |
|
|
| 1048 |
|
if (avobj.prim.ID.ToString().Contains("dead")) |
| 1049 |
|
continue; |
| 1050 |
|
|
| 1051 |
|
if (avobj.mesh != null) |
| 1052 |
|
{ |
| 1053 |
|
|
| 1054 |
} |
} |
| 1055 |
|
} |
| 1056 |
|
} |
| 1057 |
|
} |
| 1058 |
|
|
| 1059 |
#endregion |
#endregion |
| 1060 |
|
|
| 1061 |
|
|
| 2047 |
|
|
| 2048 |
Vector3D collisionpoint = new Vector3D(0, 0, 0); |
Vector3D collisionpoint = new Vector3D(0, 0, 0); |
| 2049 |
Triangle3D tri = new Triangle3D(0, 0, 0, 0, 0, 0, 0, 0, 0); |
Triangle3D tri = new Triangle3D(0, 0, 0, 0, 0, 0, 0, 0, 0); |
| 2050 |
SceneNode node = smgr.CollisionManager.GetSceneNodeFromScreenCoordinates(new Position2D(p_event.MousePosition.X, p_event.MousePosition.Y), 0, false); |
SceneNode node = smgr.CollisionManager.GetSceneNodeFromRay(projectedray, 0x0128, true); //smgr.CollisionManager.GetSceneNodeFromScreenCoordinates(new Position2D(p_event.MousePosition.X, p_event.MousePosition.Y), 0, false); |
| 2051 |
if (node == null) |
if (node == null) |
| 2052 |
{ |
{ |
| 2053 |
m_log.Warn("[PICKER]: Picked null"); |
m_log.Warn("[PICKER]: Picked null"); |
| 2059 |
{ |
{ |
| 2060 |
if (smgr.CollisionManager.GetCollisionPoint(projectedray, mts, out collisionpoint, out tri)) |
if (smgr.CollisionManager.GetCollisionPoint(projectedray, mts, out collisionpoint, out tri)) |
| 2061 |
{ |
{ |
| 2062 |
|
|
| 2063 |
//if (collisionpoint != null) |
//if (collisionpoint != null) |
| 2064 |
//{ |
//{ |
| 2065 |
//m_log.DebugFormat("Found point: <{0},{1},{2}>", collisionpoint.X, collisionpoint.Y, collisionpoint.Z); |
//m_log.DebugFormat("Found point: <{0},{1},{2}>", collisionpoint.X, collisionpoint.Y, collisionpoint.Z); |