Newer
Older
CactusServer / src / main / java / framework / animation / DefaultPose3D.java
y-ota on 10 May 2018 686 bytes 初うp
  1. package framework.animation;
  2. import javax.media.j3d.Transform3D;
  3.  
  4. import framework.model3D.Object3D;
  5.  
  6. /**
  7. * 初期状態の姿勢
  8. * @author 新田直也
  9. *
  10. */
  11. public class DefaultPose3D extends Pose3D {
  12. public void applyTo(Object3D obj) {
  13. obj.scale.setTransform(new Transform3D());
  14. for (int n = 0; n < obj.children.length; n++) {
  15. subApplyTo((Object3D)obj.children[n]);
  16. }
  17. }
  18. private void subApplyTo(Object3D obj) {
  19. obj.pos.setTransform(new Transform3D());
  20. obj.rot.setTransform(new Transform3D());
  21. obj.scale.setTransform(new Transform3D());
  22. for (int n = 0; n < obj.children.length; n++) {
  23. subApplyTo((Object3D)obj.children[n]);
  24. }
  25. }
  26. }