Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 /// <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
     });
 }
Ejemplo n.º 3
0
 protected void RemoveBinding(AvatarBindingInstance instance, bool dispose)
 {
     Bindings.Remove(instance);
 }
Ejemplo n.º 4
0
 protected void RemoveBinding(AvatarBindingInstance instance, bool dispose)
 {
     Bindings.Remove(instance);
 }
Ejemplo n.º 5
0
        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;
        }