protected AvatarBindingInstance AddBinding(Binding binding) { var content = Content.Get(); var instance = new AvatarBindingInstance(); instance.Mesh = content.AvatarMeshes.Get(binding.MeshTypeID, binding.MeshFileID); if (instance.Mesh != null) { //We make a copy so we can modify it, most of the variables //are kept as pointers because we only change a few locals //per sim, the rest are global instance.Mesh = instance.Mesh.Clone(); } if (binding.TextureFileID > 0) { instance.Texture = content.AvatarTextures.Get(binding.TextureTypeID, binding.TextureFileID); } instance.Mesh.Transform(Skeleton.RootBone); if (GPUMode) { instance.Mesh.StoreOnGPU(GPUDevice); } Bindings.Add(instance); return(instance); }
/// <summary> /// </summary> /// <param name="group"></param> public void DrawMesh(Matrix world, AvatarBindingInstance binding) { this.Sprites.Add(new _3DSprite { Effect = _3DSpriteEffect.CHARACTER, Geometry = binding.Mesh, Texture = binding.Texture, World = world }); }
protected void RemoveBinding(AvatarBindingInstance instance, bool dispose) { Bindings.Remove(instance); }
protected AvatarBindingInstance AddBinding(Binding binding) { var content = Content.Get(); var instance = new AvatarBindingInstance(); instance.Mesh = content.AvatarMeshes.Get(binding.MeshTypeID, binding.MeshFileID); if (instance.Mesh != null) { //We make a copy so we can modify it, most of the variables //are kept as pointers because we only change a few locals //per sim, the rest are global instance.Mesh = instance.Mesh.Clone(); } if (binding.TextureFileID > 0){ instance.Texture = content.AvatarTextures.Get(binding.TextureTypeID, binding.TextureFileID); } instance.Mesh.Transform(Skeleton.RootBone); if (GPUMode) { instance.Mesh.StoreOnGPU(GPUDevice); } Bindings.Add(instance); return instance; }