From e3bd12251985e24a5530ee2829e16c2411c71a0a Mon Sep 17 00:00:00 2001 From: Fadorico Date: Thu, 24 Nov 2016 15:54:36 -0500 Subject: [PATCH] Write/read the width and height of the quad --- .../main/java/com/jme3/scene/shape/Quad.java | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/jme3-core/src/main/java/com/jme3/scene/shape/Quad.java b/jme3-core/src/main/java/com/jme3/scene/shape/Quad.java index 3e0c6ce7e..6abbb53b4 100644 --- a/jme3-core/src/main/java/com/jme3/scene/shape/Quad.java +++ b/jme3-core/src/main/java/com/jme3/scene/shape/Quad.java @@ -32,8 +32,13 @@ package com.jme3.scene.shape; +import com.jme3.export.InputCapsule; +import com.jme3.export.JmeExporter; +import com.jme3.export.JmeImporter; +import com.jme3.export.OutputCapsule; import com.jme3.scene.Mesh; import com.jme3.scene.VertexBuffer.Type; +import java.io.IOException; /** * Quad represents a rectangular plane in space @@ -126,6 +131,20 @@ public class Quad extends Mesh { updateBound(); setStatic(); } + + @Override + public void read(JmeImporter e) throws IOException { + super.read(e); + InputCapsule capsule = e.getCapsule(this); + width = capsule.readFloat("width", 0); + height = capsule.readFloat("height", 0); + } - + @Override + public void write(JmeExporter e) throws IOException { + super.write(e); + OutputCapsule capsule = e.getCapsule(this); + capsule.write(width, "width", 0); + capsule.write(height, "height", 0); + } }