示例#1
0
        public void AddInstance(R_EnvCell envCell)
        {
            var origin      = envCell.EnvCell.Pos.GetWorldPos();
            var orientation = envCell.EnvCell.Pos.Frame.Orientation.ToXna();

            origin.Z += 0.05f;     // avoid z-fight for building floors

            Instances_Env.Add(new VertexInstanceEnv(origin, orientation));
        }
示例#2
0
 public void BuildInstanceBuffer()
 {
     InstanceBuffer = new VertexBuffer(GraphicsDevice, typeof(VertexInstanceEnv), Instances_Env.Count, BufferUsage.WriteOnly);
     InstanceBuffer.SetData(Instances_Env.ToArray());
 }