/***************************************************************************
*                                                                          *
*  Copyright (C) Golaem S.A.  All Rights Reserved.                         *
*                                                                          *
***************************************************************************/

#pragma once
#include "glmSDKAPI.h"
#include "glmBasePhysicsDefinitions.h"
#include <glmMemory.h>
#include <glmTypes.h>
#include <glmSimuEntityHandle.h>
#include <glmAbstractTrigger.h>

namespace glm
{
	class RagdollEntityComponent_PhysX;
	class CharacterController_PhysX;
	class PhysicsRigidBody;
	class Simulation;
	class BehaviorGraph;

	/**
	 *
	 * \brief Describe a rigid object in the physics simulation
	 *
	 * \author dev@golaem.com
	 *
	 */
	class GLM_SDK_API AbstractPhysicsRigidBodyInfo
	{
	public:
		GLM_CLASS_STAT_ID( glm::MemoryStatIds::Simulation)

	public: //data
		PhysicsMode::Value _physicsMode;

		// ragdoll is only valid if not deleted by simulation in the mean time
		bool hasValidRagdoll() const;
		RagdollEntityComponent_PhysX* getRagdoll() const;
		BehaviorGraph* getBehaviorGraph() const;

		AbstractPhysicsRigidBodyInfo();
		~AbstractPhysicsRigidBodyInfo();

		// uses only one of this pointers : CharacterController_PhysX or PhysicsRigidBody or Simulation+Handle
		CharacterController_PhysX*	_characterController;
		PhysicsRigidBody*			_physicsRigidBody;
		Simulation*					_simulation;
		SimuEntityHandle			_handle;

		AbstractTrigger::SP _advancedCollisionFilter;
	};
}
