2 * rigid shape information
4 * License : The MIT License
5 * Copyright(c) 2010 MikuToga Partners
8 package jp.sfjp.mikutoga.pmd.model;
10 import jp.sfjp.mikutoga.pmd.RigidShapeType;
14 * 球及びカプセルの半径と箱の幅は同じ値が用いられる。
16 public class RigidShape {
18 private static final float DEF_DIM = 0.1f;
20 private RigidShapeType type = RigidShapeType.BOX;
22 private float width = DEF_DIM;
23 private float height = DEF_DIM;
24 private float depth = DEF_DIM;
40 public RigidShapeType getShapeType(){
46 * @param typeArg 剛体形状種別
47 * @throws NullPointerException 引数がnull
49 public void setShapeType(RigidShapeType typeArg)
50 throws NullPointerException{
51 if(typeArg == null) throw new NullPointerException();
60 public float getWidth(){
68 public void setWidth(float width){
77 public float getHeight(){
83 * @param height 箱及びカプセルの高さ
85 public void setHeight(float height){
94 public float getDepth(){
102 public void setDepth(float depth){
111 public float getRadius(){
117 * @param radius 球及びカプセルの半径
119 public void setRadius(float radius){
126 * @return {@inheritDoc}
129 public String toString(){
130 StringBuilder result = new StringBuilder();
132 result.append(this.type).append(' ');
136 result.append("r=").append(this.width);
139 result.append("w=").append(this.width).append(", ");
140 result.append("h=").append(this.height).append(", ");
141 result.append("d=").append(this.depth);
144 result.append("r=").append(this.width).append(", ");
145 result.append("h=").append(this.height);
149 throw new AssertionError();
152 return result.toString();