#ifndef EDITSCENE_PHYSICSCOLLIDER_HPP
#define EDITSCENE_PHYSICSCOLLIDER_HPP
#pragma once

#include <Ogre.h>
#include <Jolt/Jolt.h>
#include <Jolt/Physics/Collision/Shape/Shape.h>
#include <memory>

/**
 * Physics Collider component
 * Defines a collision shape for use in rigid bodies
 * Multiple colliders can be attached to a single rigid body (as children)
 */
struct PhysicsColliderComponent {
	// Collider shape types
	enum class ShapeType {
		Box,
		Sphere,
		Capsule,
		Cylinder,
		Mesh,
		ConvexHull
	};
	
	ShapeType shapeType = ShapeType::Box;
	
	// Shape parameters
	// Box: half extents
	// Sphere: radius
	// Capsule/Cylinder: halfHeight, radius
	Ogre::Vector3 parameters = Ogre::Vector3(0.5f, 0.5f, 0.5f); // For box: half extents
	float radius = 0.5f; // For sphere, capsule, cylinder
	float halfHeight = 1.0f; // For capsule, cylinder
	
	// For mesh/convex hull colliders
	std::string meshName;
	
	// Offset from parent transform
	Ogre::Vector3 offset = Ogre::Vector3::ZERO;
	Ogre::Quaternion rotationOffset = Ogre::Quaternion::IDENTITY;
	
	// The actual Jolt shape (created when body is built)
	JPH::ShapeRefC shape;
	bool shapeDirty = true; // Needs rebuild
	
	void markDirty() { shapeDirty = true; }
};

#endif // EDITSCENE_PHYSICSCOLLIDER_HPP
