/**
 * @class kWorldComponent
 * @brief Position, region info, radius, collisions
 */
class kWorldComponent
{
public:

	/**
	 * @brief Wall radius is used for collision with walls so you can't move as close to walls as you can to actors
	 */
	float &WallRadius();
	
	/**
	 * @brief Radius is used for collision with actors and static meshes that have collision enabled
	 */
	float &Radius();
	
	
	EnumWorldComponentFlags &Flags();
	
	/**
	 * @brief Height when actor is dead
	 */
	float &DeadHeight();
	
	float &HeightOffset();
	
	/**
	 * @brief Height when actor is not dead
	 */
	float &Height();
	
	/**
	 * @brief Used for checking if touching actors and triggering the ScriptObject::OnTouch callback.
	 */
	float &TouchRadius();
	
	/**
	 * @brief Sets the actors position to nearest valid position to \a pos and sets the region
	 */
	void SetNearestPosition(const kVec3&in pos);
	
	/**
	 * @brief Sets the actors region to \a regionIndex
	 * @param regionIndex the new region to set
	 * @param callDelegates If true it will invoke the OnEnterRegion and OnExitRegion delegate callbacks if the regionIndex is not in the same area
	 */
	void SetRegion(const int regionIndex, const bool callDelegates = true);
	
	/**
	 * @brief Returns true if flags WCF_NONSOLID is off and radius is > 0
	 */
	bool HasCollision();
	
	/**
	 * @brief Links owner object to a new area node (used for actor-actor collision)
	 */
	void LinkArea();
	
	/**
	 * @brief Tries to find a region at \a origin. Returns false if no region was found.
	 */
	const bool FindRegionAtOrigin(const kVec3&in origin, const bool callDelegates = true);
	
	/**
	 * @brief Actors current regionIndex value
	 */
	const int RegionIndex();
	
	/**
	 * @brief Returns the regionIndex and \a posResult contains the position that was nearest to \a pos
	 */
	const int16 GetNearPositionAndRegionIndex(const kVec3&in pos, kVec3&out posResult, const EnumClipFlags clipFlags = CF_NEARREGIONTEST);
	
	float& FloorHeight();
	kActor@ Owner();
	void HitScan(kClipInfo&out clipInfo, const kVec3&in origin, const kVec3&in targetOrigin, const EnumClipFlags clipFlags, const float fScale = 0);

};
