From e9af2e4dc492da5fd5981e1fa6aae67b8e23b303 Mon Sep 17 00:00:00 2001 From: "Kae..pl" Date: Thu, 26 Jul 2012 13:23:09 +0000 Subject: [PATCH] Classes added that represent new constraints in blender. Classes have no implementation yet, they simply exist so that the loaded models will not crash when they use them. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9587 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../blender/constraints/ConstraintHelper.java | 4 ++ .../constraints/ConstraintSameVolume.java | 45 +++++++++++++++++++ .../constraints/ConstraintTrackTo.java | 45 +++++++++++++++++++ .../constraints/ConstraintTransLike.java | 45 +++++++++++++++++++ 4 files changed, 139 insertions(+) create mode 100644 engine/src/blender/com/jme3/scene/plugins/blender/constraints/ConstraintSameVolume.java create mode 100644 engine/src/blender/com/jme3/scene/plugins/blender/constraints/ConstraintTrackTo.java create mode 100644 engine/src/blender/com/jme3/scene/plugins/blender/constraints/ConstraintTransLike.java diff --git a/engine/src/blender/com/jme3/scene/plugins/blender/constraints/ConstraintHelper.java b/engine/src/blender/com/jme3/scene/plugins/blender/constraints/ConstraintHelper.java index 382722532..031a20e95 100644 --- a/engine/src/blender/com/jme3/scene/plugins/blender/constraints/ConstraintHelper.java +++ b/engine/src/blender/com/jme3/scene/plugins/blender/constraints/ConstraintHelper.java @@ -47,6 +47,10 @@ public class ConstraintHelper extends AbstractBlenderHelper { constraintClasses.put("bSplineIKConstraint", ConstraintSplineInverseKinematic.class); constraintClasses.put("bDampTrackConstraint", ConstraintDampTrack.class); constraintClasses.put("bPivotConstraint", ConstraintDampTrack.class); + //Blender 2.56+ + constraintClasses.put("bTrackToConstraint", ConstraintTrackTo.class); + constraintClasses.put("bSameVolumeConstraint", ConstraintSameVolume.class); + constraintClasses.put("bTransLikeConstraint", ConstraintTransLike.class); } /** diff --git a/engine/src/blender/com/jme3/scene/plugins/blender/constraints/ConstraintSameVolume.java b/engine/src/blender/com/jme3/scene/plugins/blender/constraints/ConstraintSameVolume.java new file mode 100644 index 000000000..5311057f8 --- /dev/null +++ b/engine/src/blender/com/jme3/scene/plugins/blender/constraints/ConstraintSameVolume.java @@ -0,0 +1,45 @@ +package com.jme3.scene.plugins.blender.constraints; + +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.jme3.scene.plugins.blender.BlenderContext; +import com.jme3.scene.plugins.blender.animations.Ipo; +import com.jme3.scene.plugins.blender.exceptions.BlenderFileException; +import com.jme3.scene.plugins.blender.file.Structure; + +/** + * This class represents 'Same volume' constraint type in blender. + * + * @author Marcin Roguski (Kaelthas) + */ +/*package*/ class ConstraintSameVolume extends Constraint { + private static final Logger LOGGER = Logger.getLogger(ConstraintSameVolume.class.getName()); + + /** + * This constructor creates the constraint instance. + * + * @param constraintStructure + * the constraint's structure (bConstraint clss in blender 2.49). + * @param ownerOMA + * the old memory address of the constraint owner + * @param influenceIpo + * the ipo curve of the influence factor + * @param blenderContext + * the blender context + * @throws BlenderFileException + * this exception is thrown when the blender file is somehow + * corrupted + */ + public ConstraintSameVolume(Structure constraintStructure, Long ownerOMA, + Ipo influenceIpo, BlenderContext blenderContext) + throws BlenderFileException { + super(constraintStructure, ownerOMA, influenceIpo, blenderContext); + } + + @Override + protected void bakeConstraint() { + // TODO: implement 'Same volume' constraint + LOGGER.log(Level.WARNING, "'Same volume' constraint NOT implemented!"); + } +} diff --git a/engine/src/blender/com/jme3/scene/plugins/blender/constraints/ConstraintTrackTo.java b/engine/src/blender/com/jme3/scene/plugins/blender/constraints/ConstraintTrackTo.java new file mode 100644 index 000000000..fdcf55462 --- /dev/null +++ b/engine/src/blender/com/jme3/scene/plugins/blender/constraints/ConstraintTrackTo.java @@ -0,0 +1,45 @@ +package com.jme3.scene.plugins.blender.constraints; + +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.jme3.scene.plugins.blender.BlenderContext; +import com.jme3.scene.plugins.blender.animations.Ipo; +import com.jme3.scene.plugins.blender.exceptions.BlenderFileException; +import com.jme3.scene.plugins.blender.file.Structure; + +/** + * This class represents 'Track to' constraint type in blender. + * + * @author Marcin Roguski (Kaelthas) + */ +/* package */class ConstraintTrackTo extends Constraint { + private static final Logger LOGGER = Logger.getLogger(ConstraintTrackTo.class.getName()); + + /** + * This constructor creates the constraint instance. + * + * @param constraintStructure + * the constraint's structure (bConstraint clss in blender 2.49). + * @param ownerOMA + * the old memory address of the constraint owner + * @param influenceIpo + * the ipo curve of the influence factor + * @param blenderContext + * the blender context + * @throws BlenderFileException + * this exception is thrown when the blender file is somehow + * corrupted + */ + public ConstraintTrackTo(Structure constraintStructure, Long ownerOMA, + Ipo influenceIpo, BlenderContext blenderContext) + throws BlenderFileException { + super(constraintStructure, ownerOMA, influenceIpo, blenderContext); + } + + @Override + protected void bakeConstraint() { + // TODO: implement 'Track to' constraint + LOGGER.log(Level.WARNING, "'Track to' constraint NOT implemented!"); + } +} diff --git a/engine/src/blender/com/jme3/scene/plugins/blender/constraints/ConstraintTransLike.java b/engine/src/blender/com/jme3/scene/plugins/blender/constraints/ConstraintTransLike.java new file mode 100644 index 000000000..6be52d3a9 --- /dev/null +++ b/engine/src/blender/com/jme3/scene/plugins/blender/constraints/ConstraintTransLike.java @@ -0,0 +1,45 @@ +package com.jme3.scene.plugins.blender.constraints; + +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.jme3.scene.plugins.blender.BlenderContext; +import com.jme3.scene.plugins.blender.animations.Ipo; +import com.jme3.scene.plugins.blender.exceptions.BlenderFileException; +import com.jme3.scene.plugins.blender.file.Structure; + +/** + * This class represents 'Trans like' constraint type in blender. + * + * @author Marcin Roguski (Kaelthas) + */ +/*package*/ class ConstraintTransLike extends Constraint { + private static final Logger LOGGER = Logger.getLogger(ConstraintTransLike.class.getName()); + + /** + * This constructor creates the constraint instance. + * + * @param constraintStructure + * the constraint's structure (bConstraint clss in blender 2.49). + * @param ownerOMA + * the old memory address of the constraint owner + * @param influenceIpo + * the ipo curve of the influence factor + * @param blenderContext + * the blender context + * @throws BlenderFileException + * this exception is thrown when the blender file is somehow + * corrupted + */ + public ConstraintTransLike(Structure constraintStructure, Long ownerOMA, + Ipo influenceIpo, BlenderContext blenderContext) + throws BlenderFileException { + super(constraintStructure, ownerOMA, influenceIpo, blenderContext); + } + + @Override + protected void bakeConstraint() { + // TODO: implement 'Trans like' constraint + LOGGER.log(Level.WARNING, "'Trans like' constraint NOT implemented!"); + } +}