VladX 0 Share Posted June 5, 2020 It is expected that shape recieved from getHullBounds() method doesn't follow moving object? getBountingBox() is following after moving object, also tile but hull bounds only have actual rotation of observed object. Shape of the model also doesn't move. It's a bug or not? Draw Lines colors: Whilte - BoundingBox Yellow - Tile Red - Model shape Green - HullBounds Maybe i do something wrong to recieve actual model? That occurs ofcourse when is don't get new Object, but what for if tiles and rectangle are updated? Link to comment Share on other sites More sharing options...
Pseudo 179 Share Posted June 5, 2020 Show code. Link to comment Share on other sites More sharing options...
VladX 0 Author Share Posted July 11, 2020 Iterator<Entity> et = entitiesToPaint.iterator(); while (et.hasNext()) { Entity entity = et.next(); g.setColor(Color.YELLOW); g.draw(entity.getTile().getPolygon()); g.setColor(Color.WHITE); g.draw(entity.getBoundingBox()); Model model = entity.getModel(); model = model.update(model);// what it do? g.setColor(Color.RED); model.drawWireFrame(g); g.setColor(Color.GREEN); Point p = entity.getClickablePoint(); g.drawRect((int) p.getX() - 5, (int) p.getY() - 5, 10, 10); g.setColor(Color.BLUE); g.draw(model.getHullBounds(0.78f)); Point center = model.calculateCenterPoint(); int x = (int) Math.round(center.getX()); int y = (int) Math.round(center.getY()); g.setColor(Color.CYAN); g.drawString("x", x - 2, y + 4); g.setColor(Color.WHITE); g.drawRect(x - 1, y - 1, 2, 2); } Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.