From 5d5e0082a7fe60b90c1f7cb093a72ba6a484570b Mon Sep 17 00:00:00 2001 From: "sha..rd" Date: Sat, 1 Oct 2011 00:45:35 +0000 Subject: [PATCH] * Fix inside view for Dome shape git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8322 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../src/core/com/jme3/scene/shape/Dome.java | 33 ++++++++++++++----- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/engine/src/core/com/jme3/scene/shape/Dome.java b/engine/src/core/com/jme3/scene/shape/Dome.java index 3dd616db5..5ef5a8a6d 100644 --- a/engine/src/core/com/jme3/scene/shape/Dome.java +++ b/engine/src/core/com/jme3/scene/shape/Dome.java @@ -282,21 +282,36 @@ public class Dome extends Mesh { int bottomPlaneStart = ((plane - 1) * (radialSamples + 1)); int topPlaneStart = (plane * (radialSamples + 1)); for (int sample = 0; sample < radialSamples; sample++, index += 6) { - ib.put((short) (bottomPlaneStart + sample)); - ib.put((short) (topPlaneStart + sample)); - ib.put((short) (bottomPlaneStart + sample + 1)); - ib.put((short) (bottomPlaneStart + sample + 1)); - ib.put((short) (topPlaneStart + sample)); - ib.put((short) (topPlaneStart + sample + 1)); + if (insideView){ + ib.put((short) (bottomPlaneStart + sample)); + ib.put((short) (bottomPlaneStart + sample + 1)); + ib.put((short) (topPlaneStart + sample)); + ib.put((short) (bottomPlaneStart + sample + 1)); + ib.put((short) (topPlaneStart + sample + 1)); + ib.put((short) (topPlaneStart + sample)); + }else{ + ib.put((short) (bottomPlaneStart + sample)); + ib.put((short) (topPlaneStart + sample)); + ib.put((short) (bottomPlaneStart + sample + 1)); + ib.put((short) (bottomPlaneStart + sample + 1)); + ib.put((short) (topPlaneStart + sample)); + ib.put((short) (topPlaneStart + sample + 1)); + } } } // pole triangles int bottomPlaneStart = (planes - 2) * (radialSamples + 1); for (int samples = 0; samples < radialSamples; samples++, index += 3) { - ib.put((short) (bottomPlaneStart + samples)); - ib.put((short) (vertCount - 1)); - ib.put((short) (bottomPlaneStart + samples + 1)); + if (insideView){ + ib.put((short) (bottomPlaneStart + samples)); + ib.put((short) (bottomPlaneStart + samples + 1)); + ib.put((short) (vertCount - 1)); + }else{ + ib.put((short) (bottomPlaneStart + samples)); + ib.put((short) (vertCount - 1)); + ib.put((short) (bottomPlaneStart + samples + 1)); + } } updateBound();