{"id":"boatbomber/windshake","name":"windshake","scope":"boatbomber","platform":"roblox","description":"High performance wind effect for leaves and foliage","version":"2.0.3","latest":"2.0.3","versions":["1.0.0","1.1.0","2.0.0","2.0.1","2.0.2","2.0.3"],"license":"MIT","licenseRating":"safe","licenseCaveats":[],"licenseVerified":true,"dependencies":{},"integrity":"d6075cb7e1283ef9cff675a2b42a403fb7872bdc8b9f375de72ef6cf1fa3358f","likes":0,"downloads":3,"install":"forest install boatbomber/windshake","url":"https://forest.dev/p/roblox/boatbomber/windshake","files":"https://api.forest.dev/ai/package/roblox/boatbomber/windshake/files","readme":"# WindShake\r\n\r\nHigh performance wind effect for leaves and foliage\r\n\r\n*by boatbomber*\r\n\r\nI wanted to have massive forests full of moving leaves. Not for any project of mine, I just wanted to make it cuz it sounded like fun. So I did. And now you guys benefit!\r\n\r\nThis module handled 77,750+ leaf meshes while the game ran at over 400 FPS on my machine. It's pretty darn fast, all things considered.\r\n\r\nDemo:\r\nhttps://www.youtube.com/watch?v=WdJr7k9Uqfw\r\n\r\n-----\r\n\r\n# Source:\r\n\r\n**GitHub:**\r\n\r\nhttps://github.com/boatbomber/WindShake\r\n\r\n**Library:**\r\n\r\nhttps://www.roblox.com/library/6377120469/WindShake\r\n\r\n**Uncopylocked Demo:**\r\n\r\nhttps://www.roblox.com/games/6342320514/Wind-Demo\r\n\r\n-----\r\n\r\n# API:\r\n\r\n## Properties\r\n\r\n```Lua\r\nnumber WindShake.RenderDistance\r\n```\r\n*Sets the render distance for active objects in studs. Default 150*\r\n\r\n```Lua\r\nnumber WindShake.MaxRefreshRate\r\n```\r\n*Sets the maximum dynamic refresh rate for active objects in seconds. Default 1/60*\r\n\r\n\r\n## Functions\r\n\r\n```Lua\r\nfunction WindShake:Init(config: {\r\n    MatchWorkspaceWind: boolean?,\r\n}?)\r\n```\r\n*Initializes the wind shake logic and adds shake to all tagged objects*\r\n\r\n**Parameters:**\r\n- `config` *[Optional Dictionary]*\r\n\r\n    Configuration for the initialization\r\n    - `MatchWorkspaceWind` *[Optional Boolean]*\r\n\r\n        Whether to match the wind settings to the Workspace's GlobalWind setting. Default false\r\n\r\n\r\n**Returns:**\r\n* `void`\r\n\r\n```Lua\r\nfunction WindShake:Cleanup()\r\n```\r\n*Halts and clears the wind shake logic and all object shakes*\r\n\r\n**Returns:**\r\n* `void`\r\n\r\n```Lua\r\nfunction WindShake:Pause()\r\n```\r\n*Halts the wind shake logic without clearing*\r\n\r\n**Returns:**\r\n* `void`\r\n\r\n```Lua\r\nfunction WindShake:Resume()\r\n```\r\n*Restarts the wind shake logic without clearing*\r\n\r\n**Returns:**\r\n* `void`\r\n\r\n```Lua\r\nfunction WindShake:AddObjectShake(Object, Settings)\r\n```\r\n*Adds an object to be shaken*\r\n\r\n**Parameters:**\r\n- `Object` *[BasePart]*\r\nThe Object to apply shaking to\r\n\r\n- `Settings` *[Optional Dictionary]*\r\nThe settings to apply to this object's shake (See below for Settings structure)\r\n\r\n**Returns:**\r\n* `void`\r\n\r\n```Lua\r\nfunction WindShake:RemoveObjectShake(Object)\r\n```\r\n*Removes shake from an object*\r\n\r\n**Parameters:**\r\n- `Object` *[BasePart]*\r\nThe Object to remove shaking from\r\n\r\n**Returns:**\r\n* `void`\r\n\r\n```Lua\r\nfunction WindShake:SetDefaultSettings(Settings) [DEPRECATED]\r\n```\r\n> Deprecated in favor of setting the Attributes of the WindShake modulescript\r\n\r\n*Sets the default settings for future object shake additions*\r\n\r\n\r\n**Parameters:**\r\n\r\n- `Settings` *[Dictionary]*\r\nThe settings to use as default (See below for Settings structure)\r\n\r\n**Returns:**\r\n* `void`\r\n\r\n```Lua\r\nfunction WindShake:UpdateObjectSettings(Object, Settings) [DEPRECATED]\r\n```\r\n> Deprecated in favor of setting the Attributes of the Object\r\n\r\n*Updates the shake settings of an object already added*\r\n\r\n**Parameters:**\r\n- `Object` *[BasePart]*\r\nThe Object to apply shake settings to\r\n\r\n- `Settings` *[Dictionary]*\r\nThe settings to apply to this object's shake (See below for Settings structure)\r\n\r\n**Returns:**\r\n* `void`\r\n\r\n```Lua\r\nfunction WindShake:UpdateAllObjectSettings(Settings)\r\n```\r\n*Updates the shake settings of all active shakes*\r\n\r\n**Parameters:**\r\n\r\n- `Settings` *[Dictionary]*\r\nThe settings to apply to all objects' shake (See below for Settings structure)\r\n\r\n**Returns:**\r\n* `void`\r\n\r\n```Lua\r\nfunction WindShake:MatchWorkspaceWind()\r\n```\r\n*Sets the wind settings to match the current workspace GlobalWind*\r\n\r\n> When `:Init()` is called with the `MatchWorkspaceWind` config set to true, this is called automatically\r\n\r\n**Returns:**\r\n* `void`\r\n\r\n## Events\r\n\r\n```Lua\r\nRBXScriptSignal WindShake.ObjectShakeAdded(Object)\r\n```\r\n*Fires when an object is added to WindShake*\r\n\r\n**Parameters:**\r\n\r\n- `Object` *[BasePart]*\r\nThe object that was added\r\n\r\n```Lua\r\nRBXScriptSignal WindShake.ObjectShakeRemoved(Object)\r\n```\r\n*Fires when an object is removed from WindShake*\r\n\r\n**Parameters:**\r\n\r\n- `Object` *[BasePart]*\r\nThe object that was removed\r\n\r\n```Lua\r\nRBXScriptSignal WindShake.ObjectShakeUpdated(Object)\r\n```\r\n*Fires when an object's settings are updated through the update APIs*\r\n\r\n**Parameters:**\r\n\r\n- `Object` *[BasePart]*\r\nThe object that had its settings updated\r\n\r\n```Lua\r\nRBXScriptSignal WindShake.Resumed()\r\n```\r\n*Fires when WindShake begins shaking the objects*\r\n\r\n```Lua\r\nRBXScriptSignal WindShake.Paused()\r\n```\r\n*Fires when WindShake stops shaking the objects*\r\n\r\n## Types\r\n\r\n```Lua\r\nSettings = {\r\n    WindDirection: Vector3 to shake towards (Initially 0.5,0,0.5)\r\n    WindSpeed: Positive number that defines how fast to shake (Initially 20)\r\n    WindPower: Positive number that defines how much to shake (Initially 0.5)\r\n\r\n    --If one of these is not defined, it will use default for that one,\r\n    --so you can pass a table with just one or two settings and the rest\r\n    --will be default so you don't need to make the full table every time.\r\n}\r\n```\r\n\r\n-----\r\n\r\n# Usage Example:\r\n\r\n```Lua\r\nlocal WIND_DIRECTION = Vector3.new(1,0,0.3)\r\nlocal WIND_SPEED = 25\r\nlocal WIND_POWER = 0.4\r\n\r\nlocal WindShake = require(script.WindShake)\r\n\r\nWindShake:SetDefaultSettings({\r\n\tWindSpeed = WIND_SPEED;\r\n\tWindDirection = WIND_DIRECTION;\r\n\tWindPower = WIND_POWER;\r\n})\r\n\r\nWindShake:Init() -- Anything with the WindShake tag will now shake\r\n\r\n```\r\n","readmeTruncated":false}