Changeset 13465 for branches/HeuristicLab.BinPacking/PackingPlanVisualizations/3D/BasicCuboidShape.cs
- Timestamp:
- 12/14/15 20:23:19 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.BinPacking/PackingPlanVisualizations/3D/BasicCuboidShape.cs
r13032 r13465 25 25 26 26 namespace PackingPlanVisualizations { 27 27 28 28 public class BasicCuboidShape { 29 29 //Basic information 30 private Vector3 shapeSize;30 private readonly Vector3 shapeSize; 31 31 public Vector3 ShapeSize { get { return shapeSize; } } 32 private Vector3 shapePosition;32 private readonly Vector3 shapePosition; 33 33 public Vector3 ShapePosition { get { return shapePosition; } } 34 private int shapeID;34 private readonly int shapeID; 35 35 public int ShapeID { get { return shapeID; } } 36 36 public int Material { get; set; } 37 37 38 38 39 //Vertices 39 //Vertices 40 40 private VertexPositionColorNormal[] shapeTriangleVertices; 41 41 private VertexPositionColorNormal[] shapeLineVertices; 42 42 43 43 public BasicCuboidShape(Vector3 size, Vector3 position, int shapeNr, int material) { 44 shapeSize 45 shapePosition 46 shapeID 44 shapeSize = size; 45 shapePosition = position; 46 shapeID = shapeNr; 47 47 this.Material = material; 48 48 } … … 65 65 66 66 public void RenderShapeTriangles(GraphicsDevice device) { 67 RenderShapeTriangles(device, Material == 0 ? new Color(60, 60,60) :new Color (0,0,0));67 RenderShapeTriangles(device, Material == 0 ? new Color(60, 60, 60) : new Color(0, 0, 0)); 68 68 } 69 69 … … 85 85 } 86 86 87 public Vector3 CalculatePositionRelativeToBottomLeftBackCorner(Vector3 itemSize, Vector3 itemPosition) { 88 //Vector3 bottomLeftBack = shapePosition + new Vector3(-1.0f, -1.0f, 1.0f) * shapeSize; 89 Vector3 newPosition = itemPosition - (shapeSize/2 - itemSize/2); 87 public Vector3 CalculatePositionRelativeToBottomLeftBackCorner(Vector3 itemSize, Vector3 itemPosition) { 88 Vector3 newPosition = itemPosition - (shapeSize / 2 - itemSize / 2); 90 89 return newPosition; 91 90 }
Note: See TracChangeset
for help on using the changeset viewer.