Ejemplo n.º 1
0
        public void Draw(Program program, ref Matrix4d world, SetWorldMatrixCallback setWorldMatrix, IModelMaterialBinder materialBinder)
        {
            ModelMaterial material = null;

            foreach (ModelMesh mesh in meshes)
            {
                if (setWorldMatrix != null)
                {
                    Matrix4d meshWorld;

                    if (mesh.bone != null)
                    {
                        mesh.bone.GetWorldTransform(out meshWorld);
                        world.Multiply(ref meshWorld, out meshWorld);
                        setWorldMatrix.Invoke(ref meshWorld);
                    }
                }

                foreach (ModelPart part in mesh.parts)
                {
                    if (part.Material != null && part.Material != material && materialBinder != null)
                    {
                        material = part.Material;
                        materialBinder.BindMaterial(part.Material);
                    }

                    program.Draw(part.Primitive, part.Count, elementBuffer, elementType, part.Offset);
                }
            }
        }
Ejemplo n.º 2
0
 public void Draw(Program program, ref Matrix4d world, SetWorldMatrixCallback setWorldMatrix = null)
 {
     Draw(program, null, null, ref world, setWorldMatrix);
 }
Ejemplo n.º 3
0
 public void Draw(Program program, string attributeNamePrefix, string attributeNameSuffix, Matrix4d world, SetWorldMatrixCallback setWorldMatrix = null)
 {
     Draw(program, attributeNamePrefix, attributeNameSuffix, ref world, setWorldMatrix);
 }
Ejemplo n.º 4
0
 public void Draw(Program program, string attributeNamePrefix, string attributeNameSuffix, ref Matrix4d world, SetWorldMatrixCallback setWorldMatrix = null)
 {
     BindAttributes(program, attributeNamePrefix, attributeNameSuffix);
     Draw(program, ref world, setWorldMatrix, program as IModelMaterialBinder);
 }
Ejemplo n.º 5
0
 public void Draw(Program program, IChannelAttributeSource channelAttributes, ref Matrix4d world, SetWorldMatrixCallback setWorldMatrix, IModelMaterialBinder materialBinder)
 {
     if (channelAttributes != null)
     {
         BindAttributes(channelAttributes);
     }
     Draw(program, ref world, setWorldMatrix, materialBinder);
 }
Ejemplo n.º 6
0
 public void Draw(Program program, ref Matrix4d world, SetWorldMatrixCallback setWorldMatrix = null)
 {
     Draw(program, null, null, ref world, setWorldMatrix);
 }
Ejemplo n.º 7
0
 public void Draw(Program program, string attributeNamePrefix, string attributeNameSuffix, Matrix4d world, SetWorldMatrixCallback setWorldMatrix = null)
 {
     Draw(program, attributeNamePrefix, attributeNameSuffix, ref world, setWorldMatrix);
 }
Ejemplo n.º 8
0
 public void Draw(Program program, string attributeNamePrefix, string attributeNameSuffix, ref Matrix4d world, SetWorldMatrixCallback setWorldMatrix = null)
 {
     BindAttributes(program, attributeNamePrefix, attributeNameSuffix);
     Draw(program, ref world, setWorldMatrix, program as IModelMaterialBinder);
 }
Ejemplo n.º 9
0
 public void Draw(Program program, IChannelAttributeSource channelAttributes, ref Matrix4d world, SetWorldMatrixCallback setWorldMatrix, IModelMaterialBinder materialBinder)
 {
     if (channelAttributes != null)
         BindAttributes(channelAttributes);
     Draw(program, ref world, setWorldMatrix, materialBinder);
 }
Ejemplo n.º 10
0
        public void Draw(Program program, ref Matrix4d world, SetWorldMatrixCallback setWorldMatrix, IModelMaterialBinder materialBinder)
        {
            ModelMaterial material = null;

            foreach (ModelMesh mesh in meshes) {
                if (setWorldMatrix != null) {
                    Matrix4d meshWorld;

                    if (mesh.bone != null) {
                        mesh.bone.GetWorldTransform(out meshWorld);
                        world.Multiply(ref meshWorld, out meshWorld);
                        setWorldMatrix.Invoke(ref meshWorld);
                    }
                }

                foreach (ModelPart part in mesh.parts) {
                    if (part.Material != null && part.Material != material && materialBinder != null) {
                        material = part.Material;
                        materialBinder.BindMaterial(part.Material);
                    }

                    program.Draw(part.Primitive, part.Count, elementBuffer, elementType, part.Offset);
                }
            }
        }