Skip to content

Commit 3fea76f

Browse files
authored
Update SpotLight: add toString method
1 parent 2747d7f commit 3fea76f

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

jme3-core/src/main/java/com/jme3/light/SpotLight.java

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009-2021 jMonkeyEngine
2+
* Copyright (c) 2009-2025 jMonkeyEngine
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without
@@ -118,8 +118,7 @@ public SpotLight(Vector3f position, Vector3f direction, ColorRGBA color) {
118118
setPosition(position);
119119
setDirection(direction);
120120
}
121-
122-
121+
123122
/**
124123
* Creates a SpotLight at the given position, with the given direction,
125124
* the given range and the given color.
@@ -160,7 +159,6 @@ public SpotLight(Vector3f position, Vector3f direction, float range, ColorRGBA c
160159
setDirection(direction);
161160
setSpotRange(range);
162161
}
163-
164162

165163
private void computeAngleParameters() {
166164
float innerCos = FastMath.cos(spotInnerAngle);
@@ -458,5 +456,18 @@ public SpotLight clone() {
458456
s.position = position.clone();
459457
return s;
460458
}
461-
}
462459

460+
@Override
461+
public String toString() {
462+
return getClass().getSimpleName()
463+
+ "[name=" + name
464+
+ ", direction=" + direction
465+
+ ", position=" + position
466+
+ ", range=" + spotRange
467+
+ ", innerAngle=" + spotInnerAngle
468+
+ ", outerAngle=" + spotOuterAngle
469+
+ ", color=" + color
470+
+ ", enabled=" + enabled
471+
+ "]";
472+
}
473+
}

0 commit comments

Comments
 (0)