#pragma once #include "datatypes/cframe.h" #include #include class BasePart; class Instance; class Selection; struct PartTransformState { std::shared_ptr part; Vector3 size; Vector3 velocity; CFrame cframe; }; class PartAssembly { CFrame _assemblyOrigin; Vector3 _bounds; Vector3 _size; std::vector> parts; public: PartAssembly(std::vector>, bool worldMode = false); static PartAssembly FromSelection(std::vector> selection); static PartAssembly FromSelection(std::shared_ptr selection); inline CFrame assemblyOrigin() { return _assemblyOrigin; }; inline Vector3 bounds() { return _bounds; }; inline Vector3 size() { return _size; }; inline bool multipleSelected() { return parts.size() > 1; } // Gets the current transform state of all the parts in the assembly std::vector GetCurrentTransforms(); // Transforms the assembly such that newOrigin is now this assembly's new assemblyOrigin void SetOrigin(CFrame newOrigin); // Rotates and translates the assembly by the transformation void TransformBy(CFrame transform); // Scales the assembly to the desired size // If multiple parts are selected, finds the greatest scale factor of each component pair, and // scales it up by that amount void Scale(Vector3 newSize, bool scaleUp = true); // Update temporary collisions of rigidbodies. Useful for ignoring // items for raycasts void SetCollisionsEnabled(bool enabled); };