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