public IslandPart(IPositionComponent physical, IMeshRenderComponent renderComponent, BasicPhysicsPart physics, IslandMeshFactory islandMeshFactory) { Physical = physical; RenderComponent = renderComponent; Physics = physics; IslandMeshFactory = islandMeshFactory; }
public void FixPhysical() { if (RenderComponent.Mesh != null) { return; } RenderComponent.Mesh = IslandMeshFactory.GetMesh(Seed); var boundingBox = TW.Assets.GetBoundingBox(RenderComponent.Mesh); var center = (boundingBox.Minimum + boundingBox.Maximum) * 0.5f; center.Y = boundingBox.Maximum.Y; RenderComponent.ObjectMatrix = Matrix.Translation(-center); }