/*
 * Derived from Epic Fight (https://github.com/Epic-Fight/epicfight)
 * by the Epic Fight Team, licensed under GPLv3.
 * Modifications © 2026 TiedUp! Remake Contributors, distributed under GPLv3.
 */

package com.tiedup.remake.rig.mesh;

import java.util.List;
import java.util.Map;

import com.google.common.collect.Lists;

import com.tiedup.remake.rig.mesh.Meshes.MeshAccessor;
import com.tiedup.remake.rig.cloth.ClothSimulatable;
import com.tiedup.remake.rig.cloth.ClothSimulator;
import com.tiedup.remake.rig.cloth.ClothSimulator.ClothObject.ClothPart.ConstraintType;
import com.tiedup.remake.rig.physics.SimulationProvider;

public interface SoftBodyTranslatable extends SimulationProvider<ClothSimulatable, ClothSimulator.ClothObject, ClothSimulator.ClothObjectBuilder, SoftBodyTranslatable> {
	public static final List<ClothSimulatable> TRACKING_SIMULATION_SUBJECTS = Lists.newArrayList();
	
	default boolean canStartSoftBodySimulation() {
		return this.getSoftBodySimulationInfo() != null;
	}
	
	void putSoftBodySimulationInfo(Map<String, ClothSimulationInfo> sofyBodySimulationInfo);
	
	Map<String, ClothSimulationInfo> getSoftBodySimulationInfo();
	
	default StaticMesh<?> getOriginalMesh() {
		if (this instanceof MeshAccessor<?> meshAccessor) {
			return (StaticMesh<?>)meshAccessor.get();
		} else {
			return (StaticMesh<?>)this;
		}
	}
	
	public static record ClothSimulationInfo(float particleMass, float selfCollision, List<int[]> constraints, ConstraintType[] constraintTypes, float[] compliances, int[] particles, float[] weights, float[] rootDistance, int[] normalOffsetMapping) {
	}
}
