[name]

كرة محددة بمركز ونصف قطر.

المنشئ (Constructor)

[name]( [param:Vector3 center], [param:Float radius] )

[page:Vector3 center] - مركز الكرة. الافتراضي هو [page:Vector3] عند `(0، 0، 0)`.
[page:Float radius] - نصف قطر الكرة. الافتراضي هو -1.

ينشئ [name] جديدًا.

الخصائص (Properties)

[property:Vector3 center]

[page:Vector3] يحدد مركز الكرة. الافتراضي هو `(0، 0، 0)`.

[property:Boolean isSphere]

علامة للقراءة فقط للتحقق مما إذا كان كائنًا معينًا من نوع [name].

[property:Float radius]

نصف قطر الكرة. الافتراضي هو -1.

الطرق (Methods)

[method:this applyMatrix4]( [param:Matrix4 matrix] )

[page:Matrix4 matrix] - [Page:Matrix4] للتطبيق

يحول هذه الكرة بواسطة [page:Matrix4] المحدد.

[method:Vector3 clampPoint]( [param:Vector3 point], [param:Vector3 target] )

[page:Vector3 point] - [page:Vector3] النقطة التي سيتم تثبيتها.
[page:Vector3 target] — سيتم نسخ النتيجة في هذا Vector3.

يثبت نقطة داخل الكرة. إذا كانت النقطة خارج الكرة ، فسوف يثبتها على أقرب نقطة على حافة الكرة. لن تتأثر النقاط بالفعل داخل الكرة.

[method:Sphere clone]()

يعود بكرة جديدة بنفس [page:.center center] و [page:.radius radius] كهذه.

[method:Boolean containsPoint]( [param:Vector3 point] )

[page:Vector3 point] - الـ[page:Vector3] المطلوب التحقق منه

يتحقق مما إذا كانت الكرة تحتوي على [page:Vector3 point] المحدد شاملاً سطح الكرة.

[method:this copy]( [param:Sphere sphere] )

ينسخ قيم خصائص [page:.center center] و [page:.radius radius] للكرة المعطاة إلى هذه الكرة.

[method:Float distanceToPoint]( [param:Vector3 point] )

يعيد أقرب مسافة من حدود الكرة إلى [page:Vector3 point]. إذا كانت الكرة تحتوي على النقطة ، فستكون المسافة سلبية.

[method:this expandByPoint]( [param:Vector3 point] )

[page:Vector3 point] - [page:Vector3] التي يجب تضمينها في الكرة.

يوسع حدود هذه الكرة لتشمل [page:Vector3 point].

[method:Boolean isEmpty]()

يتحقق مما إذا كانت الكرة فارغة (تم تعيين نصف القطر إلى رقم سلبي).
الكرات التي يبلغ نصف قطرها 0 تحتوي فقط على نقطة مركزها ولا يعتبر فارغًا.

[method:this makeEmpty]()

يجعل الكرة فارغة عن طريق تعيين [page:.center center] إلى (0، 0، 0) و [page:.radius radius] إلى -1.

[method:Boolean equals]( [param:Sphere sphere] )

يتحقق مما إذا كانت مراكز وأشعة الكرتين متساوية.

[method:Box3 getBoundingBox]( [param:Box3 target] )

[page:Box3 target] — سيتم نسخ النتيجة في هذا Box3.

يعود بـ[link:https://en.wikipedia.org/wiki/Minimum_bounding_box Minimum Bounding Box] للكرة.

[method:Boolean intersectsBox]( [param:Box3 box] )

[page:Box3 box] - [page:Box3] للتحقق من التقاطع ضدها.

يحدد ما إذا كانت هذه الكرة تتقاطع مع [page:Box3 box] المحددة أم لا.

[method:Boolean intersectsPlane]( [param:Plane plane] )

[page:Plane plane] - الطائرة للتحقق من التقاطع ضدها.

يحدد ما إذا كانت هذه الكرة تتقاطع مع [page:Plane plane] المحددة أم لا.

[method:Boolean intersectsSphere]( [param:Sphere sphere] )

[page:Sphere sphere] - الكرة للتحقق من التقاطع ضدها.

يتحقق مما إذا كانت كرتين تتقاطعان.

[method:this set]( [param:Vector3 center], [param:Float radius] )

[page:Vector3 center] - مركز الكرة.
[page:Float radius] - نصف قطر الكرة.

يضبط خصائص [page:.center center] و [page:.radius radius] لهذه الكرة.
يرجى ملاحظة أن هذه الطريقة تنسخ فقط القيم من المركز المحدد.

[method:this setFromPoints]( [param:Array points], [param:Vector3 optionalCenter] )

[page:Array points] - مصفوفة من مواضع [page:Vector3].
[page:Vector3 optionalCenter] - موضع اختياري لـ[page:Vector3] مركز الكرة.

يحسب الكرة المحيطة الدنيا لمصفوفة من نقاط [page:Array]. إذا تم إعطاء [page:Vector3 optionalCenter] ، يتم استخدامه كمركز للكرة . وإلا ، يتم حساب مركز المستطيل المحيط المستوي تغليف نقاط [page:Array].

[method:this translate]( [param:Vector3 offset] )

ترجمة مركز الكرة بالإزاحة المحددة [page:Vector3].

[method:this union]( [param:Sphere sphere] )

[page:Sphere sphere] - كرة المحيط التي ستتحد مع هذه كرة.

يوسع هذه الكرة لإغلاق كل من الكرة الأصلية والمعطى كرة.

المصدر (Source)

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]