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); }
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); }
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); } } }