2 * rigid shape information
4 * License : The MIT License
5 * Copyright(c) 2010 MikuToga Partners
8 package jp.sourceforge.mikutoga.pmd.model;
10 import jp.sourceforge.mikutoga.pmd.RigidShapeType;
14 * 球及びカプセルの半径と箱の幅は同じ値が用いられる。
16 public class RigidShape {
18 private RigidShapeType type = RigidShapeType.BOX;
19 private float width = 0.1f;
20 private float height = 0.1f;
21 private float depth = 0.1f;
35 public RigidShapeType getShapeType(){
41 * @param typeArg 剛体形状種別
42 * @throws NullPointerException 引数がnull
44 public void setShapeType(RigidShapeType typeArg)
45 throws NullPointerException{
46 if(typeArg == null) throw new NullPointerException();
55 public float getWidth(){
63 public void setWidth(float width){
72 public float getHeight(){
78 * @param height 箱及びカプセルの高さ
80 public void setHeight(float height){
89 public float getDepth(){
97 public void setDepth(float depth){
106 public float getRadius(){
112 * @param radius 球及びカプセルの半径
114 public void setRadius(float radius){
121 * @return {@inheritDoc}
124 public String toString(){
125 StringBuilder result = new StringBuilder();
127 result.append(this.type).append(' ');
131 result.append("r=").append(this.width);
134 result.append("w=").append(this.width).append(", ");
135 result.append("h=").append(this.height).append(", ");
136 result.append("d=").append(this.depth);
139 result.append("r=").append(this.width).append(", ");
140 result.append("h=").append(this.height);
144 throw new AssertionError();
147 return result.toString();