2 * rigid shape information
\r
4 * License : The MIT License
\r
5 * Copyright(c) 2010 MikuToga Partners
\r
8 package jp.sourceforge.mikutoga.pmd;
\r
12 * 球及びカプセルの半径と箱の幅は同じ値が用いられる。
\r
14 public class RigidShape {
\r
16 private RigidShapeType type = RigidShapeType.BOX;
\r
17 private float width = 0.1f;
\r
18 private float height = 0.1f;
\r
19 private float depth = 0.1f;
\r
24 public RigidShape(){
\r
33 public RigidShapeType getShapeType(){
\r
39 * @param typeArg 剛体形状種別
\r
40 * @throws NullPointerException 引数がnull
\r
42 public void setShapeType(RigidShapeType typeArg)
\r
43 throws NullPointerException{
\r
44 if(typeArg == null) throw new NullPointerException();
\r
45 this.type = typeArg;
\r
53 public float getWidth(){
\r
61 public void setWidth(float width){
\r
68 * @return 箱及びカプセルの高さ
\r
70 public float getHeight(){
\r
76 * @param height 箱及びカプセルの高さ
\r
78 public void setHeight(float height){
\r
79 this.height = height;
\r
87 public float getDepth(){
\r
93 * @param depth 箱の奥行き
\r
95 public void setDepth(float depth){
\r
102 * @return 球及びカプセルの半径
\r
104 public float getRadius(){
\r
110 * @param radius 球及びカプセルの半径
\r
112 public void setRadius(float radius){
\r
113 this.width = radius;
\r
119 * @return {@inheritDoc}
\r
122 public String toString(){
\r
123 StringBuilder result = new StringBuilder();
\r
125 result.append(this.type).append(' ');
\r
129 result.append("r=").append(this.width);
\r
132 result.append("w=").append(this.width).append(", ");
\r
133 result.append("h=").append(this.height).append(", ");
\r
134 result.append("d=").append(this.depth);
\r
137 result.append("r=").append(this.width).append(", ");
\r
138 result.append("h=").append(this.height);
\r
142 throw new AssertionError();
\r
145 return result.toString();
\r