public ProtocolManager(Viewer viewer) : base(viewer, -1) { avatarConnection = new SLProtocol(); avatarConnection.m_user.Settings.MULTIPLE_SIMS = true; avatarConnection.m_user.Settings.STORE_LAND_PATCHES = true; avatarConnection.m_user.Settings.PARCEL_TRACKING = false; // Event handlers // - grid avatarConnection.OnGridConnected += OnGridConnected; // - region avatarConnection.OnSimConnected += OnSimConnected; avatarConnection.OnLandPatch += OnLandPatch; avatarConnection.OnSimDisconnected += OnSimDisconnected; avatarConnection.OnTeleportFinished += OnTeleportFinished; avatarConnection.OnCurrentSimChanged += OnCurrentSimChanged; // - avatars avatarConnection.OnLogin += OnLogin; avatarConnection.OnNewAvatar += OnNewAvatar; avatarConnection.OnAvatarSitResponse += OnAvatarSitResponse; avatarConnection.OnAnimationUpdate += avatarConnection_OnAnimationUpdate; // - prims and assets avatarConnection.OnNewPrim += OnNewPrim_warning; // warning: libomv invokes OnNewPrim event both for new prims and updates to prims avatarConnection.OnObjectUpdated += OnObjectUpdated; avatarConnection.OnObjectDeleted += OnObjectDeleted; avatarConnection.OnAssetReceived += OnAssetReceived; // - miscellanious avatarConnection.OnChat += OnChat; avatarConnection.OnLoadURL += OnLoadURL; avatarConnection.OnRegisterLoginRespons += RegisterLoginResponseHandler; // - sound avatarConnection.OnAttachSound += OnAttachSound; Reference.Viewer.StateManager.OnChanged += new StateManager.ChangedListener(StateManager_OnChanged); }
public TextureManager(Viewer viewer) : base(viewer, -1) { this.viewer = viewer; driver = Reference.VideoDriver; device = Reference.Device; imagefolder = Util.TextureFolder; m_user = Reference.Viewer.ProtocolManager.AvatarConnection; m_user.OnImageReceived += imageReceivedCallback; if (!driver.QueryFeature(VideoDriverFeature.PixelShader_1_1) && !driver.QueryFeature(VideoDriverFeature.ARB_FragmentProgram_1)) { device.Logger.Log("WARNING: Pixel shaders disabled \n" + "because of missing driver/hardware support."); shaderYN=false; } if (!driver.QueryFeature(VideoDriverFeature.VertexShader_1_1) && !driver.QueryFeature(VideoDriverFeature.ARB_FragmentProgram_1)) { device.Logger.Log("WARNING: Vertex shaders disabled \n" + "because of missing driver/hardware support."); shaderYN = false; } if (shaderYN) { GPUProgrammingServices gpu = driver.GPUProgrammingServices; if (gpu != null) { OnShaderConstantSetDelegate callBack = OnSetConstants; newMaterialType1 = gpu.AddHighLevelShaderMaterial(GOOCH_VERTEX_GLSL,"main",VertexShaderType._1_1, GOOCH_FRAG_GLSL,"main", PixelShaderType._1_1, callBack, MaterialType.Solid, 0); } } }
private void IrrFileTCPRequestToAssetServer_recursive(IrrParseLib.IrrDatas _datas, SLProtocol _slProtocol, bool _root, string _directory, bool fetchTextures) { // Request mesh. IrrFileCreateCache(_datas.Mesh.Param.Mesh, _directory); if (fetchTextures) { // Request texture - note no JPEG2000 conversion occurs here. foreach (IrrParseLib.IrrMaterial material in _datas.Materials) { if (material.Texture1 != string.Empty) { IrrFileCreateCache(material.Texture1, _directory); } if (material.Texture2 != string.Empty) { IrrFileCreateCache(material.Texture2, _directory); } if (material.Texture3 != string.Empty) { IrrFileCreateCache(material.Texture3, _directory); } if (material.Texture4 != string.Empty) { IrrFileCreateCache(material.Texture4, _directory); } } } if (_datas.Childs != null) { foreach (IrrParseLib.IrrDatas datas in _datas.Childs) IrrFileTCPRequestToAssetServer_recursive(datas, _slProtocol, false, _directory, fetchTextures); } }
private void IrrFileTCPRequestToAssetServer_recursive(IrrParseLib.IrrDatas _datas, SLProtocol _slProtocol, bool _root, string _directory) { IrrFileTCPRequestToAssetServer_recursive(_datas, _slProtocol, _root, _directory, true); }
private void IrrFileRequestToAssetServer(IrrParseLib.IrrDatas _datas, SLProtocol _slProtocol, bool _root) { string filename = System.IO.Path.GetFileNameWithoutExtension(_datas.Mesh.Param.Mesh); UUID uuid = new UUID(filename); // Request mesh. _slProtocol.RequestAsset(uuid, AssetType.Object, true); // Request texture. foreach (IrrParseLib.IrrMaterial material in _datas.Materials) { if (material.Texture1 != string.Empty) { filename = System.IO.Path.GetFileNameWithoutExtension(material.Texture1); uuid = new UUID(filename); _slProtocol.RequestAsset(uuid, AssetType.Texture, true); } if (material.Texture2 != string.Empty) { filename = System.IO.Path.GetFileNameWithoutExtension(material.Texture2); uuid = new UUID(filename); _slProtocol.RequestAsset(uuid, AssetType.Texture, true); } if (material.Texture3 != string.Empty) { filename = System.IO.Path.GetFileNameWithoutExtension(material.Texture3); uuid = new UUID(filename); _slProtocol.RequestAsset(uuid, AssetType.Texture, true); } if (material.Texture4 != string.Empty) { filename = System.IO.Path.GetFileNameWithoutExtension(material.Texture4); uuid = new UUID(filename); _slProtocol.RequestAsset(uuid, AssetType.Texture, true); } } if (_datas.Childs != null) { foreach (IrrParseLib.IrrDatas datas in _datas.Childs) IrrFileRequestToAssetServer(datas, _slProtocol, false); } }
public void IrrFileTCPRequestToAssetServer_toplevel(IrrParseLib.IrrDatas _datas, SLProtocol _slProtocol, string _directory, bool fetchTextures) { // Request animation file. if (_datas.Mesh.Param.Name != string.Empty) { IrrFileCreateCache(_datas.Mesh.Param.Name + ".xml", _directory); } IrrFileTCPRequestToAssetServer_recursive(_datas, _slProtocol, true, _directory, fetchTextures); }
/// <summary> /// Request asset from IrrDatas by TCP. /// </summary> /// <param name="_datas">IrrDatas</param> /// <param name="_slProtocol">SLProtocol</param> public void IrrFileTCPRequestToAssetServer_toplevel(IrrParseLib.IrrDatas _datas, SLProtocol _slProtocol, string _directory) { IrrFileTCPRequestToAssetServer_toplevel(_datas, _slProtocol, _directory, true); }
/// <summary> /// Request asset from IrrDatas. /// </summary> /// <param name="_datas">IrrDatas</param> /// <param name="_slProtocol">SLProtocol</param> public void IrrFileRequestToAssetServer(IrrParseLib.IrrDatas _datas, SLProtocol _slProtocol) { IrrFileRequestToAssetServer(_datas, _slProtocol, true); }