private void AddMeshBuilderRecursively(List <HkdShapeInstanceInfo> children) { MyRenderComponentFracturedPiece render = this.Render; foreach (HkdShapeInstanceInfo info in children) { render.AddPiece(info.ShapeName, Matrix.Identity); } }
public MyFracturedBlock() : base() { EntityId = MyEntityIdentifier.AllocateId(); Render = new MyRenderComponentFracturedPiece(); Render.NeedsDraw = true; Render.PersistentFlags = MyPersistentEntityFlags2.Enabled; //NeedsUpdate = MyEntityUpdateEnum.EACH_FRAME; CheckConnectionAllowed = true; AddDebugRenderComponent(new MyFBDebugRender(this)); }
public void SetDataFromCompound(HkdBreakableShape compound) { MyRenderComponentFracturedPiece render = this.Render; if (render != null) { compound.GetChildren(m_shapeInfos); foreach (HkdShapeInstanceInfo info in m_shapeInfos) { if (info.IsValid()) { render.AddPiece(info.ShapeName, info.GetTransform()); } } m_shapeInfos.Clear(); } }
public override void OnAddedToContainer() { base.OnAddedToContainer(); var newRender = new MyRenderComponentFracturedPiece(); if (Entity.Render.ModelStorage != null) { newRender.ModelStorage = Entity.Render.ModelStorage; } Entity.Render.UpdateRenderObject(false); var persistentFlags = Entity.Render.PersistentFlags; var colorMaskHsv = Entity.Render.ColorMaskHsv; Entity.Render = newRender; Entity.Render.NeedsDraw = true; Entity.Render.PersistentFlags |= persistentFlags | MyPersistentEntityFlags2.CastShadows; Entity.Render.ColorMaskHsv = colorMaskHsv; Entity.Render.EnableColorMaskHsv = false; }