| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
- //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
- #pragma once
- #include "BsCorePrerequisites.h"
- #include "BsSphereCollider.h"
- #include "BsCCollider.h"
- namespace BansheeEngine
- {
- /** @addtogroup Components-Core
- * @{
- */
- /**
- * @copydoc SphereCollider
- *
- * Wraps SphereCollider as a Component.
- */
- class BS_CORE_EXPORT CSphereCollider : public CCollider
- {
- public:
- CSphereCollider(const HSceneObject& parent, float radius = 1.0f);
- /** @copydoc SphereCollider::setRadius */
- void setRadius(float radius);
- /** @copydoc SphereCollider::getRadius */
- float getRadius() const { return mRadius; }
- /** Sets the position of the sphere shape, relative to the component's scene object. */
- void setCenter(const Vector3& center);
- /** Gets the position of the sphere shape, relative to the component's scene object. */
- Vector3 getCenter() const { return mLocalPosition; }
- /** @cond INTERNAL */
- /** Returns the sphere collider that this component wraps. */
- SphereCollider* _getInternal() const { return static_cast<SphereCollider*>(mInternal.get()); }
- /** @endcond */
- /************************************************************************/
- /* COMPONENT OVERRIDES */
- /************************************************************************/
- protected:
- friend class SceneObject;
- /** @copydoc CCollider::createInternal */
- SPtr<Collider> createInternal() override;
- protected:
- float mRadius;
- /************************************************************************/
- /* RTTI */
- /************************************************************************/
- public:
- friend class CSphereColliderRTTI;
- static RTTITypeBase* getRTTIStatic();
- RTTITypeBase* getRTTI() const override;
- protected:
- CSphereCollider() {} // Serialization only
- };
- /** @} */
- }
|