Skip to content

Commit a6087db

Browse files
committed
tutorial: generate normals for lit debug meshes
1 parent 6ea523f commit a6087db

3 files changed

Lines changed: 7 additions & 0 deletions

File tree

TutorialApps/src/main/java/jme3utilities/tutorial/HelloDoor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ private PhysicsRigidBody addBall() {
251251

252252
Material yellowMaterial = createLitMaterial(1f, 1f, 0f);
253253
result.setDebugMaterial(yellowMaterial);
254+
result.setDebugMeshNormals(MeshNormals.Sphere);
254255

255256
return result;
256257
}

TutorialApps/src/main/java/jme3utilities/tutorial/HelloMotor.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
5555
import com.jme3.shadow.DirectionalLightShadowRenderer;
5656
import com.jme3.shadow.EdgeFilteringMode;
5757
import com.jme3.system.AppSettings;
58+
import jme3utilities.MeshNormals;
5859

5960
/**
6061
* A simple example of a PhysicsJoint with a motor.
@@ -179,6 +180,7 @@ private PhysicsRigidBody addDoor() {
179180

180181
Material yellowMaterial = createLitMaterial(1f, 1f, 0f);
181182
result.setDebugMaterial(yellowMaterial);
183+
result.setDebugMeshNormals(MeshNormals.Facet);
182184

183185
return result;
184186
}
@@ -205,6 +207,7 @@ private PhysicsRigidBody addFrame() {
205207

206208
Material greenMaterial = createLitMaterial(0f, 1f, 0f);
207209
result.setDebugMaterial(greenMaterial);
210+
result.setDebugMeshNormals(MeshNormals.Smooth);
208211

209212
return result;
210213
}

TutorialApps/src/main/java/jme3utilities/tutorial/HelloServo.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
5555
import com.jme3.shadow.DirectionalLightShadowRenderer;
5656
import com.jme3.shadow.EdgeFilteringMode;
5757
import com.jme3.system.AppSettings;
58+
import jme3utilities.MeshNormals;
5859

5960
/**
6061
* A simple example of a PhysicsJoint with a servo.
@@ -199,6 +200,7 @@ private PhysicsRigidBody addDoor() {
199200

200201
Material yellowMaterial = createLitMaterial(1f, 1f, 0f);
201202
result.setDebugMaterial(yellowMaterial);
203+
result.setDebugMeshNormals(MeshNormals.Facet);
202204

203205
return result;
204206
}
@@ -225,6 +227,7 @@ private PhysicsRigidBody addFrame() {
225227

226228
Material greenMaterial = createLitMaterial(0f, 1f, 0f);
227229
result.setDebugMaterial(greenMaterial);
230+
result.setDebugMeshNormals(MeshNormals.Smooth);
228231

229232
return result;
230233
}

0 commit comments

Comments
 (0)