public static VObject NewVObject(Primitive pPrim, VObject pOldObj) { VObject returnVObject = null; if (pOldObj == null) { returnVObject = new VObject(); returnVObject.Node = null; } else { returnVObject = pOldObj; } returnVObject.Prim = pPrim; returnVObject.Mesh = null; return returnVObject; }
public static string GetHashId(VObject pObj) { string returnString = string.Empty; if (pObj.Prim != null) { ulong simhandle = pObj.Prim.RegionHandle; ulong TESTNEIGHBOR = 1099511628032256; if (simhandle == 0) simhandle = TESTNEIGHBOR; returnString =simhandle.ToString() + pObj.Prim.LocalID.ToString(); } return returnString; }
/// <summary> /// Set Target to a VObject (for tracking) /// </summary> /// <param name="pTarget"></param> public void SetTarget(VObject pTarget) { if (pTarget == null) return; if (pTarget.Prim != null) { //Vector3D target = new Vector3D(pTarget.Prim.Position.X + pTarget.ParentPosition.X, pTarget.Prim.Position.Z + pTarget.ParentPosition.Z + Reference.Viewer.CameraOffsetY, pTarget.Prim.Position.Y + pTarget.ParentPosition.Y); //Vector3D target = pTarget.Node.Position + new Vector3D( pTarget.ParentPosition.X, pTarget.ParentPosition.Z + Reference.Viewer.CameraOffsetY, pTarget.ParentPosition.Y); Vector3D target = pTarget.Node.Position + new Vector3D(0, Reference.Viewer.CameraOffsetY, 0); // note: prim is in libomv coords, but settarget is in irr coords, so swap y and z SetTarget(target); VOtarget = pTarget; } }
/// <summary> /// User's Camera /// </summary> /// <param name="psmgr">Scene Manager</param> public Camera(Viewer _viewer) : base(_viewer, -1) { // VOtarget = null; SNCamera = Reference.SceneManager.AddCameraSceneNode(Reference.SceneManager.RootSceneNode); SNCamera.Position = new Vector3D(0f, 235f, -44.70f); SNCamera.Target = new Vector3D(-273, -255.3f, 407.3f); SNCamera.FarValue = 12800; SNCamera.FOV = Reference.Viewer.CameraFOV; SNCamera.Name = "Camera"; LookAtCam[0] = Vector3.Zero; LookAtCam[1] = Vector3.Zero; LookAtCam[2] = Vector3.Zero; nowDistance = Reference.Viewer.CameraDistance; UpdateCameraPosition(); }
public IrrMeshThread(Viewer viewer, VObject _obj, string _directory) : base(viewer, -1) { obj = _obj; workDirectory = _directory; }
public void OnTextureComplete(string tex, string extension, VObject vObj, UUID AssetID) { TextureCompleteNotification tx = new TextureCompleteNotification(); tx.texture = tex; tx.extension = extension; tx.vObj = vObj; tx.textureID = AssetID; entityManager.AddTexture(tx); }