@@ -28,6 +28,9 @@
[page:Vector3] يحدد مركز الكرة. الافتراضي هو `(0، 0،
0)`.
</p>
+
+ <h3>[property:Boolean isSphere]</h3>
+ <p>علامة للقراءة فقط للتحقق مما إذا كان كائنًا معينًا من نوع [name].</p>
<h3>[property:Float radius]</h3>
<p>نصف قطر الكرة. الافتراضي هو -1.</p>
@@ -29,6 +29,9 @@
+ <p>Read-only flag to check if a given object is of type [name].</p>
<p>The radius of the sphere. Default is -1.</p>
@@ -28,6 +28,11 @@
<h3>[property:Vector3 center]</h3>
<p>Un [page:Vector3] che definisce il centro della sfera. Il valore predefinito è `(0, 0, 0)`.</p>
+ <p>
+ Flag di sola lettura per verificare se l'oggetto dato è di tipo [name].
+ </p>
<p>Il raggio della sfera. Il valore predefinito è -1.</p>
<p>A [page:Vector3]定义了球心的位置,默认值位于(0, 0, 0)。</p>
+ Read-only flag to check if a given object is of type [name].
<p>球的半径,默认值为-1。</p>
@@ -9,6 +9,8 @@ class Sphere {
constructor( center = new Vector3(), radius = - 1 ) {
+ this.isSphere = true;
this.center = center;
this.radius = radius;
@@ -30,6 +30,16 @@ export default QUnit.module( 'Maths', () => {
} );
// PUBLIC
+ QUnit.test( 'isSphere', ( assert ) => {
+ const a = new Sphere();
+ assert.ok( a.isSphere === true, 'Passed!' );
+ const b = new Box3();
+ assert.ok( ! b.isSphere, 'Passed!' );
+ } );
QUnit.test( 'set', ( assert ) => {
const a = new Sphere();