| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- //********************************** 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; }
- /** @name Internal
- * @{
- */
- /** Returns the sphere collider that this component wraps. */
- SphereCollider* _getInternal() const { return static_cast<SphereCollider*>(mInternal.get()); }
- /** @} */
- /************************************************************************/
- /* 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
- };
- /** @} */
- }
|