{"id":"pepeeltoro41/jecs-assemblies","name":"jecs-assemblies","scope":"pepeeltoro41","platform":"roblox","description":"Mirrored from the Wally registry.","version":"1.0.2","latest":"1.0.2","versions":["0.1.0","1.0.0","1.0.1","1.0.2"],"license":"MIT","licenseRating":"safe","licenseCaveats":["License identified from the packaged LICENSE file; the manifest declared none."],"licenseVerified":true,"dependencies":{"ukendio/jecs":{"version":"^0.10.0","alias":"jecs"}},"integrity":"fc35f670992e3d58beed82adc89fd11c145178be4847c4298253de33b8585336","likes":0,"downloads":0,"install":"forest install pepeeltoro41/jecs-assemblies","url":"https://forest.dev/p/roblox/pepeeltoro41/jecs-assemblies","files":"https://api.forest.dev/ai/package/roblox/pepeeltoro41/jecs-assemblies/files","readme":"# Jecs Assemblies\r\n\r\nUtility for calculating cframe offset chains for Jecs.\r\n\r\n### Setup\r\n\r\n-   Replace `transform`, `relative`, and `pivot` with your own components. This is optional, and\r\n    components will be created if they don't exist when calling `jecs_assemblies.world`.\r\n\r\n-   Call `jecs_assemblies.world(world)` **before using it** to set it up with your world.\r\n\r\n-   Add `jecs_assemblies.system()` to your systems. Set the order right before your transform cframes apply.\r\n\r\n```luau\r\nlocal c = require(components)\r\nlocal jecs_assemblies = require(jecs_assemblies)\r\n\r\njecs_assemblies.transform = c.transform\r\njecs_assemblies.world(world)\r\n\r\nreturn {\r\n    system = function()\r\n        jecs_assemblies.system()\r\n    end\r\n}\r\n```\r\n\r\n### Usage\r\n\r\n-   Use `jecs_assemblies.pivot` as a pair to reference a parent entity.\r\n-   Use `jecs_assemblies.relative` to set a relative CFrame to the parent.\r\n-   Transforms will be applied to `jecs_assemblies.transform`. The very first parent will use the value of `jecs_assemblies.transform`.\r\n-   You can chain multiple pivots to get a final transform.\r\n\r\n```luau\r\nlocal c = require(components)\r\nlocal ja = require(jecs_assemblies)\r\n\r\nlocal character = world:entity()\r\nlocal camera = world:entity()\r\n\r\nworld:set(character, c.transform, cf)\r\n\r\nworld:add(camera, pair(ja.pivot, character))\r\nworld:set(camera, c.relative, rel)\r\n\r\n-- camera transform = character transform * camera rel\r\n```\r\n\r\n### Swapping pivots\r\n\r\n-   use `jecs_assemblies.swap_pivot` to swap the pivot of an entity. This will change your pivot while keeping the world space transform by\r\n    calculating the relative cframe from the current entity transform and the new pivot transform. This function will also remove any previous pivots.\r\n","readmeTruncated":false}