コード例 #1
0
        void IMyClipmapCell.UpdateMesh(MyRenderMessageUpdateClipmapCell msg)
        {
            MyMeshes.UpdateVoxelCell(m_mesh, msg.Metadata, msg.Batches);

            m_scale       = msg.Metadata.PositionScale;
            m_translation = msg.Metadata.PositionOffset;
            m_localAabb   = msg.Metadata.LocalAabb;

            UpdateActorInfo(true);
        }
コード例 #2
0
        void IMyClipmapCell.UpdateMesh(MyRenderMessageUpdateClipmapCell msg)
        {
            MyMeshes.UpdateVoxelCell(Mesh, msg.Batches);

            m_scale       = msg.PositionScale;
            m_translation = msg.PositionOffset;

            var matrix = (Matrix)(Matrix.CreateScale(m_scale) * Matrix.CreateTranslation(m_translation) * m_worldMatrix);

            m_actor.SetMatrix(ref matrix);
            m_actor.GetRenderable().SetVoxelLod(m_lod);

            m_actor.SetAabb(msg.MeshAabb.Transform((Matrix)m_worldMatrix));

            (m_actor.GetComponent(MyActorComponentEnum.Foliage) as MyFoliageComponent).InvalidateStreams();
            m_actor.MarkRenderDirty();
        }